diff --git a/app/xterm/COPYING b/app/xterm/COPYING index 772d743d3..20d1d62d6 100644 --- a/app/xterm/COPYING +++ b/app/xterm/COPYING @@ -1,7 +1,7 @@ ---- $XTermId: COPYING,v 1.3 2020/01/12 22:53:35 tom Exp $ +--- $XTermId: COPYING,v 1.5 2022/01/30 19:30:32 tom Exp $ ------------------------------------------------------------------------------- -Copyright 1996-2020,2021 by Thomas E. Dickey +Copyright 1996-2021,2022 by Thomas E. Dickey All Rights Reserved diff --git a/app/xterm/INSTALL b/app/xterm/INSTALL index f049a7ce3..52fba0f1f 100644 --- a/app/xterm/INSTALL +++ b/app/xterm/INSTALL @@ -1,6 +1,6 @@ --- $XTermId: INSTALL,v 1.158 2015/08/10 23:38:32 tom Exp $ +-- $XTermId: INSTALL,v 1.189 2022/01/30 22:46:59 tom Exp $ ------------------------------------------------------------------------------- --- Copyright 1997-2014,2015 by Thomas E. Dickey +-- Copyright 1997-2021,2022 by Thomas E. Dickey -- -- All Rights Reserved -- @@ -49,6 +49,16 @@ the sense of the default behavior. The options (in alphabetic order): + --disable-256-color disable 256-color support + + Do not compile-in code that interprets SGR 38 and 48 for 256-colors. + If this feature is disabled, the 88-color feature will be used. + + --disable-88-color disable 88-color support + + Do not compile-in code that interprets SGR 38 and 48 for 88-colors. + The 256-color option overrides this. + --disable-16-color disable 16-color support Do not compile-in code to recognize aixterm-style control sequences @@ -94,7 +104,7 @@ The options (in alphabetic order): e.g., to make boxes. When xterm loads a font, it checks if those characters are present, and draws its own if they are missing. - --disable-broken-st disallow broken string-terminators], + --disable-broken-st disallow broken string-terminators, Do not compile-in code that works around a bug in some ISDN routers (and possibly other applications written by the same people): they @@ -107,7 +117,7 @@ The options (in alphabetic order): See also --enable-broken-osc - --disable-c1-print disallow -k8 option for printable 128-159], + --disable-c1-print disallow -k8 option for printable 128-159, Use this option to suppress support for nonstandard use of codes 128-159, which normally are considered control characters. Some users @@ -137,6 +147,11 @@ The options (in alphabetic order): Note: If desktop-utils is not found they will not be installed anyway. + --disable-direct-color disable direct color support + + Do not compile-in code that interprets SGR 38 and 48 for direct colors. + This feature extends the 256-color feature. + --disable-doublechars disable support for double-size chars Do not compile-in code that supports font-manipulation needed to @@ -150,13 +165,11 @@ The options (in alphabetic order): --disable-fifo-lines enable FIFO-storage for saved-lines - With patch #244, xterm by default stores saved-lines in a FIFO - (circular buffer), which improves performance when the number of saved - lines is large. Disable this option to revert to the pre-244 layout. + (this option is deprecrated) --disable-freetype disable freetype library-support - Do not use freetype libraries if they are found. Normally they will + Do not use freetype libraries if they are found. Normally they will be used automatically. --disable-full-tgetent disable check for termcap library @@ -246,10 +259,14 @@ The options (in alphabetic order): --disable-paste64 disable support for bracketed paste mode - Do not compile-in code to support experimental bracketed paste mode, - i.e., provide functions for setting/getting the selection data. + Do not compile-in code to support bracketed paste mode, along with + functions for setting/getting the selection data, termed "paste64". - (see ctlseqs.ms description of OSC 52). + (see ctlseqs.ms description of OSC 52, and DECSET 2004). + + --disable-print-graphics disable screen dump to sixel support + + Do not compile-in code to support screen-dumps for ReGIS graphics. --disable-pty-handshake disable support for pty handshakes @@ -285,6 +302,10 @@ The options (in alphabetic order): Do not compile-in code that suppresses redundant updates to the titlebar when the text has not changed. + --disable-screen-dumps disable XHTML and SVG screen dumps + + Do not compile-in code that provides XHTML and SVG screen dumps. + --disable-selection-ops disable selection operations Do not compile-in code to support the actions which allow users @@ -306,6 +327,10 @@ The options (in alphabetic order): Do not install xterm using setuid/setgid permissions. Drop setuid permissions on startup. + --disable-sixel-graphics disable support for sixel-graphics + + Do not compile-in code to support sixel-graphics + --disable-sun-fkeys Do not compile-in code to support Sun-style function keys. @@ -345,7 +370,7 @@ The options (in alphabetic order): ISO 6429 defines a few more which historically have found little use. Some people find these amusing. - This is normally enabled. + This is normally enabled. The direct-colors feature relies upon it. --disable-wide-chars disable wide-character support @@ -353,6 +378,11 @@ The options (in alphabetic order): This is normally enabled. + --disable-xcursor disable cursorTheme resource + + Do not compile-in code that sets the XCURSOR_THEME environment variable + to enable/disable cursor themes. + --disable-ziconbeep disable -ziconbeep option Do not compile-in code that modifies the icon's title and sounds a @@ -365,14 +395,6 @@ The options (in alphabetic order): This uses less memory, but is less complete. However, most languages are covered by the 16-bit encoding. - --enable-256-color enable 256-color support - - Compile-in code that interprets SGR 38 and 48 for 256-colors. - - --enable-88-color enable 88-color support - - Compile-in code that interprets SGR 38 and 48 for 88-colors. - --enable-alt-sends-esc set default altSendsEscape resource (default: no) This sets the default resource value, which is shown in the manpage. @@ -426,11 +448,15 @@ The options (in alphabetic order): --enable-double-buffer enable double-buffering - Use experimental double-buffering for display to reduce flicker. + Set the initial value of the "buffered" resource, which tells + xterm to use double-buffering for display to reduce flicker. - This option was introduced in patch #282; at that point it needs - further work because colors used for clearing the screen do not - match the expected behavior (see vttest for instance). + --enable-env-terminfo setenv $TERMINFO if --with-own-terminfo gives value + + Use the custom terminfo directory specified in "--with-own-terminfo" + as the $TERMINFO variable for the shells spawned by xterm. Setting + this variable makes most curses (and termcap) applications look in + that directory for terminal descriptions. --enable-exec-xterm enable "spawn-new-terminal" action @@ -458,7 +484,8 @@ The options (in alphabetic order): Compile-in code that allows logging. Logging was disabled in X11R5 xterm because of security problems. - They were addressed in X11R6, but the feature was not reinstated. + They were addressed in X11R6, but the feature was not reinstated + because of concerns (long past) about xterm running as root-setuid. --enable-meta-sends-esc set default metaSendsEscape resource (default: no) @@ -495,28 +522,30 @@ The options (in alphabetic order): --enable-readline-mouse enable support for mouse in readline applications - Compile-in code to support experimental bracketed paste mode, i.e., + Compile-in code to support predecessor to bracketed paste mode, i.e., provide functions for setting/getting the selection data. Essentially this puts xterm into a mode that sends special function-key strings to bracket the data. - (See --enable-paste64, which fits xterm's protocol better). - - --enable-sco-fkeys enable support for SCO-style function keys - - Compile-in code to support SCO-style function keys. + (The "paste64" feature, which fits xterm's protocol better, is + configured by default). --enable-regis-graphics enable support for ReGIS graphics Compile-in code to support experimental ReGIS graphics - --enable-sixel-graphics enable support for sixel-graphics + --enable-sco-fkeys enable support for SCO-style function keys - Compile-in code to support experimental sixel-graphics + Compile-in code to support SCO-style function keys. - --enable-sun-fkeys enable support for Sun-style function keys + --enable-status-line enable support for status-line - Compile-in code to support Sun-style function keys. + Compile-in code to enable VT220-VT525 support for status-line. + + --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics + + Use the C11 _Noreturn keyword if the compiler supports it, rather + than the gcc-specific __attribute__((noreturn)). --enable-toolbar enable pulldown menus on toolbar @@ -605,19 +634,20 @@ The options (in alphabetic order): Check for and link with dbmalloc. - --with-desktop-category=XXX one or more desktop catgories or auto + --with-desktop-category=XXX one or more desktop categories or auto This is a list of names. The configure script maps blanks and commas - to semicolons (";") which are used by the desktop utils as a separator. + to semicolons (";") which are used by the desktop utilities as a + separator. The default value "auto" tells the configure script to look at existing ".desktop" files for xterm and common terminal emulators, to use those. If none are found, the script uses this default: - System;TerminalEmulator;Utility; + System;TerminalEmulator; --with-freetype-config configure script to use for FreeType - Use a specific option value to tell the configure script to try + Use a specific option value to tell the configure script to try just one of the variations: "pkg*", e.g., pkg-config or pkgconfig uses whatever pkg-config @@ -695,14 +725,18 @@ The options (in alphabetic order): --with-man2html[=XXX] use XXX rather than groff Specify an alternative program to use for converting manpages and - control sequences document to html. If the option is given, its - default value is "man2html", otherwise it is "groff" with groff's - special options. The "man2html" script reads formatted nroff output - from its standard input, and writes html to its standard output. Other - input/output conventions are not currently supported. + control sequences document to html. The default value for the option + is "man2html". If the "man2html" script is not found, then "groff" is + used with groff's special options. + + The "man2html" script reads formatted nroff output from its standard + input, and writes html to its standard output. Other input/output + conventions are not currently supported. See http://invisible-island.net/scripts + http://invisible-island.net/scripts/man2html.html + for an up-to-date version of "man2html". --with-neXtaw link with neXT Athena library @@ -715,9 +749,9 @@ The options (in alphabetic order): rule to point to the given directory. If you have the $TERMINFO variable defined in your environment, the - configure script will use that value. If no option and no variable - are are given, the configure script uses /usr/lib/terminfo, if it - exists. + configure script may use that value, if it matches an existing + directory. If no option and no variable are are given, the configure + script uses /usr/lib/terminfo, if it exists. You do not have to run "make install-ti", if there is already a workable terminfo description. Be advised, however, that the @@ -725,9 +759,18 @@ The options (in alphabetic order): directed to other variations (such as nxterm) which do not support the background-color erase capability. + --with-pixmapdir=DIR directory in which to install pixmaps (DATADIR/pixmaps) + + Specify directory in which to install ".xpm" files. + --with-pcre use PCRE for regular-expressions - If regular expressions are not disable (--disable-regex), use PCRE + If regular expressions are not disabled (--disable-regex), use PCRE + rather than the POSIX regular expressions. + + --with-pcre2 use PCRE2 for regular-expressions + + If regular expressions are not disabled (--disable-regex), use PCRE2 rather than the POSIX regular expressions. --with-pkg-config{=path} enable/disable use of pkg-config @@ -777,9 +820,16 @@ The options (in alphabetic order): Activate the --disable-leaks option, and ensure that "-g" is added to CFLAGS. + --without-xinerama do not use Xinerama extension for multiple screens + + Xinerama is an X server extension that allows multiple physical + screens to behave as a single screen. If you do not need the feature + (or do not want the extra library dependency), use this option to + suppress it. + --with-xpm=DIR use Xpm library for colored icon, may specify path - Use Xpm library to show colored icon in window decoration, e.g., + Use Xpm library to show colored icon in window decoration, e.g., title area. Use --without-xpm to suppress this feature. diff --git a/app/xterm/MANIFEST b/app/xterm/MANIFEST index 3ee8f0662..a576c438d 100644 --- a/app/xterm/MANIFEST +++ b/app/xterm/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-369, version xterm-369 +MANIFEST for xterm, version xterm-372 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -203,16 +203,34 @@ vttests/88colors.pl sample script showing 88-colors vttests/88colors2.pl sample script showing 88-colors vttests/8colors.sh test-script to illustrate 8-colors vttests/acolors.sh demonstrate changing the ANSI colors +vttests/acs.pl simple test for mapping alternate-character-set +vttests/altchars.sh simple test for alternate-character-set +vttests/blink.pl test scrollback of blinking text +vttests/bold-italics.pl Test bold-italics for single- and double-width characters. +vttests/bounce.sh iconify/deiconify, recording the window properties vttests/closest-rgb.pl demo of color-distances +vttests/ctlpix.sh display control/picture codes +vttests/cursor.pl exercise cursor-movement, to check color-contrasts +vttests/decsed.pl exercise DECSED with/without DECSCA +vttests/dl.sh simple test for delete-line with margins vttests/doublechars.sh test script to demonstrate doublesize chars vttests/dynamic.pl demo for dynamic colors vttests/dynamic.sh script to illustrate the dynamic colors control sequence vttests/dynamic2.sh complete example of dynamic colors +vttests/erase.pl Generate a test-pattern, erasing parts of the text on each line. vttests/fonts.sh script to demonstrate font-switching sequences +vttests/halves.pl test partial-update of double-cell characters +vttests/il.sh simple test for insert-line with margins +vttests/insdelln.pl Tests insert/delete-line feature in xterm. +vttests/iso2022.pl show ISO-2022 characters, by default GL and GR, optionally G1/G2/G3 +vttests/lrmm-scroll.pl Tests scroll left/right feature in xterm, optionally using margins. vttests/modify-keys.pl illustrate modifyOtherKeys with a table vttests/mouse-codes demo script for mouse-codes +vttests/nrcs.pl a more direct way of exercising character sets than vttest. vttests/other-sgr.sh demonstrate non-VTxx SGRs +vttests/palettes.pl Demonstrate how to set palette colors using xterm's control sequences. vttests/paste64.pl script to test base64-selection option +vttests/pointer-shapes.sh exercise xterm's pointer-shape control vttests/print-vt-chars.pl demo-script vttests/query-color.pl demonstrate OSC 4 vttests/query-dynamic.pl demonstrate OSC 10 to OSC 19 @@ -222,7 +240,19 @@ vttests/query-xres.pl test/demo for DCS+Q vttests/report-sgr.pl demonstrate report-sgr vttests/resize.pl translated resize.sh to perl since it is easy to test, and I needed vttests/resize.sh script to demonstrate resizing +vttests/scroll.pl Tests insert/delete-line feature in xterm. +vttests/setpos.pl Exercise CSI 3/13 t which set/get the window position. vttests/sgrPushPop.pl demonstrate xterm SGR push/pop vttests/sgrPushPop2.pl demonstrate xterm SGR push/pop for colors +vttests/tab0.sh Demonstrate hard-tabs. vttests/tcapquery.pl script to test tcap-query option vttests/title.sh test-script to show title of xterm in action +vttests/titlestack.pl Test the title-stack and title-mode options of xterm. +vttests/unascii.sh display the characters recognized by xterm in AsciiEquivs +vttests/under-latin.pl Print a text-test pattern using Latin-1 characters. +vttests/utf8.pl display the given Unicode characters, given their hex or decimal values. +vttests/version.sh Demonstrate version-string from xterm #354 +vttests/vt52chars.pl show the vt52 graphic characters, annotatated in a table. +vttests/wrap.pl Generates a series of wrapping lines, according to the terminal width. +vttests/xorblink.pl walk through the different states of cursor-blinking, with annotation +vttests/xtra-scroll.pl Interactively test screen-updates, e.g., cdXtraScroll and and tiXtraScroll diff --git a/app/xterm/Makefile.in b/app/xterm/Makefile.in index 5064a1275..9b79f82d0 100644 --- a/app/xterm/Makefile.in +++ b/app/xterm/Makefile.in @@ -1,8 +1,8 @@ -## $XTermId: Makefile.in,v 1.234 2015/02/12 09:31:30 tom Exp $ +## $XTermId: Makefile.in,v 1.260 2022/02/21 18:30:44 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1997-2014,2015 by Thomas E. Dickey +# Copyright 1997-2020,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -52,6 +52,7 @@ ETAGS = @ETAGS@ LN_S = @LN_S@ RM = rm -f LINT = @LINT@ +LINT_OPTS = @LINT_OPTS@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -63,7 +64,8 @@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@ EXTRA_LOADFLAGS = @IMAKE_LOADFLAGS@ -CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ -DDEFCLASS=\"@APP_CLASS@\" $(EXTRA_CPPFLAGS) +PIXMAPDIR_DEF = @no_pixmapdir@-DPIXMAP_ROOTDIR=\"@PIXMAPDIR@/\" +CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ -DDEFCLASS=\"@APP_CLASS@\" $(PIXMAPDIR_DEF) $(EXTRA_CPPFLAGS) CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS) LDFLAGS = @LDFLAGS@ @EXTRA_LDFLAGS@ LIBS = @LIBS@ @@ -102,6 +104,13 @@ EXTRAHDR = @EXTRAHDRS@ EXTRASRC = @EXTRASRCS@ EXTRAOBJ = @EXTRAOBJS@ +AUTO_SOURCE = \ + builtin_icons.h \ + VTparse.cin \ + Tekparse.cin \ + VTparse.hin \ + Tekparse.hin + SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \ data.c doublechr.c fontutils.c input.c \ linedata.c main.c menu.c misc.c \ @@ -118,13 +127,14 @@ EXTRAOBJ = @EXTRAOBJS@ OBJS2 = resize$o version$o xstrings$o SRCS = $(SRCS1) $(SRCS2) OBJS = $(OBJS1) $(OBJS2) - HDRS = VTparse.h data.h error.h main.h menu.h \ + HDRS = VTparse.h data.h error.h fontutils.h main.h menu.h \ ptyx.h version.h xstrings.h xterm.h xtermcap.h $(EXTRAHDR) PROGRAMS = xterm$x resize$x + TEST_PROGRAMS = test_charclass$x test_ptydata$x test_wcwidth$x all : $(PROGRAMS) ################################################################################ -.SUFFIXES : .i .def .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf +.SUFFIXES : .i .def .cin .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf .c$o : @RULE_CC@ @@ -134,8 +144,13 @@ all : $(PROGRAMS) @RULE_CC@ @ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@ +.def.cin : + @echo "making $@ from $<" + @$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@ + .def.hin : - grep '^CASE_' $< | $(AWK) '{printf "#define %s %d\n", $$1, n++}' >$@ + @echo "making $@ from $<" + @$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@ .man.$(manext) : $(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $(appsdir) $(CLASS) $* $* $(pixmapdir) @@ -154,7 +169,7 @@ all : $(PROGRAMS) @GROFF_NOTE@ $(SHELL) -c "tbl $*.$(manext) | groff -man" >$@ @GROFF_NOTE@ @GROFF_NOTE@.$(manext).txt : -@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -Tascii -man | col -bx" >$@ +@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -rHY=0 -Tascii -man | col -bx" >$@ @GROFF_NOTE@ @MAN2HTML_NOTE@.ms.html : @MAN2HTML_NOTE@ ./@MAN2HTML_TEMP@ $* ms ms >$@ @@ -163,15 +178,19 @@ all : $(PROGRAMS) @GROFF_NOTE@ $(SHELL) -c "tbl $< | groff -ms" >$@ @GROFF_NOTE@ @GROFF_NOTE@.ms.txt : -@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -Tascii -ms | col -bx" >$@ +@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -rHY=0 -Tascii -ms | col -bx" >$@ @GROFF_NOTE@ @GROFF_NOTE@.ps.pdf : @GROFF_NOTE@ ps2pdf $*.ps ################################################################################ + +VTPARSE_H = VTparse.h VTparse.hin +TEKPARSE_H = Tekparse.h Tekparse.hin + main$o : main.h misc$o : version.h -$(OBJS1) : xterm.h ptyx.h xtermcfg.h +$(OBJS1) : xterm.h ptyx.h fontutils.h menu.h xtermcfg.h main$o resize$o screen$o : xterm_io.h xterm$x : $(OBJS1) @@ -188,11 +207,29 @@ resize$x : $(OBJS2) -$(RM) $@ perl $(srcdir)/88colres.pl > $@ -charproc$o : main.h @CHARPROC_DEPS@ +charproc$o : $(VTPARSE_H) main.h @CHARPROC_DEPS@ +graphics_regis$o : $(VTPARSE_H) +graphics_sixel$o : $(VTPARSE_H) +misc$o : $(VTPARSE_H) +VTPrsTbl$o : $(VTPARSE_H) + +charproc$o \ +graphics$o \ +graphics_regis$o \ +graphics_sixel$o \ +main$o \ +misc$o \ +screen$o \ +util$o : graphics.h + +TekPrsTbl$o : $(TEKPARSE_H) +Tekproc$o : $(TEKPARSE_H) misc$o : builtin_icons.h -# do this to quiet gcc -Wcast-qual warnings +trace$o : VTparse.cin Tekparse.cin + +# do this to quiet gcc -Wcast-qual warnings builtin_icons.h : @echo "#if OPT_BUILTIN_XPMS" >$@ @echo "#include " >>$@ @@ -204,6 +241,18 @@ builtin_icons.h : @echo "#endif" >>$@ @echo "made $@" +################################################################################ +test_charclass$x : $(srcdir)/charclass.c + @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/charclass.c $(LDFLAGS) $(LIBS) + +################################################################################ +test_ptydata$x : $(srcdir)/ptydata.c + @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/ptydata.c $(LDFLAGS) $(LIBS) + +################################################################################ +test_wcwidth$x : $(srcdir)/wcwidth.c + @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/wcwidth.c $(LDFLAGS) $(LIBS) + ################################################################################ actual_xterm = `echo xterm| sed '$(transform)'` actual_resize = `echo resize| sed '$(transform)'` @@ -314,14 +363,13 @@ APP_NAMES = XTerm UXTerm KOI8RXTerm @no_icondir@install \ @no_icondir@install-icon \ @no_icondir@install-full :: $(ICONDIR) -@no_icondir@ ACTUAL_XTERM=$(actual_xterm) \ -@no_icondir@ $(SHELL) -c '\ +@no_icondir@ @ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\ @no_icondir@ h=$(ICONDIR)/$(ICON_THEME); \ @no_icondir@ for n in $(ICON_LIST); \ @no_icondir@ do \ @no_icondir@ x=$$ACTUAL_XTERM; \ @no_icondir@ l=`echo "$$n" | cut -f1 -d:`; \ -@no_icondir@ r=`echo "$$n" | cut -f2 -d: |sed -e s,$(ICON_NAME),$$x-color,`; \ +@no_icondir@ r=`echo "$$n" | cut -f2 -d: |sed -e "s,xterm,$$ACTUAL_XTERM,"`; \ @no_icondir@ test -z "$$r" && continue; \ @no_icondir@ d=$$h/`echo "$$r" | sed -e "s,/[^/]*$$,,"`; \ @no_icondir@ test -d "$$d" || mkdir -p "$$d"; \ @@ -344,8 +392,7 @@ APP_NAMES = XTerm UXTerm KOI8RXTerm @no_pixmapdir@install \ @no_pixmapdir@install-icon \ @no_pixmapdir@install-full :: $(PIXMAPDIR) -@no_pixmapdir@ ACTUAL_XTERM=$(actual_xterm) \ -@no_pixmapdir@ $(SHELL) -c '\ +@no_pixmapdir@ @ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\ @no_pixmapdir@ h=$(PIXMAPDIR); \ @no_pixmapdir@ for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \ @no_pixmapdir@ do \ @@ -381,7 +428,7 @@ SET_TERMINFO = @SET_TERMINFO@ install-full \ install-tc :: - @-$(SHELL) -c "test -f /etc/termcap && echo 'You must install the termcap entry manually by editing /etc/termcap'" + @-$(SHELL) -c "if test -f /etc/termcap ; then echo 'You must install the termcap entry manually by editing /etc/termcap'; fi" installdirs : $(INSTALL_DIRS) ################################################################################ @@ -448,7 +495,7 @@ uninstall-full :: @no_appsdir@uninstall \ @no_appsdir@uninstall-app \ @no_appsdir@uninstall-full :: -@no_appsdir@ @-$(SHELL) -c 'for s in $(APP_NAMES); \ +@no_appsdir@ -@ECHO_CC@$(SHELL) -c 'for s in $(APP_NAMES); \ @no_appsdir@ do \ @no_appsdir@ echo "** $$s"; \ @no_appsdir@ d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \ @@ -461,12 +508,13 @@ uninstall-full :: @no_icondir@uninstall \ @no_icondir@uninstall-icon \ @no_icondir@uninstall-full :: -@no_icondir@ -@$(SHELL) -c 'for n in $(ICON_LIST); \ +@no_icondir@ -@ECHO_CC@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \ +@no_icondir@ for n in $(ICON_LIST); \ @no_icondir@ do \ -@no_icondir@ x=$(actual_xterm); \ -@no_icondir@ r=`echo "$$n" | sed -e s,\^.\*:,, -e s,xterm,$$x,`; \ +@no_icondir@ r=`echo "$$n" | sed -e s,\^.\*:,, -e s,xterm,$$ACTUAL_XTERM,`; \ @no_icondir@ test -z "$$r" && continue; \ @no_icondir@ h=$(ICONDIR)/$(ICON_THEME); \ +@no_icondir@ test -f $$h/$$r || continue; \ @no_icondir@ echo removing $$h/$$r; \ @no_icondir@ $(RM) $$h/$$r; \ @no_icondir@ done' @@ -475,8 +523,8 @@ uninstall-full :: @no_pixmapdir@uninstall \ @no_pixmapdir@uninstall-icon \ @no_pixmapdir@uninstall-full :: -@no_pixmapdir@ ACTUAL_XTERM=$(actual_xterm) \ -@no_pixmapdir@ $(SHELL) -c 'for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \ +@no_pixmapdir@ -@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \ +@no_pixmapdir@ for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \ @no_pixmapdir@ do \ @no_pixmapdir@ l=`basename $$n`; \ @no_pixmapdir@ r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \ @@ -492,14 +540,29 @@ uninstall-full :: @desktop_utils@install-full :: @desktop_utils@ ACTUAL_XTERM=$(actual_xterm) \ @desktop_utils@ $(SHELL) -c 'for n in $(DESKTOP_FILES); \ -@desktop_utils@ do $(SHELL) df-install $$ACTUAL_XTERM $(DESKTOP_FLAGS) $$n; \ +@desktop_utils@ do $(SHELL) df-install $$ACTUAL_XTERM $(ICON_NAME) DESTDIR="$(DESTDIR)" $(DESKTOP_FLAGS) $$n; \ @desktop_utils@ done' ################################################################################ +check : $(TEST_PROGRAMS) + @ echo "See demos in vttests/* (use vttest for system-level testing)" + @ $(SHELL) -c 'echo "** executing test_charclass"; \ + ./test_charclass' + @ $(SHELL) -c 'echo "** executing test_wcwidth"; \ + for range in 32-126 160-0xff00 0x10000-0x11000; \ + do echo ".. range $$range"; \ + ./test_wcwidth -s $$range; \ + ./test_wcwidth -s $$range -w; \ + done' + @ $(SHELL) -c 'echo "** executing test_ptydata"; \ + ./test_ptydata -a' +################################################################################ mostlyclean : - -$(RM) *$o *.[is] XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp + -$(RM) *$o *.[is] XTerm[1-9]*.* Xterm.log.* XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp clean : mostlyclean - -$(RM) $(PROGRAMS) builtin_icons.h + -$(RM) $(PROGRAMS) $(TEST_PROGRAMS) $(AUTO_SOURCE) + +sources : $(AUTO_SOURCE) distclean :: clean -$(RM) Makefile config.status config.cache config.log xtermcfg.h @@ -523,8 +586,9 @@ realclean : distclean maintainer-clean : realclean -$(RM) 256colres.h 88colres.h ################################################################################ -terminfo.out : terminfo ; tic -a -I -1 terminfo >$@ -termcap.out : termcap ; tic -a -C -U termcap >$@ +TIC=tic +terminfo.out : terminfo ; $(TIC) -a -I -1 terminfo >$@ +termcap.out : termcap ; $(TIC) -a -C -U termcap >$@ ################################################################################ docs-ctlseqs \ docs :: $(srcdir)/ctlseqs.txt @MAN2HTML_NOTE@ ctlseqs.html @GROFF_NOTE@ ctlseqs.pdf ctlseqs.ps @@ -563,8 +627,8 @@ koi8rxterm.ps : koi8rxterm.$(manext) koi8rxterm.txt : koi8rxterm.$(manext) ################################################################################ lint : - $(LINT) $(CPPFLAGS) $(SRCS1) - $(LINT) $(CPPFLAGS) $(SRCS2) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS1) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS2) tags : $(CTAGS) $(SRCS) $(HDRS) diff --git a/app/xterm/NEWS b/app/xterm/NEWS index 2717990a7..77ca74a98 100644 --- a/app/xterm/NEWS +++ b/app/xterm/NEWS @@ -1,43 +1,9 @@ The NEWS file was generated from xterm.log.html, which serves as the changelog for xterm. -------------------------------------------------------------------------------- - Patch #369 - 2021/09/21 + Patch #372 - 2022/03/09 - * modify run-tic.sh to work around bug in development version of - ncurses which was packaged in FreeBSD ports. - * remove ifdef's for OPT_COLOR_RES and OPT_COLOR_RES2. - * improve performance over slow connections (report by Harald - Dunkel). - * update cursor if restoring mode for DECTCEM. - * modify CharWidth macro to ensure that the shortcut for Latin-1 is - only applied when UTF-8 is not enabled, to fix a bug in handling - soft-hyphen from patch #334 changes (patch by Martijn van Duren). - * improve terminfo: - + fill-in function-keys in terminfo which are not Sun/HP - keyboards using xterm+nopcfkeys building-block. - + add kbeg to xterm+keypad to accommodate termcap applications - + add smglp and smgrp to vt420+lrmm, to provide useful data for - the "tabs" +m option - * support shift-tab in Sun, HP and SCO keyboards. - * document some legacy features in ctlseqs.ms (prompted by discussion - with Jimmy Aguilar Mena "Ergus"). - * add “trim” option to cdXtraScroll and tiXtraScroll. - * remove support for non-fifo save-lines configuration. - * extend cdXtraScroll to check if the cursor is at the upper-left of - the scrolling region when the erasure is for the remainder of the - screen versus the whole screen (prompted by discussion with Jörg - Breitbart). - * add workaround for broken pcre2 package in Debian 10. - * change screen-refresh call used for DECCARA and DECRARA to ensure - that trailing blanks which are part of the rectangle are repainted - (report/analysis by Dennis Filder). - * when resetting the terminal, ensure that the cursor shape also is - reset, e.g., if DECSCUSR has been used to modify the cursor shape - for an xterm which was started with the underlined cursor option - (report/analysis by Luis Javier Merino). - * prevent DECSCUSR from blinking the cursor if the cursorBlink - resource is “never” (report by Vladimir D Seleznev). - * invert the sense of DECSDM, to correspond with VT382 manuals (lsix - #41). - * update tables in wcwidth.c based on Unicode 14.0.0 + * amend allocation/freeing of scrollback lines, eliminating an + adjustment for status-line added in patch #371 (report/testcase by + Rajeev V. Pillai). diff --git a/app/xterm/THANKS b/app/xterm/THANKS index 82e395360..32ec45ad9 100644 --- a/app/xterm/THANKS +++ b/app/xterm/THANKS @@ -1,4 +1,4 @@ --- $XTermId: THANKS,v 1.32 2021/09/12 23:14:32 tom Exp $ +-- $XTermId: THANKS,v 1.33 2022/02/22 21:42:29 tom Exp $ -- vile:txtmode fk=utf-8 There's no AUTHORS file in this distribution; it would be redundant since I (Thomas E. Dickey) have done more than 80% of the work on xterm since 1996. @@ -71,6 +71,7 @@ David Michael David Wolfskill David Wood David Yeo +Denis Kaganovich Denis Zaitsev Dennis Filder Dennis Preiser @@ -172,6 +173,7 @@ Miroslav Lichvar Nam SungHyun Nelson Beebe Nicholas Marriott +Nick Black Nicolas George Németh Márton Olaf Rogalsky @@ -193,6 +195,7 @@ Philipp Klaus Krause Pierre Lombard Pierre Pronchery Quinn Strahl +Rajeev V Pillai Rajesh Mandalemula Richard Braakman Richard Griswold @@ -243,6 +246,7 @@ Torrey Lyons Victor Stinner Victor Vaile Vincent Lefèvre +Vladimir A Pavlov Walter Harms Werner Fink Werner Lemberg diff --git a/app/xterm/Tekproc.c b/app/xterm/Tekproc.c index d43c1617d..19c7ba4e7 100644 --- a/app/xterm/Tekproc.c +++ b/app/xterm/Tekproc.c @@ -1,4 +1,4 @@ -/* $XTermId: Tekproc.c,v 1.245 2021/06/03 21:23:18 tom Exp $ */ +/* $XTermId: Tekproc.c,v 1.246 2021/12/27 18:07:35 tom Exp $ */ /* * Copyright 2001-2020,2021 by Thomas E. Dickey @@ -924,7 +924,7 @@ TekSetWinSize(TekWidget tw) int rows = THeight(tekscr) / (int) (ScaleOf(tw) * t->vsize); int cols = TWidth(tekscr) / (int) (ScaleOf(tw) * t->hsize); - update_winsize(TScreenOf(tw->vt)->respond, + update_winsize(TScreenOf(tw->vt), rows, cols, TFullHeight(tekscr), TFullWidth(tekscr)); diff --git a/app/xterm/VTPrsTbl.c b/app/xterm/VTPrsTbl.c index d995b5200..edc732fd9 100644 --- a/app/xterm/VTPrsTbl.c +++ b/app/xterm/VTPrsTbl.c @@ -1,7 +1,7 @@ -/* $XTermId: VTPrsTbl.c,v 1.103 2020/12/22 20:29:32 tom Exp $ */ +/* $XTermId: VTPrsTbl.c,v 1.104 2021/12/26 17:50:25 tom Exp $ */ /* - * Copyright 1999-2019,2020 by Thomas E. Dickey + * Copyright 1999-2020,2021 by Thomas E. Dickey * * All Rights Reserved * @@ -2849,8 +2849,8 @@ CASE_DECERA, CASE_DECSERA, /* | } ~ DEL */ CASE_DECSCPP, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_DECSASD, +CASE_DECSSDT, CASE_IGNORE, /* 0x80 0x81 0x82 0x83 */ CASE_GROUND_STATE, @@ -3009,8 +3009,8 @@ CASE_DECERA, CASE_DECSERA, /* udiaeresis yacute thorn ydiaeresis */ CASE_DECSCPP, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_DECSASD, +CASE_DECSSDT, CASE_GROUND_STATE, }; diff --git a/app/xterm/VTparse.def b/app/xterm/VTparse.def index 4423a2ecd..7f9204c8b 100644 --- a/app/xterm/VTparse.def +++ b/app/xterm/VTparse.def @@ -1,10 +1,10 @@ -# $XTermId: VTparse.def,v 1.64 2020/12/15 21:37:33 tom Exp $ +# $XTermId: VTparse.def,v 1.65 2021/12/26 17:49:45 tom Exp $ # # vile:confmode rs=lf # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1996-2019,2020 by Thomas E. Dickey +# Copyright 1996-2020,2021 by Thomas E. Dickey # # All Rights Reserved # @@ -218,3 +218,5 @@ CASE_XTERM_PUSH_COLORS # XTPUSHCOLORS CASE_XTERM_REPORT_COLORS # XTREPORTCOLORS CASE_XTERM_POP_COLORS # XTPOPCOLORS CASE_XTERM_SHIFT_ESCAPE # XTSHIFTESCAPE +CASE_DECSSDT +CASE_DECSASD diff --git a/app/xterm/aclocal.m4 b/app/xterm/aclocal.m4 index df76ecf68..3be1e9f18 100644 --- a/app/xterm/aclocal.m4 +++ b/app/xterm/aclocal.m4 @@ -1,8 +1,8 @@ -dnl $XTermId: aclocal.m4,v 1.404 2015/04/12 19:43:57 tom Exp $ +dnl $XTermId: aclocal.m4,v 1.496 2022/02/24 22:10:29 tom Exp $ dnl dnl --------------------------------------------------------------------------- dnl -dnl Copyright 1997-2014,2015 by Thomas E. Dickey +dnl Copyright 1997-2021,2022 by Thomas E. Dickey dnl dnl All Rights Reserved dnl @@ -32,10 +32,11 @@ dnl authorization. dnl dnl --------------------------------------------------------------------------- dnl See -dnl http://invisible-island.net/autoconf/autoconf.html +dnl https://invisible-island.net/autoconf/autoconf.html +dnl https://invisible-island.net/autoconf/my-autoconf.html dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42 +dnl AM_LANGINFO_CODESET version: 6 updated: 2021/01/01 16:53:59 dnl ------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -46,16 +47,16 @@ dnl dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ - AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], - am_cv_langinfo_codeset=yes, - am_cv_langinfo_codeset=no) - ]) - if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE(HAVE_LANGINFO_CODESET, 1, - [Define if you have and nl_langinfo(CODESET).]) - fi +AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET); (void)cs], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test "$am_cv_langinfo_codeset" = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 @@ -84,10 +85,11 @@ define([CF_ACVERSION_COMPARE], [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00 +dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. +dnl $1 = flags to add +dnl $2 = if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily @@ -101,23 +103,23 @@ cf_new_extra_cppflags= for cf_add_cflags in $1 do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; @@ -126,25 +128,25 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -155,17 +157,17 @@ done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) - CFLAGS="$CFLAGS $cf_new_cflags" + CF_APPEND_TEXT(CFLAGS,$cf_new_cflags) fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags) fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) @@ -180,7 +182,7 @@ dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27 +dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33 dnl ----------- dnl Add one or more libraries, used to enforce consistency. Libraries are dnl prepended to an existing list, since their dependencies are assumed to @@ -189,19 +191,19 @@ dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIBS],[ -cf_add_libs="$1" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in [$]ifelse($2,,LIBS,[$2]) -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="[$]ifelse($2,,LIBS,[$2])" +# reverse order +cf_add_0lib= +for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl @@ -219,6 +221,35 @@ LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's% % % CF_VERBOSE(...after $LIBS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40 +dnl ---------------- +dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions. +dnl $1 = flags to add +dnl $2 = if given makes this macro verbose. +define([CF_APPEND_CFLAGS], +[ +for cf_add_cflags in $1 +do + case "x$cf_add_cflags" in + (x-[[DU]]*) + CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) + CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) + ;; + esac + CF_ADD_CFLAGS([$cf_add_cflags],[$2]) +done +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 +dnl -------------- +dnl use this macro for appending text without introducing an extra blank at +dnl the beginning +define([CF_APPEND_TEXT], +[ + test -n "[$]$1" && $1="[$]$1 " + $1="[$]{$1}$2" +])dnl +dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. @@ -231,7 +262,7 @@ dnl Allow user to enable a normally-off option. AC_DEFUN([CF_ARG_ENABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl dnl --------------------------------------------------------------------------- -dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 +dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. @@ -244,35 +275,112 @@ dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) - if test "$enableval" != "$5" ; then + if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ - else - $4]) - fi],[enableval=$5 ifelse([$4],,,[ - $4 + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 ])dnl - ])])dnl +])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00 +dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23 +dnl --------------- +AC_DEFUN([CF_C11_NORETURN], +[ +AC_MSG_CHECKING(if you want to use C11 _Noreturn feature) +CF_ARG_ENABLE(stdnoreturn, + [ --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics], + [enable_stdnoreturn=yes], + [enable_stdnoreturn=no]) +AC_MSG_RESULT($enable_stdnoreturn) + +if test $enable_stdnoreturn = yes; then +AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn, + [AC_TRY_COMPILE([ +#include +#include +#include +static _Noreturn void giveup(void) { exit(0); } + ], + [if (feof(stdin)) giveup()], + cf_cv_c11_noreturn=yes, + cf_cv_c11_noreturn=no) + ]) +else + cf_cv_c11_noreturn=no, +fi + +if test "$cf_cv_c11_noreturn" = yes; then + AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if header is available and working]) + AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported]) + HAVE_STDNORETURN_H=1 +else + HAVE_STDNORETURN_H=0 +fi + +AC_SUBST(HAVE_STDNORETURN_H) +AC_SUBST(STDC_NORETURN) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content -dnl into CC. This will not help with broken scripts that wrap the compiler with -dnl options, but eliminates a more common category of user confusion. +dnl into CC. This will not help with broken scripts that wrap the compiler +dnl with options, but eliminates a more common category of user confusion. +dnl +dnl In particular, it addresses the problem of being able to run the C +dnl preprocessor in a consistent manner. +dnl +dnl Caveat: this also disallows blanks in the pathname for the compiler, but +dnl the nuisance of having inconsistent settings for compiler and preprocessor +dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC -: ${CC:=cc} +: "${CC:=cc}" + +AC_MSG_CHECKING(\$CFLAGS variable) +case "x$CFLAGS" in +(*-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options) + cf_flags="$CFLAGS" + CFLAGS= + for cf_arg in $cf_flags + do + CF_ADD_CFLAGS($cf_arg) + done + ;; +(*) + AC_MSG_RESULT(ok) + ;; +esac AC_MSG_CHECKING(\$CC variable) case "$CC" in -(*[[\ \ ]]-[[IUD]]*) +(*[[\ \ ]]-*) AC_MSG_RESULT(broken) - AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` - CC=`echo "$CC" | sed -e 's/[[ ]].*//'` - CF_ADD_CFLAGS($cf_flags) + cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` + CC="$cf_prog" + for cf_arg in $cf_flags + do + case "x$cf_arg" in + (x-[[IUDfgOW]]*) + CF_ADD_CFLAGS($cf_arg) + ;; + (*) + CC="$CC $cf_arg" + ;; + esac + done + CF_VERBOSE(resulting CC: '$CC') + CF_VERBOSE(resulting CFLAGS: '$CFLAGS') + CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) @@ -280,7 +388,7 @@ case "$CC" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 +dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -294,7 +402,7 @@ dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ -if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then +if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else @@ -315,7 +423,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CFLAGS version: 3 updated: 2014/07/22 05:32:57 +dnl CF_CHECK_CFLAGS version: 4 updated: 2021/01/02 19:22:58 dnl --------------- dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from dnl a build-configuration such as imake. These have the pitfall that they @@ -333,11 +441,11 @@ AC_TRY_LINK([#include ],[printf("Hello world");],, if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then CF_VERBOSE(but keeping change to \$CPPFLAGS) fi - CFLAGS="$cf_check_flags"]) + CFLAGS="$cf_check_cflags"]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42 +dnl CF_CHECK_ERRNO version: 13 updated: 2020/03/10 18:53:47 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it @@ -348,53 +456,53 @@ dnl $2 = the assumed type AC_DEFUN([CF_CHECK_ERRNO], [ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ - AC_TRY_COMPILE([ + AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include #endif #include #include #include ], - ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, - [cf_cv_dcl_$1=yes], - [cf_cv_dcl_$1=no]) + ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1; (void)x, + [cf_cv_dcl_$1=yes], + [cf_cv_dcl_$1=no]) ]) if test "$cf_cv_dcl_$1" = no ; then - CF_UPPER(cf_result,decl_$1) - AC_DEFINE_UNQUOTED($cf_result) + CF_UPPER(cf_result,decl_$1) + AC_DEFINE_UNQUOTED($cf_result) fi # It's possible (for near-UNIX clones) that the data doesn't exist CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 +dnl CF_CHECK_EXTERN_DATA version: 5 updated: 2021/09/04 06:35:04 dnl -------------------- dnl Check for existence of external data in the current set of libraries. If -dnl we can modify it, it's real enough. +dnl we can modify it, it is real enough. dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ - AC_TRY_LINK([ + AC_TRY_LINK([ #undef $1 extern $2 $1; ], - [$1 = 2], - [cf_cv_have_$1=yes], - [cf_cv_have_$1=no]) + [$1 = 2], + [cf_cv_have_$1=yes], + [cf_cv_have_$1=no]) ]) if test "$cf_cv_have_$1" = yes ; then - CF_UPPER(cf_result,have_$1) - AC_DEFINE_UNQUOTED($cf_result) + CF_UPPER(cf_result,have_$1) + AC_DEFINE_UNQUOTED($cf_result) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 +dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does @@ -413,20 +521,115 @@ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" - ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes -cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi + +CLANG_VERSION=none + +if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then + case "$CC" in + (c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]]) + AC_MSG_WARN(replacing broken compiler alias $CC) + CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`" + CC=clang + ;; + esac + + AC_MSG_CHECKING(version of $CC) + CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + test -z "$CLANG_VERSION" && CLANG_VERSION=unknown + AC_MSG_RESULT($CLANG_VERSION) + + for cf_clang_opt in \ + -Qunused-arguments \ + -Wno-error=implicit-function-declaration + do + AC_MSG_CHECKING(if option $cf_clang_opt works) + cf_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cf_clang_opt" + AC_TRY_LINK([ + #include ],[ + printf("hello!\\n");],[ + cf_clang_optok=yes],[ + cf_clang_optok=no]) + AC_MSG_RESULT($cf_clang_optok) + CFLAGS="$cf_save_CFLAGS" + if test "$cf_clang_optok" = yes; then + CF_VERBOSE(adding option $cf_clang_opt) + CF_APPEND_TEXT(CFLAGS,$cf_clang_opt) + fi + done +fi ]) dnl --------------------------------------------------------------------------- +dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17 +dnl ----------------- +dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most +dnl character-strings. +dnl +dnl It is ambiguous because the specification accommodated the pre-ANSI +dnl compilers bundled by more than one vendor in lieu of providing a standard C +dnl compiler other than by costly add-ons. Because of this, the specification +dnl did not take into account the use of const for telling the compiler that +dnl string literals would be in readonly memory. +dnl +dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to +dnl let the compiler decide how to represent Xt's strings which were #define'd. +dnl That does not solve the problem of using the block of Xt's strings which +dnl are compiled into the library (and is less efficient than one might want). +dnl +dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both +dnl when compiling the library and compiling using the library, to tell the +dnl compiler that String is const. +AC_DEFUN([CF_CONST_X_STRING], +[ +AC_REQUIRE([AC_PATH_XTRA]) + +CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) + +AC_TRY_COMPILE( +[ +#include +#include +], +[String foo = malloc(1); free((void*)foo)],[ + +AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ + AC_TRY_COMPILE( + [ +#define _CONST_X_STRING /* X11R7.8 (perhaps) */ +#undef XTSTRINGDEFINES /* X11R5 and later */ +#include +#include + ],[String foo = malloc(1); *foo = 0],[ + cf_cv_const_x_string=no + ],[ + cf_cv_const_x_string=yes + ]) +]) + +CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) + +case "$cf_cv_const_x_string" in +(no) + CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) + ;; +(*) + CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) + ;; +esac + +]) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_DISABLE_DESKTOP version: 2 updated: 2011/04/22 05:17:37 dnl ------------------ dnl Handle a configure option "--disable-desktop", which sets a shell @@ -457,9 +660,9 @@ test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#" AC_SUBST(DESKTOP_FLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28 +dnl CF_DISABLE_ECHO version: 14 updated: 2021/09/04 06:35:04 dnl --------------- -dnl You can always use "make -n" to see the actual options, but it's hard to +dnl You can always use "make -n" to see the actual options, but it is hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: @@ -474,17 +677,17 @@ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ - ECHO_LT='--silent' - ECHO_LD='@echo linking [$]@;' - RULE_CC='@echo compiling [$]<' - SHOW_CC='@echo compiling [$]@' - ECHO_CC='@' + ECHO_LT='--silent' + ECHO_LD='@echo linking [$]@;' + RULE_CC='@echo compiling [$]<' + SHOW_CC='@echo compiling [$]@' + ECHO_CC='@' ],[ - ECHO_LT='' - ECHO_LD='' - RULE_CC='' - SHOW_CC='' - ECHO_CC='' + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) @@ -494,7 +697,7 @@ AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 +dnl CF_DISABLE_LEAKS version: 9 updated: 2021/04/03 16:41:50 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -507,17 +710,19 @@ AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], - [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], - : ${with_no_leaks:=no}) + [enable_leaks=$enableval], + [enable_leaks=yes]) +dnl with_no_leaks is more readable... +if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi AC_MSG_RESULT($with_no_leaks) -if test "$with_no_leaks" = yes ; then +if test "$enable_leaks" = no ; then AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33 +dnl CF_DISABLE_RPATH_HACK version: 3 updated: 2021/01/05 20:14:44 dnl --------------------- dnl The rpath-hack makes it simpler to build programs, particularly with the dnl *BSD ports which may have essential libraries in unusual places. But it @@ -528,15 +733,18 @@ AC_DEFUN([CF_DISABLE_RPATH_HACK], AC_MSG_CHECKING(if rpath-hack should be disabled) CF_ARG_DISABLE(rpath-hack, [ --disable-rpath-hack don't add rpath options for additional libraries], - [cf_disable_rpath_hack=yes], - [cf_disable_rpath_hack=no]) + [enable_rpath_hack=no], + [enable_rpath_hack=yes]) +dnl TODO - drop cf_disable_rpath_hack +if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi AC_MSG_RESULT($cf_disable_rpath_hack) -if test "$cf_disable_rpath_hack" = no ; then + +if test "$enable_rpath_hack" = yes ; then CF_RPATH_HACK fi ]) dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_NARROWPROTO version: 5 updated: 2015/04/12 15:39:00 +dnl CF_ENABLE_NARROWPROTO version: 6 updated: 2020/12/31 18:40:20 dnl --------------------- dnl If this is not set properly, Xaw's scrollbars will not work. dnl The so-called "modular" configuration for X.org omits most of the @@ -547,7 +755,7 @@ AC_DEFUN([CF_ENABLE_NARROWPROTO], AC_MSG_CHECKING(if you want narrow prototypes for X libraries) case `$ac_config_guess` in -(*freebsd*|*gnu*|*irix5*|*irix6*|*linux-gnu*|*netbsd*|*openbsd*|*qnx*|*sco*|*sgi*) +(*freebsd*|*gnu*|*irix5*|*irix6*|*netbsd*|*openbsd*|*qnx*|*sco*|*sgi*) cf_default_narrowproto=yes ;; (*) @@ -563,6 +771,36 @@ CF_ARG_OPTION(narrowproto, AC_MSG_RESULT($enable_narrowproto) ]) dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_WARNINGS version: 9 updated: 2021/01/05 19:40:50 +dnl ------------------ +dnl Configure-option to enable gcc warnings +dnl +dnl $1 = extra options to add, if supported +dnl $2 = option for checking attributes. By default, this is done when +dnl warnings are enabled. For other values: +dnl yes: always do this, e.g., to use in generated library-headers +dnl no: never do this +AC_DEFUN([CF_ENABLE_WARNINGS],[ +if test "$GCC" = yes || test "$GXX" = yes +then +CF_FIX_WARNINGS(CFLAGS) +CF_FIX_WARNINGS(CPPFLAGS) +CF_FIX_WARNINGS(LDFLAGS) +AC_MSG_CHECKING(if you want to turn on gcc warnings) +CF_ARG_ENABLE(warnings, + [ --enable-warnings test: turn on gcc compiler warnings], + [enable_warnings=yes], + [enable_warnings=no]) +AC_MSG_RESULT($enable_warnings) +if test "$enable_warnings" = "yes" +then + ifelse($2,,[CF_GCC_ATTRIBUTES]) + CF_GCC_WARNINGS($1) +fi +ifelse($2,yes,[CF_GCC_ATTRIBUTES]) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 dnl -------- dnl Check if 'errno' is declared in @@ -571,7 +809,47 @@ AC_DEFUN([CF_ERRNO], CF_CHECK_ERRNO(errno) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_GRANTPT version: 11 updated: 2015/04/12 15:39:00 +dnl CF_FIX_WARNINGS version: 4 updated: 2021/12/16 18:22:31 +dnl --------------- +dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's +dnl "-Werror" flags can interfere with configure-checks. Those go into +dnl EXTRA_CFLAGS. +dnl +dnl $1 = variable name to repair +define([CF_FIX_WARNINGS],[ +if test "$GCC" = yes || test "$GXX" = yes +then + case [$]$1 in + (*-Werror=*) + cf_temp_flags= + for cf_temp_scan in [$]$1 + do + case "x$cf_temp_scan" in + (x-Werror=format*) + CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) + ;; + (x-Werror=*) + CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan) + ;; + (*) + CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) + ;; + esac + done + if test "x[$]$1" != "x$cf_temp_flags" + then + CF_VERBOSE(repairing $1: [$]$1) + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + fi + ;; + esac +fi +AC_SUBST(EXTRA_CFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_GRANTPT version: 15 updated: 2020/12/31 18:40:20 dnl --------------- dnl Check for grantpt versus openpty, as well as functions that "should" be dnl available if grantpt is available. @@ -582,9 +860,17 @@ stropts.h \ ) cf_func_grantpt="grantpt ptsname" +cf_prefer_openpt=no case $host_os in (darwin[[0-9]].*) ;; +(openbsd[[0-9]].*) + # The POSIX entrypoints exist, but have never worked. + ;; +(linux*) + cf_func_grantpt="$cf_func_grantpt posix_openpt" + cf_prefer_openpt=yes + ;; (*) cf_func_grantpt="$cf_func_grantpt posix_openpt" ;; @@ -624,7 +910,7 @@ dnl if we have no stropts.h, skip the checks for streams modules do cf_pty_feature= - cf_pty_next=`expr $cf_pty_this + 1` + cf_pty_next="`expr $cf_pty_this + 1`" CF_MSG_LOG(pty feature test $cf_pty_next:5) AC_TRY_RUN(#define CONFTEST $cf_pty_this $cf_pty_defines @@ -686,7 +972,9 @@ dnl dnl There is no configure run-test for openpty, since older implementations do dnl not always run properly as a non-root user. For that reason, we also allow dnl the configure script to suppress this check entirely with $disable_openpty. -if test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then +if test "x$cf_prefer_posix_openpt" = "xyes" && test "x$ac_cv_func_posix_openpt" = "xyes" ; then + CF_VERBOSE(prefer posix_openpt over openpty) +elif test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no]) if test "$cf_have_openpty" = yes ; then ac_cv_func_grantpt=no @@ -719,7 +1007,7 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_TGETENT version: 20 updated: 2015/04/12 15:39:00 +dnl CF_FUNC_TGETENT version: 23 updated: 2020/06/02 20:17:00 dnl --------------- dnl Check for tgetent function in termcap library. If we cannot find this, dnl we'll use the $LINES and $COLUMNS environment variables to pass screen @@ -749,6 +1037,17 @@ then fi test -z "$cf_TERMVAR" && cf_TERMVAR=vt100 +# BSD termcap used no header file +# SVr4 provided termcap prototypes as a legacy feature in term.h +# GNU termcap provided termcap prototypes in termcap.h +# ncurses provides termcap prototypes in both term.h and termcap.h +# +# The terminfo-based termcap interfaces do not provide a full tgetent (i.e., do +# not return the text of the termcap entry in the buffer), but as a special +# case, FreeBSD provides ncurses' termcap.h with a modified termcap reader that +# returns the termcap text. +AC_CHECK_HEADERS(termcap.h) + AC_MSG_CHECKING(if we want full tgetent function) CF_ARG_DISABLE(full-tgetent, [ --disable-full-tgetent disable check for full tgetent function], @@ -774,13 +1073,16 @@ else fi for cf_termlib in '' $cf_TERMLIB ; do LIBS="$cf_save_LIBS" - test -n "$cf_termlib" && CF_ADD_LIB($cf_termlib) + test -n "$cf_termlib" && { CF_ADD_LIB($cf_termlib) } AC_TRY_RUN([ +#ifdef HAVE_TERMCAP_H +#include +#endif /* terminfo implementations ignore the buffer argument, making it useless for * the xterm application, which uses this information to make a new TERMCAP * environment variable. */ -int main() +int main(void) { char buffer[1024]; buffer[0] = 0; @@ -804,7 +1106,7 @@ LIBS="$cf_save_LIBS" # not have side effects other than setting the cache variable, because # they are not executed when a cached value exists.) if test "x$cf_cv_lib_tgetent" != xno ; then - test "x$cf_cv_lib_tgetent" != xyes && CF_ADD_LIBS($cf_cv_lib_tgetent) + test "x$cf_cv_lib_tgetent" != xyes && { CF_ADD_LIBS($cf_cv_lib_tgetent) } AC_DEFINE(USE_TERMCAP,1,[Define 1 to indicate that working tgetent is found]) if test "$cf_full_tgetent" = no ; then AC_TRY_COMPILE([ @@ -844,14 +1146,16 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 +dnl CF_GCC_ATTRIBUTES version: 24 updated: 2021/03/20 12:00:25 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], -[ -if test "$GCC" = yes +[AC_REQUIRE([AC_PROG_FGREP])dnl +AC_REQUIRE([CF_C11_NORETURN])dnl + +if test "$GCC" = yes || test "$GXX" = yes then cat > conftest.i < conftest.$ac_ext < "conftest.$ac_ext" < conftest.$ac_ext <&AC_FD_CC - case $cf_attribute in + case "$cf_attribute" in (printf) cf_printf_attribute=yes cat >conftest.h <>confdefs.h - case $cf_attribute in + case "$cf_attribute" in (noreturn) AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; @@ -948,15 +1252,16 @@ EOF fi done else - fgrep define conftest.i >>confdefs.h + ${FGREP-fgrep} define conftest.i >>confdefs.h fi -rm -rf conftest* +rm -rf ./conftest* fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 +dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36 dnl -------------- -dnl Find version of gcc +dnl Find version of gcc, and (because icc/clang pretend to be gcc without being +dnl compatible), attempt to determine if icc/clang is actually used. AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none @@ -966,14 +1271,17 @@ if test "$GCC" = yes ; then test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi +CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) +CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00 +dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) +dnl -Winline (usually not worthwhile) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This @@ -990,14 +1298,11 @@ dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) -CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) -CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) - -cat > conftest.$ac_ext < "conftest.$ac_ext" <],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - AC_TRY_COMPILE([#include ],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_cv_gnu_source=yes]) - CPPFLAGS="$cf_save" - ]) + #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 + return 0; + #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 + return 0; + #else + # error not GNU C library + #endif], + [cf_cv_gnu_library=yes], + [cf_cv_gnu_library=no]) ]) -test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + +if test x$cf_cv_gnu_library = xyes; then + + # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE + # was changed to help a little. newlib incorporated the change about 4 + # years later. + AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ + cf_save="$CPPFLAGS" + CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) + AC_TRY_COMPILE([#include ],[ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) + return 0; + #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) + return 0; + #else + # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old + #endif], + [cf_cv_gnu_library_219=yes], + [cf_cv_gnu_library_219=no]) + CPPFLAGS="$cf_save" + ]) + + if test "x$cf_cv_gnu_library_219" = xyes; then + cf_save="$CPPFLAGS" + AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[ + CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source) + AC_TRY_COMPILE([ + #include + #include + ],[ + #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) + return 0; + #else + # error GNU C library is too old + #endif], + [cf_cv_gnu_dftsrc_219=yes], + [cf_cv_gnu_dftsrc_219=no]) + ]) + test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" + else + cf_cv_gnu_dftsrc_219=maybe + fi + + if test "x$cf_cv_gnu_dftsrc_219" != xyes; then + + AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ + AC_TRY_COMPILE([#include ],[ + #ifndef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be defined + #endif], + [cf_cv_gnu_source=no], + [cf_save="$CPPFLAGS" + CF_ADD_CFLAGS(-D_GNU_SOURCE) + AC_TRY_COMPILE([#include ],[ + #ifdef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be undefined + #endif], + [cf_cv_gnu_source=no], + [cf_cv_gnu_source=yes]) + CPPFLAGS="$cf_save" + ]) + ]) + + if test "$cf_cv_gnu_source" = yes + then + AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ + CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE) + AC_TRY_COMPILE([#include ],[ + #ifdef _DEFAULT_SOURCE + #error expected _DEFAULT_SOURCE to be undefined + #endif], + [cf_cv_default_source=no], + [cf_cv_default_source=yes]) + ]) + if test "$cf_cv_default_source" = yes + then + CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) + fi + fi + fi + +fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 +dnl CF_HELP_MESSAGE version: 4 updated: 2019/12/31 08:53:54 dnl --------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], -[AC_DIVERT_HELP([$1])dnl +[CF_ACVERSION_CHECK(2.53,[],[ +AC_DIVERT_HELP($1)])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_IMAKE_CFLAGS version: 32 updated: 2015/04/12 15:39:00 +dnl CF_IMAKE_CFLAGS version: 34 updated: 2020/12/31 18:40:20 dnl --------------- dnl Use imake to obtain compiler flags. We could, in principle, write tests to dnl get these, but if imake is properly configured there is no point in doing @@ -1147,7 +1529,7 @@ case $IMAKE in ;; (*/util/xmkmf) # A single parameter tells xmkmf where the config-files are: - cf_imake_opts="`echo $IMAKE|sed -e s,/config/util/xmkmf,,`" + cf_imake_opts="`echo "$IMAKE"|sed -e s,/config/util/xmkmf,,`" ;; (*) cf_imake_opts= @@ -1158,7 +1540,7 @@ esac # config directory. if mkdir conftestdir; then CDPATH=; export CDPATH - cf_makefile=`cd $srcdir;pwd`/Imakefile + cf_makefile=`cd "$srcdir" || exit;pwd`/Imakefile cd conftestdir cat >fix_cflags.sed <<'CF_EOF' @@ -1180,7 +1562,7 @@ s/$/"/ CF_EOF echo >./Imakefile - test -f $cf_makefile && cat $cf_makefile >>./Imakefile + test -f "$cf_makefile" && cat "$cf_makefile" >>./Imakefile cat >> ./Imakefile <<'CF_EOF' findstddefs: @@ -1188,19 +1570,19 @@ findstddefs: @echo IMAKE ${EXTRA_LOAD_FLAGS}ifelse([$2],,,[ $2]) | sed -f fix_lflags.sed CF_EOF - if ( $IMAKE $cf_imake_opts 1>/dev/null 2>&AC_FD_CC && test -f Makefile) + if ( $IMAKE "$cf_imake_opts" 1>/dev/null 2>&AC_FD_CC && test -f Makefile) then CF_VERBOSE(Using $IMAKE $cf_imake_opts) else # sometimes imake doesn't have the config path compiled in. Find it. cf_config= for cf_libpath in $X_LIBS $LIBS ; do - case $cf_libpath in + case "$cf_libpath" in (-L*) - cf_libpath=`echo .$cf_libpath | sed -e 's/^...//'` - cf_libpath=$cf_libpath/X11/config - if test -d $cf_libpath ; then - cf_config=$cf_libpath + cf_libpath=`echo ".$cf_libpath" | sed -e 's/^...//'` + cf_libpath="$cf_libpath/X11/config" + if test -d "$cf_libpath" ; then + cf_config="$cf_libpath" break fi ;; @@ -1210,7 +1592,7 @@ CF_EOF AC_MSG_WARN(Could not find imake config-directory) else cf_imake_opts="$cf_imake_opts -I$cf_config" - if ( $IMAKE -v $cf_imake_opts 2>&AC_FD_CC) + if ( "$IMAKE" -v "$cf_imake_opts" 2>&AC_FD_CC) then CF_VERBOSE(Using $IMAKE $cf_config) else @@ -1221,7 +1603,7 @@ CF_EOF # GNU make sometimes prints "make[1]: Entering...", which # would confuse us. - eval `make findstddefs 2>/dev/null | grep -v make` + eval "`make findstddefs 2>/dev/null | grep -v make`" cd .. rm -rf conftestdir @@ -1281,7 +1663,7 @@ AC_SUBST(IMAKE_CFLAGS) AC_SUBST(IMAKE_LOADFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INPUT_METHOD version: 3 updated: 2000/04/11 23:46:57 +dnl CF_INPUT_METHOD version: 5 updated: 2021/06/07 17:39:17 dnl --------------- dnl Check if the X libraries support input-method AC_DEFUN([CF_INPUT_METHOD], @@ -1299,20 +1681,22 @@ AC_TRY_LINK([ XIM xim; XIMStyles *xim_styles = 0; XIMStyle input_style; - Widget w = 0; + Widget w = XtCreateWidget("none", (WidgetClass)0, None, (ArgList)0, 0); XSetLocaleModifiers("@im=none"); xim = XOpenIM(XtDisplay(w), NULL, NULL, NULL); XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL); XCloseIM(xim); input_style = (XIMPreeditNothing | XIMStatusNothing); + (void)xim_styles; + (void)input_style; } ], [cf_cv_input_method=yes], [cf_cv_input_method=no])]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00 +dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch @@ -1330,7 +1714,7 @@ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then - case $host_os in + case "$host_os" in (linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" @@ -1350,7 +1734,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147" fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LASTLOG version: 5 updated: 2012/10/04 20:12:20 +dnl CF_LASTLOG version: 7 updated: 2021/01/02 09:31:20 dnl ---------- dnl Check for header defining _PATH_LASTLOG, or failing that, see if the lastlog dnl file exists. @@ -1366,7 +1750,7 @@ AC_TRY_COMPILE([ #ifdef HAVE_PATHS_H #include #endif -#endif],[char *path = _PATH_LASTLOG], +#endif],[char *path = _PATH_LASTLOG; (void)path], [cf_cv_path_lastlog="_PATH_LASTLOG"], [if test -f /usr/adm/lastlog ; then cf_cv_path_lastlog=/usr/adm/lastlog @@ -1374,10 +1758,10 @@ AC_TRY_COMPILE([ cf_cv_path_lastlog=no fi]) ]) -test $cf_cv_path_lastlog != no && AC_DEFINE(USE_LASTLOG,1,[Define to 1 if we can define lastlog pathname]) +test "$cf_cv_path_lastlog" != no && AC_DEFINE(USE_LASTLOG,1,[Define to 1 if we can define lastlog pathname]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LD_RPATH_OPT version: 6 updated: 2015/04/12 15:39:00 +dnl CF_LD_RPATH_OPT version: 9 updated: 2021/01/01 13:31:04 dnl --------------- dnl For the given system and compiler, find the compiler flags to pass to the dnl loader to use the "rpath" feature. @@ -1386,49 +1770,52 @@ AC_DEFUN([CF_LD_RPATH_OPT], AC_REQUIRE([CF_CHECK_CACHE]) LD_RPATH_OPT= -AC_MSG_CHECKING(for an rpath option) -case $cf_cv_system_name in -(irix*) - if test "$GCC" = yes; then +if test "x$cf_cv_enable_rpath" != xno +then + AC_MSG_CHECKING(for an rpath option) + case "$cf_cv_system_name" in + (irix*) + if test "$GCC" = yes; then + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; + (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," - else + ;; + (openbsd[[2-9]].*|mirbsd*) + LD_RPATH_OPT="-Wl,-rpath," + ;; + (dragonfly*) LD_RPATH_OPT="-rpath " - fi - ;; -(linux*|gnu*|k*bsd*-gnu) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(openbsd[[2-9]].*|mirbsd*) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(dragonfly*|freebsd*) - LD_RPATH_OPT="-rpath " - ;; -(netbsd*) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(osf*|mls+*) - LD_RPATH_OPT="-rpath " - ;; -(solaris2*) - LD_RPATH_OPT="-R" - ;; -(*) - ;; -esac -AC_MSG_RESULT($LD_RPATH_OPT) + ;; + (netbsd*) + LD_RPATH_OPT="-Wl,-rpath," + ;; + (osf*|mls+*) + LD_RPATH_OPT="-rpath " + ;; + (solaris2*) + LD_RPATH_OPT="-R" + ;; + (*) + ;; + esac + AC_MSG_RESULT($LD_RPATH_OPT) -case "x$LD_RPATH_OPT" in -(x-R*) - AC_MSG_CHECKING(if we need a space after rpath option) - cf_save_LIBS="$LIBS" - CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) - AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) - LIBS="$cf_save_LIBS" - AC_MSG_RESULT($cf_rpath_space) - test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " - ;; -esac + case "x$LD_RPATH_OPT" in + (x-R*) + AC_MSG_CHECKING(if we need a space after rpath option) + cf_save_LIBS="$LIBS" + CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) + AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) + LIBS="$cf_save_LIBS" + AC_MSG_RESULT($cf_rpath_space) + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; + esac +fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 @@ -1468,7 +1855,7 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 +dnl CF_MATH_LIB version: 10 updated: 2020/12/31 18:40:20 dnl ----------- dnl Checks for libraries. At least one UNIX system, Apple Macintosh dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler @@ -1479,9 +1866,10 @@ AC_CACHE_CHECK(if -lm needed for math functions, cf_cv_need_libm,[ AC_TRY_LINK([ #include + #include #include ], - [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], + [double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) if test "$cf_cv_need_libm" = yes @@ -1492,7 +1880,7 @@ ifelse($1,,[ fi ]) dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00 +dnl CF_MIXEDCASE_FILENAMES version: 9 updated: 2021/01/01 16:53:59 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. @@ -1500,8 +1888,8 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES], [ AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then - case $target_alias in - (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) + case "$target_alias" in + (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*) cf_cv_mixedcase=no ;; (*) @@ -1530,23 +1918,33 @@ AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00 +dnl CF_NO_LEAKS_OPTION version: 9 updated: 2021/06/13 19:45:41 dnl ------------------ dnl see CF_WITH_NO_LEAKS +dnl +dnl $1 = option/name +dnl $2 = help-text +dnl $3 = symbol to define if the option is set +dnl $4 = additional actions to take if the option is set AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], - [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ + [case "x$withval" in + (x|xno) ;; + (*) + : "${with_cflags:=-g}" + : "${enable_leaks:=no}" + with_$1=yes + AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) - : ${with_cflags:=-g} - : ${with_no_leaks:=yes} - with_$1=yes], + ;; + esac], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) -case .$with_cflags in +case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) @@ -1559,14 +1957,14 @@ case .$with_cflags in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 7 updated: 2015/04/12 15:39:00 +dnl CF_PATHSEP version: 8 updated: 2021/01/01 13:31:04 dnl ---------- dnl Provide a value for the $PATH and similar separator (or amend the value dnl as provided in autoconf 2.5x). AC_DEFUN([CF_PATHSEP], [ AC_MSG_CHECKING(for PATH separator) - case $cf_cv_system_name in + case "$cf_cv_system_name" in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac @@ -1575,12 +1973,13 @@ ifelse([$1],,,[$1=$PATH_SEPARATOR]) AC_MSG_RESULT($PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_PROG version: 9 updated: 2012/10/04 20:12:20 +dnl CF_PATH_PROG version: 12 updated: 2021/01/02 09:31:20 dnl ------------ dnl Check for a given program, defining corresponding symbol. dnl $1 = environment variable, which is suffixed by "_PATH" in the #define. dnl $2 = program name to find. dnl $3 = optional list of additional program names to test. +dnl $4 = $PATH dnl dnl If there is more than one token in the result, #define the remaining tokens dnl to $1_ARGS. We need this for 'install' in particular. @@ -1589,8 +1988,8 @@ dnl FIXME: we should allow this to be overridden by environment variables dnl AC_DEFUN([CF_PATH_PROG],[ AC_REQUIRE([CF_PATHSEP]) -test -z "[$]$1" && $1=$2 -AC_PATH_PROGS($1,[$]$1 $2 $3,[$]$1) +test -z "[$]$1" && $1="$2" +AC_PATH_PROGS($1,[$]$1 $2 ifelse($3,,,$3),[$]$1, ifelse($4,,,$4)) cf_path_prog="" cf_path_args="" @@ -1602,7 +2001,7 @@ do CF_PATH_SYNTAX(cf_temp,break) cf_path_prog="$cf_temp" else - cf_path_prog="`basename $cf_temp`" + cf_path_prog="`basename "$cf_temp"`" fi elif test -z "$cf_path_args" ; then cf_path_args="$cf_temp" @@ -1619,7 +2018,7 @@ if test -n "$cf_path_prog" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 15 updated: 2015/04/12 15:39:00 +dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the @@ -1627,38 +2026,40 @@ dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in (.\[$]\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX - ;; -(.\[$]{*prefix}*|.\[$]{*dir}*) - eval $1="[$]$1" - case ".[$]$1" in - (.NONE/*) - $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\[$]\{*prefix\}*|.\[$]\{*dir\}*) + eval $1="[$]$1" + case ".[$]$1" in + (.NONE/*) + $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` - ;; + $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) - ;; + ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 9 updated: 2015/04/12 15:39:00 +dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. +dnl +dnl Sets $PKG_CONFIG to the pathname of the pkg-config program. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) @@ -1668,7 +2069,7 @@ AC_ARG_WITH(pkg-config, [cf_pkg_config=yes]) AC_MSG_RESULT($cf_pkg_config) -case $cf_pkg_config in +case "$cf_pkg_config" in (no) PKG_CONFIG=none ;; @@ -1685,14 +2086,14 @@ esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then CF_PATH_SYNTAX(PKG_CONFIG) -else +elif test "x$cf_pkg_config" != xno ; then AC_MSG_WARN(pkg-config is not installed) fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00 +dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -1707,7 +2108,10 @@ dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], -[ +[AC_REQUIRE([CF_POSIX_VISIBLE])dnl + +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" @@ -1745,7 +2149,8 @@ make an error fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" + CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source) CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE @@ -1763,9 +2168,11 @@ if test "$cf_cv_posix_c_source" != no ; then CF_ADD_CFLAGS($cf_cv_posix_c_source) fi +fi # cf_cv_posix_visible + ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_SAVED_IDS version: 8 updated: 2012/10/04 20:12:20 +dnl CF_POSIX_SAVED_IDS version: 9 updated: 2020/03/10 18:53:47 dnl ------------------ dnl dnl Check first if saved-ids are always supported. Some systems @@ -1787,6 +2194,8 @@ AC_TRY_LINK( #if defined(_POSIX_SAVED_IDS) && (_POSIX_SAVED_IDS > 0) void *p = (void *) seteuid; int x = seteuid(geteuid()); + (void)p; + (void)x; #elif defined(BSD) && (BSD >= 199103) /* The BSD's may implement the runtime check - and it fails. * However, saved-ids work almost like POSIX (close enough for most uses). @@ -1801,10 +2210,11 @@ AC_TRY_RUN([ #include #endif #include -int main() +int main(void) { void *p = (void *) seteuid; long code = sysconf(_SC_SAVED_IDS); + (void)p; ${cf_cv_main_return:-return} ((code > 0) ? 0 : 1); }], cf_cv_posix_saved_ids=yes, @@ -1816,7 +2226,34 @@ int main() test "$cf_cv_posix_saved_ids" = yes && AC_DEFINE(HAVE_POSIX_SAVED_IDS,1,[Define to 1 if POSIX saved-ids are supported]) ]) dnl --------------------------------------------------------------------------- -dnl CF_POSIX_WAIT version: 3 updated: 2012/10/04 20:12:20 +dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 +dnl ---------------- +dnl POSIX documents test-macros which an application may set before any system +dnl headers are included to make features available. +dnl +dnl Some BSD platforms (originally FreeBSD, but copied by a few others) +dnl diverged from POSIX in 2002 by setting symbols which make all of the most +dnl recent features visible in the system header files unless the application +dnl overrides the corresponding test-macros. Doing that introduces portability +dnl problems. +dnl +dnl This macro makes a special check for the symbols used for this, to avoid a +dnl conflicting definition. +AC_DEFUN([CF_POSIX_VISIBLE], +[ +AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ +AC_TRY_COMPILE([#include ],[ +#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ + && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ + && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ + && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) +#error conflicting symbols found +#endif +],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_WAIT version: 4 updated: 2020/03/10 18:53:47 dnl ------------- dnl Check for POSIX wait support AC_DEFUN([CF_POSIX_WAIT], @@ -1834,6 +2271,8 @@ AC_TRY_LINK([ int stat_loc; pid_t pid = waitpid(-1, &stat_loc, WNOHANG|WUNTRACED); pid_t pid2 = wait(&stat_loc); + (void)pid; + (void)pid2; ], [cf_cv_posix_wait=yes], [cf_cv_posix_wait=no]) @@ -1841,7 +2280,7 @@ AC_TRY_LINK([ test "$cf_cv_posix_wait" = yes && AC_DEFINE(USE_POSIX_WAIT,1,[Define to 1 if we have POSIX wait functions]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROCFS_CWD version: 2 updated: 2007/03/12 20:39:04 +dnl CF_PROCFS_CWD version: 4 updated: 2020/12/31 18:40:20 dnl ------------- dnl Find /proc tree (may be in a different place) which implements the "cwd" dnl link. @@ -1850,22 +2289,26 @@ AC_CACHE_CHECK(for proc tree with cwd-support,cf_cv_procfs_cwd,[ cf_cv_procfs_cwd=no for cf_path in /proc /compat/linux/proc /usr/compat/linux/proc do - if test -d $cf_path && \ - test -d $cf_path/$$ && \ - ( test -d $cf_path/$$/cwd || \ - test -L $cf_path/$$/cwd ); then - cf_cv_procfs_cwd=$cf_path + if test -d "$cf_path" && \ + test -d "$cf_path"/$$ && \ + { test -d "$cf_path"/$$/cwd || \ + test -L "$cf_path"/$$/cwd; }; then + cf_cv_procfs_cwd="$cf_path" break fi done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 +dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ +CF_ACVERSION_CHECK(2.53, + [AC_MSG_WARN(this will incorrectly handle gnatgcc choice) + AC_REQUIRE([AC_PROG_CC])], + []) ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, @@ -1874,12 +2317,14 @@ CF_ACVERSION_CHECK(2.52, CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GROFF version: 1 updated: 2013/01/02 20:37:18 +dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19 dnl ------------- dnl Check if groff is available, for cases (such as html output) where nroff dnl is not enough. AC_DEFUN([CF_PROG_GROFF],[ AC_PATH_PROG(GROFF_PATH,groff,no) +AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no) +AC_PATH_PROG(TBL_PATH,tbl,cat) if test "x$GROFF_PATH" = xno then NROFF_NOTE= @@ -1888,12 +2333,24 @@ else NROFF_NOTE="#" GROFF_NOTE= fi -AC_SUBST(GROFF_PATH) AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 11 updated: 2015/04/12 15:39:00 +dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37 +dnl ------------ +AC_DEFUN([CF_PROG_LINT], +[ +AC_CHECK_PROGS(LINT, lint cppcheck splint) +case "x$LINT" in +(xcppcheck|x*/cppcheck) + test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" + ;; +esac +AC_SUBST(LINT_OPTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REGEX version: 18 updated: 2021/01/01 16:53:59 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. @@ -1901,24 +2358,36 @@ AC_DEFUN([CF_REGEX], [ cf_regex_func=no - -cf_regex_libs="regex re" -case $host_os in +cf_regex_libs= +case "$host_os" in (mingw*) - cf_regex_libs="gnurx $cf_regex_libs" + # -lsystre -ltre -lintl -liconv + AC_CHECK_LIB(systre,regcomp,[ + AC_CHECK_LIB(iconv,libiconv_open,[CF_ADD_LIB(iconv)]) + AC_CHECK_LIB(intl,libintl_gettext,[CF_ADD_LIB(intl)]) + AC_CHECK_LIB(tre,tre_regcomp,[CF_ADD_LIB(tre)]) + CF_ADD_LIB(systre) + cf_regex_func=regcomp + ],[ + AC_CHECK_LIB(gnurx,regcomp,[ + CF_ADD_LIB(gnurx) + cf_regex_func=regcomp]) + ]) + ;; +(*) + cf_regex_libs="regex re" + AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ + for cf_regex_lib in $cf_regex_libs + do + AC_CHECK_LIB($cf_regex_lib,regcomp,[ + CF_ADD_LIB($cf_regex_lib) + cf_regex_func=regcomp + break]) + done + ]) ;; esac -AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ - for cf_regex_lib in $cf_regex_libs - do - AC_CHECK_LIB($cf_regex_lib,regcomp,[ - CF_ADD_LIB($cf_regex_lib) - cf_regex_func=regcomp - break]) - done -]) - if test "$cf_regex_func" = no ; then AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ AC_CHECK_LIB(gen,compile,[ @@ -1933,13 +2402,15 @@ fi AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ cf_cv_regex_hdrs=no -case $cf_regex_func in +case "$cf_regex_func" in (compile) for cf_regex_hdr in regexp.h regexpr.h do AC_TRY_LINK([#include <$cf_regex_hdr>],[ char *p = compile("", "", "", 0); int x = step("", ""); + (void)p; + (void)x; ],[ cf_cv_regex_hdrs=$cf_regex_hdr break @@ -1951,9 +2422,11 @@ case $cf_regex_func in do AC_TRY_LINK([#include #include <$cf_regex_hdr>],[ - regex_t *p; + regex_t *p = 0; int x = regcomp(p, "", 0); int y = regexec(p, "", 0, 0, 0); + (void)x; + (void)y; regfree(p); ],[ cf_cv_regex_hdrs=$cf_regex_hdr @@ -1965,14 +2438,32 @@ esac ]) -case $cf_cv_regex_hdrs in - (no) AC_MSG_WARN(no regular expression header found) ;; - (regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS,1,[Define to 1 to include regex.h for regular expressions]) ;; - (regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS,1,[Define to 1 to include regexp.h for regular expressions]) ;; - (regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS,1,[Define to 1 to include regexpr.h for regular expressions]) ;; +case "$cf_cv_regex_hdrs" in + (no) AC_MSG_WARN(no regular expression header found) ;; + (regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS,1,[Define to 1 to include regex.h for regular expressions]) ;; + (regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS,1,[Define to 1 to include regexp.h for regular expressions]) ;; + (regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS,1,[Define to 1 to include regexpr.h for regular expressions]) ;; esac ])dnl dnl --------------------------------------------------------------------------- +dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40 +dnl ---------------- +dnl Remove a given option from CFLAGS/CPPFLAGS +dnl $1 = option to remove +dnl $2 = variable to update +dnl $3 = nonempty to allow verbose message +define([CF_REMOVE_CFLAGS], +[ +cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[ ]][[ ]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^ ]][[^ ]]*\\)\?%%" -e 's/^[[ ]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'` + test "[$]$2" != "$cf_old_cflag" || break + ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)]) + $2="$cf_old_cflag" +done +])dnl +dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list @@ -1990,11 +2481,23 @@ $1=`echo "$2" | \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK version: 11 updated: 2013/09/01 13:02:00 +dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45 +dnl --------------------- +dnl Restore flags saved in CF_SAVE_XTRA_FLAGS +dnl $1 = name of current macro +define([CF_RESTORE_XTRA_FLAGS], +[ +LIBS="$cf_save_LIBS_$1" +CFLAGS="$cf_save_CFLAGS_$1" +CPPFLAGS="$cf_save_CPPFLAGS_$1" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_RPATH_HACK version: 13 updated: 2021/01/03 18:30:50 dnl ------------- AC_DEFUN([CF_RPATH_HACK], -[ -AC_REQUIRE([CF_LD_RPATH_OPT]) +[AC_REQUIRE([AC_PROG_FGREP])dnl +AC_REQUIRE([CF_LD_RPATH_OPT])dnl + AC_MSG_CHECKING(for updated LDFLAGS) if test -n "$LD_RPATH_OPT" ; then AC_MSG_RESULT(maybe) @@ -2007,8 +2510,8 @@ if test -n "$LD_RPATH_OPT" ; then AC_TRY_LINK([#include ], [printf("Hello");], - [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq` - cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`]) + [cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq` + cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`]) # If we passed the link-test, but get a "not found" on a given library, # this could be due to inept reconfiguration of gcc to make it only @@ -2024,7 +2527,7 @@ AC_TRY_LINK([#include ], /usr/pkg \ /opt/sfw do - if test -f $cf_rpath_dir/lib/$cf_rpath_src + if test -f "$cf_rpath_dir/lib/$cf_rpath_src" then CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" @@ -2047,7 +2550,7 @@ fi AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK_2 version: 7 updated: 2015/04/12 15:39:00 +dnl CF_RPATH_HACK_2 version: 8 updated: 2021/01/01 13:31:04 dnl --------------- dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to dnl EXTRA_LDFLAGS for each -L option found. @@ -2063,7 +2566,7 @@ CF_VERBOSE(...checking $1 [$]$1) cf_rpath_dst= for cf_rpath_src in [$]$1 do - case $cf_rpath_src in + case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore @@ -2107,12 +2610,37 @@ CF_VERBOSE(...checked $1 [$]$1) AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SIGWINCH version: 1 updated: 2006/04/02 16:41:09 +dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44 +dnl ------------------ +dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers +dnl and libraries which do not update those variables. +dnl +dnl $1 = name of current macro +define([CF_SAVE_XTRA_FLAGS], +[ +cf_save_LIBS_$1="$LIBS" +cf_save_CFLAGS_$1="$CFLAGS" +cf_save_CPPFLAGS_$1="$CPPFLAGS" +LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" +for cf_X_CFLAGS in $X_CFLAGS +do + case "x$cf_X_CFLAGS" in + x-[[IUD]]*) + CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" + ;; + *) + CFLAGS="$CFLAGS $cf_X_CFLAGS" + ;; + esac +done +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SIGWINCH version: 6 updated: 2021/01/01 13:31:04 dnl ----------- dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all dnl programs need this test). dnl -dnl This is really a MacOS X 10.4.3 workaround. Defining _POSIX_C_SOURCE +dnl This is really a Mac OS X 10.4.3 workaround. Defining _POSIX_C_SOURCE dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct dnl winsize declaration is left alone - we may revisit this if Apple choose to dnl break that part of the interface as well. @@ -2122,7 +2650,7 @@ AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[ AC_TRY_COMPILE([ #include #include -],[int x = SIGWINCH], +],[int x = SIGWINCH; (void)x], [cf_cv_define_sigwinch=yes], [AC_TRY_COMPILE([ #undef _XOPEN_SOURCE @@ -2130,7 +2658,7 @@ AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[ #undef _POSIX_C_SOURCE #include #include -],[int x = SIGWINCH], +],[int x = SIGWINCH; (void)x], [cf_cv_define_sigwinch=maybe], [cf_cv_define_sigwinch=no]) ]) @@ -2140,7 +2668,7 @@ if test "$cf_cv_define_sigwinch" = maybe ; then AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[ cf_cv_fixup_sigwinch=unknown cf_sigwinch=32 -while test $cf_sigwinch != 1 +while test "$cf_sigwinch" != 1 do AC_TRY_COMPILE([ #undef _XOPEN_SOURCE @@ -2152,11 +2680,11 @@ do #if SIGWINCH != $cf_sigwinch make an error #endif -int x = SIGWINCH], +int x = SIGWINCH; (void)x], [cf_cv_fixup_sigwinch=$cf_sigwinch break]) -cf_sigwinch=`expr $cf_sigwinch - 1` +cf_sigwinch="`expr "$cf_sigwinch" - 1`" done ]) @@ -2166,9 +2694,9 @@ done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SIG_ATOMIC_T version: 3 updated: 2012/10/04 20:12:20 +dnl CF_SIG_ATOMIC_T version: 5 updated: 2020/03/10 18:53:47 dnl --------------- -dnl signal handler, but there are some gcc depedencies in that recommendation. +dnl signal handler, but there are some gcc dependencies in that recommendation. dnl Try anyway. AC_DEFUN([CF_SIG_ATOMIC_T], [ @@ -2188,6 +2716,7 @@ extern $cf_type x; $cf_type x; static void handler(int sig) { + (void)sig; x = 5; }], [signal(SIGINT, handler); @@ -2201,7 +2730,7 @@ AC_MSG_RESULT($cf_cv_sig_atomic_t) test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t,[Define to signal global datatype]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STRUCT_LASTLOG version: 2 updated: 2012/10/04 20:12:20 +dnl CF_STRUCT_LASTLOG version: 3 updated: 2020/03/10 18:53:47 dnl ----------------- dnl Check for header defining struct lastlog, ensure that its .ll_time member dnl is compatible with time(). @@ -2214,7 +2743,7 @@ AC_TRY_RUN([ #include #include -int main() +int main(void) { struct lastlog data; return (sizeof(data.ll_time) != sizeof(time_t)); @@ -2258,7 +2787,7 @@ static struct termio d_tio; test "$cf_cv_svr4" = yes && AC_DEFINE(SVR4,1,[Define to 1 if this is an SVR4 system]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SYSV version: 15 updated: 2012/10/04 05:24:07 +dnl CF_SYSV version: 16 updated: 2020/01/11 16:46:44 dnl ------- dnl Check if this is a SYSV platform, e.g., as used in , and whether dnl defining it will be helpful. The following features are used to check: @@ -2273,6 +2802,10 @@ dnl dnl c) compile with type definitions that differ on SYSV hosts from standard C. AC_DEFUN([CF_SYSV], [ +AC_REQUIRE([AC_PATH_XTRA]) + +CF_SAVE_XTRA_FLAGS([CF_SYSV]) + AC_CHECK_HEADERS( \ termios.h \ stdlib.h \ @@ -2319,9 +2852,11 @@ sys_errlist[0] = ""; /* Cygwin mis-declares this */ [cf_cv_sysv=no]) ]) test "$cf_cv_sysv" = yes && AC_DEFINE(SYSV,1,[Define to 1 if this is an SYSV system]) + +CF_RESTORE_XTRA_FLAGS([CF_SYSV]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SYSV_UTMP version: 6 updated: 2012/10/04 20:12:20 +dnl CF_SYSV_UTMP version: 7 updated: 2021/01/02 09:31:20 dnl ------------ dnl Check if this is a SYSV flavor of UTMP AC_DEFUN([CF_SYSV_UTMP], @@ -2339,7 +2874,7 @@ struct $cf_cv_have_utmp x; [cf_cv_sysv_utmp=yes], [cf_cv_sysv_utmp=no]) ]) -test $cf_cv_sysv_utmp = yes && AC_DEFINE(USE_SYSV_UTMP,1,[Define to 1 if utmp is SYSV flavor]) +test "$cf_cv_sysv_utmp" = yes && AC_DEFINE(USE_SYSV_UTMP,1,[Define to 1 if utmp is SYSV flavor]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23 @@ -2353,7 +2888,39 @@ AC_DEFUN([CF_SYS_ERRLIST], CF_CHECK_ERRNO(sys_errlist) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TERMIO_C_ISPEED version: 3 updated: 2012/10/04 20:12:20 +dnl CF_TERMIOS_TYPES version: 2 updated: 2020/03/10 18:53:47 +dnl ---------------- +dnl https://pubs.opengroup.org/onlinepubs/009695399/basedefs/termios.h.html +dnl says that tcflag_t, speed_t and cc_t are typedef'd. If they are not, +dnl fallback to historical values. +AC_DEFUN([CF_TERMIOS_TYPES],[ + +AC_CACHE_CHECK(for termios type tcflag_t, cf_cv_havetype_tcflag_t,[ + AC_TRY_COMPILE([#include ],[ + tcflag_t x = 0; (void)x], + [cf_cv_havetype_tcflag_t=yes], + [cf_cv_havetype_tcflag_t=no]) +]) +test "$cf_cv_havetype_tcflag_t" = no && AC_DEFINE(tcflag_t,unsigned long,[Define usable value of tcflag_t if not declared]) + +AC_CACHE_CHECK(for termios type speed_t, cf_cv_havetype_speed_t,[ + AC_TRY_COMPILE([#include ],[ + speed_t x = 0; (void)x], + [cf_cv_havetype_speed_t=yes], + [cf_cv_havetype_speed_t=no]) +]) +test "$cf_cv_havetype_speed_t" = no && AC_DEFINE(speed_t,unsigned short,[Define usable value of speed_t if not declared]) + +AC_CACHE_CHECK(for termios type cc_t, cf_cv_havetype_cc_t,[ + AC_TRY_COMPILE([#include ],[ + cc_t x = 0; (void)x], + [cf_cv_havetype_cc_t=yes], + [cf_cv_havetype_cc_t=no]) +]) +test "$cf_cv_havetype_cc_t" = no && AC_DEFINE(cc_t,unsigned char,[Define usable value of cc_t if not declared]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_TERMIO_C_ISPEED version: 4 updated: 2020/03/10 18:53:47 dnl ------------------ dnl Check for SGI's broken redefinition of baud rates introduced in IRIX 6.5 dnl (there doesn't appear to be a useful predefined symbol). @@ -2366,6 +2933,7 @@ AC_TRY_COMPILE([ struct termio foo; foo.c_ispeed = B38400; foo.c_ospeed = B9600; +(void)foo; ],[cf_cv_termio_c_ispeed=yes ],[cf_cv_termio_c_ispeed=no]) ]) @@ -2388,21 +2956,21 @@ AC_DEFUN([CF_TRIM_X_LIBS],[ done ]) dnl --------------------------------------------------------------------------- -dnl CF_TRY_PKG_CONFIG version: 5 updated: 2013/07/06 21:27:06 +dnl CF_TRY_PKG_CONFIG version: 6 updated: 2020/12/31 10:54:15 dnl ----------------- dnl This is a simple wrapper to use for pkg-config, for libraries which may be dnl available in that form. dnl -dnl $1 = package name +dnl $1 = package name, which may be a shell variable dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS dnl $3 = logic to use if pkg-config does not have the package AC_DEFUN([CF_TRY_PKG_CONFIG],[ AC_REQUIRE([CF_PKG_CONFIG]) -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$1"; then CF_VERBOSE(found package $1) - cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs $1 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$1" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "$1" 2>/dev/null`" CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs) CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs) CF_ADD_CFLAGS($cf_pkgconfig_incs) @@ -2415,7 +2983,7 @@ else fi ]) dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50 +dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. @@ -2431,7 +2999,7 @@ make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) AC_TRY_COMPILE([ #include #include @@ -2450,16 +3018,21 @@ if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" - CF_ADD_CFLAGS($cf_temp_xopen_source) + CF_APPEND_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- -dnl CF_TTY_GROUP version: 9 updated: 2015/04/12 15:39:00 +dnl CF_TTY_GROUP version: 14 updated: 2021/01/03 18:30:50 dnl ------------ dnl Check if the system has a tty-group defined. This is used in xterm when dnl setting pty ownership. +dnl +dnl The check relies upon running a test-program, which calls ttyname. If this +dnl is run in batch mode, or if autoconf uses shell functions, the extra layer +dnl of eval/call may close stdin, making calls to ttyname fail. To work around +dnl that, fall back to "/dev/tty". AC_DEFUN([CF_TTY_GROUP], -[ +[AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING(for explicit tty group name) AC_ARG_WITH(tty-group, [ --with-tty-group=XXX use XXX for the tty-group], @@ -2476,24 +3049,24 @@ AC_CACHE_CHECK(for tty group name,cf_cv_tty_group_name,[ # But we'll guess based on how our connection is set up - assuming it is done # properly. -cf_uid=`id | sed -e 's/^[^=]*=//' -e 's/(.*$//'` +cf_uid="`id | sed -e 's/^[^=]*=//' -e 's/(.*$//'`" # )vi if test "$cf_uid" != 0 ; then cf_cv_tty_group_name= -cf_tty_name=`tty` +cf_tty_name="`tty`" test "$cf_tty_name" = "not a tty" && cf_tty_name=/dev/tty test -z "$cf_tty_name" && cf_tty_name=/dev/tty if test -c "$cf_tty_name" then - cf_option="-l -L" + cf_option="-lL" # Expect listing to have fields like this: #-rwxrwxrwx 1 user group 34293 Jul 18 16:29 pathname - ls $cf_option $cf_tty_name >conftest.out + ls $cf_option "$cf_tty_name" >conftest.out read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest.out + cf_option="${cf_option}g" + ls "$cf_option" "$cf_tty_name" >conftest.out read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest /dev/null 1>/dev/null ) then + if ( ${EGREP-egrep} '^tty:' /etc/group 2>/dev/null 1>/dev/null ) then cf_cv_tty_group_name="tty" fi ;; @@ -2531,7 +3104,7 @@ AC_DEFINE_UNQUOTED(TTY_GROUP_NAME,"$cf_tty_group",[Define to the name use for tt # mode, or if we are cross-compiling. AC_CACHE_CHECK(if we may use the $cf_tty_group group,cf_cv_tty_group,[ -cf_tty_name=`tty` +cf_tty_name="`tty`" if test "$cf_tty_name" != "not a tty" then AC_TRY_RUN([ @@ -2539,13 +3112,23 @@ AC_TRY_RUN([ #include #include #include -int main() +int main(void) { struct stat sb; - struct group *ttygrp = getgrnam(TTY_GROUP_NAME); - char *name = ttyname(0); + struct group *ttygrp; + int fd; + char *name; + for (fd = 0; fd < 3; ++fd) { + if ((name = ttyname(fd)) != 0) + break; + } + if (name == 0) + name = "/dev/tty"; + + ttygrp = getgrnam(TTY_GROUP_NAME); endgrent(); + if (ttygrp != 0 && name != 0 && stat(name, &sb) == 0 @@ -2573,7 +3156,7 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TYPE_CC_T version: 2 updated: 2012/10/04 20:12:20 +dnl CF_TYPE_CC_T version: 3 updated: 2020/03/10 18:53:47 dnl ------------ dnl Check for cc_t type, used in termio. AC_DEFUN([CF_TYPE_CC_T], @@ -2589,7 +3172,7 @@ AC_CACHE_VAL(cf_cv_type_cc_t,[ #include #endif ], - [cc_t x], + [cc_t x; (void)x], [cf_cv_type_cc_t=yes], [cf_cv_type_cc_t=no]) ]) @@ -2626,7 +3209,7 @@ if test x$cf_cv_type_fd_mask = xCSRG_BASED ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TYPE_FD_SET version: 5 updated: 2012/10/04 20:12:20 +dnl CF_TYPE_FD_SET version: 6 updated: 2020/03/10 18:53:47 dnl -------------- dnl Check for the declaration of fd_set. Some platforms declare it in dnl , and some in , which requires . @@ -2640,20 +3223,20 @@ AC_CACHE_CHECK(for declaration of fd_set,cf_cv_type_fd_set, [CF_MSG_LOG(sys/types alone) AC_TRY_COMPILE([ #include ], - [fd_set x], + [fd_set x; (void)x], [cf_cv_type_fd_set=sys/types.h], [CF_MSG_LOG(X11/Xpoll.h) AC_TRY_COMPILE([ #ifdef HAVE_X11_XPOLL_H #include #endif], - [fd_set x], + [fd_set x; (void)x], [cf_cv_type_fd_set=X11/Xpoll.h], [CF_MSG_LOG(sys/select.h) AC_TRY_COMPILE([ #include #include ], - [fd_set x], + [fd_set x; (void)x], [cf_cv_type_fd_set=sys/select.h], [cf_cv_type_fd_set=unknown])])])]) if test $cf_cv_type_fd_set = sys/select.h ; then @@ -2707,7 +3290,7 @@ if test "$cf_cv_have_utempter" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP version: 10 updated: 2012/10/04 20:12:20 +dnl CF_UTMP version: 12 updated: 2021/01/02 09:31:20 dnl ------- dnl Check for UTMP/UTMPX headers AC_DEFUN([CF_UTMP], @@ -2728,6 +3311,8 @@ cf_utmp_includes=" AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_header x; char *name = x.ut_name; /* utmp.h and compatible definitions */ + (void)x; + (void)name; ], [cf_cv_have_utmp=$cf_header break], @@ -2735,6 +3320,8 @@ cf_utmp_includes=" AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_header x; char *name = x.ut_user; /* utmpx.h must declare this */ + (void)x; + (void)name; ], [cf_cv_have_utmp=$cf_header break @@ -2742,9 +3329,9 @@ cf_utmp_includes=" done ]) -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_DEFINE(HAVE_UTMP,1,[Define to 1 if the utmp interface is available]) - test $cf_cv_have_utmp = utmpx && AC_DEFINE(UTMPX_FOR_UTMP,1,[Define if we have utmpx interface]) + test "$cf_cv_have_utmp" = utmpx && AC_DEFINE(UTMPX_FOR_UTMP,1,[Define if we have utmpx interface]) CF_UTMP_UT_HOST CF_UTMP_UT_SYSLEN CF_UTMP_UT_NAME @@ -2755,7 +3342,7 @@ if test $cf_cv_have_utmp != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_GROUP version: 1 updated: 2005/10/06 20:29:29 +dnl CF_UTMP_GROUP version: 2 updated: 2020/12/31 10:54:15 dnl ------------- dnl Find the utmp/utmpx file and determine its group to allow setgid programs dnl to manipulate it, e.g., when there is no intermediary. @@ -2771,15 +3358,15 @@ do then cf_cv_utmp_group=root - cf_option="-l -L" + cf_option="-lL" # Expect listing to have fields like this: #-r--r--r-- 1 user group 34293 Jul 18 16:29 pathname - ls $cf_option $cf_utmp_path/$cf_utmp_file >conftest + ls "$cf_option" "$cf_utmp_path/$cf_utmp_file" >conftest read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest + cf_option="${cf_option}g" + ls "$cf_option" "$cf_utmp_path/$cf_utmp_file" >conftest read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; char *y = &x.ut_host[0]], + [struct $cf_cv_have_utmp x; + char *y = &x.ut_host[0]; + (void)x; + (void)y], [cf_cv_have_utmp_ut_host=yes], [cf_cv_have_utmp_ut_host=no]) ]) AC_MSG_RESULT($cf_cv_have_utmp_ut_host) -test $cf_cv_have_utmp_ut_host != no && AC_DEFINE(HAVE_UTMP_UT_HOST,1,[Define to 1 if UTMP/UTMPX struct defines ut_host member]) +test "$cf_cv_have_utmp_ut_host" != no && AC_DEFINE(HAVE_UTMP_UT_HOST,1,[Define to 1 if UTMP/UTMPX struct defines ut_host member]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_UT_NAME version: 6 updated: 2015/04/12 15:39:00 +dnl CF_UTMP_UT_NAME version: 8 updated: 2021/01/02 09:31:20 dnl --------------- dnl Check if UTMP/UTMPX struct defines ut_name member AC_DEFUN([CF_UTMP_UT_NAME], [ -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_name is declared,cf_cv_have_utmp_ut_name,[ cf_cv_have_utmp_ut_name=no cf_utmp_includes=" @@ -2843,13 +3433,15 @@ for cf_header in ut_name ut_user ; do AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_cv_have_utmp x; char *name = x.$cf_header; + (void)x; + (void)name; ], [cf_cv_have_utmp_ut_name=$cf_header break]) done ]) -case $cf_cv_have_utmp_ut_name in +case "$cf_cv_have_utmp_ut_name" in (no) AC_MSG_ERROR(Cannot find declaration for ut.ut_name) ;; @@ -2860,47 +3452,53 @@ esac fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_UT_SESSION version: 6 updated: 2012/10/04 20:12:20 +dnl CF_UTMP_UT_SESSION version: 9 updated: 2021/06/07 17:39:17 dnl ------------------ dnl Check if UTMP/UTMPX struct defines ut_session member AC_DEFUN([CF_UTMP_UT_SESSION], [ -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_session is declared, cf_cv_have_utmp_ut_session,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; long y = x.ut_session], + [static struct $cf_cv_have_utmp x; + long y = x.ut_session; + (void)x; + (void)y], [cf_cv_have_utmp_ut_session=yes], [cf_cv_have_utmp_ut_session=no]) ]) -if test $cf_cv_have_utmp_ut_session != no ; then +if test "$cf_cv_have_utmp_ut_session" != no ; then AC_DEFINE(HAVE_UTMP_UT_SESSION,1,[Define to 1 if UTMP/UTMPX struct defines ut_session member]) fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_UT_SYSLEN version: 2 updated: 2012/10/04 20:12:20 +dnl CF_UTMP_UT_SYSLEN version: 4 updated: 2021/01/02 09:31:20 dnl ----------------- dnl Check if UTMP/UTMPX struct defines ut_syslen member AC_DEFUN([CF_UTMP_UT_SYSLEN], [ -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_MSG_CHECKING(if ${cf_cv_have_utmp}.ut_syslen is declared) AC_CACHE_VAL(cf_cv_have_utmp_ut_syslen,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; int y = x.ut_syslen], + [struct $cf_cv_have_utmp x; + int y = x.ut_syslen; + (void)x; + (void)y], [cf_cv_have_utmp_ut_syslen=yes], [cf_cv_have_utmp_ut_syslen=no]) ]) AC_MSG_RESULT($cf_cv_have_utmp_ut_syslen) -test $cf_cv_have_utmp_ut_syslen != no && AC_DEFINE(HAVE_UTMP_UT_SYSLEN,1,[Define to 1 if UTMP/UTMPX struct defines ut_syslen member]) +test "$cf_cv_have_utmp_ut_syslen" != no && AC_DEFINE(HAVE_UTMP_UT_SYSLEN,1,[Define to 1 if UTMP/UTMPX struct defines ut_syslen member]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_UT_XSTATUS version: 4 updated: 2012/10/04 20:12:20 +dnl CF_UTMP_UT_XSTATUS version: 6 updated: 2021/01/02 09:31:20 dnl ------------------ dnl Check for known variants on the UTMP/UTMPX struct's exit-status as reported dnl by various people: @@ -2914,7 +3512,7 @@ dnl Note: utmp_xstatus is not a conventional compatibility definition in the dnl system header files. AC_DEFUN([CF_UTMP_UT_XSTATUS], [ -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_CACHE_CHECK(for exit-status in $cf_cv_have_utmp,cf_cv_have_utmp_ut_xstatus,[ for cf_result in \ ut_exit.__e_exit \ @@ -2925,42 +3523,51 @@ do AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; long y = x.$cf_result = 0], + [struct $cf_cv_have_utmp x; + long y = x.$cf_result = 0; + (void)x; + (void)y], [cf_cv_have_utmp_ut_xstatus=$cf_result break], [cf_cv_have_utmp_ut_xstatus=no]) done ]) -if test $cf_cv_have_utmp_ut_xstatus != no ; then +if test "$cf_cv_have_utmp_ut_xstatus" != no ; then AC_DEFINE(HAVE_UTMP_UT_XSTATUS,1,[Define to 1 if UTMP/UTMPX has exit-status member]) AC_DEFINE_UNQUOTED(ut_xstatus,$cf_cv_have_utmp_ut_xstatus,[Define if needed to rename member ut_xstatus of UTMP/UTMPX]) fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTMP_UT_XTIME version: 9 updated: 2012/10/04 20:12:20 +dnl CF_UTMP_UT_XTIME version: 11 updated: 2021/01/02 09:31:20 dnl ---------------- dnl Check if UTMP/UTMPX struct defines ut_xtime member AC_DEFUN([CF_UTMP_UT_XTIME], [ -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_xtime is declared, cf_cv_have_utmp_ut_xtime,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0], + [struct $cf_cv_have_utmp x; + long y = x.ut_xtime = 0; + (void)x; + (void)y], [cf_cv_have_utmp_ut_xtime=yes], [AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], - [struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec], + [struct $cf_cv_have_utmp x; + long y = x.ut_tv.tv_sec; + (void)x; + (void)y], [cf_cv_have_utmp_ut_xtime=define], [cf_cv_have_utmp_ut_xtime=no]) ]) ]) -if test $cf_cv_have_utmp_ut_xtime != no ; then +if test "$cf_cv_have_utmp_ut_xtime" != no ; then AC_DEFINE(HAVE_UTMP_UT_XTIME,1,[Define to 1 if UTMP/UTMPX struct defines ut_xtime member]) - if test $cf_cv_have_utmp_ut_xtime = define ; then + if test "$cf_cv_have_utmp_ut_xtime" = define ; then AC_DEFINE(ut_xtime,ut_tv.tv_sec,[Define if needed to alternate name for utmpx.ut_xtime member]) fi fi @@ -3108,7 +3715,7 @@ if test "$with_dbmalloc" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DESKTOP_CATEGORY version: 5 updated: 2015/04/12 15:39:00 +dnl CF_WITH_DESKTOP_CATEGORY version: 9 updated: 2021/01/03 18:30:50 dnl ------------------------ dnl Taking into account the absence of standardization of desktop categories dnl take a look to see whether other applications on the current system are @@ -3125,8 +3732,8 @@ dnl dnl The macro tells the configure script to substitute the $DESKTOP_CATEGORY dnl value. AC_DEFUN([CF_WITH_DESKTOP_CATEGORY],[ -AC_REQUIRE([CF_DISABLE_DESKTOP]) - +AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([CF_DISABLE_DESKTOP])dnl if test -z "$desktop_utils" then AC_MSG_CHECKING(for requested desktop-category) @@ -3151,11 +3758,11 @@ then do read cf_desktop_path test -z "$cf_desktop_path" && break - cf_desktop_name=`basename $cf_desktop_path .desktop` + cf_desktop_name=`basename "$cf_desktop_path" .desktop` case $cf_desktop_name in ($1|*-$1|$2) CF_VERBOSE(inspect $cf_desktop_path) - egrep '^Categories=' $cf_desktop_path | \ + ${EGREP-egrep} '^Categories=' "$cf_desktop_path" | \ tr ';' '\n' | \ sed -e 's%^.*=%%' -e '/^$/d' >>conftest.1 ;; @@ -3171,16 +3778,28 @@ then do read cf_desktop_this test -z "$cf_desktop_this" && break - case $cf_desktop_this in - (Qt*|GTK*|KDE*|GNOME*|*XFCE*|*Xfce*) + if test -s conftest.2 + then + grep -w "$cf_desktop_this" conftest.2 >/dev/null && continue + elif test -s conftest.3 + then + grep -w "$cf_desktop_this" conftest.3 >/dev/null && continue + fi + case "$cf_desktop_this" in + (-*) + ;; + (Qt*|*Xfce*|*[[ABCDEFGHIJKLMNOPQRSTUVWXYZ]][[ABCDEFGHIJKLMNOPQRSTUVWXYZ]]*) + CF_VERBOSE(ignored $cf_desktop_this) + echo "$cf_desktop_this" >> conftest.3 ;; ($3) - test "x$cf_desktop_last" != "x$cf_desktop_this" && echo $cf_desktop_this >>conftest.2 + CF_VERBOSE(applied $cf_desktop_this) + test "x$cf_desktop_last" != "x$cf_desktop_this" && echo "$cf_desktop_this" >>conftest.2 ;; esac cf_desktop_last=$cf_desktop_this done - cf_desktop_want=`cat conftest.2 | tr '\n' ';'` + cf_desktop_want="`tr '\n' ';' < conftest.2`" fi if test -n "$cf_desktop_want" then @@ -3309,7 +3928,7 @@ AC_SUBST(ICON_SYMLINK) AC_MSG_RESULT($ICON_SYMLINK) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ICON_THEME version: 11 updated: 2015/04/12 15:39:00 +dnl CF_WITH_ICON_THEME version: 13 updated: 2020/12/31 10:54:15 dnl ------------------ dnl If asked, check for prerequisites and setup symbols to permit installing dnl one or more application icons in the Red Hat icon-theme directory @@ -3326,7 +3945,7 @@ dnl $3 = formats (defaults to list [.svg .png .xpm]) dnl $4 = alternate icon if no theme is used (defaults to $1). dnl dnl Result: -dnl ICON_NAME = basename of first item in $1 +dnl ICON_NAME = basename of first item in $1, unless already set dnl ICON_LIST = reprocessed $1 dnl ICON_THEME = reprocessed $2 dnl ICON_FORMAT = reprocessed $3 @@ -3370,7 +3989,6 @@ fi : ${ICON_FORMAT:=ifelse([$3],,[".svg .png .xpm"],[$3])} -# ICON_NAME= ICON_LIST= ifelse([$4],,[cf_icon_list=$1],[ @@ -3406,7 +4024,7 @@ do fi if test "x$ICON_THEME" != xno then - cf_base=`basename $cf_left` + cf_base=`basename "$cf_left"` cf_trim=`echo "$cf_base" | sed -e 's/_[[0-9]][[0-9]]x[[0-9]][[0-9]]\././'` case "x${cf_base}" in (*:*) @@ -3442,7 +4060,7 @@ do ICON_LIST="$ICON_LIST${cf_icon}" if test -z "$ICON_NAME" then - ICON_NAME=`basename $cf_icon | sed -e 's/[[.:]].*//'` + ICON_NAME=`basename "$cf_icon" | sed -e 's/[[.:]].*//'` fi done done @@ -3468,7 +4086,7 @@ AC_SUBST(ICON_LIST) AC_SUBST(ICON_NAME) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_IMAKE_CFLAGS version: 10 updated: 2015/04/12 15:39:00 +dnl CF_WITH_IMAKE_CFLAGS version: 12 updated: 2022/02/24 17:10:03 dnl -------------------- dnl xterm and similar programs build more readily when propped up with imake's dnl hand-tuned definitions. If we do not use imake, provide fallbacks for the @@ -3537,6 +4155,23 @@ else ;; esac + # "modern" systems install X applications in /usr/bin. Other systems may + # use one of the X release-based directories. + case "$CFLAGS $CPPFLAGS $IMAKE_CFLAGS" in + (*-DPROJECTROOT*) + ;; + (*) + for cf_dir in /usr/X11R7 /usr/X11R6 /usr/X11R5 + do + if test -d "$cf_dir/bin" + then + IMAKE_CFLAGS="$IMAKE_CFLAGS -DPROJECTROOT=\\\"$cf_dir\\\"" + break + fi + done + ;; + esac + CF_ADD_CFLAGS($IMAKE_CFLAGS) AC_SUBST(IMAKE_CFLAGS) @@ -3544,22 +4179,51 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_MAN2HTML version: 3 updated: 2015/04/12 15:39:00 +dnl CF_WITH_MAN2HTML version: 12 updated: 2021/01/03 18:30:50 dnl ---------------- -dnl Check for man2html and groff. Optionally prefer man2html over groff. +dnl Check for man2html and groff. Prefer man2html over groff, but use groff +dnl as a fallback. See +dnl +dnl http://invisible-island.net/scripts/man2html.html +dnl dnl Generate a shell script which hides the differences between the two. dnl dnl We name that "man2html.tmp". dnl dnl The shell script can be removed later, e.g., using "make distclean". AC_DEFUN([CF_WITH_MAN2HTML],[ -AC_REQUIRE([CF_PROG_GROFF]) +AC_REQUIRE([CF_PROG_GROFF])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl + +case "x${with_man2html}" in +(xno) + cf_man2html=no + ;; +(x|xyes) + AC_PATH_PROG(cf_man2html,man2html,no) + case "x$cf_man2html" in + (x/*) + AC_MSG_CHECKING(for the modified Earl Hood script) + if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) + then + cf_man2html_ok=yes + else + cf_man2html=no + cf_man2html_ok=no + fi + AC_MSG_RESULT($cf_man2html_ok) + ;; + (*) + cf_man2html=no + ;; + esac +esac AC_MSG_CHECKING(for program to convert manpage to html) AC_ARG_WITH(man2html, [ --with-man2html=XXX use XXX rather than groff], [cf_man2html=$withval], - [cf_man2html=$GROFF_PATH]) + [cf_man2html=$cf_man2html]) cf_with_groff=no @@ -3580,14 +4244,14 @@ esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <conftest.out + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out - cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` - cf_man2html_top=`expr $cf_man2html_1st - 2` - cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'` - cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` + cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`" + cf_man2html_top=`expr "$cf_man2html_1st" - 2` + cf_man2html_bot="`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`" + cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" AC_MSG_RESULT($cf_man2html_top_bot) @@ -3650,8 +4325,8 @@ CF_EOF CF_EOF done - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out - cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out + cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`" test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 @@ -3660,13 +4335,13 @@ CF_EOF cat >>$MAN2HTML_TEMP < @@ -3859,14 +4599,17 @@ AC_TRY_LINK([ #include /* has the XkbBI_xxx definitions */ ],[ int x = (XkbBI_Info |XkbBI_MinorError |XkbBI_MajorError |XkbBI_TerminalBell |XkbBI_MarginBell); - Atom y; + Atom y = 0; + (void)x; XkbBell((Display *)0, (Widget)0, 0, y); ],[cf_cv_xkb_bell_ext=yes],[cf_cv_xkb_bell_ext=no]) ]) test "$cf_cv_xkb_bell_ext" = yes && AC_DEFINE(HAVE_XKB_BELL_EXT,1,[Define 1 if we have XKB Bell extension]) + +CF_RESTORE_XTRA_FLAGS([CF_XKB_BELL_EXT]) ]) dnl --------------------------------------------------------------------------- -dnl CF_XKB_KEYCODE_TO_KEYSYM version: 2 updated: 2012/09/28 20:23:33 +dnl CF_XKB_KEYCODE_TO_KEYSYM version: 3 updated: 2020/03/10 18:53:47 dnl ------------------------ dnl Some older vendor-unix systems made a practice of delivering fragments of dnl Xkb, requiring test-compiles. @@ -3877,6 +4620,7 @@ AC_TRY_COMPILE([ #include ],[ KeySym keysym = XkbKeycodeToKeysym((Display *)0, 0, 0, 0); + (void)keysym; ],[ cf_cv_xkb_keycode_to_keysym=yes ],[ @@ -3925,7 +4669,7 @@ then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 49 updated: 2015/04/12 15:39:00 +dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -3936,16 +4680,19 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([CF_POSIX_VISIBLE]) + +if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) cf_xopen_source= -case $host_os in +case "$host_os" in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; -(cygwin|msys) +(msys) cf_XOPEN_SOURCE=600 ;; (darwin[[0-8]].*) @@ -3955,7 +4702,7 @@ case $host_os in cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; -(freebsd*|dragonfly*) +(freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L @@ -3973,8 +4720,8 @@ case $host_os in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|gnu*|mint*|k*bsd*-gnu) - CF_GNU_SOURCE +(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) + CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... @@ -3987,7 +4734,15 @@ case $host_os in (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; -(openbsd[[4-9]]*) +(openbsd[[6-9]]*) + # OpenBSD 6.x has broken locale support, both compile-time and runtime. + # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html + # Abusing the conformance level is a workaround. + AC_MSG_WARN(this system does not provide usable locale support) + cf_xopen_source="-D_BSD_SOURCE" + cf_XOPEN_SOURCE=700 + ;; +(openbsd[[4-5]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 @@ -4019,7 +4774,7 @@ case $host_os in esac if test -n "$cf_xopen_source" ; then - CF_ADD_CFLAGS($cf_xopen_source,true) + CF_APPEND_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting @@ -4034,7 +4789,7 @@ make an error [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) - if test $cf_XOPEN_SOURCE_set = yes + if test "$cf_XOPEN_SOURCE_set" = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE @@ -4042,7 +4797,7 @@ make an error #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) - if test $cf_XOPEN_SOURCE_set_ok = no + if test "$cf_XOPEN_SOURCE_set_ok" = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi @@ -4050,9 +4805,10 @@ make an error CF_TRY_XOPEN_SOURCE fi fi +fi # cf_cv_posix_visible ]) dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA version: 23 updated: 2015/04/12 15:39:00 +dnl CF_X_ATHENA version: 24 updated: 2020/03/10 18:53:47 dnl ----------- dnl Check for Xaw (Athena) libraries dnl @@ -4128,7 +4884,8 @@ AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[ AC_TRY_LINK([ #include ],[ -int check = XmuCompareISOLatin1("big", "small") +int check = XmuCompareISOLatin1("big", "small"); +(void)check; ],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])]) if test "$cf_cv_xaw_compat" = no @@ -4164,12 +4921,13 @@ if test -z "$cf_x_athena_lib" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA_CPPFLAGS version: 5 updated: 2010/05/26 17:35:30 +dnl CF_X_ATHENA_CPPFLAGS version: 9 updated: 2020/12/31 10:54:15 dnl -------------------- dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw. AC_DEFUN([CF_X_ATHENA_CPPFLAGS], [ +AC_REQUIRE([AC_PATH_XTRA]) cf_x_athena_root=ifelse([$1],,Xaw,[$1]) cf_x_athena_inc="" @@ -4180,10 +4938,10 @@ for cf_path in default \ /usr/local do if test -z "$cf_x_athena_inc" ; then - cf_save="$CPPFLAGS" + CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS]) cf_test=X11/$cf_x_athena_root/SimpleMenu.h - if test $cf_path != default ; then - CPPFLAGS="$cf_save -I$cf_path/include" + if test "$cf_path" != default ; then + CF_APPEND_TEXT(CPPFLAGS,-I$cf_path/include) AC_MSG_CHECKING(for $cf_test in $cf_path) else AC_MSG_CHECKING(for $cf_test) @@ -4194,24 +4952,23 @@ do [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) + CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS]) if test "$cf_result" = yes ; then - cf_x_athena_inc=$cf_path + test "$cf_path" = default && cf_x_athena_inc=default + test "$cf_path" != default && cf_x_athena_inc="$cf_path/include" break - else - CPPFLAGS="$cf_save" fi fi done if test -z "$cf_x_athena_inc" ; then - AC_MSG_WARN( -[Unable to successfully find Athena header files with test program]) + AC_MSG_WARN([Unable to find Athena header files]) elif test "$cf_x_athena_inc" != default ; then - CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" + CF_APPEND_TEXT(CPPFLAGS,-I$cf_x_athena_inc) fi ]) dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA_LIBS version: 12 updated: 2011/07/17 19:55:02 +dnl CF_X_ATHENA_LIBS version: 13 updated: 2020/01/11 18:16:10 dnl ---------------- dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw. @@ -4236,29 +4993,26 @@ do "-l$cf_lib -lXpm -lXmu" \ "-l${cf_lib}_s -lXmu_s" do - if test -z "$cf_x_athena_lib" ; then - cf_save="$LIBS" - cf_test=XawSimpleMenuAddGlobalActions - if test $cf_path != default ; then - CF_ADD_LIBS(-L$cf_path/lib $cf_libs) - AC_MSG_CHECKING(for $cf_libs in $cf_path) - else - CF_ADD_LIBS($cf_libs) - AC_MSG_CHECKING(for $cf_test in $cf_libs) - fi - AC_TRY_LINK([ + test -n "$cf_x_athena_lib" && break + + CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_LIBS]) + cf_test=XawSimpleMenuAddGlobalActions + test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs" + CF_ADD_LIBS($cf_libs) + AC_MSG_CHECKING(for $cf_test in $cf_libs) + AC_TRY_LINK([ #include #include ],[ $cf_test((XtAppContext) 0)], - [cf_result=yes], - [cf_result=no]) - AC_MSG_RESULT($cf_result) - if test "$cf_result" = yes ; then - cf_x_athena_lib="$cf_libs" - break - fi - LIBS="$cf_save" + [cf_result=yes], + [cf_result=no]) + AC_MSG_RESULT($cf_result) + CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_LIBS]) + + if test "$cf_result" = yes ; then + cf_x_athena_lib="$cf_libs" + break fi done # cf_libs test -n "$cf_x_athena_lib" && break @@ -4270,6 +5024,7 @@ if test -z "$cf_x_athena_lib" ; then [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program]) fi +CF_ADD_LIBS($cf_x_athena_lib) CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) ]) @@ -4282,7 +5037,18 @@ CF_TRY_PKG_CONFIG(Xext,,[ [CF_ADD_LIB(Xext)])]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_X_FONTCONFIG version: 6 updated: 2015/04/12 15:39:00 +dnl CF_X_EXT_DOUBLE_BUFFER version: 1 updated: 2019/07/18 21:09:40 +dnl ---------------------- +AC_DEFUN([CF_X_EXT_DOUBLE_BUFFER],[ +AC_REQUIRE([CF_X_EXT]) +AC_CHECK_HEADER(X11/extensions/Xdbe.h, + AC_DEFINE(HAVE_X11_EXTENSIONS_XDBE_H,1,[Define to 1 if we have X11/extensions/Xdbe.h]) + AC_CHECK_FUNC(XdbeSwapBuffers, + [AC_DEFINE(HAVE_XDBESWAPBUFFERS,1,[Define to 1 if we have XdbeSwapBuffers]) + cf_x_ext_double_buffer=yes])) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_X_FONTCONFIG version: 7 updated: 2020/03/10 18:53:47 dnl --------------- dnl Check for fontconfig library, a dependency of the X FreeType library. AC_DEFUN([CF_X_FONTCONFIG], @@ -4294,7 +5060,7 @@ AC_CACHE_CHECK(for usable Xft/fontconfig package,cf_cv_xft_compat,[ AC_TRY_LINK([ #include ],[ - XftPattern *pat; + XftPattern *pat = 0; XftPatternBuild(pat, XFT_FAMILY, XftTypeString, "mono", (void *) 0); @@ -4323,7 +5089,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_X_FREETYPE version: 27 updated: 2015/04/12 15:39:00 +dnl CF_X_FREETYPE version: 28 updated: 2020/03/10 18:53:47 dnl ------------- dnl Check for X FreeType headers and libraries (XFree86 4.x, etc). dnl @@ -4443,7 +5209,7 @@ AC_TRY_LINK([ #include #include #include ],[ - XftPattern *pat = XftNameParse ("name");], + XftPattern *pat = XftNameParse ("name"); (void)pat], [cf_cv_found_freetype=yes], [cf_cv_found_freetype=no]) AC_MSG_RESULT($cf_cv_found_freetype) @@ -4472,7 +5238,7 @@ AC_SUBST(HAVE_TYPE_FCCHAR32) AC_SUBST(HAVE_TYPE_XFTCHARSPEC) ]) dnl --------------------------------------------------------------------------- -dnl CF_X_TOOLKIT version: 23 updated: 2015/04/12 15:39:00 +dnl CF_X_TOOLKIT version: 26 updated: 2021/01/02 09:31:20 dnl ------------ dnl Check for X Toolkit libraries AC_DEFUN([CF_X_TOOLKIT], @@ -4480,7 +5246,7 @@ AC_DEFUN([CF_X_TOOLKIT], AC_REQUIRE([AC_PATH_XTRA]) AC_REQUIRE([CF_CHECK_CACHE]) -# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and +# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and # in some cases has installed dummy files in the former, other cases replaced # it with a link to the new location). This complicates the configure script. # Check for that pitfall, and recover using pkg-config @@ -4492,6 +5258,8 @@ then CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)]) CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)]) CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)]) +else + LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS" fi cf_have_X_LIBS=no @@ -4524,7 +5292,7 @@ AC_TRY_LINK([ AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[ AC_TRY_LINK([ #include -],[int num = IceConnectionNumber(0) +],[int num = IceConnectionNumber(0); (void) num ],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])]) if test "$cf_cv_xt_ice_compat" = no @@ -4554,18 +5322,16 @@ AC_TRY_LINK([ AC_CHECK_FUNC(XOpenDisplay,,[ AC_CHECK_LIB(X11,XOpenDisplay, - [CF_ADD_LIB(X11)],, - [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) + [CF_ADD_LIB(X11)])]) AC_CHECK_FUNC(XtAppInitialize,,[ AC_CHECK_LIB(Xt, XtAppInitialize, [AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library]) cf_have_X_LIBS=Xt - LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],, - [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) + LIBS="-lXt $LIBS"])]) ]) -if test $cf_have_X_LIBS = no ; then +if test "$cf_have_X_LIBS" = no ; then AC_MSG_WARN( [Unable to successfully link X Toolkit library (-lXt) with test program. You will have to check and add the proper libraries by hand @@ -4573,26 +5339,26 @@ to makefile.]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF__GRANTPT_BODY version: 4 updated: 2012/05/07 19:39:45 +dnl CF__GRANTPT_BODY version: 6 updated: 2021/06/07 17:39:17 dnl ---------------- dnl Body for workability check of grantpt. define([CF__GRANTPT_BODY],[ int code = 0; - int rc; int pty; int tty; char *slave; struct termios tio; + (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); - else if ((rc = grantpt(pty)) < 0) + else if (grantpt(pty) < 0) failed(2); - else if ((rc = unlockpt(pty)) < 0) + else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); @@ -4601,9 +5367,9 @@ define([CF__GRANTPT_BODY],[ failed(4); #endif #if CONFTEST >= 4 - else if ((rc = tcgetattr(pty, &tio)) < 0) + else if (tcgetattr(pty, &tio) < 0) failed(20); - else if ((rc = tcsetattr(pty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. @@ -4614,34 +5380,35 @@ define([CF__GRANTPT_BODY],[ #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) - else if ((rc = ioctl(tty, I_PUSH, "ptem")) < 0) + else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) - else if ((rc = ioctl(tty, I_PUSH, "ldterm")) < 0) + else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) - else if ((rc = ioctl(tty, I_PUSH, "ttcompat")) < 0) + else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 - else if ((rc = tcgetattr(tty, &tio)) < 0) + else if (tcgetattr(tty, &tio) < 0) failed(30); - else if ((rc = tcsetattr(tty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ - + (void) tty; ${cf_cv_main_return:-return}(code); ]) dnl --------------------------------------------------------------------------- -dnl CF__GRANTPT_HEAD version: 3 updated: 2012/01/29 17:13:14 +dnl CF__GRANTPT_HEAD version: 4 updated: 2020/03/10 18:53:47 dnl ---------------- dnl Headers for workability check of grantpt. define([CF__GRANTPT_HEAD],[ #include +#include #include #include #include @@ -4665,6 +5432,7 @@ static void failed(int code) static void my_timeout(int sig) { + (void)sig; exit(99); } ]) diff --git a/app/xterm/button.c b/app/xterm/button.c index c87567bd0..f10092a10 100644 --- a/app/xterm/button.c +++ b/app/xterm/button.c @@ -1,4 +1,4 @@ -/* $XTermId: button.c,v 1.637 2021/08/12 00:33:06 tom Exp $ */ +/* $XTermId: button.c,v 1.638 2021/11/26 01:27:25 tom Exp $ */ /* * Copyright 1999-2020,2021 by Thomas E. Dickey @@ -325,7 +325,6 @@ visibleScan(int mode) static char * scanTrans(char *source, int *this_is, int *next_is, unsigned *first, unsigned *last) { - char ch; char *target = source; *first = *last = 0; @@ -333,6 +332,7 @@ scanTrans(char *source, int *this_is, int *next_is, unsigned *first, unsigned *l target = 0; } else { do { + char ch; while (IsSpace(*target)) target++; *first = (unsigned) (target - source); diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index c2fc6609b..422a28b8b 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -1,7 +1,7 @@ -/* $XTermId: charproc.c,v 1.1846 2021/09/18 00:04:08 tom Exp $ */ +/* $XTermId: charproc.c,v 1.1888 2022/02/22 09:00:26 Vladimir.A.Pavlov Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -339,13 +339,12 @@ static XtActionsRec actionsList[] = { #if OPT_DEC_SOFTFONT { "set-font-loading", HandleFontLoading }, #endif -#if OPT_SCREEN_DUMPS - { "dump-html", HandleDumpHtml }, - { "dump-svg", HandleDumpSvg }, -#endif #if OPT_EXEC_XTERM { "spawn-new-terminal", HandleSpawnTerminal }, #endif +#if OPT_GRAPHICS + { "set-private-colors", HandleSetPrivateColorRegisters }, +#endif #if OPT_HP_FUNC_KEYS { "set-hp-function-keys", HandleHpFunctionKeys }, #endif @@ -377,6 +376,10 @@ static XtActionsRec actionsList[] = { #if OPT_SCO_FUNC_KEYS { "set-sco-function-keys", HandleScoFunctionKeys }, #endif +#if OPT_SCREEN_DUMPS + { "dump-html", HandleDumpHtml }, + { "dump-svg", HandleDumpSvg }, +#endif #if OPT_SCROLL_LOCK { "scroll-lock", HandleScrollLock }, #endif @@ -393,9 +396,6 @@ static XtActionsRec actionsList[] = { #if OPT_SIXEL_GRAPHICS { "set-sixel-scrolling", HandleSixelScrolling }, #endif -#if OPT_GRAPHICS - { "set-private-colors", HandleSetPrivateColorRegisters }, -#endif #if OPT_SUN_FUNC_KEYS { "set-sun-function-keys", HandleSunFunctionKeys }, #endif @@ -736,7 +736,7 @@ static XtResource xterm_resources[] = #endif #if OPT_SIXEL_GRAPHICS - Bres(XtNsixelScrolling, XtCSixelScrolling, screen.sixel_scrolling, True), + Bres(XtNsixelScrolling, XtCSixelScrolling, screen.sixel_scrolling, False), Bres(XtNsixelScrollsRight, XtCSixelScrollsRight, screen.sixel_scrolls_right, False), #endif @@ -748,6 +748,10 @@ static XtResource xterm_resources[] = screen.privatecolorregisters, True), #endif +#if OPT_STATUS_LINE + Sres(XtNindicatorFormat, XtCIndicatorFormat, screen.status_fmt, DEF_SL_FORMAT), +#endif + #if OPT_SUNPC_KBD Ires(XtNctrlFKeys, XtCCtrlFKeys, misc.ctrl_fkeys, 10), #endif @@ -817,6 +821,7 @@ static XtResource xterm_resources[] = RES_FACESIZE(4), RES_FACESIZE(5), RES_FACESIZE(6), + RES_FACESIZE(7), Dres(XtNfaceSize, XtCFaceSize, misc.face_size[0], DEFFACESIZE), Sres(XtNfaceName, XtCFaceName, misc.default_xft.f_n, DEFFACENAME), Sres(XtNrenderFont, XtCRenderFont, misc.render_font_s, "default"), @@ -1325,11 +1330,17 @@ resetMargins(XtermWidget xw) { TScreen *screen = TScreenOf(xw); - UIntClr(xw->flags, LEFT_RIGHT); reset_tb_margins(screen); reset_lr_margins(screen); } +static void +resetMarginMode(XtermWidget xw) +{ + UIntClr(xw->flags, LEFT_RIGHT); + resetMargins(xw); +} + static void resetRendition(XtermWidget xw) { @@ -2221,6 +2232,9 @@ init_parser(XtermWidget xw, struct ParseState *sp) { TScreen *screen = TScreenOf(xw); + free(sp->defer_area); + free(sp->print_area); + free(sp->string_area); memset(sp, 0, sizeof(*sp)); sp->scssize = 94; /* number of printable/nonspace ASCII */ sp->lastchar = -1; /* not a legal IChar */ @@ -2250,6 +2264,483 @@ deferparsing(unsigned c, struct ParseState *sp) sp->defer_area[(sp->defer_used)++] = CharOf(c); } +#if OPT_STATUS_LINE +typedef enum { + SLnone = 0, /* no status-line timer needed */ + SLclock = 1, /* status-line updates once/second */ + SLcoords = 2, /* status-line shows cursor-position */ + SLwritten = 3 /* status-line may need asynchonous repainting */ +} SL_MODE; + +#define SL_BUFSIZ 80 + +#if OPT_TRACE +static const char * +visibleStatusType(int code) +{ + const char *result = "?"; + switch (code) { + case 0: + result = "none"; + break; + case 1: + result = "indicator"; + break; + case 2: + result = "writable"; + break; + } + return result; +} + +static void +trace_status_line(XtermWidget xw, int lineno, const char *tag) +{ + TScreen *screen = TScreenOf(xw); + + TRACE(("@%d, %s (%s, %s)%s%s @ (%d,%d) vs %d\n", + lineno, + tag, + screen->status_active ? "active" : "inactive", + visibleStatusType(screen->status_type), + ((screen->status_type != screen->status_shown) + ? " vs " + : ""), + ((screen->status_type != screen->status_shown) + ? visibleStatusType(screen->status_shown) + : ""), + screen->cur_row, + screen->cur_col, + LastRowNumber(screen))); +} + +#define TRACE_SL(tag) trace_status_line(xw, __LINE__, tag) +#else +#define TRACE_SL(tag) /* nothing */ +#endif + +static SL_MODE +find_SL_MODE(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + SL_MODE result = SLnone; + const char *parse; + + for (parse = screen->status_fmt; *parse != '\0'; ++parse) { + const char *found = parse; + if (*parse == '%') { + if (*++parse == L_CURL) { + const char *check = strchr(parse, '%'); + size_t length = 0; + + if (check != NULL && check[1] == R_CURL) { + length = (size_t) (2 + check - found); + } else { + length = strlen(found); + } + + if (!strncmp(found, "%{unixtime%}", length)) { + if (result == SLnone) + result = SLclock; + } else if (!strncmp(found, "%{position%}", length)) { + result = SLcoords; + } + parse = found + length - 1; + } +#if defined(HAVE_STRFTIME) + else if (*parse != '\0') { + if (result == SLnone && strchr("cEgOrsSTX+", *parse) != NULL) { + result = SLclock; + } + } +#endif + } + } + return result; +} + +static long +find_SL_Timeout(XtermWidget xw) +{ + long result = 0; + switch (find_SL_MODE(xw)) { + case SLnone: + case SLwritten: + break; + case SLclock: + result = 1000; + break; + case SLcoords: + result = 80; + break; + } + return result; +} + +static void +StatusInit(SavedCursor * data) +{ + memset(data, 0, sizeof(*data)); + data->sgr_foreground = -1; + data->sgr_background = -1; +} + +/* save the status-line position, restore main display */ +static void +StatusSave(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + CursorSave2(xw, &screen->status_data[1]); + CursorRestore2(xw, &screen->status_data[0]); + + TRACE(("...StatusSave %d,%d -> %d,%d (main)\n", + screen->status_data[1].row, + screen->status_data[1].col, + screen->cur_row, + screen->cur_col)); +} + +/* save the main-display position, restore status-line */ +static void +StatusRestore(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + CursorSave2(xw, &screen->status_data[0]); + CursorRestore2(xw, &screen->status_data[1]); + screen->cur_row = FirstRowNumber(screen); + + TRACE(("...StatusRestore %d,%d -> %d,%d (status)\n", + screen->status_data[0].row, + screen->status_data[0].col, + screen->cur_row, + screen->cur_col)); +} + +static void +StatusPutChars(XtermWidget xw, const char *value, int length) +{ + TScreen *screen = TScreenOf(xw); + + if (length < 0) + length = (int) strlen(value); + + while (length > 0) { + IChar buffer[SL_BUFSIZ + 1]; + Cardinal n; + for (n = 0; n < SL_BUFSIZ && length > 0 && *value != '\0'; ++n) { + buffer[n] = CharOf(*value++); + --length; + } + buffer[n] = 0; + dotext(xw, + screen->gsets[(int) (screen->curgl)], + buffer, n); + } +} + +static void +show_indicator_status(XtPointer closure, XtIntervalId * id GCC_UNUSED) +{ + XtermWidget xw = (XtermWidget) closure; + TScreen *screen = TScreenOf(xw); + + time_t now; + const char *parse; + char buffer[SL_BUFSIZ + 1]; + long interval; + + if (screen->status_type != 1) { + screen->status_timeout = False; + return; + } + if (screen->status_active) { + return; + } + + screen->status_active = True; + + CursorSave2(xw, &screen->status_data[0]); + screen->cur_row = FirstRowNumber(screen); + screen->cur_col = 0; + + xw->flags |= INVERSE; + xw->flags &= (IFlags) (~WRAPAROUND); + + now = time((time_t *) 0); + + for (parse = screen->status_fmt; *parse != '\0'; ++parse) { + const char *found = parse; + if (*parse == '%') { + if (*++parse == L_CURL) { + const char *check = strchr(parse, '%'); + size_t length = 0; + + if (check != NULL && check[1] == R_CURL) { + length = (size_t) (2 + check - found); + } else { + length = strlen(found); + } + + if (!strncmp(found, "%{version%}", length)) { + StatusPutChars(xw, xtermVersion(), -1); + } else if (!strncmp(found, "%{unixtime%}", length)) { + char *t = x_strtrim(ctime(&now)); + if (t != 0) { + StatusPutChars(xw, t, -1); + free(t); + } + } else if (!strncmp(found, "%{position%}", length)) { + sprintf(buffer, "(%02d,%03d)", + screen->status_data[0].row + 1, + screen->status_data[0].col + 1); + StatusPutChars(xw, buffer, -1); + } else { + StatusPutChars(xw, found, (int) length); + } + parse = found + length - 1; + } +#if defined(HAVE_STRFTIME) + else if (*parse != '\0') { + char format[3]; + struct tm *tm = localtime(&now); + + format[0] = '%'; + format[1] = *parse; + format[2] = '\0'; + if (strftime(buffer, sizeof(buffer) - 1, format, tm) != 0) { + StatusPutChars(xw, buffer, -1); + } else { + StatusPutChars(xw, "?", 1); + StatusPutChars(xw, parse - 1, 2); + } + } +#endif + } else { + StatusPutChars(xw, parse, 1); + } + } + while (screen->cur_col < screen->max_col) + StatusPutChars(xw, " ", 1); + + ScrnRefresh(xw, FirstRowNumber(screen), 0, 1, screen->max_col, True); + screen->status_active = False; + + CursorRestore2(xw, &screen->status_data[0]); + + /* if we processed a position or date/time, repeat */ + interval = find_SL_Timeout(xw); + if (interval > 0) { + (void) XtAppAddTimeOut(app_con, + (unsigned long) interval, + show_indicator_status, xw); + } + screen->status_timeout = True; +} + +static void +clear_status_line(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + SavedCursor save_me; + SavedCursor clearit; + int save_type = screen->status_type; + + TRACE_SL("clear_status_line"); + StatusInit(&clearit); + CursorSave2(xw, &save_me); + CursorRestore2(xw, &clearit); + + screen->status_type = 2; + set_cur_row(screen, LastRowNumber(screen)); +#if 1 + ClearLine(xw); +#else + if (getLineData(screen, screen->cur_row) != NULL) { + int n; + char buffer[SL_BUFSIZ + 1]; + CLineData *ld = getLineData(screen, screen->cur_row); + + TRACE(("...text[%d:%d]:%s\n", + screen->cur_row, + LastRowNumber(screen), + visibleIChars(ld->charData, ld->lineSize))); + + memset(buffer, '#', SL_BUFSIZ); + for (n = 0; n < screen->max_col; n += SL_BUFSIZ) { + StatusPutChars(xw, buffer, screen->max_col - n); + } + } +#endif + CursorRestore2(xw, &save_me); + screen->status_type = save_type; + TRACE_SL("clear_status_line (done)"); +} + +static void +show_writable_status(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + TRACE(("show_writable_status (%d:%d) max=%d\n", + FirstRowNumber(screen), + LastRowNumber(screen), + MaxRows(screen))); + screen->cur_row = FirstRowNumber(screen); +} + +/* + * Depending the status-type, make the window grow or shrink by one row to + * show or hide the status-line. Keep the rest of the window from scrolling + * by overriding the resize-gravity. + */ +static void +resize_status_line(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + XtGravity savedGravity = xw->misc.resizeGravity; + + TRACE_SL(screen->status_type + ? "...resize to show status-line" + : "...resize to hide status-line"); + + xw->misc.resizeGravity = NorthWestGravity; + + RequestResize(xw, MaxRows(screen), MaxCols(screen), True); + + xw->misc.resizeGravity = savedGravity; +} + +/* + * DEC STD 070, chapter 14 "VSRM - Status Display Extension" + */ +static void +update_status_line(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + TRACE_SL("update_status_line"); + + if (screen->status_type == 1) { + if (screen->status_type != screen->status_shown) { + if (screen->status_shown == 0) { + resize_status_line(xw); + } else { + clear_status_line(xw); + } + screen->status_shown = screen->status_type; + TRACE_SL("...updating shown"); + } + show_indicator_status(xw, NULL); + } else if (screen->status_active) { + if (screen->status_type != screen->status_shown) { + Boolean do_resize = False; + + if (screen->status_type == 0) { + if (screen->status_shown >= 2) { + StatusSave(xw); + } + do_resize = True; /* shrink... */ + clear_status_line(xw); + StatusInit(&screen->status_data[1]); + } else if (screen->status_shown == 0) { + if (screen->status_type >= 2) { + StatusRestore(xw); + } + do_resize = True; /* grow... */ + } else { + clear_status_line(xw); + } + if (do_resize) { + resize_status_line(xw); + } + screen->status_shown = screen->status_type; + TRACE_SL("...updating shown"); + } + show_writable_status(xw); + } else { + if (screen->status_shown) { + if (screen->status_type != 0 && + screen->status_type != screen->status_shown) { + clear_status_line(xw); + } + if (screen->status_shown >= 2) { + StatusSave(xw); + } + if (screen->status_type == 0) { + screen->status_timeout = False; + clear_status_line(xw); + StatusInit(&screen->status_data[1]); + resize_status_line(xw); /* shrink... */ + } + screen->status_shown = screen->status_type; + TRACE_SL("...updating shown"); + } + } + TRACE_SL("update_status_line (done)"); +} + +/* + * If the status-type is "2", we can switch the active status display back and + * forth between the main-display and the status-line without clearing the + * status-line (unless the status-line was not shown before). + * + * This has no effect if the status-line displays an indicator (type==1). + */ +static void +handle_DECSASD(XtermWidget xw, int value) +{ + TScreen *screen = TScreenOf(xw); + Boolean updates = value ? True : False; + + TRACE(("CASE_DECSASD - select active status display: %s (currently %s)\n", + BtoS(value), + BtoS(screen->status_active))); + + if (screen->status_active != updates) { + screen->status_active = updates; + if (screen->status_type != 1) { + if (updates) { + TRACE(("...@%d, saving main position %d,%d\n", + __LINE__, screen->cur_row, screen->cur_col)); + CursorSave2(xw, &screen->status_data[0]); + } + update_status_line(xw); + } + } +} + +/* + * If the status-line is inactive (i.e., only the main-display is used), + * changing the status-type between none/writable has no immediate effect. + * + * But if the status-line is active, setting the status-type reinitializes the + * status-line. + * + * Setting the status-type to indicator overrides the DECSASD active-display + * mode. + */ +static void +handle_DECSSDT(XtermWidget xw, int value) +{ + TScreen *screen = TScreenOf(xw); + + TRACE(("CASE_DECSSDT - select type of status display: %d (currently %d)\n", + value, + screen->status_type)); + if (value <= 2) { + screen->status_type = value; + if (!screen->status_active) { + TRACE(("...@%d, saving main position %d,%d\n", + __LINE__, screen->cur_row, screen->cur_col)); + CursorSave2(xw, &screen->status_data[0]); + } + update_status_line(xw); + } +} +#endif + #if OPT_VT52_MODE static void update_vt52_vt100_settings(void) @@ -3093,7 +3584,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) break; default: /* VT100 */ reply.a_param[count++] = 1; /* VT100 */ - reply.a_param[count++] = 0 | 2 | 0; /* no STP, AVO, no GPO (ReGIS) */ + reply.a_param[count++] = 2; /* no STP, AVO, no GPO (ReGIS) */ break; } } else { @@ -3542,11 +4033,15 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) : "CPR"))); /* CPR */ /* DECXCPR (with page=1) */ - value = (screen->cur_row + 1); + value = screen->cur_row; if ((xw->flags & ORIGIN) != 0) { value -= screen->top_marg; } - reply.a_param[count++] = (ParmType) value; + if_STATUS_LINE(screen, { + if ((value -= LastRowNumber(screen)) < 0) + value = 0; + }); + reply.a_param[count++] = (ParmType) (value + 1); value = (screen->cur_col + 1); if ((xw->flags & ORIGIN) != 0) { @@ -3760,11 +4255,15 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) if (screen->cursor_state) HideCursor(xw); /* - * DEC STD 070 does not mention left/right margins. Likely the - * text was for VT100, and not updated for VT420. + * DEC STD 070 (see pages D-19 to D-20) does not mention left/right + * margins. The section is dated March 1985, not updated for the + * VT420 (introduced in 1990). */ + UIntClr(xw->flags, ORIGIN); + screen->do_wrap = False; resetRendition(xw); resetMargins(xw); + xterm_ResetDouble(xw); CursorSet(screen, 0, 0, xw->flags); xtermParseRect(xw, 0, 0, &myRect); ScrnFillRectangle(xw, &myRect, 'E', 0, False); @@ -4113,7 +4612,11 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) status = 2; /* error in Pa */ break; } + if (status == 0 && !(optSixelGraphics(screen) + || optRegisGraphics(screen))) + status = 3; break; +# if OPT_SIXEL_GRAPHICS case 2: /* graphics geometry */ switch (GetParam(1)) { case 1: /* read */ @@ -4137,7 +4640,10 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) status = 2; /* error in Pa */ break; } + if (status == 0 && !optSixelGraphics(screen)) + status = 3; break; +#endif # if OPT_REGIS_GRAPHICS case 3: /* ReGIS geometry */ switch (GetParam(1)) { @@ -4159,6 +4665,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) status = 2; /* error in Pa */ break; } + if (status == 0 && !optRegisGraphics(screen)) + status = 3; break; #endif default: @@ -4173,9 +4681,11 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) count = 0; reply.a_param[count++] = (ParmType) GetParam(0); reply.a_param[count++] = (ParmType) status; - reply.a_param[count++] = (ParmType) result; - if (GetParam(0) >= 2) - reply.a_param[count++] = (ParmType) result2; + if (status == 0) { + reply.a_param[count++] = (ParmType) result; + if (GetParam(0) >= 2) + reply.a_param[count++] = (ParmType) result2; + } reply.a_nparam = (ParmType) count; reply.a_inters = 0; reply.a_final = 'S'; @@ -4735,6 +5245,24 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) break; #endif /* OPT_DEC_RECTOPS */ + case CASE_DECSASD: +#if OPT_STATUS_LINE + if (screen->vtXX_level >= 2) { + handle_DECSASD(xw, zero_if_default(0)); + } +#endif + ResetState(sp); + break; + + case CASE_DECSSDT: +#if OPT_STATUS_LINE + if (screen->vtXX_level >= 2) { + handle_DECSSDT(xw, zero_if_default(0)); + } +#endif + ResetState(sp); + break; + #if OPT_XTERM_SGR case CASE_CSI_HASH_STATE: TRACE(("CASE_CSI_HASH_STATE\n")); @@ -5484,6 +6012,45 @@ in_put(XtermWidget xw) } #else /* VMS */ +static void +init_timeval(struct timeval *target, long usecs) +{ + target->tv_sec = 0; + target->tv_usec = usecs; + while (target->tv_usec > 1000000) { + target->tv_usec -= 1000000; + target->tv_sec++; + } +} + +static Boolean +better_timeout(struct timeval *check, struct timeval *against) +{ + Boolean result = False; + if (against->tv_sec == 0 && against->tv_usec == 0) { + result = True; + } else if (check->tv_sec == against->tv_sec) { + if (check->tv_usec < against->tv_usec) { + result = True; + } + } else if (check->tv_sec < against->tv_sec) { + result = True; + } + return result; +} + +#if OPT_BLINK_CURS +static long +smaller_timeout(long value) +{ + /* 1000 for msec/usec, 8 for "much" smaller */ + value *= (1000 / 8); + if (value < 1) + value = 1; + return value; +} +#endif + static void in_put(XtermWidget xw) { @@ -5496,21 +6063,7 @@ in_put(XtermWidget xw) #if USE_DOUBLE_BUFFER int should_wait = 1; #endif - - static struct timeval select_timeout; - -#if OPT_BLINK_CURS - /* - * Compute the timeout for the blinking cursor to be much smaller than - * the "on" or "off" interval. - */ - int tick = ((screen->blink_on < screen->blink_off) - ? screen->blink_on - : screen->blink_off); - tick *= (1000 / 8); /* 1000 for msec/usec, 8 for "much" smaller */ - if (tick < 1) - tick = 1; -#endif + struct timeval my_timeout; for (;;) { int size; @@ -5546,9 +6099,8 @@ in_put(XtermWidget xw) * of output. */ if (size == FRG_SIZE) { - select_timeout.tv_sec = 0; - i = Select(max_plus1, &select_mask, &write_mask, 0, - &select_timeout); + init_timeval(&my_timeout, 0); + i = Select(max_plus1, &select_mask, &write_mask, 0, &my_timeout); if (i > 0 && FD_ISSET(screen->respond, &select_mask)) { sched_yield(); } else @@ -5576,7 +6128,7 @@ in_put(XtermWidget xw) XFD_COPYSET(&pty_mask, &write_mask); } else FD_ZERO(&write_mask); - select_timeout.tv_sec = 0; + init_timeval(&my_timeout, 0); time_select = 0; /* @@ -5588,33 +6140,50 @@ in_put(XtermWidget xw) * on the host. */ if (xtermAppPending()) { - select_timeout.tv_usec = 0; time_select = 1; - } else if (screen->awaitInput) { - select_timeout.tv_usec = 50000; - time_select = 1; -#if OPT_BLINK_CURS - } else if ((screen->blink_timer != 0 && - ((screen->select & FOCUS) || screen->always_highlight)) || - (screen->cursor_state == BLINKED_OFF)) { - select_timeout.tv_usec = tick; - while (select_timeout.tv_usec > 1000000) { - select_timeout.tv_usec -= 1000000; - select_timeout.tv_sec++; + } else { +#define ImproveTimeout(usecs) \ + struct timeval try_timeout; \ + init_timeval(&try_timeout, usecs); \ + if (better_timeout(&try_timeout, &my_timeout)) { \ + my_timeout = try_timeout; \ + } +#if OPT_STATUS_LINE + if ((screen->status_type == 1) && screen->status_timeout) { + ImproveTimeout(find_SL_Timeout(xw) * 1000); + time_select = 1; } - time_select = 1; #endif -#if OPT_SESSION_MGT - } else if (resource.sessionMgt) { - if (ice_fd >= 0) - FD_SET(ice_fd, &select_mask); + if (screen->awaitInput) { + ImproveTimeout(50000); + time_select = 1; + } +#if OPT_BLINK_CURS + if ((screen->blink_timer != 0 && + ((screen->select & FOCUS) || screen->always_highlight)) || + (screen->cursor_state == BLINKED_OFF)) { + /* + * Compute the timeout for the blinking cursor to be much + * smaller than the "on" or "off" interval. + */ + long tick = smaller_timeout((screen->blink_on < screen->blink_off) + ? screen->blink_on + : screen->blink_off); + ImproveTimeout(tick); + time_select = 1; + } #endif } +#if OPT_SESSION_MGT + if (resource.sessionMgt && (ice_fd >= 0)) { + FD_SET(ice_fd, &select_mask); + } +#endif if (need_cleanup) NormalExit(); xtermFlushDbe(xw); i = Select(max_plus1, &select_mask, &write_mask, 0, - (time_select ? &select_timeout : 0)); + (time_select ? &my_timeout : 0)); if (i < 0) { if (errno != EINTR) SysError(ERROR_SELECT); @@ -5737,15 +6306,24 @@ dotext(XtermWidget xw, for (offset = 0; offset < len && (chars_chomped > 0 || screen->do_wrap); offset += chars_chomped) { +#if OPT_DEC_CHRSET + CLineData *ld = getLineData(screen, screen->cur_row); + int real_rmargin = (CSET_DOUBLE(GetLineDblCS(ld)) + ? (rmargin / 2) + : rmargin); +#else + int real_rmargin = rmargin; +#endif + int last_col = LineMaxCol(screen, ld); int width_here = 0; int last_chomp = 0; Boolean force_wrap; chars_chomped = 0; do { - int right = ((screen->cur_col > rmargin) - ? screen->max_col - : rmargin); + int right = ((screen->cur_col > real_rmargin) + ? last_col + : real_rmargin); int width_available = right + 1 - screen->cur_col; Boolean need_wrap = False; Boolean did_wrap = False; @@ -5756,9 +6334,9 @@ dotext(XtermWidget xw, screen->do_wrap = False; if ((xw->flags & WRAPAROUND)) { WrapLine(xw); - right = ((screen->cur_col > rmargin) - ? screen->max_col - : rmargin); + right = ((screen->cur_col > real_rmargin) + ? last_col + : real_rmargin); width_available = right + 1 - screen->cur_col; next_col = screen->cur_col; did_wrap = True; @@ -5850,7 +6428,7 @@ dotext(XtermWidget xw, need_wrap = True; } - if (chars_chomped != 0 && next_col <= screen->max_col) { + if (chars_chomped != 0 && next_col <= last_col) { WriteText(xw, buf + offset, chars_chomped); } else if (!did_wrap && len > 0 @@ -6137,6 +6715,46 @@ really_set_mousemode(XtermWidget xw, : SCREEN_FLAG_unset(screen, f)) #endif +/* + * DEC 070, pp 5-29 to 5-30 (DECLRMM). + * DEC 070, pp 5-71 to 5-72 (DECCOLM). + * + * The descriptions for DECLRMM and DECCOLM agree that setting DECLRMM resets + * double-sized mode to single-size, and that if DECLRMM is being set, then + * double-sized mode is disabled. Resetting DECLRMM has no effect on the + * double-sized mode. The description of DECCOLM has an apparent error in its + * pseudo-code (because it is inconsistent with the description of DECLRMM), + * indicating that left_right_margins_mode is changed to SETABLE no matter + * which way DECCOLM is set. + */ +static void +set_column_mode(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + /* switch 80/132 columns clears the screen and sets to single-width */ + xterm_ResetDouble(xw); + resetMargins(xw); + CursorSet(screen, 0, 0, xw->flags); +} + +/* + * DEC 070, pp 5-29 to 5-30. + */ +static void +set_left_right_margin_mode(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + + if (screen->vtXX_level >= 4) { + if (IsLeftRightMode(xw)) { + xterm_ResetDouble(xw); + } else { + reset_lr_margins(screen); + } + } +} + /* * process DEC private modes set, reset */ @@ -6148,6 +6766,9 @@ dpmodes(XtermWidget xw, BitFunc func) unsigned myflags; TRACE(("changing %d DEC private modes\n", nparam)); + if_STATUS_LINE(screen, { + return; + }); for (i = 0; i < nparam; ++i) { int code = GetParam(i); @@ -6209,8 +6830,7 @@ dpmodes(XtermWidget xw, BitFunc func) if (willResize) RequestResize(xw, -1, j, True); (*func) (&xw->flags, IN132COLUMNS); - resetMargins(xw); - CursorSet(screen, 0, 0, xw->flags); + set_column_mode(xw); } break; case srm_DECSCLM: /* (slow scroll) */ @@ -6408,11 +7028,7 @@ dpmodes(XtermWidget xw, BitFunc func) case srm_DECLRMM: if (screen->vtXX_level >= 4) { /* VT420 */ (*func) (&xw->flags, LEFT_RIGHT); - if (IsLeftRightMode(xw)) { - xterm_ResetDouble(xw); - } else { - reset_lr_margins(screen); - } + set_left_right_margin_mode(xw); } break; #if OPT_SIXEL_GRAPHICS @@ -6632,6 +7248,9 @@ savemodes(XtermWidget xw) TScreen *screen = TScreenOf(xw); int i; + if_STATUS_LINE(screen, { + return; + }); for (i = 0; i < nparam; i++) { int code = GetParam(i); @@ -6919,6 +7538,9 @@ restoremodes(XtermWidget xw) TScreen *screen = TScreenOf(xw); int i, j; + if_STATUS_LINE(screen, { + return; + }); for (i = 0; i < nparam; i++) { int code = GetParam(i); @@ -8188,6 +8810,12 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text) #endif TRACE(("RequestResize(rows=%d, cols=%d, text=%d)\n", rows, cols, text)); +#if OPT_STATUS_LINE + if (IsStatusShown(screen) && (rows > 0)) { + TRACE(("...reserve a row for status-line\n")); + ++rows; + } +#endif /* check first if the row/column values fit into a Dimension */ if (cols > 0) { @@ -8295,7 +8923,10 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text) getXtermSizeHints(xw); #endif - TRACE(("...requesting resize %dx%d\n", askedHeight, askedWidth)); + TRACE(("...requesting resize %dx%d (%dx%d)\n", + askedHeight, askedWidth, + askedHeight / FontHeight(screen), + askedWidth / FontWidth(screen))); status = REQ_RESIZE((Widget) xw, askedWidth, askedHeight, &replyWidth, &replyHeight); @@ -9169,6 +9800,11 @@ VTInitialize(Widget wrequest, wnew->numVisuals = 0; (void) getVisualInfo(wnew); +#if OPT_STATUS_LINE + StatusInit(&screen->status_data[0]); + StatusInit(&screen->status_data[1]); +#endif + /* * We use the default foreground/background colors to compare/check if a * color-resource has been set. @@ -10119,6 +10755,10 @@ VTInitialize(Widget wrequest, init_Bres(screen.graphics_rotated_print_mode); #endif +#if OPT_STATUS_LINE + init_Sres(screen.status_fmt); +#endif + /* look for focus related events on the shell, because we need * to care about the shell's border being part of our focus. */ @@ -10754,6 +11394,7 @@ discount_frame_extents(XtermWidget xw, int *high, int *wide) TRACE(("...ignoring extents\n")); rc = False; } + XFree(args); } else { rc = False; } @@ -11200,7 +11841,7 @@ VTRealize(Widget w, set_cur_row(screen, 0); set_max_col(screen, Width(screen) / screen->fullVwin.f_width - 1); set_max_row(screen, Height(screen) / screen->fullVwin.f_height - 1); - resetMargins(xw); + resetMarginMode(xw); memset(screen->sc, 0, sizeof(screen->sc)); @@ -12402,10 +13043,11 @@ HandleBlinking(XtPointer closure, XtIntervalId * id GCC_UNUSED) */ if (!(screen->blink_as_bold)) { int row; - int first_row = screen->max_row; + int start_row = LastRowNumber(screen); + int first_row = start_row; int last_row = -1; - for (row = screen->max_row; row >= 0; row--) { + for (row = start_row; row >= 0; row--) { LineData *ld = getLineData(screen, ROW2INX(screen, row)); if (ld != 0 && LineTstBlinked(ld)) { @@ -12524,7 +13166,7 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) #endif /* reset scrolling region */ - resetMargins(xw); + resetMarginMode(xw); bitclr(&xw->flags, ORIGIN); diff --git a/app/xterm/config.guess b/app/xterm/config.guess index 1f5c50c0d..e81d3ae7c 100644 --- a/app/xterm/config.guess +++ b/app/xterm/config.guess @@ -1,8 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2014-03-23' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2021-06-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +17,7 @@ timestamp='2014-03-23' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -24,12 +26,20 @@ timestamp='2014-03-23' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` @@ -39,7 +49,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,22 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,45 +242,80 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -249,163 +329,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + set_cc_for_build + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -415,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -461,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -560,76 +636,77 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -662,13 +739,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -679,23 +756,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -720,38 +797,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -759,139 +836,145 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -901,172 +984,226 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1074,12 +1211,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1089,43 +1226,43 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1133,9 +1270,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1144,248 +1281,438 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` +# shellcheck disable=SC2003 +script_age=`expr "$thisyear" - "$our_year"` +if test "$script_age" -lt 3 ; then + cat >&2 </dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/app/xterm/config.sub b/app/xterm/config.sub index 88a0cb463..d74fb6dea 100644 --- a/app/xterm/config.sub +++ b/app/xterm/config.sub @@ -1,8 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2014-07-28' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2021-08-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +17,7 @@ timestamp='2014-07-28' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -25,7 +27,7 @@ timestamp='2014-07-28' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +35,7 @@ timestamp='2014-07-28' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,15 +52,21 @@ timestamp='2014-07-28' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +76,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -90,12 +98,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,1219 +119,1181 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -bluegene*) - os=-cnk + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - c54x) - basic_machine=tic54x-unknown + op50n) + cpu=hppa1.1 + vendor=oki ;; - c55x) - basic_machine=tic55x-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - c6x) - basic_machine=tic6x-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - ms1) - basic_machine=mt-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + 3b*) + cpu=we32k + vendor=att ;; - xscaleeb) - basic_machine=armeb-unknown + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - xscaleel) - basic_machine=armel-unknown + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + cpu=$basic_machine + vendor=pc ;; + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" pc98) - basic_machine=i386-pc + cpu=i386 + vendor=pc ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + basic_os=${basic_os:-unicosmp} ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc + c90-unknown | c90-cray) + vendor=cray + basic_os=${Basic_os:-unicos} ;; - pentium4) - basic_machine=i786-pc + fx80-unknown) + vendor=alliant ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + romp-unknown) + vendor=ibm ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + mmix-unknown) + vendor=knuth ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + rs6000-unknown) + vendor=ibm ;; - pn) - basic_machine=pn-gould + vax-unknown) + vendor=dec ;; - power) basic_machine=power-ibm + pdp11-unknown) + vendor=dec ;; - ppc | ppcbe) basic_machine=powerpc-unknown + we32k-unknown) + vendor=att ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + cydra-unknown) + vendor=cydrome ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown + i370-ibm*) + vendor=ibm ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + orion-unknown) + vendor=highlevel ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond + # Here we normalize CPU types with a missing or matching vendor + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + basic_os=${basic_os:-bosx} ;; - op50n) - basic_machine=hppa1.1-oki + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - op60c) - basic_machine=hppa1.1-oki + blackfin-*) + cpu=bfin + basic_os=linux ;; - romp) - basic_machine=romp-ibm + c54x-*) + cpu=tic54x ;; - mmix) - basic_machine=mmix-knuth + c55x-*) + cpu=tic55x ;; - rs6000) - basic_machine=rs6000-ibm + c6x-*) + cpu=tic6x ;; - vax) - basic_machine=vax-dec + e500v[12]-*) + cpu=powerpc + basic_os=${basic_os}"spe" ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + mips3*-*) + cpu=mips64 ;; - pdp11) - basic_machine=pdp11-dec + ms1-*) + cpu=mt ;; - we32k) - basic_machine=we32k-att + m68knommu-*) + cpu=m68k + basic_os=linux ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + openrisc-*) + cpu=or32 ;; - cydra) - basic_machine=cydra-cydrome + parisc-*) + cpu=hppa + basic_os=linux ;; - orion) - basic_machine=orion-highlevel + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - orion105) - basic_machine=clipper-highlevel + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + pentium4-*) + cpu=i786 ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + pc98-*) + cpu=i386 ;; + ppc-* | ppcbe-*) + cpu=powerpc + ;; + ppcle-* | powerpclittle-*) + cpu=powerpcle + ;; + ppc64-*) + cpu=powerpc64 + ;; + ppc64le-* | powerpc64little-*) + cpu=powerpc64le + ;; + sb1-*) + cpu=mipsisa64sb1 + ;; + sb1el-*) + cpu=mipsisa64sb1el + ;; + sh5e[lb]-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` + ;; + spur-*) + cpu=spur + ;; + strongarm-* | thumb-*) + cpu=arm + ;; + tx39-*) + cpu=mipstx39 + ;; + tx39el-*) + cpu=mipstx39el + ;; + x64-*) + cpu=x86_64 + ;; + xscale-* | xscalee[bl]-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` + ;; + arm64-*) + cpu=aarch64 + ;; + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + basic_os=${basic_os:-elf} + ;; + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis + ;; + cris-* | etrax*-*) + cpu=cris + vendor=axis + ;; + crx-*) + basic_os=${basic_os:-elf} + ;; + neo-tandem) + cpu=neo + vendor=tandem + ;; + nse-tandem) + cpu=nse + vendor=tandem + ;; + nsr-tandem) + cpu=nsr + vendor=tandem + ;; + nsv-tandem) + cpu=nsv + vendor=tandem + ;; + nsx-tandem) + cpu=nsx + vendor=tandem + ;; + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony + ;; + tile*-*) + basic_os=${basic_os:-linux-gnu} + ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1331,200 +1301,215 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1537,261 +1522,362 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 + ;; + pru-*) + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs + os=luna ;; *-next) - os=-nextstep3 + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) vendor=ibm ;; - -os400*) + *-os400*) vendor=ibm ;; - -ptx*) + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/app/xterm/configure b/app/xterm/configure index 391999655..b8a93b850 100644 --- a/app/xterm/configure +++ b/app/xterm/configure @@ -1,7 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20141204. +# Generated by Autoconf 2.52.20210509. # +# Copyright 2003-2020,2021 Thomas E. Dickey # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -59,9 +60,9 @@ as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset + as_unset="unset" else - as_unset=false + as_unset="false" fi # NLS nuisances. @@ -96,13 +97,14 @@ exec 6>&1 ac_default_prefix=/usr/local cross_compiling=no subdirs= -MFLAGS= MAKEFLAGS= +MFLAGS= +MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} +: "${ac_max_here_lines=38}" ac_unique_file="charproc.c" # Factoring default headers for most tests. @@ -175,6 +177,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' @@ -202,7 +205,7 @@ do # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -243,7 +246,7 @@ do expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo "$ac_feature" | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) @@ -252,8 +255,8 @@ do expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in + ac_feature=`echo "$ac_feature" | sed 's/-/_/g'` + case "$ac_option" in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac @@ -317,6 +320,15 @@ do | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst \ + | --runs | --run | --ru) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* \ + | --runs=* | --run=* | --ru=*) + runstatedir=$ac_optarg ;; + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) @@ -434,8 +446,8 @@ do expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in + ac_package=`echo "$ac_package" | sed 's/-/_/g'` + case "$ac_option" in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac @@ -447,7 +459,7 @@ do expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` + ac_package=`echo "$ac_package" | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) @@ -481,21 +493,21 @@ Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; + export "$ac_envvar" ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` + ac_option=--`echo "$ac_prev" | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi @@ -503,8 +515,8 @@ fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do - eval ac_val=$`echo $ac_var` - case $ac_val in + eval ac_val=$`echo "$ac_var"` + case "$ac_val" in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; @@ -515,8 +527,8 @@ done for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do - eval ac_val=$`echo $ac_var` - case $ac_val in + eval ac_val=$`echo "$ac_var"` + case "$ac_val" in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; @@ -553,13 +565,13 @@ if test -z "$srcdir"; then ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then +if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } @@ -654,6 +666,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR extra definition of runtime data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -694,7 +707,7 @@ Compile/Install Options: --disable-full-tgetent disable check for full tgetent function --with-app-class=XXX override X applications class (default XTerm) --with-app-defaults=DIR directory in which to install resource files (EPREFIX/lib/X11/app-defaults) - --with-icon-name=XXXX override icon name (default: xterm-color) + --with-icon-name=XXXX override icon name (default: mini.xterm) --with-icon-symlink=XXX make symbolic link for icon name (default: xterm) --with-pixmapdir=DIR directory in which to install pixmaps (DATADIR/pixmaps) --with-icondir=DIR directory in which to install icons for desktop @@ -713,10 +726,12 @@ Compile/Install Options: --with-x use the X Window System --with-pkg-config{=path} enable/disable use of pkg-config --with-xpm=DIR use Xpm library for colored icon, may specify path + --without-xinerama do not use Xinerama extension for multiscreen support --with-Xaw3d link with Xaw 3d library --with-Xaw3dxft link with Xaw 3d xft library --with-neXtaw link with neXT Athena library --with-XawPlus link with Athena-Plus library + --disable-xcursor disable cursorTheme resource --enable-narrowproto enable narrow prototypes for X libraries --disable-imake disable use of imake for definitions --with-man2html=XXX use XXX rather than groff @@ -730,12 +745,14 @@ Terminal Configuration: --enable-alt-sends-esc set default altSendsEscape resource (default: no) --enable-meta-sends-esc set default metaSendsEscape resource (default: no) --with-own-terminfo=P set default $TERMINFO (default: from environment) + --enable-env-terminfo setenv $TERMINFO if --with-own-terminfo gives value Optional Features: --disable-active-icon disable X11R6.3 active-icon feature --disable-ansi-color disable ANSI color --disable-16-color disable 16-color support - --enable-256-color enable 256-color support - --enable-88-color enable 88-color support + --disable-256-color disable 256-color support + --disable-direct-color disable direct-color support + --disable-88-color disable 88-color support --disable-blink-cursor disable support for blinking cursor --enable-broken-osc allow broken Linux OSC-strings --disable-broken-st disallow broken string-terminators @@ -748,7 +765,7 @@ Optional Features: --disable-doublechars disable support for double-size chars --disable-boxchars disable fallback-support for box chars --enable-exec-xterm enable "spawn-new-terminal" action - --enable-double-buffer enable double-buffering + --enable-double-buffer enable double-buffering in default resources --disable-freetype disable freetype library-support --with-freetype-config configure script to use for FreeType --with-freetype-cflags -D/-I options for compiling with FreeType @@ -769,11 +786,13 @@ Optional Features: --disable-pty-handshake disable pty-handshake support --enable-readline-mouse enable support for mouse in readline applications --disable-regex disable regular-expression selections + --with-pcre2 use PCRE2 for regular-expressions --with-pcre use PCRE for regular-expressions --disable-rightbar disable right-scrollbar support --disable-samename disable check for redundant name-change --disable-selection-ops disable selection-action operations --disable-session-mgt disable support for session management + --enable-status-line enable support for status-line --disable-tcap-fkeys disable termcap function-keys support --disable-tcap-query disable compiled-in termcap-query support --disable-tek4014 disable tek4014 emulation @@ -786,8 +805,10 @@ Optional Features: --disable-luit enable luit filter (Unicode translation) --enable-dabbrev enable dynamic-abbreviation support --enable-dec-locator enable DECterm Locator support + --disable-screen-dumps disable XHTML and SVG screen dumps --enable-regis-graphics enable ReGIS graphics support - --enable-sixel-graphics enable sixel graphics support + --disable-sixel-graphics disable sixel graphics support + --disable-print-graphics disable screen dump to sixel support --disable-rectangles disable VT420 rectangle support --disable-ziconbeep disable -ziconbeep option Testing/development Options: @@ -798,7 +819,8 @@ Testing/development Options: --disable-leaks test: free permanent memory, analyze leaks --disable-echo do not display "compiling" commands --enable-xmc-glitch test: enable xmc magic-cookie emulation - --enable-warnings test: turn on GCC compiler warnings + --enable-warnings test: turn on gcc compiler warnings + --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics --disable-rpath-hack don't add rpath options for additional libraries Some influential environment variables: @@ -820,42 +842,43 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue - cd $ac_subdir + cd "$ac_subdir" # A "../" for each directory in /$ac_subdir. - ac_dots=`echo $ac_subdir | + ac_dots=`echo "$ac_subdir" | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` - case $srcdir in + case "$srcdir" in .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; + ac_sub_srcdir="$srcdir" ;; [\\/]* | ?:[\\/]* ) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_subdir ;; + ac_sub_srcdir="$srcdir/$ac_subdir" ;; *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;; esac # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure.gnu; then + if test -f "$ac_sub_srcdir/configure.gnu"; then echo - $SHELL $ac_sub_srcdir/configure.gnu --help=recursive - elif test -f $ac_sub_srcdir/configure; then + $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_sub_srcdir/configure"; then echo - $SHELL $ac_sub_srcdir/configure --help=recursive - elif test -f $ac_sub_srcdir/configure.ac || - test -f $ac_sub_srcdir/configure.in; then + $SHELL "$ac_sub_srcdir/configure" --help=recursive + elif test -f "$ac_sub_srcdir/configure.ac" || + test -f "$ac_sub_srcdir/configure.in"; then echo - $ac_configure --help + "$ac_configure" --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 -if $ac_init_version; then +if "$ac_init_version"; then cat <<\EOF +Copyright 2003-2020,2021 Thomas E. Dickey Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -869,7 +892,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.52.20141204. Invocation command line was +generated by GNU Autoconf 2.52.20210509. Invocation command line was $ $0 $@ @@ -916,7 +939,7 @@ ac_configure_args= ac_sep= for ac_arg do - case $ac_arg in + case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -973,7 +996,7 @@ trap 'exit_status=$? exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal" done ac_signal=0 @@ -993,7 +1016,7 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - { echo "$as_me:996: loading site script $ac_site_file" >&5 + { echo "$as_me:1019: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" @@ -1004,7 +1027,7 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:1007: loading cache $cache_file" >&5 + { echo "$as_me:1030: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -1012,7 +1035,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:1015: creating cache $cache_file" >&5 + { echo "$as_me:1038: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1026,23 +1049,23 @@ for ac_var in `(set) 2>&1 | eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in + case "$ac_old_set,$ac_new_set" in set,) - { echo "$as_me:1031: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:1054: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:1035: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:1058: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:1041: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:1064: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:1043: former value: $ac_old_val" >&5 + { echo "$as_me:1066: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:1045: current value: $ac_new_val" >&5 + { echo "$as_me:1068: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -1050,7 +1073,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then - case $ac_new_val in + case "$ac_new_val" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" @@ -1060,35 +1083,43 @@ echo "$as_me: current value: $ac_new_val" >&2;} esac fi done -if $ac_cache_corrupted; then - { echo "$as_me:1064: error: changes in the environment can compromise the build" >&5 +if "$ac_cache_corrupted"; then + { echo "$as_me:1087: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:1066: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:1089: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' +ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_main_return=return +ac_main_return="return" case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway - ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; + *c*,-n*) ECHO_N= + ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway + ECHO_T=' ' + ;; + *c*,* ) ECHO_N=-n + ECHO_C= + ECHO_T= + ;; + *) ECHO_N= + ECHO_C='\c' + ECHO_T= + ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:1087: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:1118: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:1090: \$? = $ac_status" >&5 - (exit $ac_status); }; then + echo "$as_me:1121: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then ac_path_separator=';' else ac_path_separator=: @@ -1100,22 +1131,22 @@ ac_config_headers="$ac_config_headers xtermcfg.h:xtermcfg.hin" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1118: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1149: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi @@ -1125,11 +1156,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:1128: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1159: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1132: checking build system type" >&5 +echo "$as_me:1163: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1138,24 +1169,24 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1141: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1172: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:1145: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` || + { { echo "$as_me:1176: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1150: result: $ac_cv_build" >&5 +echo "$as_me:1181: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1158: checking host system type" >&5 +if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then + echo "$as_me:1189: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1163,18 +1194,18 @@ else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:1167: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` || + { { echo "$as_me:1198: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1172: result: $ac_cv_host" >&5 +echo "$as_me:1203: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` system_name="$host_os" else @@ -1195,13 +1226,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1198: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1229: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then - echo "$as_me:1202: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1233: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 - { { echo "$as_me:1204: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1235: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1209,24 +1240,24 @@ fi ### checks for alternative programs case "$host_os" in -(openedition) : ${CFLAGS="-O2 -Wc,dll -Wl,EDIT=NO"} - : ${CPPFLAGS="-D_ALL_SOURCE"} - : ${LIBS="/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x"} - : ${CC=c89};; +(openedition) : "${CFLAGS=\"-O2 -Wc,dll -Wl,EDIT=NO\"}" + : "${CPPFLAGS=\"-D_ALL_SOURCE\"}" + : "${LIBS=\"/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x\"}" + : "${CC=c89}";; (darwin*) - : ${LDFLAGS}="${LDFLAGS} -Wl,-bind_at_load";; + : "${LDFLAGS}=\"${LDFLAGS} -Wl,-bind_at_load\"";; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' +ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_main_return=return +ac_main_return="return" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:1229: checking for $ac_word" >&5 +echo "$as_me:1260: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1241,7 +1272,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" -echo "$as_me:1244: found $ac_dir/$ac_word" >&5 +echo "$as_me:1275: found $ac_dir/$ac_word" >&5 break done @@ -1249,10 +1280,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1252: result: $CC" >&5 + echo "$as_me:1283: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1255: result: no" >&5 + echo "$as_me:1286: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1261,7 +1292,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:1264: checking for $ac_word" >&5 +echo "$as_me:1295: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1276,7 +1307,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1279: found $ac_dir/$ac_word" >&5 +echo "$as_me:1310: found $ac_dir/$ac_word" >&5 break done @@ -1284,10 +1315,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1287: result: $ac_ct_CC" >&5 + echo "$as_me:1318: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1290: result: no" >&5 + echo "$as_me:1321: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1300,7 +1331,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:1303: checking for $ac_word" >&5 +echo "$as_me:1334: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1315,7 +1346,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" -echo "$as_me:1318: found $ac_dir/$ac_word" >&5 +echo "$as_me:1349: found $ac_dir/$ac_word" >&5 break done @@ -1323,10 +1354,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1326: result: $CC" >&5 + echo "$as_me:1357: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1329: result: no" >&5 + echo "$as_me:1360: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1335,7 +1366,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1338: checking for $ac_word" >&5 +echo "$as_me:1369: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1350,7 +1381,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1353: found $ac_dir/$ac_word" >&5 +echo "$as_me:1384: found $ac_dir/$ac_word" >&5 break done @@ -1358,10 +1389,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1361: result: $ac_ct_CC" >&5 + echo "$as_me:1392: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1364: result: no" >&5 + echo "$as_me:1395: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1374,7 +1405,7 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1377: checking for $ac_word" >&5 +echo "$as_me:1408: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1394,11 +1425,11 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1397: found $ac_dir/$ac_word" >&5 +echo "$as_me:1428: found $ac_dir/$ac_word" >&5 break done -if test $ac_prog_rejected = yes; then +if test "$ac_prog_rejected" = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift @@ -1416,10 +1447,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1419: result: $CC" >&5 + echo "$as_me:1450: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1422: result: no" >&5 + echo "$as_me:1453: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1430,7 +1461,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:1433: checking for $ac_word" >&5 +echo "$as_me:1464: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1445,7 +1476,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -echo "$as_me:1448: found $ac_dir/$ac_word" >&5 +echo "$as_me:1479: found $ac_dir/$ac_word" >&5 break done @@ -1453,10 +1484,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1456: result: $CC" >&5 + echo "$as_me:1487: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1459: result: no" >&5 + echo "$as_me:1490: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1469,7 +1500,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:1472: checking for $ac_word" >&5 +echo "$as_me:1503: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1484,7 +1515,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" -echo "$as_me:1487: found $ac_dir/$ac_word" >&5 +echo "$as_me:1518: found $ac_dir/$ac_word" >&5 break done @@ -1492,10 +1523,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1495: result: $ac_ct_CC" >&5 + echo "$as_me:1526: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1498: result: no" >&5 + echo "$as_me:1529: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1507,36 +1538,36 @@ fi fi -test -z "$CC" && { { echo "$as_me:1510: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1541: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:1515:" \ +echo "$as_me:1546:" \ "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1518: \"$ac_compiler --version &5\"") >&5 +ac_compiler=`set X $ac_compile; echo "$2"` +{ (eval echo "$as_me:1549: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1521: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1523: \"$ac_compiler -v &5\"") >&5 + echo "$as_me:1552: \$? = $ac_status" >&5 + (exit "$ac_status"); } +{ (eval echo "$as_me:1554: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1526: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1528: \"$ac_compiler -V &5\"") >&5 + echo "$as_me:1557: \$? = $ac_status" >&5 + (exit "$ac_status"); } +{ (eval echo "$as_me:1559: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1531: \$? = $ac_status" >&5 - (exit $ac_status); } + echo "$as_me:1562: \$? = $ac_status" >&5 + (exit "$ac_status"); } -cat >conftest.$ac_ext <<_ACEOF -#line 1535 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 1566 "configure" #include "confdefs.h" int -main () +main (void) { ; @@ -1548,14 +1579,14 @@ ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:1551: checking for C compiler default output" >&5 +echo "$as_me:1582: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:1554: \"$ac_link_default\"") >&5 +ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'` +if { (eval echo "$as_me:1585: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1557: \$? = $ac_status" >&5 - (exit $ac_status); }; then + echo "$as_me:1588: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. @@ -1576,35 +1607,35 @@ for ac_file in `ls a.exe conftest.exe 2>/dev/null; done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1580: error: C compiler cannot create executables" >&5 +cat "conftest.$ac_ext" >&5 +{ { echo "$as_me:1611: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext -echo "$as_me:1586: result: $ac_file" >&5 +echo "$as_me:1617: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1591: checking whether the C compiler works" >&5 +echo "$as_me:1622: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:1597: \"$ac_try\"") >&5 + { (eval echo "$as_me:1628: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1600: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:1631: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1607: error: cannot run C compiled programs. + { { echo "$as_me:1638: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} @@ -1612,25 +1643,25 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1615: result: yes" >&5 +echo "$as_me:1646: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +rm -f a.out a.exe "conftest$ac_cv_exeext" ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1622: checking whether we are cross compiling" >&5 +echo "$as_me:1653: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1624: result: $cross_compiling" >&5 +echo "$as_me:1655: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1627: checking for executable suffix" >&5 +echo "$as_me:1658: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1629: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1660: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1632: \$? = $ac_status" >&5 - (exit $ac_status); }; then + echo "$as_me:1663: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -1645,29 +1676,29 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1648: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1679: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi -rm -f conftest$ac_cv_exeext -echo "$as_me:1654: result: $ac_cv_exeext" >&5 +rm -f "conftest$ac_cv_exeext" +echo "$as_me:1685: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 -rm -f conftest.$ac_ext +rm -f "conftest.$ac_ext" EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:1660: checking for object suffix" >&5 +echo "$as_me:1691: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 1666 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1697 "configure" #include "confdefs.h" int -main () +main (void) { ; @@ -1675,11 +1706,11 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1678: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1709: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1681: \$? = $ac_status" >&5 - (exit $ac_status); }; then + echo "$as_me:1712: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; @@ -1689,29 +1720,29 @@ if { (eval echo "$as_me:1678: \"$ac_compile\"") >&5 done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1693: error: cannot compute OBJEXT: cannot compile" >&5 +cat "conftest.$ac_ext" >&5 +{ { echo "$as_me:1724: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext" fi -echo "$as_me:1700: result: $ac_cv_objext" >&5 +echo "$as_me:1731: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1704: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1735: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 1710 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1741 "configure" #include "confdefs.h" int -main () +main (void) { #ifndef __GNUC__ choke me @@ -1721,72 +1752,72 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1725: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:1756: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1728: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1731: \"$ac_try\"") >&5 + echo "$as_me:1759: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:1762: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1734: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:1765: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1746: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1777: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" -echo "$as_me:1752: checking whether $CC accepts -g" >&5 +echo "$as_me:1783: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 1758 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1789 "configure" #include "confdefs.h" int -main () +main (void) { ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1773: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1776: \"$ac_try\"") >&5 + echo "$as_me:1804: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:1807: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1779: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:1810: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:1789: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1820: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -1807,23 +1838,23 @@ fi # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF +cat >"conftest.$ac_ext" <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1816: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:1847: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1819: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1822: \"$ac_try\"") >&5 + echo "$as_me:1850: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:1853: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1825: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:1856: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then for ac_declaration in \ ''\ '#include ' \ @@ -1833,107 +1864,284 @@ if { (eval echo "$as_me:1816: \"$ac_compile\"") >&5 'extern "C" void exit (int);' \ 'void exit (int);' do - cat >conftest.$ac_ext <<_ACEOF -#line 1837 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1868 "configure" #include "confdefs.h" #include $ac_declaration int -main () +main (void) { exit (42); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1850: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1853: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1856: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1859: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line 1869 "configure" -#include "confdefs.h" -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext +rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1881: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1884: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1887: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1890: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit "$ac_status"); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +continue +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1900 "configure" +#include "confdefs.h" +$ac_declaration +int +main (void) +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:1912: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1915: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:1918: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1921: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" done rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h + echo "$ac_declaration" >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" ac_ext=c ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' +ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_main_return=return +ac_main_return="return" GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:1920: checking version of $CC" >&5 + echo "$as_me:1951: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:1924: result: $GCC_VERSION" >&5 + echo "$as_me:1955: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi -echo "$as_me:1928: checking for $CC option to accept ANSI C" >&5 +INTEL_COMPILER=no + +if test "$GCC" = yes ; then + case "$host_os" in + (linux*|gnu*) + echo "$as_me:1964: checking if this is really Intel C compiler" >&5 +echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -no-gcc" + cat >"conftest.$ac_ext" <<_ACEOF +#line 1969 "configure" +#include "confdefs.h" + +int +main (void) +{ + +#ifdef __INTEL_COMPILER +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:1986: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1989: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:1992: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1995: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + INTEL_COMPILER=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147" + +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + CFLAGS="$cf_save_CFLAGS" + echo "$as_me:2006: result: $INTEL_COMPILER" >&5 +echo "${ECHO_T}$INTEL_COMPILER" >&6 + ;; + esac +fi + +CLANG_COMPILER=no + +if test "$GCC" = yes ; then + echo "$as_me:2015: checking if this is really Clang C compiler" >&5 +echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2019 "configure" +#include "confdefs.h" + +int +main (void) +{ + +#ifdef __clang__ +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2039: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:2042: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2045: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + CLANG_COMPILER=yes + +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + CFLAGS="$cf_save_CFLAGS" + echo "$as_me:2055: result: $CLANG_COMPILER" >&5 +echo "${ECHO_T}$CLANG_COMPILER" >&6 +fi + +CLANG_VERSION=none + +if test "x$CLANG_COMPILER" = "xyes" ; then + case "$CC" in + (c[1-9][0-9]|*/c[1-9][0-9]) + { echo "$as_me:2064: WARNING: replacing broken compiler alias $CC" >&5 +echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;} + CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`" + CC=clang + ;; + esac + + echo "$as_me:2071: checking version of $CC" >&5 +echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 + CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + test -z "$CLANG_VERSION" && CLANG_VERSION=unknown + echo "$as_me:2075: result: $CLANG_VERSION" >&5 +echo "${ECHO_T}$CLANG_VERSION" >&6 + + for cf_clang_opt in \ + -Qunused-arguments \ + -Wno-error=implicit-function-declaration + do + echo "$as_me:2082: checking if option $cf_clang_opt works" >&5 +echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cf_clang_opt" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2087 "configure" +#include "confdefs.h" + + #include +int +main (void) +{ + + printf("hello!\\n"); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:2101: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2104: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:2107: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2110: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + + cf_clang_optok=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 + + cf_clang_optok=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + echo "$as_me:2121: result: $cf_clang_optok" >&5 +echo "${ECHO_T}$cf_clang_optok" >&6 + CFLAGS="$cf_save_CFLAGS" + if test "$cf_clang_optok" = yes; then + test -n "$verbose" && echo " adding option $cf_clang_opt" 1>&6 + +echo "${as_me:-configure}:2127: testing adding option $cf_clang_opt ..." 1>&5 + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_clang_opt" + + fi + done +fi + +echo "$as_me:2136: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line 1936 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 2144 "configure" #include "confdefs.h" #include #include @@ -1964,7 +2172,7 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i int argc; char **argv; int -main () +main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; @@ -1981,80 +2189,87 @@ _ACEOF for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:1985: \"$ac_compile\"") >&5 + rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:2193: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1988: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1991: \"$ac_try\"") >&5 + echo "$as_me:2196: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:2199: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1994: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:2202: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext +rm -f "conftest.$ac_objext" done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f "conftest.$ac_ext" "conftest.$ac_objext" CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:2011: result: none needed" >&5 + echo "$as_me:2219: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:2014: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:2222: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # This should have been defined by AC_PROG_CC -: ${CC:=cc} +: "${CC:=cc}" -echo "$as_me:2022: checking \$CC variable" >&5 -echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 -case "$CC" in -(*[\ \ ]-[IUD]*) - echo "$as_me:2026: result: broken" >&5 +echo "$as_me:2230: checking \$CFLAGS variable" >&5 +echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6 +case "x$CFLAGS" in +(*-[IUD]*) + echo "$as_me:2234: result: broken" >&5 echo "${ECHO_T}broken" >&6 - { echo "$as_me:2028: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 -echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} - # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[^ ]*[ ]//'` - CC=`echo "$CC" | sed -e 's/[ ].*//'` + { echo "$as_me:2236: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5 +echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;} + cf_flags="$CFLAGS" + CFLAGS= + for cf_arg in $cf_flags + do cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in $cf_flags +for cf_add_cflags in $cf_arg do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -2063,7 +2278,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -2073,19 +2288,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -2096,33 +2319,278 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi + done ;; (*) - echo "$as_me:2114: result: ok" >&5 + echo "$as_me:2344: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac +echo "$as_me:2349: checking \$CC variable" >&5 +echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 +case "$CC" in +(*[\ \ ]-*) + echo "$as_me:2353: result: broken" >&5 +echo "${ECHO_T}broken" >&6 + { echo "$as_me:2355: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 +echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} + # humor him... + cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'` + CC="$cf_prog" + for cf_arg in $cf_flags + do + case "x$cf_arg" in + (x-[IUDfgOW]*) + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_arg +do +case "$cf_fix_cppflags" in +(no) + case "$cf_add_cflags" in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case "$cf_add_cflags" in + (-D*) + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case "$cf_add_cflags" in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + ;; + (*) + CC="$CC $cf_arg" + ;; + esac + done + test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 + +echo "${as_me:-configure}:2472: testing resulting CC: '$CC' ..." 1>&5 + + test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 + +echo "${as_me:-configure}:2476: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 + + test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 + +echo "${as_me:-configure}:2480: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 + + ;; +(*) + echo "$as_me:2484: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + ;; +esac + +for ac_prog in ggrep grep +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2493: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GREP"; then + ac_cv_prog_GREP="$GREP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_GREP="$ac_prog" +echo "$as_me:2508: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +GREP=$ac_cv_prog_GREP +if test -n "$GREP"; then + echo "$as_me:2516: result: $GREP" >&5 +echo "${ECHO_T}$GREP" >&6 +else + echo "$as_me:2519: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$GREP" && break +done +test -n "$GREP" || GREP=": " + +echo "$as_me:2527: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + for ac_prog in gegrep egrep +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2539: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_EGREP="$ac_dir/$ac_word" + echo "$as_me:2556: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +EGREP=$ac_cv_path_EGREP + +if test -n "$EGREP"; then + echo "$as_me:2567: result: $EGREP" >&5 +echo "${ECHO_T}$EGREP" >&6 +else + echo "$as_me:2570: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$EGREP" && break +done +test -n "$EGREP" || EGREP=": " + + test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2578: error: cannot find workable egrep" >&5 +echo "$as_me: error: cannot find workable egrep" >&2;} + { (exit 1); exit 1; }; } + fi +fi +echo "$as_me:2583: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6 + EGREP="$ac_cv_path_EGREP" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' +ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_main_return=return -echo "$as_me:2125: checking how to run the C preprocessor" >&5 +ac_main_return="return" +echo "$as_me:2593: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -2142,20 +2610,20 @@ do # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line 2146 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2614 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2151: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2157: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:2625: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -2168,27 +2636,27 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line 2180 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2648 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2184: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:2652: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2190: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:2658: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -2202,16 +2670,16 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" if $ac_preproc_ok; then break fi @@ -2224,7 +2692,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2227: result: $CPP" >&5 +echo "$as_me:2695: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2233,20 +2701,20 @@ do # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line 2237 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2705 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2242: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2248: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:2716: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -2259,27 +2727,27 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line 2271 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 2739 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2275: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:2743: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2281: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:2749: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -2293,36 +2761,36 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" if $ac_preproc_ok; then : else - { { echo "$as_me:2309: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2777: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' +ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_main_return=return +ac_main_return="return" for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2325: checking for $ac_word" >&5 +echo "$as_me:2793: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2337,7 +2805,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" -echo "$as_me:2340: found $ac_dir/$ac_word" >&5 +echo "$as_me:2808: found $ac_dir/$ac_word" >&5 break done @@ -2345,10 +2813,10 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:2348: result: $AWK" >&5 + echo "$as_me:2816: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:2351: result: no" >&5 + echo "$as_me:2819: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2367,7 +2835,7 @@ done # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:2370: checking for a BSD compatible install" >&5 +echo "$as_me:2838: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then @@ -2416,7 +2884,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:2419: result: $INSTALL" >&5 +echo "$as_me:2887: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2427,14 +2895,14 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:2430: checking whether ln -s works" >&5 +echo "$as_me:2898: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:2434: result: yes" >&5 + echo "$as_me:2902: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2437: result: no, using $LN_S" >&5 + echo "$as_me:2905: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi @@ -2451,11 +2919,11 @@ _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed -for ac_prog in tdlint lint alint +for ac_prog in lint cppcheck splint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2458: checking for $ac_word" >&5 +echo "$as_me:2926: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2470,7 +2938,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" -echo "$as_me:2473: found $ac_dir/$ac_word" >&5 +echo "$as_me:2941: found $ac_dir/$ac_word" >&5 break done @@ -2478,27 +2946,84 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:2481: result: $LINT" >&5 + echo "$as_me:2949: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:2484: result: no" >&5 + echo "$as_me:2952: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done +case "x$LINT" in +(xcppcheck|x*/cppcheck) + test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" + ;; +esac + ### checks for compiler characteristics -cf_XOPEN_SOURCE=500 +echo "$as_me:2967: checking if the POSIX test-macros are already defined" >&5 +echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6 +if test "${cf_cv_posix_visible+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >"conftest.$ac_ext" <<_ACEOF +#line 2974 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + +#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ + && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ + && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ + && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) +#error conflicting symbols found +#endif + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2996: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:2999: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3002: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_posix_visible=no +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_posix_visible=yes +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:3013: result: $cf_cv_posix_visible" >&5 +echo "${ECHO_T}$cf_cv_posix_visible" >&6 + +if test "$cf_cv_posix_visible" = no; then + +cf_XOPEN_SOURCE=700 cf_POSIX_C_SOURCE=199506L cf_xopen_source= -case $host_os in +case "$host_os" in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; -(cygwin|msys) +(msys) cf_XOPEN_SOURCE=600 ;; (darwin[0-8].*) @@ -2508,7 +3033,7 @@ case $host_os in cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; -(freebsd*|dragonfly*) +(freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L @@ -2526,90 +3051,515 @@ case $host_os in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|gnu*|mint*|k*bsd*-gnu) +(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) -echo "$as_me:2531: checking if we must define _GNU_SOURCE" >&5 +cf_gnu_xopen_source=$cf_XOPEN_SOURCE + +echo "$as_me:3058: checking if this is the GNU C library" >&5 +echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6 +if test "${cf_cv_gnu_library+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >"conftest.$ac_ext" <<_ACEOF +#line 3065 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + + #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 + return 0; + #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 + return 0; + #else + # error not GNU C library + #endif + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3084: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3087: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3090: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3093: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_gnu_library=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_gnu_library=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:3104: result: $cf_cv_gnu_library" >&5 +echo "${ECHO_T}$cf_cv_gnu_library" >&6 + +if test x$cf_cv_gnu_library = xyes; then + + # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE + # was changed to help a little. newlib incorporated the change about 4 + # years later. + echo "$as_me:3112: checking if _DEFAULT_SOURCE can be used as a basis" >&5 +echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6 +if test "${cf_cv_gnu_library_219+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save="$CPPFLAGS" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3124 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) + return 0; + #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) + return 0; + #else + # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old + #endif + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3143: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3146: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3149: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3152: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_gnu_library_219=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_gnu_library_219=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + CPPFLAGS="$cf_save" + +fi +echo "$as_me:3164: result: $cf_cv_gnu_library_219" >&5 +echo "${ECHO_T}$cf_cv_gnu_library_219" >&6 + + if test "x$cf_cv_gnu_library_219" = xyes; then + cf_save="$CPPFLAGS" + echo "$as_me:3169: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5 +echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6 +if test "${cf_cv_gnu_dftsrc_219+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source +do +case "$cf_fix_cppflags" in +(no) + case "$cf_add_cflags" in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case "$cf_add_cflags" in + (-D*) + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case "$cf_add_cflags" in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3274 "configure" +#include "confdefs.h" + + #include + #include + +int +main (void) +{ + + #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) + return 0; + #else + # error GNU C library is too old + #endif + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3294: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3297: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3300: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3303: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_gnu_dftsrc_219=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_gnu_dftsrc_219=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:3314: result: $cf_cv_gnu_dftsrc_219" >&5 +echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6 + test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" + else + cf_cv_gnu_dftsrc_219=maybe + fi + + if test "x$cf_cv_gnu_dftsrc_219" != xyes; then + + echo "$as_me:3323: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 2538 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 3330 "configure" #include "confdefs.h" #include int -main () +main (void) { -#ifndef _XOPEN_SOURCE -make an error -#endif + #ifndef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be defined + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2553: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3345: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2556: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2559: \"$ac_try\"") >&5 + echo "$as_me:3348: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3351: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2562: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3354: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - cat >conftest.$ac_ext <<_ACEOF -#line 2571 "configure" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in -D_GNU_SOURCE +do +case "$cf_fix_cppflags" in +(no) + case "$cf_add_cflags" in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case "$cf_add_cflags" in + (-D*) + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case "$cf_add_cflags" in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3461 "configure" #include "confdefs.h" #include int -main () +main (void) { -#ifdef _XOPEN_SOURCE -make an error -#endif + #ifdef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be undefined + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2586: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3476: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2589: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2592: \"$ac_try\"") >&5 + echo "$as_me:3479: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3482: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2595: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3485: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_gnu_source=yes fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save" +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + CPPFLAGS="$cf_save" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:2610: result: $cf_cv_gnu_source" >&5 +echo "$as_me:3500: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 -test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + + if test "$cf_cv_gnu_source" = yes + then + echo "$as_me:3505: checking if we should also define _DEFAULT_SOURCE" >&5 +echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 +if test "${cf_cv_default_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE" + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3515 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + + #ifdef _DEFAULT_SOURCE + #error expected _DEFAULT_SOURCE to be undefined + #endif + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3530: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3533: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3536: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3539: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_default_source=no +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_default_source=yes +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:3550: result: $cf_cv_default_source" >&5 +echo "${ECHO_T}$cf_cv_default_source" >&6 + if test "$cf_cv_default_source" = yes + then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" + + fi + fi + fi + +fi ;; (minix*) @@ -2619,6 +3569,8 @@ test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" @@ -2632,20 +3584,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:2635: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:3587: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me:-configure}:2641: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:3593: testing if the symbol is already defined go no further ..." 1>&5 - cat >conftest.$ac_ext <<_ACEOF -#line 2644 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 3596 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -2655,22 +3607,22 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2659: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3611: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2662: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2665: \"$ac_try\"") >&5 + echo "$as_me:3614: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3617: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2668: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3620: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) @@ -2685,12 +3637,12 @@ cf_want_posix_source=no ;; esac if test "$cf_want_posix_source" = yes ; then - cat >conftest.$ac_ext <<_ACEOF -#line 2689 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 3641 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifdef _POSIX_SOURCE @@ -2700,40 +3652,43 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2704: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3656: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2707: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2710: \"$ac_try\"") >&5 + echo "$as_me:3659: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3662: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2713: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3665: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "${as_me:-configure}:2724: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:3676: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" -echo "${as_me:-configure}:2729: testing if the second compile does not leave our definition intact error ..." 1>&5 + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" - cat >conftest.$ac_ext <<_ACEOF -#line 2732 "configure" +echo "${as_me:-configure}:3684: testing if the second compile does not leave our definition intact error ..." 1>&5 + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3687 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -2743,33 +3698,33 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2747: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3702: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2750: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2753: \"$ac_try\"") >&5 + echo "$as_me:3705: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3708: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2756: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3711: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:2772: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:3727: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then @@ -2783,23 +3738,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -2808,7 +3769,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -2818,19 +3779,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -2841,26 +3810,43 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi +fi # cf_cv_posix_visible + ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; -(openbsd[4-9]*) +(openbsd[6-9]*) + # OpenBSD 6.x has broken locale support, both compile-time and runtime. + # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html + # Abusing the conformance level is a workaround. + { echo "$as_me:3844: WARNING: this system does not provide usable locale support" >&5 +echo "$as_me: WARNING: this system does not provide usable locale support" >&2;} + cf_xopen_source="-D_BSD_SOURCE" + cf_XOPEN_SOURCE=700 + ;; +(openbsd[4-5]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 @@ -2887,14 +3873,14 @@ fi ;; (*) -echo "$as_me:2890: checking if we should define _XOPEN_SOURCE" >&5 +echo "$as_me:3876: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 2897 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 3883 "configure" #include "confdefs.h" #include @@ -2902,7 +3888,7 @@ else #include int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -2912,26 +3898,29 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2916: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3902: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2919: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2922: \"$ac_try\"") >&5 + echo "$as_me:3905: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3908: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2925: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3911: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - cat >conftest.$ac_ext <<_ACEOF -#line 2934 "configure" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + + cat >"conftest.$ac_ext" <<_ACEOF +#line 3923 "configure" #include "confdefs.h" #include @@ -2939,7 +3928,7 @@ cf_save="$CPPFLAGS" #include int -main () +main (void) { #ifdef _XOPEN_SOURCE @@ -2949,32 +3938,32 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2953: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:3942: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2956: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2959: \"$ac_try\"") >&5 + echo "$as_me:3945: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:3948: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2962: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:3951: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:2977: result: $cf_cv_xopen_source" >&5 +echo "$as_me:3966: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -2989,30 +3978,62 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" +for cf_add_cflags in $cf_temp_xopen_source +do + case "x$cf_add_cflags" in + (x-[DU]*) + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CFLAGS" != "$cf_old_cflag" || break + + CFLAGS="$cf_old_cflag" +done + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CPPFLAGS" != "$cf_old_cflag" || break + + CPPFLAGS="$cf_old_cflag" +done + + ;; + esac + cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in $cf_temp_xopen_source +for cf_add_cflags in $cf_add_cflags do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3021,7 +4042,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -3031,19 +4052,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -3054,21 +4083,31 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi +done + +fi + +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" @@ -3082,20 +4121,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:3085: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:4124: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me:-configure}:3091: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:4130: testing if the symbol is already defined go no further ..." 1>&5 - cat >conftest.$ac_ext <<_ACEOF -#line 3094 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4133 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -3105,22 +4144,22 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3109: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4148: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3112: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3115: \"$ac_try\"") >&5 + echo "$as_me:4151: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4154: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3118: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4157: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) @@ -3135,12 +4174,12 @@ cf_want_posix_source=no ;; esac if test "$cf_want_posix_source" = yes ; then - cat >conftest.$ac_ext <<_ACEOF -#line 3139 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4178 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifdef _POSIX_SOURCE @@ -3150,40 +4189,43 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3154: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4193: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3157: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3160: \"$ac_try\"") >&5 + echo "$as_me:4196: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4199: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3163: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4202: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "${as_me:-configure}:3174: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:4213: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" -echo "${as_me:-configure}:3179: testing if the second compile does not leave our definition intact error ..." 1>&5 + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" - cat >conftest.$ac_ext <<_ACEOF -#line 3182 "configure" +echo "${as_me:-configure}:4221: testing if the second compile does not leave our definition intact error ..." 1>&5 + + cat >"conftest.$ac_ext" <<_ACEOF +#line 4224 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -3193,33 +4235,33 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3197: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4239: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3200: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3203: \"$ac_try\"") >&5 + echo "$as_me:4242: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4245: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3206: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4248: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:3222: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:4264: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then @@ -3233,23 +4275,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3258,7 +4306,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -3268,19 +4316,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -3291,50 +4347,96 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi +fi # cf_cv_posix_visible + ;; esac if test -n "$cf_xopen_source" ; then +for cf_add_cflags in $cf_xopen_source +do + case "x$cf_add_cflags" in + (x-[DU]*) + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CFLAGS" != "$cf_old_cflag" || break + test -n "$verbose" && echo " removing old option $cf_add_cflags from CFLAGS" 1>&6 + +echo "${as_me:-configure}:4390: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5 + + CFLAGS="$cf_old_cflag" +done + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CPPFLAGS" != "$cf_old_cflag" || break + test -n "$verbose" && echo " removing old option $cf_add_cflags from CPPFLAGS" 1>&6 + +echo "${as_me:-configure}:4402: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5 + + CPPFLAGS="$cf_old_cflag" +done + + ;; + esac + cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in $cf_xopen_source +for cf_add_cflags in $cf_add_cflags do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3343,7 +4445,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -3353,19 +4455,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -3377,38 +4487,46 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 -echo "${as_me:-configure}:3380: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 +echo "${as_me:-configure}:4490: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" - CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 -echo "${as_me:-configure}:3388: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 +echo "${as_me:-configure}:4500: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 -echo "${as_me:-configure}:3396: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 +echo "${as_me:-configure}:4510: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi +done + fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then - echo "$as_me:3404: checking if _XOPEN_SOURCE really is set" >&5 + echo "$as_me:4522: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -#line 3407 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4525 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -3418,35 +4536,35 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3422: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3425: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3428: \"$ac_try\"") >&5 + echo "$as_me:4543: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4546: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3431: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4549: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_XOPEN_SOURCE_set=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_XOPEN_SOURCE_set=no fi -rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:3440: result: $cf_XOPEN_SOURCE_set" >&5 +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + echo "$as_me:4558: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 - if test $cf_XOPEN_SOURCE_set = yes + if test "$cf_XOPEN_SOURCE_set" = yes then - cat >conftest.$ac_ext <<_ACEOF -#line 3445 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4563 "configure" #include "confdefs.h" #include int -main () +main (void) { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE @@ -3456,40 +4574,40 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3460: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4578: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3463: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3466: \"$ac_try\"") >&5 + echo "$as_me:4581: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4584: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3469: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4587: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_XOPEN_SOURCE_set_ok=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_XOPEN_SOURCE_set_ok=no fi -rm -f conftest.$ac_objext conftest.$ac_ext - if test $cf_XOPEN_SOURCE_set_ok = no +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + if test "$cf_XOPEN_SOURCE_set_ok" = no then - { echo "$as_me:3480: WARNING: _XOPEN_SOURCE is lower than requested" >&5 + { echo "$as_me:4598: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else -echo "$as_me:3485: checking if we should define _XOPEN_SOURCE" >&5 +echo "$as_me:4603: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 3492 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4610 "configure" #include "confdefs.h" #include @@ -3497,7 +4615,7 @@ else #include int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -3507,26 +4625,29 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3511: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4629: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3514: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3517: \"$ac_try\"") >&5 + echo "$as_me:4632: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4635: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3520: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4638: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - cat >conftest.$ac_ext <<_ACEOF -#line 3529 "configure" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + + cat >"conftest.$ac_ext" <<_ACEOF +#line 4650 "configure" #include "confdefs.h" #include @@ -3534,7 +4655,7 @@ cf_save="$CPPFLAGS" #include int -main () +main (void) { #ifdef _XOPEN_SOURCE @@ -3544,32 +4665,32 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3548: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4669: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3551: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3554: \"$ac_try\"") >&5 + echo "$as_me:4672: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4675: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3557: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4678: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:3572: result: $cf_cv_xopen_source" >&5 +echo "$as_me:4693: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -3584,30 +4705,62 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" +for cf_add_cflags in $cf_temp_xopen_source +do + case "x$cf_add_cflags" in + (x-[DU]*) + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CFLAGS" != "$cf_old_cflag" || break + + CFLAGS="$cf_old_cflag" +done + +cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` +while true +do + cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` + test "$CPPFLAGS" != "$cf_old_cflag" || break + + CPPFLAGS="$cf_old_cflag" +done + + ;; + esac + cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in $cf_temp_xopen_source +for cf_add_cflags in $cf_add_cflags do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3616,7 +4769,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -3626,19 +4779,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -3649,63 +4810,72 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi +done + fi fi fi +fi # cf_cv_posix_visible -echo "$as_me:3670: checking if SIGWINCH is defined" >&5 +echo "$as_me:4840: checking if SIGWINCH is defined" >&5 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6 if test "${cf_cv_define_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 3677 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4847 "configure" #include "confdefs.h" #include #include int -main () +main (void) { -int x = SIGWINCH +int x = SIGWINCH; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3692: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4862: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3695: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3698: \"$ac_try\"") >&5 + echo "$as_me:4865: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4868: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3701: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4871: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_define_sigwinch=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -#line 3708 "configure" +cat "conftest.$ac_ext" >&5 +cat >"conftest.$ac_ext" <<_ACEOF +#line 4878 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -3715,42 +4885,42 @@ cat >conftest.$ac_ext <<_ACEOF #include int -main () +main (void) { -int x = SIGWINCH +int x = SIGWINCH; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3726: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4896: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3729: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3732: \"$ac_try\"") >&5 + echo "$as_me:4899: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4902: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3735: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4905: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_define_sigwinch=maybe else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_define_sigwinch=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:3749: result: $cf_cv_define_sigwinch" >&5 +echo "$as_me:4919: result: $cf_cv_define_sigwinch" >&5 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6 if test "$cf_cv_define_sigwinch" = maybe ; then -echo "$as_me:3753: checking for actual SIGWINCH definition" >&5 +echo "$as_me:4923: checking for actual SIGWINCH definition" >&5 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6 if test "${cf_cv_fixup_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3758,10 +4928,10 @@ else cf_cv_fixup_sigwinch=unknown cf_sigwinch=32 -while test $cf_sigwinch != 1 +while test "$cf_sigwinch" != 1 do - cat >conftest.$ac_ext <<_ACEOF -#line 3764 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 4934 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -3771,42 +4941,42 @@ do #include int -main () +main (void) { #if SIGWINCH != $cf_sigwinch make an error #endif -int x = SIGWINCH +int x = SIGWINCH; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3786: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:4956: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3789: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3792: \"$ac_try\"") >&5 + echo "$as_me:4959: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:4962: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3795: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:4965: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" -cf_sigwinch=`expr $cf_sigwinch - 1` +cf_sigwinch="`expr "$cf_sigwinch" - 1`" done fi -echo "$as_me:3809: result: $cf_cv_fixup_sigwinch" >&5 +echo "$as_me:4979: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then @@ -3828,24 +4998,24 @@ wchar.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:3831: checking for $ac_header" >&5 +echo "$as_me:5001: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 3837 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5007 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:3841: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:5011: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3847: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:5017: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -3858,14 +5028,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:3866: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:5036: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:5046: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 3882 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5052 "configure" #include "confdefs.h" #include #include #include int -main () +main (void) { if ((struct tm *) 0) return 0; @@ -3894,27 +5064,27 @@ return 0; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3898: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5068: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3901: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3904: \"$ac_try\"") >&5 + echo "$as_me:5071: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5074: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3907: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5077: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_header_time=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:3917: result: $ac_cv_header_time" >&5 +echo "$as_me:5087: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -3924,57 +5094,57 @@ EOF fi - echo "$as_me:3927: checking for nl_langinfo and CODESET" >&5 +echo "$as_me:5097: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 3933 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5103 "configure" #include "confdefs.h" #include int -main () +main (void) { -char* cs = nl_langinfo(CODESET); +char* cs = nl_langinfo(CODESET); (void)cs ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3945: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:5115: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3948: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3951: \"$ac_try\"") >&5 + echo "$as_me:5118: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:5121: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3954: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5124: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 am_cv_langinfo_codeset=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:3965: result: $am_cv_langinfo_codeset" >&5 +echo "$as_me:5135: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 - if test $am_cv_langinfo_codeset = yes; then + if test "$am_cv_langinfo_codeset" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LANGINFO_CODESET 1 EOF - fi + fi ### checks for typedefs -echo "$as_me:3977: checking for signal global datatype" >&5 +echo "$as_me:5147: checking for signal global datatype" >&5 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6 if test "${cf_cv_sig_atomic_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3985,8 +5155,8 @@ else "sig_atomic_t" \ "int" do - cat >conftest.$ac_ext <<_ACEOF -#line 3989 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5159 "configure" #include "confdefs.h" #include @@ -3997,10 +5167,11 @@ extern $cf_type x; $cf_type x; static void handler(int sig) { + (void)sig; x = 5; } int -main () +main (void) { signal(SIGINT, handler); x = 1 @@ -4008,44 +5179,44 @@ signal(SIGINT, handler); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4012: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5183: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4015: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4018: \"$ac_try\"") >&5 + echo "$as_me:5186: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5189: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4021: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5192: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_sig_atomic_t=$cf_type else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_sig_atomic_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_sig_atomic_t" != no && break done fi -echo "$as_me:4035: result: $cf_cv_sig_atomic_t" >&5 +echo "$as_me:5206: result: $cf_cv_sig_atomic_t" >&5 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <&5 +echo "$as_me:5213: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4048 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5219 "configure" #include "confdefs.h" #include #include @@ -4053,14 +5224,14 @@ else #include _ACEOF -if { (eval echo "$as_me:4056: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:5227: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4062: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:5233: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -4073,21 +5244,21 @@ if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line 4084 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5255 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -4098,14 +5269,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line 4102 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5273 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -4119,8 +5290,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else - cat >conftest.$ac_ext <<_ACEOF -#line 4123 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5294 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -4135,7 +5306,7 @@ else #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main () +main (void) { int i; for (i = 0; i < 256; i++) @@ -4145,29 +5316,29 @@ main () $ac_main_return (0); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:4149: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:5320: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4152: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:4154: \"$ac_try\"") >&5 + echo "$as_me:5323: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:5325: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4157: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5328: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi fi fi -echo "$as_me:4170: result: $ac_cv_header_stdc" >&5 +echo "$as_me:5341: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -4183,40 +5354,40 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:4186: checking for $ac_header" >&5 +echo "$as_me:5357: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4192 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5363 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4198: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5369: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4201: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4204: \"$ac_try\"") >&5 + echo "$as_me:5372: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5375: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4207: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5378: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4217: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:5388: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:5398: checking for time_t" >&5 echo $ECHO_N "checking for time_t... $ECHO_C" >&6 if test "${ac_cv_type_time_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4233 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5404 "configure" #include "confdefs.h" $ac_includes_default int -main () +main (void) { if ((time_t *) 0) return 0; @@ -4244,29 +5415,29 @@ if (sizeof (time_t)) return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4248: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5419: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4251: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4254: \"$ac_try\"") >&5 + echo "$as_me:5422: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5425: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4257: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5428: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_type_time_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_type_time_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4267: result: $ac_cv_type_time_t" >&5 +echo "$as_me:5438: result: $ac_cv_type_time_t" >&5 echo "${ECHO_T}$ac_cv_type_time_t" >&6 -if test $ac_cv_type_time_t = yes; then +if test "$ac_cv_type_time_t" = yes; then : else @@ -4276,14 +5447,14 @@ EOF fi -echo "$as_me:4279: checking for cc_t in or " >&5 +echo "$as_me:5450: checking for cc_t in or " >&5 echo $ECHO_N "checking for cc_t in or ... $ECHO_C" >&6 if test "${cf_cv_type_cc_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4286 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5457 "configure" #include "confdefs.h" #include @@ -4295,53 +5466,53 @@ else #endif int -main () +main (void) { -cc_t x +cc_t x; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4306: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5477: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4309: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4312: \"$ac_try\"") >&5 + echo "$as_me:5480: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5483: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4315: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5486: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_type_cc_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_type_cc_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4327: result: $cf_cv_type_cc_t" >&5 +echo "$as_me:5498: result: $cf_cv_type_cc_t" >&5 echo "${ECHO_T}$cf_cv_type_cc_t" >&6 test $cf_cv_type_cc_t = no && cat >>confdefs.h <<\EOF #define cc_t unsigned char EOF -echo "$as_me:4334: checking for mode_t" >&5 +echo "$as_me:5505: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4340 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5511 "configure" #include "confdefs.h" $ac_includes_default int -main () +main (void) { if ((mode_t *) 0) return 0; @@ -4351,29 +5522,29 @@ if (sizeof (mode_t)) return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4355: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5526: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4358: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4361: \"$ac_try\"") >&5 + echo "$as_me:5529: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5532: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4364: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5535: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_type_mode_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4374: result: $ac_cv_type_mode_t" >&5 +echo "$as_me:5545: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 -if test $ac_cv_type_mode_t = yes; then +if test "$ac_cv_type_mode_t" = yes; then : else @@ -4383,17 +5554,17 @@ EOF fi -echo "$as_me:4386: checking for pid_t" >&5 +echo "$as_me:5557: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4392 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5563 "configure" #include "confdefs.h" $ac_includes_default int -main () +main (void) { if ((pid_t *) 0) return 0; @@ -4403,29 +5574,29 @@ if (sizeof (pid_t)) return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4407: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5578: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4410: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4413: \"$ac_try\"") >&5 + echo "$as_me:5581: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5584: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4416: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5587: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_type_pid_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4426: result: $ac_cv_type_pid_t" >&5 +echo "$as_me:5597: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then +if test "$ac_cv_type_pid_t" = yes; then : else @@ -4435,19 +5606,19 @@ EOF fi -echo "$as_me:4438: checking for uid_t in sys/types.h" >&5 +echo "$as_me:5609: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4444 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5615 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "uid_t" >/dev/null 2>&1; then + $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no @@ -4455,7 +5626,7 @@ fi rm -rf conftest* fi -echo "$as_me:4458: result: $ac_cv_type_uid_t" >&5 +echo "$as_me:5629: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then @@ -4469,17 +5640,17 @@ EOF fi -echo "$as_me:4472: checking for off_t" >&5 +echo "$as_me:5643: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4478 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5649 "configure" #include "confdefs.h" $ac_includes_default int -main () +main (void) { if ((off_t *) 0) return 0; @@ -4489,29 +5660,29 @@ if (sizeof (off_t)) return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4493: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5664: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4496: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4499: \"$ac_try\"") >&5 + echo "$as_me:5667: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5670: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4502: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5673: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_type_off_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4512: result: $ac_cv_type_off_t" >&5 +echo "$as_me:5683: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then +if test "$ac_cv_type_off_t" = yes; then : else @@ -4525,6 +5696,8 @@ fi for ac_func in \ gethostname \ + getusershell \ + endusershell \ getlogin \ initgroups \ mkdtemp \ @@ -4539,65 +5712,65 @@ for ac_func in \ wcwidth do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:4542: checking for $ac_func" >&5 +echo "$as_me:5715: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4548 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5721 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4579: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:5752: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4582: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4585: \"$ac_try\"") >&5 + echo "$as_me:5755: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:5758: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4588: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5761: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:4598: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:5771: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:5784: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4617 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5790 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:4621: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:5794: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4627: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:5800: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -4638,14 +5811,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:4646: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:5819: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:5829: checking for lastlog path" >&5 echo $ECHO_N "checking for lastlog path... $ECHO_C" >&6 if test "${cf_cv_path_lastlog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 4663 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 5836 "configure" #include "confdefs.h" #include @@ -4672,46 +5845,46 @@ cat >conftest.$ac_ext <<_ACEOF #endif #endif int -main () +main (void) { -char *path = _PATH_LASTLOG +char *path = _PATH_LASTLOG; (void)path ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4683: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5856: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4686: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4689: \"$ac_try\"") >&5 + echo "$as_me:5859: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5862: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4692: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5865: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_path_lastlog="_PATH_LASTLOG" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 if test -f /usr/adm/lastlog ; then cf_cv_path_lastlog=/usr/adm/lastlog else cf_cv_path_lastlog=no fi fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4707: result: $cf_cv_path_lastlog" >&5 +echo "$as_me:5880: result: $cf_cv_path_lastlog" >&5 echo "${ECHO_T}$cf_cv_path_lastlog" >&6 -test $cf_cv_path_lastlog != no && +test "$cf_cv_path_lastlog" != no && cat >>confdefs.h <<\EOF #define USE_LASTLOG 1 EOF -echo "$as_me:4714: checking for utmp implementation" >&5 +echo "$as_me:5887: checking for utmp implementation" >&5 echo $ECHO_N "checking for utmp implementation... $ECHO_C" >&6 if test "${cf_cv_have_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4727,197 +5900,207 @@ cf_utmp_includes=" #include /* may conflict with utmpx.h on Linux */ #endif " - cat >conftest.$ac_ext <<_ACEOF -#line 4731 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5904 "configure" #include "confdefs.h" $cf_utmp_includes int -main () +main (void) { struct $cf_header x; char *name = x.ut_name; /* utmp.h and compatible definitions */ + (void)x; + (void)name; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4745: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5920: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4748: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4751: \"$ac_try\"") >&5 + echo "$as_me:5923: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5926: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4754: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5929: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp=$cf_header break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 - cat >conftest.$ac_ext <<_ACEOF -#line 4763 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 5938 "configure" #include "confdefs.h" $cf_utmp_includes int -main () +main (void) { struct $cf_header x; char *name = x.ut_user; /* utmpx.h must declare this */ + (void)x; + (void)name; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4777: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:5954: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4780: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4783: \"$ac_try\"") >&5 + echo "$as_me:5957: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:5960: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4786: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:5963: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp=$cf_header break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi -echo "$as_me:4801: result: $cf_cv_have_utmp" >&5 +echo "$as_me:5978: result: $cf_cv_have_utmp" >&5 echo "${ECHO_T}$cf_cv_have_utmp" >&6 -if test $cf_cv_have_utmp != no ; then +if test "$cf_cv_have_utmp" != no ; then cat >>confdefs.h <<\EOF #define HAVE_UTMP 1 EOF - test $cf_cv_have_utmp = utmpx && + test "$cf_cv_have_utmp" = utmpx && cat >>confdefs.h <<\EOF #define UTMPX_FOR_UTMP 1 EOF -if test $cf_cv_have_utmp != no ; then -echo "$as_me:4816: checking if ${cf_cv_have_utmp}.ut_host is declared" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:5993: checking if ${cf_cv_have_utmp}.ut_host is declared" >&5 echo $ECHO_N "checking if ${cf_cv_have_utmp}.ut_host is declared... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4823 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6000 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; char *y = &x.ut_host[0] +struct $cf_cv_have_utmp x; + char *y = &x.ut_host[0]; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6017: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4840: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4843: \"$ac_try\"") >&5 + echo "$as_me:6020: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6023: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4846: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6026: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_host=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utmp_ut_host=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4858: result: $cf_cv_have_utmp_ut_host" >&5 +echo "$as_me:6038: result: $cf_cv_have_utmp_ut_host" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_host" >&6 -test $cf_cv_have_utmp_ut_host != no && +test "$cf_cv_have_utmp_ut_host" != no && cat >>confdefs.h <<\EOF #define HAVE_UTMP_UT_HOST 1 EOF fi -if test $cf_cv_have_utmp != no ; then -echo "$as_me:4868: checking if ${cf_cv_have_utmp}.ut_syslen is declared" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:6048: checking if ${cf_cv_have_utmp}.ut_syslen is declared" >&5 echo $ECHO_N "checking if ${cf_cv_have_utmp}.ut_syslen is declared... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_syslen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 4875 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6055 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; int y = x.ut_syslen +struct $cf_cv_have_utmp x; + int y = x.ut_syslen; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4889: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6072: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4892: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4895: \"$ac_try\"") >&5 + echo "$as_me:6075: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6078: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4898: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6081: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_syslen=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utmp_ut_syslen=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:4910: result: $cf_cv_have_utmp_ut_syslen" >&5 +echo "$as_me:6093: result: $cf_cv_have_utmp_ut_syslen" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_syslen" >&6 -test $cf_cv_have_utmp_ut_syslen != no && +test "$cf_cv_have_utmp_ut_syslen" != no && cat >>confdefs.h <<\EOF #define HAVE_UTMP_UT_SYSLEN 1 EOF fi -if test $cf_cv_have_utmp != no ; then -echo "$as_me:4920: checking if ${cf_cv_have_utmp}.ut_name is declared" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:6103: checking if ${cf_cv_have_utmp}.ut_name is declared" >&5 echo $ECHO_N "checking if ${cf_cv_have_utmp}.ut_name is declared... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4933,48 +6116,50 @@ cf_utmp_includes=" #endif " for cf_header in ut_name ut_user ; do - cat >conftest.$ac_ext <<_ACEOF -#line 4937 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6120 "configure" #include "confdefs.h" $cf_utmp_includes int -main () +main (void) { struct $cf_cv_have_utmp x; char *name = x.$cf_header; + (void)x; + (void)name; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4951: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6136: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4954: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4957: \"$ac_try\"") >&5 + echo "$as_me:6139: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6142: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4960: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6145: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_name=$cf_header break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi -echo "$as_me:4972: result: $cf_cv_have_utmp_ut_name" >&5 +echo "$as_me:6157: result: $cf_cv_have_utmp_ut_name" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_name" >&6 -case $cf_cv_have_utmp_ut_name in +case "$cf_cv_have_utmp_ut_name" in (no) - { { echo "$as_me:4977: error: Cannot find declaration for ut.ut_name" >&5 + { { echo "$as_me:6162: error: Cannot find declaration for ut.ut_name" >&5 echo "$as_me: error: Cannot find declaration for ut.ut_name" >&2;} { (exit 1); exit 1; }; } ;; @@ -4988,8 +6173,8 @@ EOF esac fi -if test $cf_cv_have_utmp != no ; then -echo "$as_me:4992: checking for exit-status in $cf_cv_have_utmp" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:6177: checking for exit-status in $cf_cv_have_utmp" >&5 echo $ECHO_N "checking for exit-status in $cf_cv_have_utmp... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_xstatus+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5001,46 +6186,49 @@ for cf_result in \ ut_exit.ut_e_exit \ ut_exit.ut_exit do -cat >conftest.$ac_ext <<_ACEOF -#line 5005 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 6190 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; long y = x.$cf_result = 0 +struct $cf_cv_have_utmp x; + long y = x.$cf_result = 0; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5019: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6207: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5022: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5025: \"$ac_try\"") >&5 + echo "$as_me:6210: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6213: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5028: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6216: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_xstatus=$cf_result break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utmp_ut_xstatus=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi -echo "$as_me:5041: result: $cf_cv_have_utmp_ut_xstatus" >&5 +echo "$as_me:6229: result: $cf_cv_have_utmp_ut_xstatus" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_xstatus" >&6 -if test $cf_cv_have_utmp_ut_xstatus != no ; then +if test "$cf_cv_have_utmp_ut_xstatus" != no ; then cat >>confdefs.h <<\EOF #define HAVE_UTMP_UT_XSTATUS 1 @@ -5053,90 +6241,96 @@ EOF fi fi -if test $cf_cv_have_utmp != no ; then -echo "$as_me:5057: checking if ${cf_cv_have_utmp}.ut_xtime is declared" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:6245: checking if ${cf_cv_have_utmp}.ut_xtime is declared" >&5 echo $ECHO_N "checking if ${cf_cv_have_utmp}.ut_xtime is declared... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_xtime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5064 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6252 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0 +struct $cf_cv_have_utmp x; + long y = x.ut_xtime = 0; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5078: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6269: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5081: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5084: \"$ac_try\"") >&5 + echo "$as_me:6272: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6275: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5087: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6278: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_xtime=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -#line 5094 "configure" +cat "conftest.$ac_ext" >&5 +cat >"conftest.$ac_ext" <<_ACEOF +#line 6285 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec +struct $cf_cv_have_utmp x; + long y = x.ut_tv.tv_sec; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5108: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6302: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5111: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5114: \"$ac_try\"") >&5 + echo "$as_me:6305: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6308: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5117: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6311: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_xtime=define else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utmp_ut_xtime=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:5131: result: $cf_cv_have_utmp_ut_xtime" >&5 +echo "$as_me:6325: result: $cf_cv_have_utmp_ut_xtime" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_xtime" >&6 -if test $cf_cv_have_utmp_ut_xtime != no ; then +if test "$cf_cv_have_utmp_ut_xtime" != no ; then cat >>confdefs.h <<\EOF #define HAVE_UTMP_UT_XTIME 1 EOF - if test $cf_cv_have_utmp_ut_xtime = define ; then + if test "$cf_cv_have_utmp_ut_xtime" = define ; then cat >>confdefs.h <<\EOF #define ut_xtime ut_tv.tv_sec @@ -5146,51 +6340,54 @@ EOF fi fi -if test $cf_cv_have_utmp != no ; then -echo "$as_me:5150: checking if ${cf_cv_have_utmp}.ut_session is declared" >&5 +if test "$cf_cv_have_utmp" != no ; then +echo "$as_me:6344: checking if ${cf_cv_have_utmp}.ut_session is declared" >&5 echo $ECHO_N "checking if ${cf_cv_have_utmp}.ut_session is declared... $ECHO_C" >&6 if test "${cf_cv_have_utmp_ut_session+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5157 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6351 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { -struct $cf_cv_have_utmp x; long y = x.ut_session +static struct $cf_cv_have_utmp x; + long y = x.ut_session; + (void)x; + (void)y ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5171: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6368: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5174: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5177: \"$ac_try\"") >&5 + echo "$as_me:6371: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6374: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5180: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6377: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utmp_ut_session=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utmp_ut_session=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:5191: result: $cf_cv_have_utmp_ut_session" >&5 +echo "$as_me:6388: result: $cf_cv_have_utmp_ut_session" >&5 echo "${ECHO_T}$cf_cv_have_utmp_ut_session" >&6 -if test $cf_cv_have_utmp_ut_session != no ; then +if test "$cf_cv_have_utmp_ut_session" != no ; then cat >>confdefs.h <<\EOF #define HAVE_UTMP_UT_SESSION 1 @@ -5199,21 +6396,21 @@ EOF fi fi -echo "$as_me:5202: checking if $cf_cv_have_utmp is SYSV flavor" >&5 +echo "$as_me:6399: checking if $cf_cv_have_utmp is SYSV flavor" >&5 echo $ECHO_N "checking if $cf_cv_have_utmp is SYSV flavor... $ECHO_C" >&6 if test "${cf_cv_sysv_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cf_cv_have_utmp" = "utmp" && cf_prefix="ut" || cf_prefix="utx" -cat >conftest.$ac_ext <<_ACEOF -#line 5210 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 6407 "configure" #include "confdefs.h" #include #include <${cf_cv_have_utmp}.h> int -main () +main (void) { struct $cf_cv_have_utmp x; @@ -5225,30 +6422,30 @@ struct $cf_cv_have_utmp x; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5229: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:6426: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5232: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5235: \"$ac_try\"") >&5 + echo "$as_me:6429: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:6432: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5238: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6435: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_sysv_utmp=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_sysv_utmp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:5249: result: $cf_cv_sysv_utmp" >&5 +echo "$as_me:6446: result: $cf_cv_sysv_utmp" >&5 echo "${ECHO_T}$cf_cv_sysv_utmp" >&6 -test $cf_cv_sysv_utmp = yes && +test "$cf_cv_sysv_utmp" = yes && cat >>confdefs.h <<\EOF #define USE_SYSV_UTMP 1 EOF @@ -5258,24 +6455,24 @@ fi for ac_header in lastlog.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5261: checking for $ac_header" >&5 +echo "$as_me:6458: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5267 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6464 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:5271: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:6468: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5277: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:6474: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -5288,14 +6485,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:5296: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:6493: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:6503: checking for struct lastlog" >&5 echo $ECHO_N "checking for struct lastlog... $ECHO_C" >&6 if test "${cf_cv_struct_lastlog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5313,44 +6510,44 @@ if test "$cross_compiling" = yes; then cf_cv_struct_lastlog=unknown else - cat >conftest.$ac_ext <<_ACEOF -#line 5317 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6514 "configure" #include "confdefs.h" #include #include #include -int main() +int main(void) { struct lastlog data; return (sizeof(data.ll_time) != sizeof(time_t)); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:5331: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:6528: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5334: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5336: \"$ac_try\"") >&5 + echo "$as_me:6531: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:6533: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5339: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6536: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_struct_lastlog=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_struct_lastlog=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi fi -echo "$as_me:5353: result: $cf_cv_struct_lastlog" >&5 +echo "$as_me:6550: result: $cf_cv_struct_lastlog" >&5 echo "${ECHO_T}$cf_cv_struct_lastlog" >&6 test $cf_cv_struct_lastlog != no && @@ -5363,24 +6560,24 @@ sys/param.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5366: checking for $ac_header" >&5 +echo "$as_me:6563: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5372 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6569 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:5376: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:6573: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5382: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:6579: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -5393,14 +6590,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:5401: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:6598: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:6608: checking if POSIX saved-ids are supported" >&5 echo $ECHO_N "checking if POSIX saved-ids are supported... $ECHO_C" >&6 if test "${cf_cv_posix_saved_ids+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 5418 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 6615 "configure" #include "confdefs.h" #include @@ -5424,12 +6621,14 @@ cat >conftest.$ac_ext <<_ACEOF #endif int -main () +main (void) { #if defined(_POSIX_SAVED_IDS) && (_POSIX_SAVED_IDS > 0) void *p = (void *) seteuid; int x = seteuid(geteuid()); + (void)p; + (void)x; #elif defined(BSD) && (BSD >= 199103) /* The BSD's may implement the runtime check - and it fails. * However, saved-ids work almost like POSIX (close enough for most uses). @@ -5442,68 +6641,69 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5446: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:6645: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5449: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5452: \"$ac_try\"") >&5 + echo "$as_me:6648: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:6651: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5455: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6654: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_posix_saved_ids=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 if test "$cross_compiling" = yes; then cf_cv_posix_saved_ids=unknown else - cat >conftest.$ac_ext <<_ACEOF -#line 5467 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6666 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include #endif #include -int main() +int main(void) { void *p = (void *) seteuid; long code = sysconf(_SC_SAVED_IDS); + (void)p; ${cf_cv_main_return:-return} ((code > 0) ? 0 : 1); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:5482: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:6682: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5485: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5487: \"$ac_try\"") >&5 + echo "$as_me:6685: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:6687: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5490: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6690: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_posix_saved_ids=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_posix_saved_ids=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:5506: result: $cf_cv_posix_saved_ids" >&5 +echo "$as_me:6706: result: $cf_cv_posix_saved_ids" >&5 echo "${ECHO_T}$cf_cv_posix_saved_ids" >&6 test "$cf_cv_posix_saved_ids" = yes && @@ -5529,24 +6729,82 @@ then fi test -z "$cf_TERMVAR" && cf_TERMVAR=vt100 -echo "$as_me:5532: checking if we want full tgetent function" >&5 +# BSD termcap used no header file +# SVr4 provided termcap prototypes as a legacy feature in term.h +# GNU termcap provided termcap prototypes in termcap.h +# ncurses provides termcap prototypes in both term.h and termcap.h +# +# The terminfo-based termcap interfaces do not provide a full tgetent (i.e., do +# not return the text of the termcap entry in the buffer), but as a special +# case, FreeBSD provides ncurses' termcap.h with a modified termcap reader that +# returns the termcap text. + +for ac_header in termcap.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:6745: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 6751 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:6755: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + $EGREP -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:6761: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat "conftest.$ac_ext" >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err "conftest.$ac_ext" +fi +echo "$as_me:6780: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then + cat >>confdefs.h <&5 echo $ECHO_N "checking if we want full tgetent function... $ECHO_C" >&6 # Check whether --enable-full-tgetent or --disable-full-tgetent was given. if test "${enable_full_tgetent+set}" = set; then enableval="$enable_full_tgetent" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then cf_full_tgetent=no - else - cf_full_tgetent=yes - fi + else + cf_full_tgetent=yes + fi else enableval=yes - cf_full_tgetent=yes + cf_full_tgetent=yes fi; -echo "$as_me:5549: result: $cf_full_tgetent" >&5 +echo "$as_me:6807: result: $cf_full_tgetent" >&5 echo "${ECHO_T}$cf_full_tgetent" >&6 if test "$cf_full_tgetent" = yes ; then @@ -5555,7 +6813,7 @@ else cf_test_message="tgetent" fi -echo "$as_me:5558: checking for $cf_test_message function" >&5 +echo "$as_me:6816: checking for $cf_test_message function" >&5 echo $ECHO_N "checking for $cf_test_message function... $ECHO_C" >&6 if test "${cf_cv_lib_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5572,52 +6830,55 @@ else fi for cf_termlib in '' $cf_TERMLIB ; do LIBS="$cf_save_LIBS" - test -n "$cf_termlib" && -cf_add_libs="-l$cf_termlib" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then + test -n "$cf_termlib" && { +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -l$cf_termlib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" - + } if test "$cross_compiling" = yes; then echo "cross-compiling, cannot verify if a termcap/tgetent is present in $cf_termlib" 1>&5 else - cat >conftest.$ac_ext <<_ACEOF -#line 5596 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6854 "configure" #include "confdefs.h" +#ifdef HAVE_TERMCAP_H +#include +#endif /* terminfo implementations ignore the buffer argument, making it useless for * the xterm application, which uses this information to make a new TERMCAP * environment variable. */ -int main() +int main(void) { char buffer[1024]; buffer[0] = 0; tgetent(buffer, "$cf_TERMVAR"); ${cf_cv_main_return:-return} ($cf_TERMTST); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:5611: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:6872: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5614: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5616: \"$ac_try\"") >&5 + echo "$as_me:6875: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:6877: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5619: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6880: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then echo "yes, there is a termcap/tgetent in $cf_termlib" 1>&5 if test -n "$cf_termlib" ; then cf_cv_lib_tgetent="-l$cf_termlib" @@ -5628,16 +6889,16 @@ if { (eval echo "$as_me:5611: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 echo "no, there is no termcap/tgetent in $cf_termlib" 1>&5 fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi done LIBS="$cf_save_LIBS" fi -echo "$as_me:5640: result: $cf_cv_lib_tgetent" >&5 +echo "$as_me:6901: result: $cf_cv_lib_tgetent" >&5 echo "${ECHO_T}$cf_cv_lib_tgetent" >&6 # If we found a working tgetent(), set LIBS and check for termcap.h. @@ -5645,35 +6906,36 @@ echo "${ECHO_T}$cf_cv_lib_tgetent" >&6 # not have side effects other than setting the cache variable, because # they are not executed when a cached value exists.) if test "x$cf_cv_lib_tgetent" != xno ; then - test "x$cf_cv_lib_tgetent" != xyes && -cf_add_libs="$cf_cv_lib_tgetent" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then + test "x$cf_cv_lib_tgetent" != xyes && { +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_cv_lib_tgetent; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" + } cat >>confdefs.h <<\EOF #define USE_TERMCAP 1 EOF if test "$cf_full_tgetent" = no ; then - cat >conftest.$ac_ext <<_ACEOF -#line 5671 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6933 "configure" #include "confdefs.h" #include int -main () +main (void) { #ifdef NCURSES_VERSION @@ -5683,50 +6945,50 @@ make an error return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5687: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:6949: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5690: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5693: \"$ac_try\"") >&5 + echo "$as_me:6952: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:6955: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5696: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:6958: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cat >>confdefs.h <<\EOF #define HAVE_TERMCAP_H 1 EOF else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" else for ac_header in termcap.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5712: checking for $ac_header" >&5 +echo "$as_me:6974: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5718 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 6980 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:5722: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:6984: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5728: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:6990: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -5739,14 +7001,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:5747: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:7009: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 + echo "$as_me:7026: checking for partial tgetent function" >&5 echo $ECHO_N "checking for partial tgetent function... $ECHO_C" >&6 if test "${cf_cv_lib_part_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5770,84 +7032,84 @@ else cf_cv_lib_part_tgetent=no for cf_termlib in $cf_TERMLIB ; do LIBS="$cf_save_LIBS -l$cf_termlib" - cat >conftest.$ac_ext <<_ACEOF -#line 5774 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 7036 "configure" #include "confdefs.h" int -main () +main (void) { tgetent(0, "$cf_TERMVAR") ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5786: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:7048: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5789: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5792: \"$ac_try\"") >&5 + echo "$as_me:7051: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:7054: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5795: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:7057: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then echo "there is a terminfo/tgetent in $cf_termlib" 1>&5 cf_cv_lib_part_tgetent="-l$cf_termlib" break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" done LIBS="$cf_save_LIBS" fi -echo "$as_me:5809: result: $cf_cv_lib_part_tgetent" >&5 +echo "$as_me:7071: result: $cf_cv_lib_part_tgetent" >&5 echo "${ECHO_T}$cf_cv_lib_part_tgetent" >&6 if test "$cf_cv_lib_part_tgetent" != no ; then -cf_add_libs="$cf_cv_lib_part_tgetent" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_cv_lib_part_tgetent; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" for ac_header in termcap.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5833: checking for $ac_header" >&5 +echo "$as_me:7095: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 5839 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 7101 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:5843: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:7105: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5849: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:7111: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -5860,14 +7122,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:5868: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:7130: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:7150: checking for X applications class" >&5 echo $ECHO_N "checking for X applications class... $ECHO_C" >&6 # Check whether --with-app-class or --without-app-class was given. @@ -5898,23 +7160,23 @@ fi; case x$APP_CLASS in (*[/@,%]*) - { echo "$as_me:5901: WARNING: X applications class cannot contain punctuation" >&5 + { echo "$as_me:7163: WARNING: X applications class cannot contain punctuation" >&5 echo "$as_me: WARNING: X applications class cannot contain punctuation" >&2;} APP_CLASS=XTerm ;; (x[A-Z]*) ;; (*) - { echo "$as_me:5908: WARNING: X applications class must start with capital, ignoring $APP_CLASS" >&5 + { echo "$as_me:7170: WARNING: X applications class must start with capital, ignoring $APP_CLASS" >&5 echo "$as_me: WARNING: X applications class must start with capital, ignoring $APP_CLASS" >&2;} APP_CLASS=XTerm ;; esac -echo "$as_me:5914: result: $APP_CLASS" >&5 +echo "$as_me:7176: result: $APP_CLASS" >&5 echo "${ECHO_T}$APP_CLASS" >&6 -echo "$as_me:5917: checking for directory to install resource files" >&5 +echo "$as_me:7179: checking for directory to install resource files" >&5 echo $ECHO_N "checking for directory to install resource files... $ECHO_C" >&6 # Check whether --with-app-defaults or --without-app-defaults was given. @@ -5954,39 +7216,39 @@ else cf_path=$APPSDIR if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_path" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_path="$cf_path" - case ".$cf_path" in - (.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_path="$cf_path" + case ".$cf_path" in + (.NONE/*) + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - { { echo "$as_me:5981: error: expected a pathname, not \"$cf_path\"" >&5 + { { echo "$as_me:7243: error: expected a pathname, not \"$cf_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac fi -echo "$as_me:5989: result: $APPSDIR" >&5 +echo "$as_me:7251: result: $APPSDIR" >&5 echo "${ECHO_T}$APPSDIR" >&6 no_appsdir= @@ -5997,7 +7259,7 @@ else EXTRA_INSTALL_DIRS="$EXTRA_INSTALL_DIRS \$(APPSDIR)" fi -echo "$as_me:6000: checking for the icon name" >&5 +echo "$as_me:7262: checking for the icon name" >&5 echo $ECHO_N "checking for the icon name... $ECHO_C" >&6 # Check whether --with-icon-name or --without-icon-name was given. @@ -6005,18 +7267,18 @@ if test "${with_icon_name+set}" = set; then withval="$with_icon_name" ICON_NAME="$withval" else - ICON_NAME=xterm-color + ICON_NAME=mini.xterm fi; case "x$ICON_NAME" in (xyes|xno|x) - ICON_NAME=xterm-color + ICON_NAME=mini.xterm ;; esac -echo "$as_me:6016: result: $ICON_NAME" >&5 +echo "$as_me:7278: result: $ICON_NAME" >&5 echo "${ECHO_T}$ICON_NAME" >&6 -echo "$as_me:6019: checking for icon symlink to use" >&5 +echo "$as_me:7281: checking for icon symlink to use" >&5 echo $ECHO_N "checking for icon symlink to use... $ECHO_C" >&6 # Check whether --with-icon-symlink or --without-icon-symlink was given. @@ -6035,10 +7297,36 @@ case "x$ICON_SYMLINK" in ;; esac -echo "$as_me:6038: result: $ICON_SYMLINK" >&5 +echo "$as_me:7300: result: $ICON_SYMLINK" >&5 echo "${ECHO_T}$ICON_SYMLINK" >&6 -echo "$as_me:6041: checking for directory to install pixmaps" >&5 +# Install all icons except for the overused "terminal". +cf_cv_icon_list= +for my_item in $srcdir/icons/*.svg +do + test -f "$my_item" || continue + cf_icon_name=`echo "$my_item" |sed -e "s,.svg,," -e "s,^$srcdir/,,"` + case $cf_icon_name in + (*_48x48) + continue + ;; + esac + test -n "$verbose" && echo " adding $cf_icon_name to icon-list" 1>&6 + +echo "${as_me:-configure}:7316: testing adding $cf_icon_name to icon-list ..." 1>&5 + + cf_cv_icon_list="$cf_cv_icon_list $cf_icon_name" + if test -f "${cf_icon_name}_48x48.png" + then + test -n "$verbose" && echo " adding ${cf_icon_name}_48x48 to icon-list" 1>&6 + +echo "${as_me:-configure}:7323: testing adding ${cf_icon_name}_48x48 to icon-list ..." 1>&5 + + cf_cv_icon_list="$cf_cv_icon_list ${cf_icon_name}_48x48" + fi +done + +echo "$as_me:7329: checking for directory to install pixmaps" >&5 echo $ECHO_N "checking for directory to install pixmaps... $ECHO_C" >&6 # Check whether --with-pixmapdir or --without-pixmapdir was given. @@ -6065,38 +7353,38 @@ else cf_path=$PIXMAPDIR if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_path" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_path="$cf_path" - case ".$cf_path" in - (.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_path="$cf_path" + case ".$cf_path" in + (.NONE/*) + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - { { echo "$as_me:6092: error: expected a pathname, not \"$cf_path\"" >&5 + { { echo "$as_me:7380: error: expected a pathname, not \"$cf_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac fi -echo "$as_me:6099: result: $PIXMAPDIR" >&5 +echo "$as_me:7387: result: $PIXMAPDIR" >&5 echo "${ECHO_T}$PIXMAPDIR" >&6 no_pixmapdir= @@ -6107,7 +7395,7 @@ else EXTRA_INSTALL_DIRS="$EXTRA_INSTALL_DIRS \$(PIXMAPDIR)" fi -echo "$as_me:6110: checking for directory to install icons" >&5 +echo "$as_me:7398: checking for directory to install icons" >&5 echo $ECHO_N "checking for directory to install icons... $ECHO_C" >&6 # Check whether --with-icondir or --without-icondir was given. @@ -6134,38 +7422,38 @@ else cf_path=$ICONDIR if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_path" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_path="$cf_path" - case ".$cf_path" in - (.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_path="$cf_path" + case ".$cf_path" in + (.NONE/*) + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - { { echo "$as_me:6161: error: expected a pathname, not \"$cf_path\"" >&5 + { { echo "$as_me:7449: error: expected a pathname, not \"$cf_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac fi -echo "$as_me:6168: result: $ICONDIR" >&5 +echo "$as_me:7456: result: $ICONDIR" >&5 echo "${ECHO_T}$ICONDIR" >&6 no_icondir= @@ -6176,7 +7464,7 @@ else EXTRA_INSTALL_DIRS="$EXTRA_INSTALL_DIRS \$(ICONDIR)" fi -echo "$as_me:6179: checking if icon theme should be used" >&5 +echo "$as_me:7467: checking if icon theme should be used" >&5 echo $ECHO_N "checking if icon theme should be used... $ECHO_C" >&6 # Check whether --with-icon-theme or --without-icon-theme was given. @@ -6194,7 +7482,7 @@ case "x$ICON_THEME" in ICON_THEME=hicolor ;; esac -echo "$as_me:6197: result: $ICON_THEME" >&5 +echo "$as_me:7485: result: $ICON_THEME" >&5 echo "${ECHO_T}$ICON_THEME" >&6 if test "x$ICON_THEME" = xno @@ -6203,14 +7491,14 @@ then then test -n "$verbose" && echo " ignoring icondir without theme" 1>&6 -echo "${as_me:-configure}:6206: testing ignoring icondir without theme ..." 1>&5 +echo "${as_me:-configure}:7494: testing ignoring icondir without theme ..." 1>&5 no_icondir="#" fi else if test "x$ICONDIR" = xno then - { { echo "$as_me:6213: error: icondir must be set for icon theme" >&5 + { { echo "$as_me:7501: error: icondir must be set for icon theme" >&5 echo "$as_me: error: icondir must be set for icon theme" >&2;} { (exit 1); exit 1; }; } fi @@ -6218,23 +7506,22 @@ fi : ${ICON_FORMAT:=".svg .png .xpm"} -# ICON_NAME= ICON_LIST= if test "x$ICON_THEME" != xno then - cf_icon_list="icons/$ICON_NAME icons/${ICON_NAME}_48x48" + cf_icon_list="$cf_cv_icon_list" else cf_icon_list="icons/${ICON_NAME}_48x48" fi -echo "$as_me:6231: checking for icon(s) to install" >&5 +echo "$as_me:7518: checking for icon(s) to install" >&5 echo $ECHO_N "checking for icon(s) to install... $ECHO_C" >&6 for cf_name in $cf_icon_list do test -n "$verbose" && echo " using $ICON_FORMAT" 1>&6 -echo "${as_me:-configure}:6237: testing using $ICON_FORMAT ..." 1>&5 +echo "${as_me:-configure}:7524: testing using $ICON_FORMAT ..." 1>&5 for cf_suffix in $ICON_FORMAT do @@ -6256,7 +7543,7 @@ echo "${as_me:-configure}:6237: testing using $ICON_FORMAT ..." 1>&5 fi if test "x$ICON_THEME" != xno then - cf_base=`basename $cf_left` + cf_base=`basename "$cf_left"` cf_trim=`echo "$cf_base" | sed -e 's/_[0-9][0-9]x[0-9][0-9]\././'` case "x${cf_base}" in (*:*) @@ -6267,7 +7554,7 @@ echo "${as_me:-configure}:6237: testing using $ICON_FORMAT ..." 1>&5 cf_size=`file "$cf_left"|sed -e 's/^[^:]*://' -e 's/^.*[^0-9]\([0-9][0-9]* x [0-9][0-9]*\)[^0-9].*$/\1/' -e 's/ //g'` if test -z "$cf_size" then - { echo "$as_me:6270: WARNING: cannot determine size of $cf_left" >&5 + { echo "$as_me:7557: WARNING: cannot determine size of $cf_left" >&5 echo "$as_me: WARNING: cannot determine size of $cf_left" >&2;} continue fi @@ -6279,7 +7566,7 @@ echo "$as_me: WARNING: cannot determine size of $cf_left" >&2;} (*.xpm) test -n "$verbose" && echo " ignored XPM file in icon theme" 1>&6 -echo "${as_me:-configure}:6282: testing ignored XPM file in icon theme ..." 1>&5 +echo "${as_me:-configure}:7569: testing ignored XPM file in icon theme ..." 1>&5 continue ;; @@ -6291,7 +7578,7 @@ echo "${as_me:-configure}:6282: testing ignored XPM file in icon theme ..." 1>&5 esac test -n "$verbose" && echo " adding $cf_next" 1>&6 -echo "${as_me:-configure}:6294: testing adding $cf_next ..." 1>&5 +echo "${as_me:-configure}:7581: testing adding $cf_next ..." 1>&5 cf_icon="${cf_icon}:${cf_next}" fi @@ -6299,57 +7586,57 @@ echo "${as_me:-configure}:6294: testing adding $cf_next ..." 1>&5 ICON_LIST="$ICON_LIST${cf_icon}" if test -z "$ICON_NAME" then - ICON_NAME=`basename $cf_icon | sed -e 's/[.:].*//'` + ICON_NAME=`basename "$cf_icon" | sed -e 's/[.:].*//'` fi done done if test -n "$verbose" then - echo "$as_me:6309: checking result" >&5 + echo "$as_me:7596: checking result" >&5 echo $ECHO_N "checking result... $ECHO_C" >&6 fi -echo "$as_me:6312: result: $ICON_LIST" >&5 +echo "$as_me:7599: result: $ICON_LIST" >&5 echo "${ECHO_T}$ICON_LIST" >&6 if test -z "$ICON_LIST" then - { { echo "$as_me:6317: error: no icons found" >&5 + { { echo "$as_me:7604: error: no icons found" >&5 echo "$as_me: error: no icons found" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:6322: checking for icon name" >&5 +echo "$as_me:7609: checking for icon name" >&5 echo $ECHO_N "checking for icon name... $ECHO_C" >&6 -echo "$as_me:6324: result: $ICON_NAME" >&5 +echo "$as_me:7611: result: $ICON_NAME" >&5 echo "${ECHO_T}$ICON_NAME" >&6 # Comment-out the install-desktop rule if the desktop-utils are not found. -echo "$as_me:6328: checking if you want to install desktop files" >&5 +echo "$as_me:7615: checking if you want to install desktop files" >&5 echo $ECHO_N "checking if you want to install desktop files... $ECHO_C" >&6 # Check whether --enable-desktop or --disable-desktop was given. if test "${enable_desktop+set}" = set; then enableval="$enable_desktop" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_desktop=$enableval - else - enable_desktop=$enableval - fi + else + enable_desktop=$enableval + fi else enableval=yes - enable_desktop=$enableval + enable_desktop=$enableval fi; -echo "$as_me:6345: result: $enable_desktop" >&5 +echo "$as_me:7632: result: $enable_desktop" >&5 echo "${ECHO_T}$enable_desktop" >&6 desktop_utils= if test "$enable_desktop" = yes ; then # Extract the first word of "desktop-file-install", so it can be a program name with args. set dummy desktop-file-install; ac_word=$2 -echo "$as_me:6352: checking for $ac_word" >&5 +echo "$as_me:7639: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_desktop_utils+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6364,7 +7651,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_desktop_utils="yes" -echo "$as_me:6367: found $ac_dir/$ac_word" >&5 +echo "$as_me:7654: found $ac_dir/$ac_word" >&5 break done @@ -6373,10 +7660,10 @@ fi fi desktop_utils=$ac_cv_prog_desktop_utils if test -n "$desktop_utils"; then - echo "$as_me:6376: result: $desktop_utils" >&5 + echo "$as_me:7663: result: $desktop_utils" >&5 echo "${ECHO_T}$desktop_utils" >&6 else - echo "$as_me:6379: result: no" >&5 + echo "$as_me:7666: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -6386,7 +7673,7 @@ test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#" if test -z "$desktop_utils" then - echo "$as_me:6389: checking for requested desktop-category" >&5 + echo "$as_me:7676: checking for requested desktop-category" >&5 echo $ECHO_N "checking for requested desktop-category... $ECHO_C" >&6 # Check whether --with-desktop-category or --without-desktop-category was given. @@ -6396,7 +7683,7 @@ if test "${with_desktop_category+set}" = set; then else cf_desktop_want=auto fi; - echo "$as_me:6399: result: $cf_desktop_want" >&5 + echo "$as_me:7686: result: $cf_desktop_want" >&5 echo "${ECHO_T}$cf_desktop_want" >&6 if test "$cf_desktop_want" = auto @@ -6414,14 +7701,14 @@ echo "${ECHO_T}$cf_desktop_want" >&6 do read cf_desktop_path test -z "$cf_desktop_path" && break - cf_desktop_name=`basename $cf_desktop_path .desktop` + cf_desktop_name=`basename "$cf_desktop_path" .desktop` case $cf_desktop_name in - (xterm|*-xterm|*rxvt*|konsole|*-terminal) + (xterm|*-xterm|*rxvt*|*konsole|*[Tt]erminal) test -n "$verbose" && echo " inspect $cf_desktop_path" 1>&6 -echo "${as_me:-configure}:6422: testing inspect $cf_desktop_path ..." 1>&5 +echo "${as_me:-configure}:7709: testing inspect $cf_desktop_path ..." 1>&5 - egrep '^Categories=' $cf_desktop_path | \ + ${EGREP-egrep} '^Categories=' "$cf_desktop_path" | \ tr ';' '\n' | \ sed -e 's%^.*=%%' -e '/^$/d' >>conftest.1 ;; @@ -6437,16 +7724,34 @@ echo "${as_me:-configure}:6422: testing inspect $cf_desktop_path ..." 1>&5 do read cf_desktop_this test -z "$cf_desktop_this" && break - case $cf_desktop_this in - (Qt*|GTK*|KDE*|GNOME*|*XFCE*|*Xfce*) + if test -s conftest.2 + then + grep -w "$cf_desktop_this" conftest.2 >/dev/null && continue + elif test -s conftest.3 + then + grep -w "$cf_desktop_this" conftest.3 >/dev/null && continue + fi + case "$cf_desktop_this" in + (-*) ;; - (System|TerminalEmulator|Utility|*) - test "x$cf_desktop_last" != "x$cf_desktop_this" && echo $cf_desktop_this >>conftest.2 + (Qt*|*Xfce*|*[ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + test -n "$verbose" && echo " ignored $cf_desktop_this" 1>&6 + +echo "${as_me:-configure}:7740: testing ignored $cf_desktop_this ..." 1>&5 + + echo "$cf_desktop_this" >> conftest.3 + ;; + (System|TerminalEmulator|*) + test -n "$verbose" && echo " applied $cf_desktop_this" 1>&6 + +echo "${as_me:-configure}:7747: testing applied $cf_desktop_this ..." 1>&5 + + test "x$cf_desktop_last" != "x$cf_desktop_this" && echo "$cf_desktop_this" >>conftest.2 ;; esac cf_desktop_last=$cf_desktop_this done - cf_desktop_want=`cat conftest.2 | tr '\n' ';'` + cf_desktop_want="`tr '\n' ';' < conftest.2`" fi if test -n "$cf_desktop_want" then @@ -6463,21 +7768,21 @@ echo "${as_me:-configure}:6422: testing inspect $cf_desktop_path ..." 1>&5 fi if test -z "$cf_desktop_want" then - cf_desktop_want="`echo "System|TerminalEmulator|Utility|*" | sed -e 's/\*//g' -e 's/|/;/g' -e 's/;*$/;/g'`" + cf_desktop_want="`echo "System|TerminalEmulator|*" | sed -e 's/\*//g' -e 's/|/;/g' -e 's/;*$/;/g'`" test -n "$verbose" && echo " no usable value found for desktop category" 1>&6 -echo "${as_me:-configure}:6469: testing no usable value found for desktop category ..." 1>&5 +echo "${as_me:-configure}:7774: testing no usable value found for desktop category ..." 1>&5 fi fi DESKTOP_CATEGORY=`echo "$cf_desktop_want" | sed -e 's/[ ,]/;/g'` test -n "$verbose" && echo " will use Categories=$DESKTOP_CATEGORY" 1>&6 -echo "${as_me:-configure}:6476: testing will use Categories=$DESKTOP_CATEGORY ..." 1>&5 +echo "${as_me:-configure}:7781: testing will use Categories=$DESKTOP_CATEGORY ..." 1>&5 fi -echo "$as_me:6480: checking for install-permissions reference" >&5 +echo "$as_me:7785: checking for install-permissions reference" >&5 echo $ECHO_N "checking for install-permissions reference... $ECHO_C" >&6 # Check whether --with-reference or --without-reference was given. @@ -6487,27 +7792,27 @@ if test "${with_reference+set}" = set; then else with_reference=xterm fi; -echo "$as_me:6490: result: $with_reference" >&5 +echo "$as_me:7795: result: $with_reference" >&5 echo "${ECHO_T}$with_reference" >&6 with_full_paths=yes - echo "$as_me:6495: checking for PATH separator" >&5 + echo "$as_me:7800: checking for PATH separator" >&5 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6 - case $cf_cv_system_name in + case "$cf_cv_system_name" in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac - echo "$as_me:6502: result: $PATH_SEPARATOR" >&5 + echo "$as_me:7807: result: $PATH_SEPARATOR" >&5 echo "${ECHO_T}$PATH_SEPARATOR" >&6 -test -z "$XTERM_PATH" && XTERM_PATH=$with_reference +test -z "$XTERM_PATH" && XTERM_PATH="$with_reference" for ac_prog in $XTERM_PATH $with_reference do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:6510: checking for $ac_word" >&5 +echo "$as_me:7815: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XTERM_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6524,7 +7829,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_XTERM_PATH="$ac_dir/$ac_word" - echo "$as_me:6527: found $ac_dir/$ac_word" >&5 + echo "$as_me:7832: found $ac_dir/$ac_word" >&5 break fi done @@ -6535,10 +7840,10 @@ fi XTERM_PATH=$ac_cv_path_XTERM_PATH if test -n "$XTERM_PATH"; then - echo "$as_me:6538: result: $XTERM_PATH" >&5 + echo "$as_me:7843: result: $XTERM_PATH" >&5 echo "${ECHO_T}$XTERM_PATH" >&6 else - echo "$as_me:6541: result: no" >&5 + echo "$as_me:7846: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -6555,37 +7860,37 @@ do if test "$with_full_paths" = yes ; then if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_temp" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_temp="$cf_temp" - case ".$cf_temp" in - (.NONE/*) - cf_temp=`echo $cf_temp | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_temp="$cf_temp" + case ".$cf_temp" in + (.NONE/*) + cf_temp=`echo "$cf_temp" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_temp=`echo $cf_temp | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_temp=`echo "$cf_temp" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - break - ;; + break + ;; esac cf_path_prog="$cf_temp" else - cf_path_prog="`basename $cf_temp`" + cf_path_prog="`basename "$cf_temp"`" fi elif test -z "$cf_path_args" ; then cf_path_args="$cf_temp" @@ -6597,7 +7902,7 @@ IFS="$cf_save_ifs" if test -n "$cf_path_prog" ; then -echo "${as_me:-configure}:6600: testing defining path for ${cf_path_prog} ..." 1>&5 +echo "${as_me:-configure}:7905: testing defining path for ${cf_path_prog} ..." 1>&5 cat >>confdefs.h <&5 +echo "$as_me:7926: checking for symbolic link to create to $cf_name" >&5 echo $ECHO_N "checking for symbolic link to create to $cf_name... $ECHO_C" >&6 # Check whether --with-xterm-symlink or --without-xterm-symlink was given. @@ -6628,76 +7933,76 @@ if test "${with_xterm_symlink+set}" = set; then else with_symlink=xterm fi; -echo "$as_me:6631: result: $with_symlink" >&5 +echo "$as_me:7936: result: $with_symlink" >&5 echo "${ECHO_T}$with_symlink" >&6 test "$with_symlink" = yes && with_symlink=xterm test -n "$with_symlink" && \ test "$with_symlink" != no && \ - test "$with_symlink" != $cf_name && \ + test "$with_symlink" != "$cf_name" && \ XTERM_SYMLINK="$with_symlink" fi -echo "$as_me:6640: checking if you want to disable openpty" >&5 +echo "$as_me:7945: checking if you want to disable openpty" >&5 echo $ECHO_N "checking if you want to disable openpty... $ECHO_C" >&6 # Check whether --enable-openpty or --disable-openpty was given. if test "${enable_openpty+set}" = set; then enableval="$enable_openpty" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then disable_openpty=yes - else - disable_openpty=no - fi + else + disable_openpty=no + fi else enableval=yes - disable_openpty=no + disable_openpty=no fi; -echo "$as_me:6657: result: $disable_openpty" >&5 +echo "$as_me:7962: result: $disable_openpty" >&5 echo "${ECHO_T}$disable_openpty" >&6 -echo "$as_me:6660: checking if you want to disable setuid" >&5 +echo "$as_me:7965: checking if you want to disable setuid" >&5 echo $ECHO_N "checking if you want to disable setuid... $ECHO_C" >&6 # Check whether --enable-setuid or --disable-setuid was given. if test "${enable_setuid+set}" = set; then enableval="$enable_setuid" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then disable_setuid=yes - else - disable_setuid=no - fi + else + disable_setuid=no + fi else enableval=yes - disable_setuid=no + disable_setuid=no fi; -echo "$as_me:6677: result: $disable_setuid" >&5 +echo "$as_me:7982: result: $disable_setuid" >&5 echo "${ECHO_T}$disable_setuid" >&6 -echo "$as_me:6680: checking if you want to disable setgid" >&5 +echo "$as_me:7985: checking if you want to disable setgid" >&5 echo $ECHO_N "checking if you want to disable setgid... $ECHO_C" >&6 # Check whether --enable-setgid or --disable-setgid was given. if test "${enable_setgid+set}" = set; then enableval="$enable_setgid" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then disable_setgid=yes - else - disable_setgid=no - fi + else + disable_setgid=no + fi else enableval=yes - disable_setgid=no + disable_setgid=no fi; -echo "$as_me:6697: result: $disable_setgid" >&5 +echo "$as_me:8002: result: $disable_setgid" >&5 echo "${ECHO_T}$disable_setgid" >&6 -echo "$as_me:6700: checking if you want to run xterm setuid to a given user" >&5 +echo "$as_me:8005: checking if you want to run xterm setuid to a given user" >&5 echo $ECHO_N "checking if you want to run xterm setuid to a given user... $ECHO_C" >&6 # Check whether --with-setuid or --without-setuid was given. @@ -6707,7 +8012,7 @@ if test "${with_setuid+set}" = set; then else use_given_setuid=no fi; -echo "$as_me:6710: result: $use_given_setuid" >&5 +echo "$as_me:8015: result: $use_given_setuid" >&5 echo "${ECHO_T}$use_given_setuid" >&6 if test "$use_given_setuid" != no ; then @@ -6720,7 +8025,7 @@ if test "$use_given_setuid" != no ; then SINSTALL_OPTS="$SINSTALL_OPTS u+s -u $cf_cv_given_setuid" fi -echo "$as_me:6723: checking if you want to run xterm setgid to match utmp/utmpx file" >&5 +echo "$as_me:8028: checking if you want to run xterm setgid to match utmp/utmpx file" >&5 echo $ECHO_N "checking if you want to run xterm setgid to match utmp/utmpx file... $ECHO_C" >&6 # Check whether --with-utmp-setgid or --without-utmp-setgid was given. @@ -6730,14 +8035,14 @@ if test "${with_utmp_setgid+set}" = set; then else use_utmp_setgid=no fi; -echo "$as_me:6733: result: $use_utmp_setgid" >&5 +echo "$as_me:8038: result: $use_utmp_setgid" >&5 echo "${ECHO_T}$use_utmp_setgid" >&6 if test "$use_utmp_setgid" != no ; then if test "$use_utmp_setgid" = yes ; then if test $cf_cv_have_utmp != no ; then -echo "$as_me:6740: checking for utmp/utmpx group" >&5 +echo "$as_me:8045: checking for utmp/utmpx group" >&5 echo $ECHO_N "checking for utmp/utmpx group... $ECHO_C" >&6 if test "${cf_cv_utmp_group+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6751,15 +8056,15 @@ do then cf_cv_utmp_group=root - cf_option="-l -L" + cf_option="-lL" # Expect listing to have fields like this: #-r--r--r-- 1 user group 34293 Jul 18 16:29 pathname - ls $cf_option $cf_utmp_path/$cf_utmp_file >conftest + ls "$cf_option" "$cf_utmp_path/$cf_utmp_file" >conftest read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest + cf_option="${cf_option}g" + ls "$cf_option" "$cf_utmp_path/$cf_utmp_file" >conftest read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest &5 +echo "$as_me:8087: result: $cf_cv_utmp_group" >&5 echo "${ECHO_T}$cf_cv_utmp_group" >&6 else - { { echo "$as_me:6785: error: cannot find utmp group" >&5 + { { echo "$as_me:8090: error: cannot find utmp group" >&5 echo "$as_me: error: cannot find utmp group" >&2;} { (exit 1); exit 1; }; } fi @@ -6791,7 +8096,7 @@ fi cf_cv_utmp_group=$use_utmp_setgid fi if test "$cf_cv_posix_saved_ids" != yes ; then - { { echo "$as_me:6794: error: Your system does not support POSIX saved-ids" >&5 + { { echo "$as_me:8099: error: Your system does not support POSIX saved-ids" >&5 echo "$as_me: error: Your system does not support POSIX saved-ids" >&2;} { (exit 1); exit 1; }; } fi @@ -6803,7 +8108,7 @@ EOF SINSTALL_OPTS="$SINSTALL_OPTS g+s -g $cf_cv_utmp_group" fi -echo "$as_me:6806: checking if you want to link with utempter" >&5 +echo "$as_me:8111: checking if you want to link with utempter" >&5 echo $ECHO_N "checking if you want to link with utempter... $ECHO_C" >&6 # Check whether --with-utempter or --without-utempter was given. @@ -6813,12 +8118,12 @@ if test "${with_utempter+set}" = set; then else use_utempter=no fi; -echo "$as_me:6816: result: $use_utempter" >&5 +echo "$as_me:8121: result: $use_utempter" >&5 echo "${ECHO_T}$use_utempter" >&6 if test "$use_utempter" = yes ; then -echo "$as_me:6821: checking if we can link with utempter library" >&5 +echo "$as_me:8126: checking if we can link with utempter library" >&5 echo $ECHO_N "checking if we can link with utempter library... $ECHO_C" >&6 if test "${cf_cv_have_utempter+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6826,30 +8131,30 @@ else cf_save_LIBS="$LIBS" -cf_add_libs="-lutempter" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lutempter; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" -cat >conftest.$ac_ext <<_ACEOF -#line 6846 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 8151 "configure" #include "confdefs.h" #include int -main () +main (void) { addToUtmp("/dev/tty", 0, 1); @@ -6859,31 +8164,31 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6863: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8168: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6866: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6869: \"$ac_try\"") >&5 + echo "$as_me:8171: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8174: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6872: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8177: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_utempter=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_utempter=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS="$cf_save_LIBS" fi -echo "$as_me:6886: result: $cf_cv_have_utempter" >&5 +echo "$as_me:8191: result: $cf_cv_have_utempter" >&5 echo "${ECHO_T}$cf_cv_have_utempter" >&6 if test "$cf_cv_have_utempter" = yes ; then @@ -6891,19 +8196,19 @@ cat >>confdefs.h <<\EOF #define USE_UTEMPTER 1 EOF -cf_add_libs="-lutempter" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lutempter; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -6921,21 +8226,21 @@ if test "$use_utempter" = yes ; then disable_setuid=yes test -n "$verbose" && echo " No --disable-setuid option given, force to yes" 1>&6 -echo "${as_me:-configure}:6924: testing No --disable-setuid option given, force to yes ..." 1>&5 +echo "${as_me:-configure}:8229: testing No --disable-setuid option given, force to yes ..." 1>&5 fi fi ### checks for external data -echo "$as_me:6931: checking if external errno is declared" >&5 +echo "$as_me:8236: checking if external errno is declared" >&5 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 6938 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8243 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -6945,42 +8250,42 @@ else #include #include int -main () +main (void) { -int x = (int) errno +int x = (int) errno; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6956: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:8261: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6959: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6962: \"$ac_try\"") >&5 + echo "$as_me:8264: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:8267: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6965: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8270: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_dcl_errno=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_dcl_errno=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:6976: result: $cf_cv_dcl_errno" >&5 +echo "$as_me:8281: result: $cf_cv_dcl_errno" >&5 echo "${ECHO_T}$cf_cv_dcl_errno" >&6 if test "$cf_cv_dcl_errno" = no ; then cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - cat >>confdefs.h <>confdefs.h <&5 +echo "$as_me:8296: checking if external errno exists" >&5 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 if test "${cf_cv_have_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 6998 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8303 "configure" #include "confdefs.h" #undef errno extern int errno; int -main () +main (void) { errno = 2 ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7013: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8318: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7016: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7019: \"$ac_try\"") >&5 + echo "$as_me:8321: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8324: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7022: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8327: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_have_errno=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_have_errno=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:7033: result: $cf_cv_have_errno" >&5 +echo "$as_me:8338: result: $cf_cv_have_errno" >&5 echo "${ECHO_T}$cf_cv_have_errno" >&6 if test "$cf_cv_have_errno" = yes ; then cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - cat >>confdefs.h <>confdefs.h <&5 +echo "$as_me:8351: checking for explicit tty group name" >&5 echo $ECHO_N "checking for explicit tty group name... $ECHO_C" >&6 # Check whether --with-tty-group or --without-tty-group was given. @@ -7055,11 +8360,11 @@ else fi; test -z "$cf_tty_group" && cf_tty_group=auto... test "$cf_tty_group" = yes && cf_tty_group=auto... -echo "$as_me:7058: result: $cf_tty_group" >&5 +echo "$as_me:8363: result: $cf_tty_group" >&5 echo "${ECHO_T}$cf_tty_group" >&6 if test "$cf_tty_group" = "auto..." ; then -echo "$as_me:7062: checking for tty group name" >&5 +echo "$as_me:8367: checking for tty group name" >&5 echo $ECHO_N "checking for tty group name... $ECHO_C" >&6 if test "${cf_cv_tty_group_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7069,24 +8374,24 @@ else # But we'll guess based on how our connection is set up - assuming it is done # properly. -cf_uid=`id | sed -e 's/^^=*=//' -e 's/(.*$//'` +cf_uid="`id | sed -e 's/^^=*=//' -e 's/(.*$//'`" # )vi if test "$cf_uid" != 0 ; then cf_cv_tty_group_name= -cf_tty_name=`tty` +cf_tty_name="`tty`" test "$cf_tty_name" = "not a tty" && cf_tty_name=/dev/tty test -z "$cf_tty_name" && cf_tty_name=/dev/tty if test -c "$cf_tty_name" then - cf_option="-l -L" + cf_option="-lL" # Expect listing to have fields like this: #-rwxrwxrwx 1 user group 34293 Jul 18 16:29 pathname - ls $cf_option $cf_tty_name >conftest.out + ls $cf_option "$cf_tty_name" >conftest.out read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest.out + cf_option="${cf_option}g" + ls "$cf_option" "$cf_tty_name" >conftest.out read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest /dev/null 1>/dev/null ) then + if ( ${EGREP-egrep} '^tty:' /etc/group 2>/dev/null 1>/dev/null ) then cf_cv_tty_group_name="tty" fi ;; @@ -7112,7 +8417,7 @@ esac fi fi -echo "$as_me:7115: result: $cf_cv_tty_group_name" >&5 +echo "$as_me:8420: result: $cf_cv_tty_group_name" >&5 echo "${ECHO_T}$cf_cv_tty_group_name" >&6 cf_tty_group="$cf_cv_tty_group_name" else @@ -7132,33 +8437,43 @@ EOF # does apply to the device. We cannot perform this test if we are in batch # mode, or if we are cross-compiling. -echo "$as_me:7135: checking if we may use the $cf_tty_group group" >&5 +echo "$as_me:8440: checking if we may use the $cf_tty_group group" >&5 echo $ECHO_N "checking if we may use the $cf_tty_group group... $ECHO_C" >&6 if test "${cf_cv_tty_group+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cf_tty_name=`tty` +cf_tty_name="`tty`" if test "$cf_tty_name" != "not a tty" then if test "$cross_compiling" = yes; then cf_cv_tty_group=unknown else - cat >conftest.$ac_ext <<_ACEOF -#line 7148 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8453 "configure" #include "confdefs.h" #include #include #include #include -int main() +int main(void) { struct stat sb; - struct group *ttygrp = getgrnam(TTY_GROUP_NAME); - char *name = ttyname(0); + struct group *ttygrp; + int fd; + char *name; + for (fd = 0; fd < 3; ++fd) { + if ((name = ttyname(fd)) != 0) + break; + } + if (name == 0) + name = "/dev/tty"; + + ttygrp = getgrnam(TTY_GROUP_NAME); endgrent(); + if (ttygrp != 0 && name != 0 && stat(name, &sb) == 0 @@ -7170,25 +8485,25 @@ int main() } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:7174: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:8489: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7177: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:7179: \"$ac_try\"") >&5 + echo "$as_me:8492: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:8494: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7182: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8497: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_tty_group=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_tty_group=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi elif test "$cross_compiling" = yes; then cf_cv_tty_group=unknown @@ -7197,11 +8512,11 @@ else fi fi -echo "$as_me:7200: result: $cf_cv_tty_group" >&5 +echo "$as_me:8515: result: $cf_cv_tty_group" >&5 echo "${ECHO_T}$cf_cv_tty_group" >&6 if test $cf_cv_tty_group = no ; then - { echo "$as_me:7204: WARNING: Cannot use $cf_tty_group group" >&5 + { echo "$as_me:8519: WARNING: Cannot use $cf_tty_group group" >&5 echo "$as_me: WARNING: Cannot use $cf_tty_group group" >&2;} else cat >>confdefs.h <<\EOF @@ -7212,598 +8527,7 @@ fi ### checks for system services and user specified options -echo "$as_me:7215: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 7221 "configure" -#include "confdefs.h" -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7243: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7246: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7249: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7252: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_sys_wait_h=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_header_sys_wait_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:7262: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 -if test $ac_cv_header_sys_wait_h = yes; then - -cat >>confdefs.h <<\EOF -#define HAVE_SYS_WAIT_H 1 -EOF - -fi - -echo "$as_me:7272: checking for POSIX wait functions" >&5 -echo $ECHO_N "checking for POSIX wait functions... $ECHO_C" >&6 -if test "${cf_cv_posix_wait+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 7279 "configure" -#include "confdefs.h" - -#include -#include -#include -#ifdef HAVE_SYS_WAIT_H -#include -#endif - -int -main () -{ - - int stat_loc; - pid_t pid = waitpid(-1, &stat_loc, WNOHANG|WUNTRACED); - pid_t pid2 = wait(&stat_loc); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7302: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7305: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7308: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7311: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_posix_wait=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_posix_wait=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:7322: result: $cf_cv_posix_wait" >&5 -echo "${ECHO_T}$cf_cv_posix_wait" >&6 -test "$cf_cv_posix_wait" = yes && -cat >>confdefs.h <<\EOF -#define USE_POSIX_WAIT 1 -EOF - -echo "$as_me:7329: checking if external sys_nerr is declared" >&5 -echo $ECHO_N "checking if external sys_nerr is declared... $ECHO_C" >&6 -if test "${cf_cv_dcl_sys_nerr+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line 7336 "configure" -#include "confdefs.h" - -#ifdef HAVE_STDLIB_H -#include -#endif -#include -#include -#include -int -main () -{ -int x = (int) sys_nerr - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7354: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7357: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7360: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7363: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_dcl_sys_nerr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_dcl_sys_nerr=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:7374: result: $cf_cv_dcl_sys_nerr" >&5 -echo "${ECHO_T}$cf_cv_dcl_sys_nerr" >&6 - -if test "$cf_cv_dcl_sys_nerr" = no ; then - -cf_result=`echo "decl_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking if external sys_nerr exists... $ECHO_C" >&6 -if test "${cf_cv_have_sys_nerr+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line 7396 "configure" -#include "confdefs.h" - -#undef sys_nerr -extern int sys_nerr; - -int -main () -{ -sys_nerr = 2 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7411: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7414: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7417: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7420: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_have_sys_nerr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_have_sys_nerr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:7431: result: $cf_cv_have_sys_nerr" >&5 -echo "${ECHO_T}$cf_cv_have_sys_nerr" >&6 - -if test "$cf_cv_have_sys_nerr" = yes ; then - -cf_result=`echo "have_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking if external sys_errlist is declared... $ECHO_C" >&6 -if test "${cf_cv_dcl_sys_errlist+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line 7451 "configure" -#include "confdefs.h" - -#ifdef HAVE_STDLIB_H -#include -#endif -#include -#include -#include -int -main () -{ -int x = (int) sys_errlist - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7469: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7472: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7475: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7478: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_dcl_sys_errlist=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_dcl_sys_errlist=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:7489: result: $cf_cv_dcl_sys_errlist" >&5 -echo "${ECHO_T}$cf_cv_dcl_sys_errlist" >&6 - -if test "$cf_cv_dcl_sys_errlist" = no ; then - -cf_result=`echo "decl_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking if external sys_errlist exists... $ECHO_C" >&6 -if test "${cf_cv_have_sys_errlist+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line 7511 "configure" -#include "confdefs.h" - -#undef sys_errlist -extern int sys_errlist; - -int -main () -{ -sys_errlist = 2 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7526: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7529: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7532: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7535: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_have_sys_errlist=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_have_sys_errlist=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:7546: result: $cf_cv_have_sys_errlist" >&5 -echo "${ECHO_T}$cf_cv_have_sys_errlist" >&6 - -if test "$cf_cv_have_sys_errlist" = yes ; then - -cf_result=`echo "have_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 7572 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:7576: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:7582: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:7601: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <&5 -echo $ECHO_N "checking if we should define SYSV... $ECHO_C" >&6 -if test "${cf_cv_sysv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 7618 "configure" -#include "confdefs.h" - -#undef SYSV -#define SYSV 1 /* get Xos.h to declare sys_errlist[] */ -#ifdef HAVE_STDLIB_H -#include /* look for wchar_t */ -#endif -#ifdef HAVE_X11_INTRINSIC_H -#include /* Intrinsic.h has other traps... */ -#endif -#ifdef HAVE_TERMIOS_H /* needed for HPUX 10.20 */ -#include -#define STRUCT_TERMIOS struct termios -#else -#define STRUCT_TERMIOS struct termio -#endif -#include -#include /* eliminate most BSD hacks */ -#include /* declare sys_errlist on older systems */ -#include /* eliminate most of the remaining ones */ - -int -main () -{ - -static STRUCT_TERMIOS d_tio; - d_tio.c_cc[VINTR] = 0; - d_tio.c_cc[VQUIT] = 0; - d_tio.c_cc[VERASE] = 0; - d_tio.c_cc[VKILL] = 0; - d_tio.c_cc[VEOF] = 0; - d_tio.c_cc[VEOL] = 0; - d_tio.c_cc[VMIN] = 0; - d_tio.c_cc[VTIME] = 0; -#if defined(HAVE_SYS_ERRLIST) && !defined(DECL_SYS_ERRLIST) -sys_errlist[0] = ""; /* Cygwin mis-declares this */ -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7662: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7665: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7668: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7671: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_sysv=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_sysv=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:7682: result: $cf_cv_sysv" >&5 -echo "${ECHO_T}$cf_cv_sysv" >&6 -test "$cf_cv_sysv" = yes && -cat >>confdefs.h <<\EOF -#define SYSV 1 -EOF - -echo "$as_me:7689: checking for elf_begin in -lelf" >&5 -echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6 -if test "${ac_cv_lib_elf_elf_begin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lelf $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 7697 "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char elf_begin (); -int -main () -{ -elf_begin (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7716: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7719: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7722: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7725: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_elf_elf_begin=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_elf_elf_begin=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:7736: result: $ac_cv_lib_elf_elf_begin" >&5 -echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6 -if test $ac_cv_lib_elf_elf_begin = yes; then - -echo "$as_me:7740: checking if this is an SVR4 system" >&5 -echo $ECHO_N "checking if this is an SVR4 system... $ECHO_C" >&6 -if test "${cf_cv_svr4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 7747 "configure" -#include "confdefs.h" - -#if defined(__CYGWIN__) -make an error -#endif -#include -#include - -int -main () -{ - -static struct termio d_tio; - d_tio.c_cc[VINTR] = 0; - d_tio.c_cc[VQUIT] = 0; - d_tio.c_cc[VERASE] = 0; - d_tio.c_cc[VKILL] = 0; - d_tio.c_cc[VEOF] = 0; - d_tio.c_cc[VEOL] = 0; - d_tio.c_cc[VMIN] = 0; - d_tio.c_cc[VTIME] = 0; - d_tio.c_cc[VLNEXT] = 0; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7776: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7779: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7782: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7785: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_svr4=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_svr4=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:7796: result: $cf_cv_svr4" >&5 -echo "${ECHO_T}$cf_cv_svr4" >&6 - -fi - -test "$cf_cv_svr4" = yes && -cat >>confdefs.h <<\EOF -#define SVR4 1 -EOF - -echo "$as_me:7806: checking for X" >&5 +echo "$as_me:8530: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. @@ -7835,11 +8559,11 @@ acfindx: EOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`" # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib dll; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -7863,21 +8587,28 @@ fi # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include +/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include +/opt/local/include +/opt/X11/include + /usr/include/X11 +/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include +/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 +/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -7899,19 +8630,19 @@ ac_x_header_dirs=' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF -#line 7903 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8634 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:7907: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:8638: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:7913: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:8644: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -7925,7 +8656,7 @@ if test -z "$ac_cpp_err"; then ac_x_includes= else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir @@ -7933,7 +8664,7 @@ else fi done fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -7942,49 +8673,49 @@ if test "$ac_x_libraries" = no; then # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line 7946 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8677 "configure" #include "confdefs.h" #include int -main () +main (void) { XtMalloc (0) ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7958: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8689: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7961: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7964: \"$ac_try\"") >&5 + echo "$as_me:8692: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8695: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7967: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8698: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib dll; do - if test -r $ac_dir/libXt.$ac_extension; then + if test -r "$ac_dir/libXt.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then @@ -8002,7 +8733,7 @@ fi fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:8005: result: $have_x" >&5 + echo "$as_me:8736: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else @@ -8012,7 +8743,7 @@ else # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:8015: result: libraries $x_libraries, headers $x_includes" >&5 + echo "$as_me:8746: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi @@ -8023,7 +8754,10 @@ cat >>confdefs.h <<\EOF #define X_DISPLAY_MISSING 1 EOF - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= + X_CFLAGS= + X_PRE_LIBS= + X_LIBS= + X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" @@ -8036,83 +8770,83 @@ else # others require no space. Words are not sufficient . . . . case `(uname -sr) 2>/dev/null` in "SunOS 5"*) - echo "$as_me:8039: checking whether -R must be followed by a space" >&5 + echo "$as_me:8773: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line 8043 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8777 "configure" #include "confdefs.h" int -main () +main (void) { ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8055: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8789: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8058: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8061: \"$ac_try\"") >&5 + echo "$as_me:8792: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8795: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8064: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8798: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_R_nospace=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_R_nospace=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" if test $ac_R_nospace = yes; then - echo "$as_me:8074: result: no" >&5 + echo "$as_me:8808: result: no" >&5 echo "${ECHO_T}no" >&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line 8080 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8814 "configure" #include "confdefs.h" int -main () +main (void) { ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8092: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8826: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8095: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8098: \"$ac_try\"") >&5 + echo "$as_me:8829: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8832: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8101: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8835: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_R_space=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_R_space=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" if test $ac_R_space = yes; then - echo "$as_me:8111: result: yes" >&5 + echo "$as_me:8845: result: yes" >&5 echo "${ECHO_T}yes" >&6 X_LIBS="$X_LIBS -R $x_libraries" else - echo "$as_me:8115: result: neither works" >&5 + echo "$as_me:8849: result: neither works" >&5 echo "${ECHO_T}neither works" >&6 fi fi @@ -8131,8 +8865,8 @@ echo "${ECHO_T}neither works" >&6 # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF -#line 8135 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 8869 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8143,38 +8877,38 @@ extern "C" builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int -main () +main (void) { XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8154: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8888: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8157: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8160: \"$ac_try\"") >&5 + echo "$as_me:8891: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8894: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8163: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8897: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -echo "$as_me:8169: checking for dnet_ntoa in -ldnet" >&5 +cat "conftest.$ac_ext" >&5 +echo "$as_me:8903: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8177 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 8911 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8185,50 +8919,50 @@ extern "C" builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int -main () +main (void) { dnet_ntoa (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8196: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8930: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8199: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8202: \"$ac_try\"") >&5 + echo "$as_me:8933: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8936: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8205: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8939: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8216: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "$as_me:8950: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_dnet_ntoa = yes; then +if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:8223: checking for dnet_ntoa in -ldnet_stub" >&5 + echo "$as_me:8957: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8231 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 8965 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8239,43 +8973,43 @@ extern "C" builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int -main () +main (void) { dnet_ntoa (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8250: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:8984: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8253: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8256: \"$ac_try\"") >&5 + echo "$as_me:8987: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:8990: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8259: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:8993: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8270: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "$as_me:9004: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then +if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, @@ -8286,75 +9020,75 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:8289: checking for gethostbyname" >&5 + echo "$as_me:9023: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 8295 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 9029 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define gethostbyname autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef gethostbyname + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char gethostbyname (); -char (*f) (); +char gethostbyname (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for gethostbyname #endif + return gethostbyname (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8326: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9060: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8329: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8332: \"$ac_try\"") >&5 + echo "$as_me:9063: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9066: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8335: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9069: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:8345: result: $ac_cv_func_gethostbyname" >&5 +echo "$as_me:9079: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:8349: checking for gethostbyname in -lnsl" >&5 + echo "$as_me:9083: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8357 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9091 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8365,50 +9099,50 @@ extern "C" builtin and then its argument prototype would still apply. */ char gethostbyname (); int -main () +main (void) { gethostbyname (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8376: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9110: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8379: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8382: \"$ac_try\"") >&5 + echo "$as_me:9113: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9116: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8385: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9119: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8396: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "$as_me:9130: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then +if test "$ac_cv_lib_nsl_gethostbyname" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:8403: checking for gethostbyname in -lbsd" >&5 + echo "$as_me:9137: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8411 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9145 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8419,37 +9153,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char gethostbyname (); int -main () +main (void) { gethostbyname (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8430: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9164: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8433: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8436: \"$ac_try\"") >&5 + echo "$as_me:9167: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9170: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8439: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9173: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_bsd_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8450: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "$as_me:9184: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 -if test $ac_cv_lib_bsd_gethostbyname = yes; then +if test "$ac_cv_lib_bsd_gethostbyname" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -8463,75 +9197,75 @@ fi # variants that don't use the nameserver (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:8466: checking for connect" >&5 + echo "$as_me:9200: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 8472 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 9206 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define connect autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef connect + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char connect (); -char (*f) (); +char connect (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for connect #endif + return connect (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8503: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9237: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8506: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8509: \"$ac_try\"") >&5 + echo "$as_me:9240: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9243: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8512: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9246: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:8522: result: $ac_cv_func_connect" >&5 +echo "$as_me:9256: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then - echo "$as_me:8526: checking for connect in -lsocket" >&5 + echo "$as_me:9260: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8534 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9268 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8542,112 +9276,112 @@ extern "C" builtin and then its argument prototype would still apply. */ char connect (); int -main () +main (void) { connect (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8553: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9287: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8556: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8559: \"$ac_try\"") >&5 + echo "$as_me:9290: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9293: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8562: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9296: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_socket_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8573: result: $ac_cv_lib_socket_connect" >&5 +echo "$as_me:9307: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 -if test $ac_cv_lib_socket_connect = yes; then +if test "$ac_cv_lib_socket_connect" = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:8582: checking for remove" >&5 + echo "$as_me:9316: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6 if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 8588 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 9322 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define remove autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef remove + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char remove (); -char (*f) (); +char remove (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_remove) || defined (__stub___remove) -choke me -#else -f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for remove #endif + return remove (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8619: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9353: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8622: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8625: \"$ac_try\"") >&5 + echo "$as_me:9356: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9359: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8628: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9362: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:8638: result: $ac_cv_func_remove" >&5 +echo "$as_me:9372: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then - echo "$as_me:8642: checking for remove in -lposix" >&5 + echo "$as_me:9376: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8650 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9384 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8658,112 +9392,112 @@ extern "C" builtin and then its argument prototype would still apply. */ char remove (); int -main () +main (void) { remove (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8669: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9403: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8672: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8675: \"$ac_try\"") >&5 + echo "$as_me:9406: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9409: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8678: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9412: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_posix_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8689: result: $ac_cv_lib_posix_remove" >&5 +echo "$as_me:9423: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 -if test $ac_cv_lib_posix_remove = yes; then +if test "$ac_cv_lib_posix_remove" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:8698: checking for shmat" >&5 + echo "$as_me:9432: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6 if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 8704 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 9438 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define shmat autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef shmat + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char shmat (); -char (*f) (); +char shmat (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shmat) || defined (__stub___shmat) -choke me -#else -f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for shmat #endif + return shmat (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8735: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9469: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8738: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8741: \"$ac_try\"") >&5 + echo "$as_me:9472: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9475: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8744: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9478: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:8754: result: $ac_cv_func_shmat" >&5 +echo "$as_me:9488: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then - echo "$as_me:8758: checking for shmat in -lipc" >&5 + echo "$as_me:9492: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8766 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9500 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8774,37 +9508,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char shmat (); int -main () +main (void) { shmat (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8785: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9519: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8788: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8791: \"$ac_try\"") >&5 + echo "$as_me:9522: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9525: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8794: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9528: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_ipc_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8805: result: $ac_cv_lib_ipc_shmat" >&5 +echo "$as_me:9539: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 -if test $ac_cv_lib_ipc_shmat = yes; then +if test "$ac_cv_lib_ipc_shmat" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -8820,15 +9554,15 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - echo "$as_me:8823: checking for IceConnectionNumber in -lICE" >&5 + echo "$as_me:9557: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8831 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 9565 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -8839,37 +9573,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int -main () +main (void) { IceConnectionNumber (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8850: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9584: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8853: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8856: \"$ac_try\"") >&5 + echo "$as_me:9587: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9590: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8859: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:9593: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:8870: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "$as_me:9604: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 -if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then +if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -8877,7 +9611,620 @@ fi fi -echo "$as_me:8880: checking if you want to use pkg-config" >&5 +echo "$as_me:9614: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 9620 "configure" +#include "confdefs.h" +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:9642: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9645: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:9648: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9651: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_header_sys_wait_h=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_header_sys_wait_h=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" +fi +echo "$as_me:9661: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +if test $ac_cv_header_sys_wait_h = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +echo "$as_me:9671: checking for POSIX wait functions" >&5 +echo $ECHO_N "checking for POSIX wait functions... $ECHO_C" >&6 +if test "${cf_cv_posix_wait+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >"conftest.$ac_ext" <<_ACEOF +#line 9678 "configure" +#include "confdefs.h" + +#include +#include +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +int +main (void) +{ + + int stat_loc; + pid_t pid = waitpid(-1, &stat_loc, WNOHANG|WUNTRACED); + pid_t pid2 = wait(&stat_loc); + (void)pid; + (void)pid2; + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9703: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9706: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9709: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9712: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_posix_wait=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_posix_wait=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + +fi +echo "$as_me:9723: result: $cf_cv_posix_wait" >&5 +echo "${ECHO_T}$cf_cv_posix_wait" >&6 +test "$cf_cv_posix_wait" = yes && +cat >>confdefs.h <<\EOF +#define USE_POSIX_WAIT 1 +EOF + +echo "$as_me:9730: checking if external sys_nerr is declared" >&5 +echo $ECHO_N "checking if external sys_nerr is declared... $ECHO_C" >&6 +if test "${cf_cv_dcl_sys_nerr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 9737 "configure" +#include "confdefs.h" + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include +int +main (void) +{ +int x = (int) sys_nerr; (void)x + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:9755: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9758: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:9761: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9764: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_dcl_sys_nerr=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_dcl_sys_nerr=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:9775: result: $cf_cv_dcl_sys_nerr" >&5 +echo "${ECHO_T}$cf_cv_dcl_sys_nerr" >&6 + +if test "$cf_cv_dcl_sys_nerr" = no ; then + +cf_result=`echo "decl_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&5 +echo $ECHO_N "checking if external sys_nerr exists... $ECHO_C" >&6 +if test "${cf_cv_have_sys_nerr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 9797 "configure" +#include "confdefs.h" + +#undef sys_nerr +extern int sys_nerr; + +int +main (void) +{ +sys_nerr = 2 + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9812: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9815: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9818: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9821: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_have_sys_nerr=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_have_sys_nerr=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + +fi +echo "$as_me:9832: result: $cf_cv_have_sys_nerr" >&5 +echo "${ECHO_T}$cf_cv_have_sys_nerr" >&6 + +if test "$cf_cv_have_sys_nerr" = yes ; then + +cf_result=`echo "have_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&5 +echo $ECHO_N "checking if external sys_errlist is declared... $ECHO_C" >&6 +if test "${cf_cv_dcl_sys_errlist+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 9852 "configure" +#include "confdefs.h" + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include +int +main (void) +{ +int x = (int) sys_errlist; (void)x + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:9870: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9873: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:9876: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9879: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_dcl_sys_errlist=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_dcl_sys_errlist=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:9890: result: $cf_cv_dcl_sys_errlist" >&5 +echo "${ECHO_T}$cf_cv_dcl_sys_errlist" >&6 + +if test "$cf_cv_dcl_sys_errlist" = no ; then + +cf_result=`echo "decl_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&5 +echo $ECHO_N "checking if external sys_errlist exists... $ECHO_C" >&6 +if test "${cf_cv_have_sys_errlist+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 9912 "configure" +#include "confdefs.h" + +#undef sys_errlist +extern int sys_errlist; + +int +main (void) +{ +sys_errlist = 2 + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:9927: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9930: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:9933: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9936: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_have_sys_errlist=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_have_sys_errlist=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + +fi +echo "$as_me:9947: result: $cf_cv_have_sys_errlist" >&5 +echo "${ECHO_T}$cf_cv_have_sys_errlist" >&6 + +if test "$cf_cv_have_sys_errlist" = yes ; then + +cf_result=`echo "have_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 9989 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:9993: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + $EGREP -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9999: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat "conftest.$ac_ext" >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err "conftest.$ac_ext" +fi +echo "$as_me:10018: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking if we should define SYSV... $ECHO_C" >&6 +if test "${cf_cv_sysv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >"conftest.$ac_ext" <<_ACEOF +#line 10035 "configure" +#include "confdefs.h" + +#undef SYSV +#define SYSV 1 /* get Xos.h to declare sys_errlist[] */ +#ifdef HAVE_STDLIB_H +#include /* look for wchar_t */ +#endif +#ifdef HAVE_X11_INTRINSIC_H +#include /* Intrinsic.h has other traps... */ +#endif +#ifdef HAVE_TERMIOS_H /* needed for HPUX 10.20 */ +#include +#define STRUCT_TERMIOS struct termios +#else +#define STRUCT_TERMIOS struct termio +#endif +#include +#include /* eliminate most BSD hacks */ +#include /* declare sys_errlist on older systems */ +#include /* eliminate most of the remaining ones */ + +int +main (void) +{ + +static STRUCT_TERMIOS d_tio; + d_tio.c_cc[VINTR] = 0; + d_tio.c_cc[VQUIT] = 0; + d_tio.c_cc[VERASE] = 0; + d_tio.c_cc[VKILL] = 0; + d_tio.c_cc[VEOF] = 0; + d_tio.c_cc[VEOL] = 0; + d_tio.c_cc[VMIN] = 0; + d_tio.c_cc[VTIME] = 0; +#if defined(HAVE_SYS_ERRLIST) && !defined(DECL_SYS_ERRLIST) +sys_errlist[0] = ""; /* Cygwin mis-declares this */ +#endif + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:10079: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10082: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:10085: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10088: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_sysv=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_sysv=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:10099: result: $cf_cv_sysv" >&5 +echo "${ECHO_T}$cf_cv_sysv" >&6 +test "$cf_cv_sysv" = yes && +cat >>confdefs.h <<\EOF +#define SYSV 1 +EOF + +LIBS="$cf_save_LIBS_CF_SYSV" +CFLAGS="$cf_save_CFLAGS_CF_SYSV" +CPPFLAGS="$cf_save_CPPFLAGS_CF_SYSV" + +echo "$as_me:10110: checking for elf_begin in -lelf" >&5 +echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6 +if test "${ac_cv_lib_elf_elf_begin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lelf $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 10118 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char elf_begin (); +int +main (void) +{ +elf_begin (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:10137: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10140: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:10143: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10146: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_elf_elf_begin=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_elf_elf_begin=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10157: result: $ac_cv_lib_elf_elf_begin" >&5 +echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6 +if test "$ac_cv_lib_elf_elf_begin" = yes; then + +echo "$as_me:10161: checking if this is an SVR4 system" >&5 +echo $ECHO_N "checking if this is an SVR4 system... $ECHO_C" >&6 +if test "${cf_cv_svr4+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >"conftest.$ac_ext" <<_ACEOF +#line 10168 "configure" +#include "confdefs.h" + +#if defined(__CYGWIN__) +make an error +#endif +#include +#include + +int +main (void) +{ + +static struct termio d_tio; + d_tio.c_cc[VINTR] = 0; + d_tio.c_cc[VQUIT] = 0; + d_tio.c_cc[VERASE] = 0; + d_tio.c_cc[VKILL] = 0; + d_tio.c_cc[VEOF] = 0; + d_tio.c_cc[VEOL] = 0; + d_tio.c_cc[VMIN] = 0; + d_tio.c_cc[VTIME] = 0; + d_tio.c_cc[VLNEXT] = 0; + + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:10197: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10200: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:10203: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10206: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_svr4=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_svr4=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:10217: result: $cf_cv_svr4" >&5 +echo "${ECHO_T}$cf_cv_svr4" >&6 + +fi + +test "$cf_cv_svr4" = yes && +cat >>confdefs.h <<\EOF +#define SVR4 1 +EOF + +echo "$as_me:10227: checking if you want to use pkg-config" >&5 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6 # Check whether --with-pkg-config or --without-pkg-config was given. @@ -8887,10 +10234,10 @@ if test "${with_pkg_config+set}" = set; then else cf_pkg_config=yes fi; -echo "$as_me:8890: result: $cf_pkg_config" >&5 +echo "$as_me:10237: result: $cf_pkg_config" >&5 echo "${ECHO_T}$cf_pkg_config" >&6 -case $cf_pkg_config in +case "$cf_pkg_config" in (no) PKG_CONFIG=none ;; @@ -8899,7 +10246,7 @@ case $cf_pkg_config in if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -echo "$as_me:8902: checking for $ac_word" >&5 +echo "$as_me:10249: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8916,7 +10263,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" - echo "$as_me:8919: found $ac_dir/$ac_word" >&5 + echo "$as_me:10266: found $ac_dir/$ac_word" >&5 break fi done @@ -8927,10 +10274,10 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - echo "$as_me:8930: result: $PKG_CONFIG" >&5 + echo "$as_me:10277: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else - echo "$as_me:8933: result: no" >&5 + echo "$as_me:10280: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -8939,7 +10286,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:8942: checking for $ac_word" >&5 +echo "$as_me:10289: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8956,7 +10303,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word" - echo "$as_me:8959: found $ac_dir/$ac_word" >&5 + echo "$as_me:10306: found $ac_dir/$ac_word" >&5 break fi done @@ -8968,10 +10315,10 @@ fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - echo "$as_me:8971: result: $ac_pt_PKG_CONFIG" >&5 + echo "$as_me:10318: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 else - echo "$as_me:8974: result: no" >&5 + echo "$as_me:10321: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -8990,42 +10337,42 @@ test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$PKG_CONFIG" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval PKG_CONFIG="$PKG_CONFIG" - case ".$PKG_CONFIG" in - (.NONE/*) - PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval PKG_CONFIG="$PKG_CONFIG" + case ".$PKG_CONFIG" in + (.NONE/*) + PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` - ;; + PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - { { echo "$as_me:9017: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 + { { echo "$as_me:10364: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac -else - { echo "$as_me:9024: WARNING: pkg-config is not installed" >&5 +elif test "x$cf_pkg_config" != xno ; then + { echo "$as_me:10371: WARNING: pkg-config is not installed" >&5 echo "$as_me: WARNING: pkg-config is not installed" >&2;} fi -# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and +# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and # in some cases has installed dummy files in the former, other cases replaced # it with a link to the new location). This complicates the configure script. # Check for that pitfall, and recover using pkg-config @@ -9034,20 +10381,20 @@ fi if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}" then -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then test -n "$verbose" && echo " found package x11" 1>&6 -echo "${as_me:-configure}:9040: testing found package x11 ..." 1>&5 +echo "${as_me:-configure}:10387: testing found package x11 ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`" test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9046: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:10393: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9050: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:10397: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9056,23 +10403,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9081,7 +10434,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9091,19 +10444,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9114,32 +10475,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9147,24 +10514,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:9150: WARNING: unable to find X11 library" >&5 + { echo "$as_me:10517: WARNING: unable to find X11 library" >&5 echo "$as_me: WARNING: unable to find X11 library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then test -n "$verbose" && echo " found package ice" 1>&6 -echo "${as_me:-configure}:9157: testing found package ice ..." 1>&5 +echo "${as_me:-configure}:10524: testing found package ice ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`" test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9163: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:10530: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9167: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:10534: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9173,23 +10540,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9198,7 +10571,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9208,19 +10581,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9231,32 +10612,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9264,24 +10651,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:9267: WARNING: unable to find ICE library" >&5 + { echo "$as_me:10654: WARNING: unable to find ICE library" >&5 echo "$as_me: WARNING: unable to find ICE library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then test -n "$verbose" && echo " found package sm" 1>&6 -echo "${as_me:-configure}:9274: testing found package sm ..." 1>&5 +echo "${as_me:-configure}:10661: testing found package sm ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`" test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9280: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:10667: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9284: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:10671: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9290,23 +10677,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9315,7 +10708,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9325,19 +10718,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9348,32 +10749,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9381,24 +10788,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:9384: WARNING: unable to find SM library" >&5 + { echo "$as_me:10791: WARNING: unable to find SM library" >&5 echo "$as_me: WARNING: unable to find SM library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then test -n "$verbose" && echo " found package xt" 1>&6 -echo "${as_me:-configure}:9391: testing found package xt ..." 1>&5 +echo "${as_me:-configure}:10798: testing found package xt ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`" test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9397: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:10804: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9401: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:10808: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9407,23 +10814,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9432,7 +10845,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9442,19 +10855,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9465,32 +10886,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9498,28 +10925,30 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:9501: WARNING: unable to find Xt library" >&5 + { echo "$as_me:10928: WARNING: unable to find Xt library" >&5 echo "$as_me: WARNING: unable to find Xt library" >&2;} fi +else + LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS" fi cf_have_X_LIBS=no -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then test -n "$verbose" && echo " found package xt" 1>&6 -echo "${as_me:-configure}:9512: testing found package xt ..." 1>&5 +echo "${as_me:-configure}:10941: testing found package xt ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`" test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9518: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:10947: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9522: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:10951: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9528,23 +10957,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9553,7 +10988,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9563,19 +10998,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9586,32 +11029,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9620,20 +11069,20 @@ LIBS="$cf_add_libs" ;; (*) # we have an "xt" package, but it may omit Xt's dependency on X11 -echo "$as_me:9623: checking for usable X dependency" >&5 +echo "$as_me:11072: checking for usable X dependency" >&5 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6 if test "${cf_cv_xt_x11_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 9630 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 11079 "configure" #include "confdefs.h" #include int -main () +main (void) { int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); @@ -9645,50 +11094,50 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9649: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11098: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9652: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9655: \"$ac_try\"") >&5 + echo "$as_me:11101: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11104: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9658: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11107: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xt_x11_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xt_x11_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:9668: result: $cf_cv_xt_x11_compat" >&5 +echo "$as_me:11117: result: $cf_cv_xt_x11_compat" >&5 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6 if test "$cf_cv_xt_x11_compat" = no then test -n "$verbose" && echo " work around broken X11 dependency" 1>&6 -echo "${as_me:-configure}:9674: testing work around broken X11 dependency ..." 1>&5 +echo "${as_me:-configure}:11123: testing work around broken X11 dependency ..." 1>&5 # 2010/11/19 - good enough until a working Xt on Xcb is delivered. -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then test -n "$verbose" && echo " found package x11" 1>&6 -echo "${as_me:-configure}:9681: testing found package x11 ..." 1>&5 +echo "${as_me:-configure}:11130: testing found package x11 ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`" test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9687: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:11136: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9691: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:11140: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9697,23 +11146,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9722,7 +11177,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9732,19 +11187,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9755,32 +11218,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -9791,12 +11260,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:9794: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:11263: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:9799: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:11268: testing ...after $LIBS ..." 1>&5 fi @@ -9804,48 +11273,48 @@ fi ;; esac -echo "$as_me:9807: checking for usable X Toolkit package" >&5 +echo "$as_me:11276: checking for usable X Toolkit package" >&5 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6 if test "${cf_cv_xt_ice_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 9814 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 11283 "configure" #include "confdefs.h" #include int -main () +main (void) { -int num = IceConnectionNumber(0) +int num = IceConnectionNumber(0); (void) num ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9829: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11298: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9832: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9835: \"$ac_try\"") >&5 + echo "$as_me:11301: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11304: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9838: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11307: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xt_ice_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xt_ice_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:9848: result: $cf_cv_xt_ice_compat" >&5 +echo "$as_me:11317: result: $cf_cv_xt_ice_compat" >&5 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6 if test "$cf_cv_xt_ice_compat" = no @@ -9859,22 +11328,22 @@ echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6 (*) test -n "$verbose" && echo " work around broken ICE dependency" 1>&6 -echo "${as_me:-configure}:9862: testing work around broken ICE dependency ..." 1>&5 +echo "${as_me:-configure}:11331: testing work around broken ICE dependency ..." 1>&5 -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then test -n "$verbose" && echo " found package ice" 1>&6 -echo "${as_me:-configure}:9867: testing found package ice ..." 1>&5 +echo "${as_me:-configure}:11336: testing found package ice ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`" test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9873: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:11342: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9877: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:11346: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9883,23 +11352,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -9908,7 +11383,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -9918,19 +11393,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -9941,49 +11424,55 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then test -n "$verbose" && echo " found package sm" 1>&6 -echo "${as_me:-configure}:9976: testing found package sm ..." 1>&5 +echo "${as_me:-configure}:11465: testing found package sm ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`" test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:9982: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:11471: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:9986: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:11475: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -9992,23 +11481,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -10017,7 +11512,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -10027,19 +11522,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -10050,32 +11553,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -10092,12 +11601,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:10095: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:11604: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:10100: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:11609: testing ...after $LIBS ..." 1>&5 fi @@ -10117,7 +11626,7 @@ else test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 -echo "${as_me:-configure}:10120: testing checking additions to CFLAGS ..." 1>&5 +echo "${as_me:-configure}:11629: testing checking additions to CFLAGS ..." 1>&5 cf_check_cflags="$CFLAGS" cf_check_cppflags="$CPPFLAGS" @@ -10129,23 +11638,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $X_CFLAGS do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -10154,7 +11669,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -10164,19 +11679,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -10188,142 +11711,148 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 -echo "${as_me:-configure}:10191: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 +echo "${as_me:-configure}:11714: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" - CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 -echo "${as_me:-configure}:10199: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 +echo "${as_me:-configure}:11724: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 -echo "${as_me:-configure}:10207: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 +echo "${as_me:-configure}:11734: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi if test "x$cf_check_cflags" != "x$CFLAGS" ; then -cat >conftest.$ac_ext <<_ACEOF -#line 10214 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 11743 "configure" #include "confdefs.h" #include int -main () +main (void) { printf("Hello world"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10226: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11755: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10229: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10232: \"$ac_try\"") >&5 + echo "$as_me:11758: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11761: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10235: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11764: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 -echo "${as_me:-configure}:10243: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 +echo "${as_me:-configure}:11772: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 -echo "${as_me:-configure}:10248: testing but keeping change to \$CPPFLAGS ..." 1>&5 +echo "${as_me:-configure}:11777: testing but keeping change to \$CPPFLAGS ..." 1>&5 fi - CFLAGS="$cf_check_flags" + CFLAGS="$cf_check_cflags" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi - echo "$as_me:10256: checking for XOpenDisplay" >&5 + echo "$as_me:11785: checking for XOpenDisplay" >&5 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6 if test "${ac_cv_func_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 10262 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 11791 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XOpenDisplay (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define XOpenDisplay autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef XOpenDisplay + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char XOpenDisplay (); -char (*f) (); +char XOpenDisplay (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay) -choke me -#else -f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for XOpenDisplay #endif + return XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10293: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11822: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10296: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10299: \"$ac_try\"") >&5 + echo "$as_me:11825: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11828: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10302: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11831: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_XOpenDisplay=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:10312: result: $ac_cv_func_XOpenDisplay" >&5 +echo "$as_me:11841: result: $ac_cv_func_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6 -if test $ac_cv_func_XOpenDisplay = yes; then +if test "$ac_cv_func_XOpenDisplay" = yes; then : else - echo "$as_me:10318: checking for XOpenDisplay in -lX11" >&5 + echo "$as_me:11847: checking for XOpenDisplay in -lX11" >&5 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10326 "configure" +LIBS="-lX11 $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 11855 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10334,51 +11863,51 @@ extern "C" builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int -main () +main (void) { XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10345: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11874: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10348: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10351: \"$ac_try\"") >&5 + echo "$as_me:11877: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11880: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10354: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11883: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_X11_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_X11_XOpenDisplay=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10365: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +echo "$as_me:11894: result: $ac_cv_lib_X11_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 -if test $ac_cv_lib_X11_XOpenDisplay = yes; then +if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then -cf_add_libs="-lX11" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -10386,77 +11915,77 @@ fi fi - echo "$as_me:10389: checking for XtAppInitialize" >&5 + echo "$as_me:11918: checking for XtAppInitialize" >&5 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6 if test "${ac_cv_func_XtAppInitialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 10395 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 11924 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XtAppInitialize (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define XtAppInitialize autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef XtAppInitialize + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char XtAppInitialize (); -char (*f) (); +char XtAppInitialize (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize) -choke me -#else -f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for XtAppInitialize #endif + return XtAppInitialize (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10426: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:11955: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10429: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10432: \"$ac_try\"") >&5 + echo "$as_me:11958: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:11961: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10435: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:11964: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_XtAppInitialize=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_XtAppInitialize=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:10445: result: $ac_cv_func_XtAppInitialize" >&5 +echo "$as_me:11974: result: $ac_cv_func_XtAppInitialize" >&5 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6 -if test $ac_cv_func_XtAppInitialize = yes; then +if test "$ac_cv_func_XtAppInitialize" = yes; then : else - echo "$as_me:10451: checking for XtAppInitialize in -lXt" >&5 + echo "$as_me:11980: checking for XtAppInitialize in -lXt" >&5 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10459 "configure" +LIBS="-lXt $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 11988 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10467,52 +11996,52 @@ extern "C" builtin and then its argument prototype would still apply. */ char XtAppInitialize (); int -main () +main (void) { XtAppInitialize (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10478: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:12007: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10481: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10484: \"$ac_try\"") >&5 + echo "$as_me:12010: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:12013: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10487: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:12016: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_Xt_XtAppInitialize=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_Xt_XtAppInitialize=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10498: result: $ac_cv_lib_Xt_XtAppInitialize" >&5 +echo "$as_me:12027: result: $ac_cv_lib_Xt_XtAppInitialize" >&5 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6 -if test $ac_cv_lib_Xt_XtAppInitialize = yes; then +if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LIBXT 1 EOF cf_have_X_LIBS=Xt - LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS" + LIBS="-lXt $LIBS" fi fi fi -if test $cf_have_X_LIBS = no ; then - { echo "$as_me:10515: WARNING: Unable to successfully link X Toolkit library (-lXt) with +if test "$cf_have_X_LIBS" = no ; then + { echo "$as_me:12044: WARNING: Unable to successfully link X Toolkit library (-lXt) with test program. You will have to check and add the proper libraries by hand to makefile." >&5 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with @@ -10525,29 +12054,30 @@ for ac_header in \ X11/Sunkeysym.h \ X11/XF86keysym.h \ X11/XKBlib.h \ + X11/TranslateI.h \ X11/Xpoll.h \ X11/extensions/XKB.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:10533: checking for $ac_header" >&5 +echo "$as_me:12063: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 10539 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 12069 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:10543: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:12073: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:10549: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:12079: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -10560,14 +12090,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:10568: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:12098: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:12113: checking if you want to use the Xpm library for colored icon" >&5 echo $ECHO_N "checking if you want to use the Xpm library for colored icon... $ECHO_C" >&6 # Check whether --with-xpm or --without-xpm was given. @@ -10590,7 +12120,7 @@ if test "${with_xpm+set}" = set; then else cf_Xpm_library=yes fi; -echo "$as_me:10593: result: $cf_Xpm_library" >&5 +echo "$as_me:12123: result: $cf_Xpm_library" >&5 echo "${ECHO_T}$cf_Xpm_library" >&6 if test "$cf_Xpm_library" != no ; then @@ -10598,24 +12128,24 @@ if test "$cf_Xpm_library" != no ; then CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib" fi - echo "$as_me:10601: checking for X11/xpm.h" >&5 + echo "$as_me:12131: checking for X11/xpm.h" >&5 echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6 if test "${ac_cv_header_X11_xpm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 10607 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 12137 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10611: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:12141: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:10617: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:12147: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -10628,24 +12158,24 @@ if test -z "$ac_cpp_err"; then ac_cv_header_X11_xpm_h=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 ac_cv_header_X11_xpm_h=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:10636: result: $ac_cv_header_X11_xpm_h" >&5 +echo "$as_me:12166: result: $ac_cv_header_X11_xpm_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6 -if test $ac_cv_header_X11_xpm_h = yes; then +if test "$ac_cv_header_X11_xpm_h" = yes; then - echo "$as_me:10640: checking for XpmCreatePixmapFromData in -lXpm" >&5 + echo "$as_me:12170: checking for XpmCreatePixmapFromData in -lXpm" >&5 echo $ECHO_N "checking for XpmCreatePixmapFromData in -lXpm... $ECHO_C" >&6 if test "${ac_cv_lib_Xpm_XpmCreatePixmapFromData+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lX11 $X_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10648 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 12178 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10656,37 +12186,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char XpmCreatePixmapFromData (); int -main () +main (void) { XpmCreatePixmapFromData (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10667: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:12197: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10670: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10673: \"$ac_try\"") >&5 + echo "$as_me:12200: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:12203: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10676: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:12206: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_Xpm_XpmCreatePixmapFromData=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10687: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5 +echo "$as_me:12217: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6 -if test $ac_cv_lib_Xpm_XpmCreatePixmapFromData = yes; then +if test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LIBXPM 1 @@ -10704,9 +12234,283 @@ fi fi +echo "$as_me:12237: checking if you want to use the Xinerama extension" >&5 +echo $ECHO_N "checking if you want to use the Xinerama extension... $ECHO_C" >&6 + +# Check whether --with-xinerama or --without-xinerama was given. +if test "${with_xinerama+set}" = set; then + withval="$with_xinerama" + cf_with_xinerama="$withval" +else + cf_with_xinerama=yes +fi; +echo "$as_me:12247: result: $cf_with_xinerama" >&5 +echo "${ECHO_T}$cf_with_xinerama" >&6 +if test "$cf_with_xinerama" = yes; then + +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xinerama"; then + test -n "$verbose" && echo " found package xinerama" 1>&6 + +echo "${as_me:-configure}:12254: testing found package xinerama ..." 1>&5 + + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xinerama" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xinerama" 2>/dev/null`" + test -n "$verbose" && echo " package xinerama CFLAGS: $cf_pkgconfig_incs" 1>&6 + +echo "${as_me:-configure}:12260: testing package xinerama CFLAGS: $cf_pkgconfig_incs ..." 1>&5 + + test -n "$verbose" && echo " package xinerama LIBS: $cf_pkgconfig_libs" 1>&6 + +echo "${as_me:-configure}:12264: testing package xinerama LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_pkgconfig_incs +do +case "$cf_fix_cppflags" in +(no) + case "$cf_add_cflags" in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case "$cf_add_cflags" in + (-D*) + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case "$cf_add_cflags" in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + + cat >>confdefs.h <<\EOF +#define HAVE_X11_EXTENSIONS_XINERAMA_H 1 +EOF + +else + cf_pkgconfig_incs= + cf_pkgconfig_libs= + + echo "$as_me:12388: checking for XineramaQueryScreens in -lXinerama" >&5 +echo $ECHO_N "checking for XineramaQueryScreens in -lXinerama... $ECHO_C" >&6 +if test "${ac_cv_lib_Xinerama_XineramaQueryScreens+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXinerama $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 12396 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XineramaQueryScreens (); +int +main (void) +{ +XineramaQueryScreens (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:12415: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12418: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:12421: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12424: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_Xinerama_XineramaQueryScreens=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_Xinerama_XineramaQueryScreens=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:12435: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5 +echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6 +if test "$ac_cv_lib_Xinerama_XineramaQueryScreens" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lXinerama; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +for ac_header in \ + X11/extensions/Xinerama.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:12460: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 12466 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:12470: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + $EGREP -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:12476: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat "conftest.$ac_ext" >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err "conftest.$ac_ext" +fi +echo "$as_me:12495: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then + cat >>confdefs.h <&5 +echo "$as_me:12513: checking if you want to link with Xaw 3d library" >&5 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6 withval= @@ -10717,14 +12521,14 @@ if test "${with_Xaw3d+set}" = set; then fi; if test "$withval" = yes ; then cf_x_athena=Xaw3d - echo "$as_me:10720: result: yes" >&5 + echo "$as_me:12524: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:10723: result: no" >&5 + echo "$as_me:12527: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:10727: checking if you want to link with Xaw 3d xft library" >&5 +echo "$as_me:12531: checking if you want to link with Xaw 3d xft library" >&5 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6 withval= @@ -10735,14 +12539,14 @@ if test "${with_Xaw3dxft+set}" = set; then fi; if test "$withval" = yes ; then cf_x_athena=Xaw3dxft - echo "$as_me:10738: result: yes" >&5 + echo "$as_me:12542: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:10741: result: no" >&5 + echo "$as_me:12545: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:10745: checking if you want to link with neXT Athena library" >&5 +echo "$as_me:12549: checking if you want to link with neXT Athena library" >&5 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6 withval= @@ -10753,14 +12557,14 @@ if test "${with_neXtaw+set}" = set; then fi; if test "$withval" = yes ; then cf_x_athena=neXtaw - echo "$as_me:10756: result: yes" >&5 + echo "$as_me:12560: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:10759: result: no" >&5 + echo "$as_me:12563: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:10763: checking if you want to link with Athena-Plus library" >&5 +echo "$as_me:12567: checking if you want to link with Athena-Plus library" >&5 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6 withval= @@ -10771,10 +12575,10 @@ if test "${with_XawPlus+set}" = set; then fi; if test "$withval" = yes ; then cf_x_athena=XawPlus - echo "$as_me:10774: result: yes" >&5 + echo "$as_me:12578: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:10777: result: no" >&5 + echo "$as_me:12581: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -10791,20 +12595,20 @@ if test "$PKG_CONFIG" != none ; then lib${cf_x_athena}-devel do -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then test -n "$verbose" && echo " found package $cf_athena_pkg" 1>&6 -echo "${as_me:-configure}:10797: testing found package $cf_athena_pkg ..." 1>&5 +echo "${as_me:-configure}:12601: testing found package $cf_athena_pkg ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs $cf_athena_pkg 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "$cf_athena_pkg" 2>/dev/null`" test -n "$verbose" && echo " package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:10803: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:12607: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:10807: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:12611: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -10813,23 +12617,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -10838,7 +12648,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -10848,19 +12658,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -10871,32 +12689,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -10915,55 +12739,56 @@ EOF LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'` test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6 -echo "${as_me:-configure}:10918: testing ..trimmed $LIBS ..." 1>&5 +echo "${as_me:-configure}:12742: testing ..trimmed $LIBS ..." 1>&5 ;; esac done -echo "$as_me:10924: checking for usable $cf_x_athena/Xmu package" >&5 +echo "$as_me:12748: checking for usable $cf_x_athena/Xmu package" >&5 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6 if test "${cf_cv_xaw_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 10931 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 12755 "configure" #include "confdefs.h" #include int -main () +main (void) { -int check = XmuCompareISOLatin1("big", "small") +int check = XmuCompareISOLatin1("big", "small"); +(void)check; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10947: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:12772: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10950: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10953: \"$ac_try\"") >&5 + echo "$as_me:12775: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:12778: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10956: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:12781: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xaw_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xaw_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:10966: result: $cf_cv_xaw_compat" >&5 +echo "$as_me:12791: result: $cf_cv_xaw_compat" >&5 echo "${ECHO_T}$cf_cv_xaw_compat" >&6 if test "$cf_cv_xaw_compat" = no @@ -10975,25 +12800,25 @@ echo "${ECHO_T}$cf_cv_xaw_compat" >&6 (*) test -n "$verbose" && echo " work around broken package" 1>&6 -echo "${as_me:-configure}:10978: testing work around broken package ..." 1>&5 +echo "${as_me:-configure}:12803: testing work around broken package ..." 1>&5 cf_save_xmu="$LIBS" cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^ *//' -e 's/ .*//'` -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then test -n "$verbose" && echo " found package xmu" 1>&6 -echo "${as_me:-configure}:10986: testing found package xmu ..." 1>&5 +echo "${as_me:-configure}:12811: testing found package xmu ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xmu 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xmu" 2>/dev/null`" test -n "$verbose" && echo " package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:10992: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:12817: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package xmu LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:10996: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:12821: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11002,23 +12827,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11027,7 +12858,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11037,19 +12868,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11060,32 +12899,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11093,12 +12938,12 @@ LIBS="$cf_add_libs" test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:11096: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:12941: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:11101: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:12946: testing ...after $LIBS ..." 1>&5 else cf_pkgconfig_incs= @@ -11106,12 +12951,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:11109: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:12954: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:11114: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:12959: testing ...after $LIBS ..." 1>&5 fi @@ -11122,7 +12967,7 @@ fi LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'` test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6 -echo "${as_me:-configure}:11125: testing ..trimmed $LIBS ..." 1>&5 +echo "${as_me:-configure}:12970: testing ..trimmed $LIBS ..." 1>&5 ;; esac @@ -11144,20 +12989,20 @@ fi if test -z "$cf_x_athena_lib" ; then -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then test -n "$verbose" && echo " found package Xext" 1>&6 -echo "${as_me:-configure}:11150: testing found package Xext ..." 1>&5 +echo "${as_me:-configure}:12995: testing found package Xext ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs Xext 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "Xext" 2>/dev/null`" test -n "$verbose" && echo " package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11156: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13001: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package Xext LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11160: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13005: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11166,23 +13011,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11191,7 +13042,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11201,19 +13052,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11224,32 +13083,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11258,15 +13123,15 @@ else cf_pkgconfig_incs= cf_pkgconfig_libs= - echo "$as_me:11261: checking for XextCreateExtension in -lXext" >&5 + echo "$as_me:13126: checking for XextCreateExtension in -lXext" >&5 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 11269 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 13134 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11277,51 +13142,51 @@ extern "C" builtin and then its argument prototype would still apply. */ char XextCreateExtension (); int -main () +main (void) { XextCreateExtension (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11288: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:13153: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11291: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11294: \"$ac_try\"") >&5 + echo "$as_me:13156: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:13159: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11297: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:13162: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_Xext_XextCreateExtension=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_Xext_XextCreateExtension=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11308: result: $ac_cv_lib_Xext_XextCreateExtension" >&5 +echo "$as_me:13173: result: $ac_cv_lib_Xext_XextCreateExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6 -if test $ac_cv_lib_Xext_XextCreateExtension = yes; then +if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then -cf_add_libs="-lXext" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11329,7 +13194,7 @@ fi fi -# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and +# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and # in some cases has installed dummy files in the former, other cases replaced # it with a link to the new location). This complicates the configure script. # Check for that pitfall, and recover using pkg-config @@ -11338,20 +13203,20 @@ fi if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}" then -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then test -n "$verbose" && echo " found package x11" 1>&6 -echo "${as_me:-configure}:11344: testing found package x11 ..." 1>&5 +echo "${as_me:-configure}:13209: testing found package x11 ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`" test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11350: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13215: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11354: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13219: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11360,23 +13225,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11385,7 +13256,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11395,19 +13266,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11418,32 +13297,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11451,24 +13336,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:11454: WARNING: unable to find X11 library" >&5 + { echo "$as_me:13339: WARNING: unable to find X11 library" >&5 echo "$as_me: WARNING: unable to find X11 library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then test -n "$verbose" && echo " found package ice" 1>&6 -echo "${as_me:-configure}:11461: testing found package ice ..." 1>&5 +echo "${as_me:-configure}:13346: testing found package ice ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`" test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11467: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13352: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11471: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13356: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11477,23 +13362,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11502,7 +13393,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11512,19 +13403,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11535,32 +13434,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11568,24 +13473,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:11571: WARNING: unable to find ICE library" >&5 + { echo "$as_me:13476: WARNING: unable to find ICE library" >&5 echo "$as_me: WARNING: unable to find ICE library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then test -n "$verbose" && echo " found package sm" 1>&6 -echo "${as_me:-configure}:11578: testing found package sm ..." 1>&5 +echo "${as_me:-configure}:13483: testing found package sm ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`" test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11584: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13489: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11588: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13493: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11594,23 +13499,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11619,7 +13530,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11629,19 +13540,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11652,32 +13571,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11685,24 +13610,24 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:11688: WARNING: unable to find SM library" >&5 + { echo "$as_me:13613: WARNING: unable to find SM library" >&5 echo "$as_me: WARNING: unable to find SM library" >&2;} fi -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then test -n "$verbose" && echo " found package xt" 1>&6 -echo "${as_me:-configure}:11695: testing found package xt ..." 1>&5 +echo "${as_me:-configure}:13620: testing found package xt ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`" test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11701: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13626: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11705: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13630: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11711,23 +13636,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11736,7 +13667,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11746,19 +13677,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11769,32 +13708,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11802,28 +13747,30 @@ LIBS="$cf_add_libs" else cf_pkgconfig_incs= cf_pkgconfig_libs= - { echo "$as_me:11805: WARNING: unable to find Xt library" >&5 + { echo "$as_me:13750: WARNING: unable to find Xt library" >&5 echo "$as_me: WARNING: unable to find Xt library" >&2;} fi +else + LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS" fi cf_have_X_LIBS=no -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then test -n "$verbose" && echo " found package xt" 1>&6 -echo "${as_me:-configure}:11816: testing found package xt ..." 1>&5 +echo "${as_me:-configure}:13763: testing found package xt ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`" test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11822: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13769: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11826: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13773: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -11832,23 +13779,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -11857,7 +13810,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -11867,19 +13820,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -11890,32 +13851,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -11924,20 +13891,20 @@ LIBS="$cf_add_libs" ;; (*) # we have an "xt" package, but it may omit Xt's dependency on X11 -echo "$as_me:11927: checking for usable X dependency" >&5 +echo "$as_me:13894: checking for usable X dependency" >&5 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6 if test "${cf_cv_xt_x11_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 11934 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 13901 "configure" #include "confdefs.h" #include int -main () +main (void) { int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); @@ -11949,50 +13916,50 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11953: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:13920: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11956: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11959: \"$ac_try\"") >&5 + echo "$as_me:13923: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:13926: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11962: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:13929: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xt_x11_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xt_x11_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:11972: result: $cf_cv_xt_x11_compat" >&5 +echo "$as_me:13939: result: $cf_cv_xt_x11_compat" >&5 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6 if test "$cf_cv_xt_x11_compat" = no then test -n "$verbose" && echo " work around broken X11 dependency" 1>&6 -echo "${as_me:-configure}:11978: testing work around broken X11 dependency ..." 1>&5 +echo "${as_me:-configure}:13945: testing work around broken X11 dependency ..." 1>&5 # 2010/11/19 - good enough until a working Xt on Xcb is delivered. -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then test -n "$verbose" && echo " found package x11" 1>&6 -echo "${as_me:-configure}:11985: testing found package x11 ..." 1>&5 +echo "${as_me:-configure}:13952: testing found package x11 ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`" test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:11991: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:13958: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:11995: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:13962: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -12001,23 +13968,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -12026,7 +13999,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -12036,19 +14009,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -12059,32 +14040,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -12095,12 +14082,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:12098: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:14085: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:12103: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:14090: testing ...after $LIBS ..." 1>&5 fi @@ -12108,48 +14095,48 @@ fi ;; esac -echo "$as_me:12111: checking for usable X Toolkit package" >&5 +echo "$as_me:14098: checking for usable X Toolkit package" >&5 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6 if test "${cf_cv_xt_ice_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 12118 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 14105 "configure" #include "confdefs.h" #include int -main () +main (void) { -int num = IceConnectionNumber(0) +int num = IceConnectionNumber(0); (void) num ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12133: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14120: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12136: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12139: \"$ac_try\"") >&5 + echo "$as_me:14123: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14126: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12142: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14129: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xt_ice_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xt_ice_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:12152: result: $cf_cv_xt_ice_compat" >&5 +echo "$as_me:14139: result: $cf_cv_xt_ice_compat" >&5 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6 if test "$cf_cv_xt_ice_compat" = no @@ -12163,22 +14150,22 @@ echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6 (*) test -n "$verbose" && echo " work around broken ICE dependency" 1>&6 -echo "${as_me:-configure}:12166: testing work around broken ICE dependency ..." 1>&5 +echo "${as_me:-configure}:14153: testing work around broken ICE dependency ..." 1>&5 -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then test -n "$verbose" && echo " found package ice" 1>&6 -echo "${as_me:-configure}:12171: testing found package ice ..." 1>&5 +echo "${as_me:-configure}:14158: testing found package ice ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`" test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:12177: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:14164: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:12181: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:14168: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -12187,23 +14174,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -12212,7 +14205,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -12222,19 +14215,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -12245,49 +14246,55 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then test -n "$verbose" && echo " found package sm" 1>&6 -echo "${as_me:-configure}:12280: testing found package sm ..." 1>&5 +echo "${as_me:-configure}:14287: testing found package sm ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`" test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:12286: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:14293: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:12290: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:14297: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -12296,23 +14303,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -12321,7 +14334,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -12331,19 +14344,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -12354,32 +14375,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -12396,12 +14423,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:12399: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:14426: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:12404: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:14431: testing ...after $LIBS ..." 1>&5 fi @@ -12421,7 +14448,7 @@ else test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 -echo "${as_me:-configure}:12424: testing checking additions to CFLAGS ..." 1>&5 +echo "${as_me:-configure}:14451: testing checking additions to CFLAGS ..." 1>&5 cf_check_cflags="$CFLAGS" cf_check_cppflags="$CPPFLAGS" @@ -12433,23 +14460,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $X_CFLAGS do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -12458,7 +14491,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -12468,19 +14501,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -12492,142 +14533,148 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 -echo "${as_me:-configure}:12495: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 +echo "${as_me:-configure}:14536: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" - CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 -echo "${as_me:-configure}:12503: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 +echo "${as_me:-configure}:14546: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 -echo "${as_me:-configure}:12511: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 +echo "${as_me:-configure}:14556: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi if test "x$cf_check_cflags" != "x$CFLAGS" ; then -cat >conftest.$ac_ext <<_ACEOF -#line 12518 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 14565 "configure" #include "confdefs.h" #include int -main () +main (void) { printf("Hello world"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12530: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14577: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12533: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12536: \"$ac_try\"") >&5 + echo "$as_me:14580: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14583: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12539: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14586: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 -echo "${as_me:-configure}:12547: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 +echo "${as_me:-configure}:14594: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 -echo "${as_me:-configure}:12552: testing but keeping change to \$CPPFLAGS ..." 1>&5 +echo "${as_me:-configure}:14599: testing but keeping change to \$CPPFLAGS ..." 1>&5 fi - CFLAGS="$cf_check_flags" + CFLAGS="$cf_check_cflags" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi - echo "$as_me:12560: checking for XOpenDisplay" >&5 + echo "$as_me:14607: checking for XOpenDisplay" >&5 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6 if test "${ac_cv_func_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 12566 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 14613 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XOpenDisplay (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define XOpenDisplay autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef XOpenDisplay + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char XOpenDisplay (); -char (*f) (); +char XOpenDisplay (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay) -choke me -#else -f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for XOpenDisplay #endif + return XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12597: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14644: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12600: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12603: \"$ac_try\"") >&5 + echo "$as_me:14647: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14650: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12606: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14653: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_XOpenDisplay=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:12616: result: $ac_cv_func_XOpenDisplay" >&5 +echo "$as_me:14663: result: $ac_cv_func_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6 -if test $ac_cv_func_XOpenDisplay = yes; then +if test "$ac_cv_func_XOpenDisplay" = yes; then : else - echo "$as_me:12622: checking for XOpenDisplay in -lX11" >&5 + echo "$as_me:14669: checking for XOpenDisplay in -lX11" >&5 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12630 "configure" +LIBS="-lX11 $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 14677 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12638,51 +14685,51 @@ extern "C" builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int -main () +main (void) { XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12649: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14696: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12652: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12655: \"$ac_try\"") >&5 + echo "$as_me:14699: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14702: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12658: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14705: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_X11_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_X11_XOpenDisplay=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12669: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +echo "$as_me:14716: result: $ac_cv_lib_X11_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 -if test $ac_cv_lib_X11_XOpenDisplay = yes; then +if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then -cf_add_libs="-lX11" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -12690,77 +14737,77 @@ fi fi - echo "$as_me:12693: checking for XtAppInitialize" >&5 + echo "$as_me:14740: checking for XtAppInitialize" >&5 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6 if test "${ac_cv_func_XtAppInitialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 12699 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 14746 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XtAppInitialize (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define XtAppInitialize autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef XtAppInitialize + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char XtAppInitialize (); -char (*f) (); +char XtAppInitialize (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize) -choke me -#else -f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for XtAppInitialize #endif + return XtAppInitialize (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12730: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14777: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12733: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12736: \"$ac_try\"") >&5 + echo "$as_me:14780: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12739: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14786: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_XtAppInitialize=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_XtAppInitialize=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:12749: result: $ac_cv_func_XtAppInitialize" >&5 +echo "$as_me:14796: result: $ac_cv_func_XtAppInitialize" >&5 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6 -if test $ac_cv_func_XtAppInitialize = yes; then +if test "$ac_cv_func_XtAppInitialize" = yes; then : else - echo "$as_me:12755: checking for XtAppInitialize in -lXt" >&5 + echo "$as_me:14802: checking for XtAppInitialize in -lXt" >&5 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12763 "configure" +LIBS="-lXt $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 14810 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12771,52 +14818,52 @@ extern "C" builtin and then its argument prototype would still apply. */ char XtAppInitialize (); int -main () +main (void) { XtAppInitialize (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12782: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:14829: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12785: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12788: \"$ac_try\"") >&5 + echo "$as_me:14832: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:14835: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12791: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14838: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_Xt_XtAppInitialize=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_Xt_XtAppInitialize=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12802: result: $ac_cv_lib_Xt_XtAppInitialize" >&5 +echo "$as_me:14849: result: $ac_cv_lib_Xt_XtAppInitialize" >&5 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6 -if test $ac_cv_lib_Xt_XtAppInitialize = yes; then +if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LIBXT 1 EOF cf_have_X_LIBS=Xt - LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS" + LIBS="-lXt $LIBS" fi fi fi -if test $cf_have_X_LIBS = no ; then - { echo "$as_me:12819: WARNING: Unable to successfully link X Toolkit library (-lXt) with +if test "$cf_have_X_LIBS" = no ; then + { echo "$as_me:14866: WARNING: Unable to successfully link X Toolkit library (-lXt) with test program. You will have to check and add the proper libraries by hand to makefile." >&5 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with @@ -12834,65 +14881,91 @@ for cf_path in default \ /usr/local do if test -z "$cf_x_athena_inc" ; then - cf_save="$CPPFLAGS" + +cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS" +cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS" +cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS" +LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" +for cf_X_CFLAGS in $X_CFLAGS +do + case "x$cf_X_CFLAGS" in + x-[IUD]*) + CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" + ;; + *) + CFLAGS="$CFLAGS $cf_X_CFLAGS" + ;; + esac +done + cf_test=X11/$cf_x_athena_root/SimpleMenu.h - if test $cf_path != default ; then - CPPFLAGS="$cf_save -I$cf_path/include" - echo "$as_me:12841: checking for $cf_test in $cf_path" >&5 + if test "$cf_path" != default ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-I$cf_path/include" + + echo "$as_me:14907: checking for $cf_test in $cf_path" >&5 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6 else - echo "$as_me:12844: checking for $cf_test" >&5 + echo "$as_me:14910: checking for $cf_test" >&5 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6 fi - cat >conftest.$ac_ext <<_ACEOF -#line 12848 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 14914 "configure" #include "confdefs.h" #include #include <$cf_test> int -main () +main (void) { ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:12862: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:14928: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12865: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12868: \"$ac_try\"") >&5 + echo "$as_me:14931: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:14934: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12871: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:14937: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_result=no fi -rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:12880: result: $cf_result" >&5 +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + echo "$as_me:14946: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 + +LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS" +CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS" + if test "$cf_result" = yes ; then - cf_x_athena_inc=$cf_path + test "$cf_path" = default && cf_x_athena_inc=default + test "$cf_path" != default && cf_x_athena_inc="$cf_path/include" break - else - CPPFLAGS="$cf_save" fi fi done if test -z "$cf_x_athena_inc" ; then - { echo "$as_me:12892: WARNING: Unable to successfully find Athena header files with test program" >&5 -echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;} + { echo "$as_me:14962: WARNING: Unable to find Athena header files" >&5 +echo "$as_me: WARNING: Unable to find Athena header files" >&2;} elif test "$cf_x_athena_inc" != default ; then - CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc" + fi cf_x_athena_root=$cf_x_athena @@ -12914,59 +14987,54 @@ do "-l$cf_lib -lXpm -lXmu" \ "-l${cf_lib}_s -lXmu_s" do - if test -z "$cf_x_athena_lib" ; then - cf_save="$LIBS" - cf_test=XawSimpleMenuAddGlobalActions - if test $cf_path != default ; then + test -n "$cf_x_athena_lib" && break -cf_add_libs="-L$cf_path/lib $cf_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS +cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS" +cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS" +cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS" +LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" +for cf_X_CFLAGS in $X_CFLAGS do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then + case "x$cf_X_CFLAGS" in + x-[IUD]*) + CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" + ;; + *) + CFLAGS="$CFLAGS $cf_X_CFLAGS" + ;; + esac +done + + cf_test=XawSimpleMenuAddGlobalActions + test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs" + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" - echo "$as_me:12938: checking for $cf_libs in $cf_path" >&5 -echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6 - else - -cf_add_libs="$cf_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then - cf_add_1lib= - break - fi - done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" -done -LIBS="$cf_add_libs" - - echo "$as_me:12958: checking for $cf_test in $cf_libs" >&5 + echo "$as_me:15027: checking for $cf_test in $cf_libs" >&5 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6 - fi - cat >conftest.$ac_ext <<_ACEOF -#line 12962 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15030 "configure" #include "confdefs.h" #include #include int -main () +main (void) { $cf_test((XtAppContext) 0) @@ -12974,32 +15042,35 @@ $cf_test((XtAppContext) 0) return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12978: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:15046: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12981: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12984: \"$ac_try\"") >&5 + echo "$as_me:15049: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:15052: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12987: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15055: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_result=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:12996: result: $cf_result" >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + echo "$as_me:15064: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 - if test "$cf_result" = yes ; then - cf_x_athena_lib="$cf_libs" - break - fi - LIBS="$cf_save" + +LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS" +CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS" +CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS" + + if test "$cf_result" = yes ; then + cf_x_athena_lib="$cf_libs" + break fi done # cf_libs test -n "$cf_x_athena_lib" && break @@ -13007,11 +15078,27 @@ echo "${ECHO_T}$cf_result" >&6 done if test -z "$cf_x_athena_lib" ; then - { { echo "$as_me:13010: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5 + { { echo "$as_me:15081: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;} { (exit 1); exit 1; }; } fi +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 +echo "$as_me:15113: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 13032 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15119 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13036: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:15123: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:13042: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:15129: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -13053,14 +15140,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:13061: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:15148: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:15158: checking for declaration of fd_set" >&5 echo $ECHO_N "checking for declaration of fd_set... $ECHO_C" >&6 if test "${cf_cv_type_fd_set+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me:-configure}:13077: testing sys/types alone ..." 1>&5 +echo "${as_me:-configure}:15164: testing sys/types alone ..." 1>&5 -cat >conftest.$ac_ext <<_ACEOF -#line 13080 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 15167 "configure" #include "confdefs.h" #include int -main () +main (void) { -fd_set x +fd_set x; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13093: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15180: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13096: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13099: \"$ac_try\"") >&5 + echo "$as_me:15183: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15186: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13102: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15189: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_type_fd_set=sys/types.h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 -echo "${as_me:-configure}:13109: testing X11/Xpoll.h ..." 1>&5 +echo "${as_me:-configure}:15196: testing X11/Xpoll.h ..." 1>&5 -cat >conftest.$ac_ext <<_ACEOF -#line 13112 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 15199 "configure" #include "confdefs.h" #ifdef HAVE_X11_XPOLL_H #include #endif int -main () +main (void) { -fd_set x +fd_set x; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13127: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15214: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13130: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13133: \"$ac_try\"") >&5 + echo "$as_me:15217: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15220: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13136: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15223: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_type_fd_set=X11/Xpoll.h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 -echo "${as_me:-configure}:13143: testing sys/select.h ..." 1>&5 +echo "${as_me:-configure}:15230: testing sys/select.h ..." 1>&5 -cat >conftest.$ac_ext <<_ACEOF -#line 13146 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 15233 "configure" #include "confdefs.h" #include #include int -main () +main (void) { -fd_set x +fd_set x; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13160: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15247: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13163: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13166: \"$ac_try\"") >&5 + echo "$as_me:15250: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15253: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13169: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15256: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_type_fd_set=sys/select.h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_type_fd_set=unknown fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:13183: result: $cf_cv_type_fd_set" >&5 +echo "$as_me:15270: result: $cf_cv_type_fd_set" >&5 echo "${ECHO_T}$cf_cv_type_fd_set" >&6 if test $cf_cv_type_fd_set = sys/select.h ; then @@ -13190,86 +15277,86 @@ EOF fi -echo "$as_me:13193: checking for declaration of fd_mask" >&5 +echo "$as_me:15280: checking for declaration of fd_mask" >&5 echo $ECHO_N "checking for declaration of fd_mask... $ECHO_C" >&6 if test "${cf_cv_type_fd_mask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test x$cf_cv_type_fd_set = xX11/Xpoll.h ; then - cat >conftest.$ac_ext <<_ACEOF -#line 13201 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15288 "configure" #include "confdefs.h" #include int -main () +main (void) { fd_mask x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13214: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15301: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13217: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13220: \"$ac_try\"") >&5 + echo "$as_me:15304: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15307: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13223: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15310: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 -echo "${as_me:-configure}:13230: testing if we must define CSRG_BASED ..." 1>&5 +echo "${as_me:-configure}:15317: testing if we must define CSRG_BASED ..." 1>&5 # Xosdefs.h on Mac OS X may not define this (but it should). - cat >conftest.$ac_ext <<_ACEOF -#line 13234 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15321 "configure" #include "confdefs.h" #define CSRG_BASED #include int -main () +main (void) { fd_mask x ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13248: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15335: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13251: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13254: \"$ac_try\"") >&5 + echo "$as_me:15338: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15341: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13257: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15344: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_type_fd_mask=CSRG_BASED else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" else cf_cv_type_fd_mask=$cf_cv_type_fd_set fi fi -echo "$as_me:13272: result: $cf_cv_type_fd_mask" >&5 +echo "$as_me:15359: result: $cf_cv_type_fd_mask" >&5 echo "${ECHO_T}$cf_cv_type_fd_mask" >&6 if test x$cf_cv_type_fd_mask = xCSRG_BASED ; then @@ -13279,111 +15366,228 @@ EOF fi -echo "$as_me:13282: checking for IRIX 6.5 baud-rate redefinitions" >&5 +echo "$as_me:15369: checking for IRIX 6.5 baud-rate redefinitions" >&5 echo $ECHO_N "checking for IRIX 6.5 baud-rate redefinitions... $ECHO_C" >&6 if test "${cf_cv_termio_c_ispeed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 13289 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 15376 "configure" #include "confdefs.h" #include #include int -main () +main (void) { struct termio foo; foo.c_ispeed = B38400; foo.c_ospeed = B9600; +(void)foo; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13307: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15395: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13310: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13313: \"$ac_try\"") >&5 + echo "$as_me:15398: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15401: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13316: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15404: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_termio_c_ispeed=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_termio_c_ispeed=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:13328: result: $cf_cv_termio_c_ispeed" >&5 +echo "$as_me:15416: result: $cf_cv_termio_c_ispeed" >&5 echo "${ECHO_T}$cf_cv_termio_c_ispeed" >&6 test "$cf_cv_termio_c_ispeed" = yes && cat >>confdefs.h <<\EOF #define HAVE_TERMIO_C_ISPEED 1 EOF -# If we notice Xcursor, there is a workaround needed. -echo "$as_me:13336: checking for XcursorGetTheme in -lXcursor" >&5 -echo $ECHO_N "checking for XcursorGetTheme in -lXcursor... $ECHO_C" >&6 -if test "${ac_cv_lib_Xcursor_XcursorGetTheme+set}" = set; then +echo "$as_me:15423: checking for termios type tcflag_t" >&5 +echo $ECHO_N "checking for termios type tcflag_t... $ECHO_C" >&6 +if test "${cf_cv_havetype_tcflag_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXcursor $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 13344 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XcursorGetTheme (); + cat >"conftest.$ac_ext" <<_ACEOF +#line 15430 "configure" +#include "confdefs.h" +#include int -main () +main (void) { -XcursorGetTheme (); + + tcflag_t x = 0; (void)x ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13363: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15443: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13366: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13369: \"$ac_try\"") >&5 + echo "$as_me:15446: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15449: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13372: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xcursor_XcursorGetTheme=yes + echo "$as_me:15452: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_havetype_tcflag_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_Xcursor_XcursorGetTheme=no +cat "conftest.$ac_ext" >&5 +cf_cv_havetype_tcflag_t=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + fi -echo "$as_me:13383: result: $ac_cv_lib_Xcursor_XcursorGetTheme" >&5 -echo "${ECHO_T}$ac_cv_lib_Xcursor_XcursorGetTheme" >&6 -if test $ac_cv_lib_Xcursor_XcursorGetTheme = yes; then - cat >>confdefs.h <<\EOF +echo "$as_me:15463: result: $cf_cv_havetype_tcflag_t" >&5 +echo "${ECHO_T}$cf_cv_havetype_tcflag_t" >&6 +test "$cf_cv_havetype_tcflag_t" = no && +cat >>confdefs.h <<\EOF +#define tcflag_t unsigned long +EOF + +echo "$as_me:15470: checking for termios type speed_t" >&5 +echo $ECHO_N "checking for termios type speed_t... $ECHO_C" >&6 +if test "${cf_cv_havetype_speed_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 15477 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + + speed_t x = 0; (void)x + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15490: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:15493: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15496: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15499: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_havetype_speed_t=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_havetype_speed_t=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:15510: result: $cf_cv_havetype_speed_t" >&5 +echo "${ECHO_T}$cf_cv_havetype_speed_t" >&6 +test "$cf_cv_havetype_speed_t" = no && +cat >>confdefs.h <<\EOF +#define speed_t unsigned short +EOF + +echo "$as_me:15517: checking for termios type cc_t" >&5 +echo $ECHO_N "checking for termios type cc_t... $ECHO_C" >&6 +if test "${cf_cv_havetype_cc_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 15524 "configure" +#include "confdefs.h" +#include +int +main (void) +{ + + cc_t x = 0; (void)x + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:15537: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:15540: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:15543: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15546: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_havetype_cc_t=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_havetype_cc_t=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:15557: result: $cf_cv_havetype_cc_t" >&5 +echo "${ECHO_T}$cf_cv_havetype_cc_t" >&6 +test "$cf_cv_havetype_cc_t" = no && +cat >>confdefs.h <<\EOF +#define cc_t unsigned char +EOF + +# The Xcursor library is normally (weakly) linked via the X11 library rather +# than directly to applications. xterm can select a cursor theme; users can +# also use environment variables to select cursor size. We would only notice +# the library if there are development files for it. Provide a way to disable +# the feature if it is unwanted. +echo "$as_me:15569: checking if we expect to use the Xcursor library" >&5 +echo $ECHO_N "checking if we expect to use the Xcursor library... $ECHO_C" >&6 + +# Check whether --enable-xcursor or --disable-xcursor was given. +if test "${enable_xcursor+set}" = set; then + enableval="$enable_xcursor" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + enable_xcursor=no + else + enable_xcursor=yes + fi +else + enableval=yes + enable_xcursor=yes + +fi; +echo "$as_me:15586: result: $enable_xcursor" >&5 +echo "${ECHO_T}$enable_xcursor" >&6 +if test "$enable_xcursor" = yes; then + +cat >>confdefs.h <<\EOF #define HAVE_LIB_XCURSOR 1 EOF @@ -13396,24 +15600,24 @@ stropts.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13399: checking for $ac_header" >&5 +echo "$as_me:15603: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 13405 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15609 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13409: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:15613: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:13415: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:15619: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -13426,14 +15630,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:13434: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:15638: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:15668: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 13462 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15674 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13493: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:15705: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13496: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13499: \"$ac_try\"") >&5 + echo "$as_me:15708: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:15711: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13502: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15714: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:13512: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:15724: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 + echo "$as_me:15736: checking if grantpt really works" >&5 echo $ECHO_N "checking if grantpt really works... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -#line 13527 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15739 "configure" #include "confdefs.h" #include +#include #include #include #include @@ -13551,29 +15764,30 @@ static void failed(int code) static void my_timeout(int sig) { + (void)sig; exit(99); } int -main () +main (void) { int code = 0; - int rc; int pty; int tty; char *slave; struct termios tio; + (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); - else if ((rc = grantpt(pty)) < 0) + else if (grantpt(pty) < 0) failed(2); - else if ((rc = unlockpt(pty)) < 0) + else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); @@ -13582,9 +15796,9 @@ main () failed(4); #endif #if CONFTEST >= 4 - else if ((rc = tcgetattr(pty, &tio)) < 0) + else if (tcgetattr(pty, &tio) < 0) failed(20); - else if ((rc = tcsetattr(pty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. @@ -13595,53 +15809,54 @@ main () #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) - else if ((rc = ioctl(tty, I_PUSH, "ptem")) < 0) + else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) - else if ((rc = ioctl(tty, I_PUSH, "ldterm")) < 0) + else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) - else if ((rc = ioctl(tty, I_PUSH, "ttcompat")) < 0) + else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 - else if ((rc = tcgetattr(tty, &tio)) < 0) + else if (tcgetattr(tty, &tio) < 0) failed(30); - else if ((rc = tcsetattr(tty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ - + (void) tty; ${cf_cv_main_return:-return}(code); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13625: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:15839: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13628: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13631: \"$ac_try\"") >&5 + echo "$as_me:15842: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:15845: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13634: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15848: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then ac_cv_func_grantpt=maybe else - cat >conftest.$ac_ext <<_ACEOF -#line 13641 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 15855 "configure" #include "confdefs.h" #include +#include #include #include #include @@ -13665,6 +15880,7 @@ static void failed(int code) static void my_timeout(int sig) { + (void)sig; exit(99); } @@ -13672,21 +15888,21 @@ int main(void) { int code = 0; - int rc; int pty; int tty; char *slave; struct termios tio; + (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); - else if ((rc = grantpt(pty)) < 0) + else if (grantpt(pty) < 0) failed(2); - else if ((rc = unlockpt(pty)) < 0) + else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); @@ -13695,9 +15911,9 @@ int main(void) failed(4); #endif #if CONFTEST >= 4 - else if ((rc = tcgetattr(pty, &tio)) < 0) + else if (tcgetattr(pty, &tio) < 0) failed(20); - else if ((rc = tcsetattr(pty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. @@ -13708,66 +15924,66 @@ int main(void) #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) - else if ((rc = ioctl(tty, I_PUSH, "ptem")) < 0) + else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) - else if ((rc = ioctl(tty, I_PUSH, "ldterm")) < 0) + else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) - else if ((rc = ioctl(tty, I_PUSH, "ttcompat")) < 0) + else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 - else if ((rc = tcgetattr(tty, &tio)) < 0) + else if (tcgetattr(tty, &tio) < 0) failed(30); - else if ((rc = tcsetattr(tty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ - + (void) tty; ${cf_cv_main_return:-return}(code); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:13737: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:15953: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13740: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13742: \"$ac_try\"") >&5 + echo "$as_me:15956: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:15958: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13745: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:15961: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_grantpt=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_grantpt=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:13764: result: $ac_cv_func_grantpt" >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + echo "$as_me:15980: result: $ac_cv_func_grantpt" >&5 echo "${ECHO_T}$ac_cv_func_grantpt" >&6 if test "x$ac_cv_func_grantpt" != "xno" ; then if test "x$ac_cv_func_grantpt" = "xyes" ; then - echo "$as_me:13770: checking for pty features" >&5 + echo "$as_me:15986: checking for pty features" >&5 echo $ECHO_N "checking for pty features... $ECHO_C" >&6 if test "x$ac_cv_header_stropts_h" = xyes then @@ -13781,22 +15997,23 @@ echo $ECHO_N "checking for pty features... $ECHO_C" >&6 do cf_pty_feature= - cf_pty_next=`expr $cf_pty_this + 1` + cf_pty_next="`expr $cf_pty_this + 1`" -echo "${as_me:-configure}:13786: testing pty feature test $cf_pty_next:5 ..." 1>&5 +echo "${as_me:-configure}:16002: testing pty feature test $cf_pty_next:5 ..." 1>&5 if test "$cross_compiling" = yes; then - { { echo "$as_me:13789: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:16005: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else - cat >conftest.$ac_ext <<_ACEOF -#line 13794 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 16010 "configure" #include "confdefs.h" #define CONFTEST $cf_pty_this $cf_pty_defines #include +#include #include #include #include @@ -13820,6 +16037,7 @@ static void failed(int code) static void my_timeout(int sig) { + (void)sig; exit(99); } @@ -13827,21 +16045,21 @@ int main(void) { int code = 0; - int rc; int pty; int tty; char *slave; struct termios tio; + (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); - else if ((rc = grantpt(pty)) < 0) + else if (grantpt(pty) < 0) failed(2); - else if ((rc = unlockpt(pty)) < 0) + else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); @@ -13850,9 +16068,9 @@ int main(void) failed(4); #endif #if CONFTEST >= 4 - else if ((rc = tcgetattr(pty, &tio)) < 0) + else if (tcgetattr(pty, &tio) < 0) failed(20); - else if ((rc = tcsetattr(pty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. @@ -13863,42 +16081,42 @@ int main(void) #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) - else if ((rc = ioctl(tty, I_PUSH, "ptem")) < 0) + else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) - else if ((rc = ioctl(tty, I_PUSH, "ldterm")) < 0) + else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) - else if ((rc = ioctl(tty, I_PUSH, "ttcompat")) < 0) + else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 - else if ((rc = tcgetattr(tty, &tio)) < 0) + else if (tcgetattr(tty, &tio) < 0) failed(30); - else if ((rc = tcsetattr(tty, TCSAFLUSH, &tio)) < 0) + else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ - + (void) tty; ${cf_cv_main_return:-return}(code); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:13892: \"$ac_link\"") >&5 +rm -f "conftest$ac_exeext" +if { (eval echo "$as_me:16110: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13895: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13897: \"$ac_try\"") >&5 + echo "$as_me:16113: \$? = $ac_status" >&5 + (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' + { (eval echo "$as_me:16115: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13900: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16118: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then case $cf_pty_next in (1) # - streams @@ -13924,19 +16142,19 @@ if { (eval echo "$as_me:13892: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 case $cf_pty_next in (1|2|3) -echo "${as_me:-configure}:13932: testing skipping remaining streams features $cf_pty_this..2 ..." 1>&5 +echo "${as_me:-configure}:16150: testing skipping remaining streams features $cf_pty_this..2 ..." 1>&5 cf_pty_next=3 ;; esac fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi if test -n "$cf_pty_feature" then @@ -13948,23 +16166,28 @@ fi cf_pty_this=$cf_pty_next done - echo "$as_me:13951: result: $cf_grantpt_opts" >&5 + echo "$as_me:16169: result: $cf_grantpt_opts" >&5 echo "${ECHO_T}$cf_grantpt_opts" >&6 cf_grantpt_opts=`echo "$cf_grantpt_opts" | sed -e 's/ isatty//'` fi fi fi -if test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then - echo "$as_me:13959: checking for openpty in -lutil" >&5 +if test "x$cf_prefer_posix_openpt" = "xyes" && test "x$ac_cv_func_posix_openpt" = "xyes" ; then + test -n "$verbose" && echo " prefer posix_openpt over openpty" 1>&6 + +echo "${as_me:-configure}:16179: testing prefer posix_openpt over openpty ..." 1>&5 + +elif test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then + echo "$as_me:16182: checking for openpty in -lutil" >&5 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6 if test "${ac_cv_lib_util_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 13967 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 16190 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -13975,37 +16198,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char openpty (); int -main () +main (void) { openpty (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13986: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:16209: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13989: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13992: \"$ac_try\"") >&5 + echo "$as_me:16212: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:16215: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13995: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16218: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_util_openpty=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_util_openpty=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:14006: result: $ac_cv_lib_util_openpty" >&5 +echo "$as_me:16229: result: $ac_cv_lib_util_openpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6 -if test $ac_cv_lib_util_openpty = yes; then +if test "$ac_cv_lib_util_openpty" = yes; then cf_have_openpty=yes else cf_have_openpty=no @@ -14026,24 +16249,24 @@ for ac_header in \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:14029: checking for $ac_header" >&5 +echo "$as_me:16252: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 14035 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 16258 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:14039: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:16262: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:14045: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:16268: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -14056,14 +16279,14 @@ if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:14064: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +echo "$as_me:16287: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&6 -echo "${as_me:-configure}:14081: testing will rely upon grantpt ..." 1>&5 +echo "${as_me:-configure}:16304: testing will rely upon grantpt ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_WORKING_GRANTPT 1 @@ -14099,23 +16322,23 @@ elif test "x$cf_have_openpty" = xno then test -n "$verbose" && echo " will rely upon BSD-pseudoterminals" 1>&6 -echo "${as_me:-configure}:14102: testing will rely upon BSD-pseudoterminals ..." 1>&5 +echo "${as_me:-configure}:16325: testing will rely upon BSD-pseudoterminals ..." 1>&5 else test -n "$verbose" && echo " will rely upon openpty" 1>&6 -echo "${as_me:-configure}:14107: testing will rely upon openpty ..." 1>&5 +echo "${as_me:-configure}:16330: testing will rely upon openpty ..." 1>&5 fi -echo "$as_me:14111: checking if we can use XkbQueryExtension" >&5 +echo "$as_me:16334: checking if we can use XkbQueryExtension" >&5 echo $ECHO_N "checking if we can use XkbQueryExtension... $ECHO_C" >&6 if test "${cf_cv_xkb_query_extension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 14118 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 16341 "configure" #include "confdefs.h" #include @@ -14123,7 +16346,7 @@ cat >conftest.$ac_ext <<_ACEOF #include int -main () +main (void) { int xkbmajor = XkbMajorVersion; @@ -14143,32 +16366,32 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14147: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:16370: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14150: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14153: \"$ac_try\"") >&5 + echo "$as_me:16373: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:16376: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14156: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16379: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xkb_query_extension=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xkb_query_extension=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:14171: result: $cf_cv_xkb_query_extension" >&5 +echo "$as_me:16394: result: $cf_cv_xkb_query_extension" >&5 echo "${ECHO_T}$cf_cv_xkb_query_extension" >&6 if test $cf_cv_xkb_query_extension = yes @@ -14177,65 +16400,65 @@ then for ac_func in XkbQueryExtension do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:14180: checking for $ac_func" >&5 +echo "$as_me:16403: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 14186 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 16409 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14217: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:16440: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14220: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14223: \"$ac_try\"") >&5 + echo "$as_me:16443: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:16446: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14226: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16449: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:14236: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:16459: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:16471: checking if we can use XkbKeycodeToKeysym" >&5 echo $ECHO_N "checking if we can use XkbKeycodeToKeysym... $ECHO_C" >&6 if test "${cf_cv_xkb_keycode_to_keysym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 14255 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 16478 "configure" #include "confdefs.h" #include #include int -main () +main (void) { KeySym keysym = XkbKeycodeToKeysym((Display *)0, 0, 0, 0); + (void)keysym; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14272: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:16496: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14275: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14278: \"$ac_try\"") >&5 + echo "$as_me:16499: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:16502: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14281: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16505: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xkb_keycode_to_keysym=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xkb_keycode_to_keysym=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi -echo "$as_me:14296: result: $cf_cv_xkb_keycode_to_keysym" >&5 +echo "$as_me:16520: result: $cf_cv_xkb_keycode_to_keysym" >&5 echo "${ECHO_T}$cf_cv_xkb_keycode_to_keysym" >&6 if test $cf_cv_xkb_keycode_to_keysym = yes @@ -14302,65 +16526,65 @@ then for ac_func in XkbKeycodeToKeysym do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:14305: checking for $ac_func" >&5 +echo "$as_me:16529: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 14311 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 16535 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14342: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:16566: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14345: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14348: \"$ac_try\"") >&5 + echo "$as_me:16569: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:16572: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14351: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16575: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:14361: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:16585: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +cf_save_LIBS_CF_XKB_BELL_EXT="$LIBS" +cf_save_CFLAGS_CF_XKB_BELL_EXT="$CFLAGS" +cf_save_CPPFLAGS_CF_XKB_BELL_EXT="$CPPFLAGS" +LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" +for cf_X_CFLAGS in $X_CFLAGS +do + case "x$cf_X_CFLAGS" in + x-[IUD]*) + CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" + ;; + *) + CFLAGS="$CFLAGS $cf_X_CFLAGS" + ;; + esac +done + +echo "$as_me:16613: checking for XKB Bell extension" >&5 echo $ECHO_N "checking for XKB Bell extension... $ECHO_C" >&6 if test "${cf_cv_xkb_bell_ext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 14380 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 16620 "configure" #include "confdefs.h" #include @@ -14385,107 +16625,112 @@ cat >conftest.$ac_ext <<_ACEOF #include /* has the XkbBI_xxx definitions */ int -main () +main (void) { int x = (XkbBI_Info |XkbBI_MinorError |XkbBI_MajorError |XkbBI_TerminalBell |XkbBI_MarginBell); - Atom y; + Atom y = 0; + (void)x; XkbBell((Display *)0, (Widget)0, 0, y); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14400: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:16641: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14403: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14406: \"$ac_try\"") >&5 + echo "$as_me:16644: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:16647: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14409: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16650: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xkb_bell_ext=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xkb_bell_ext=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:14420: result: $cf_cv_xkb_bell_ext" >&5 +echo "$as_me:16661: result: $cf_cv_xkb_bell_ext" >&5 echo "${ECHO_T}$cf_cv_xkb_bell_ext" >&6 test "$cf_cv_xkb_bell_ext" = yes && cat >>confdefs.h <<\EOF #define HAVE_XKB_BELL_EXT 1 EOF +LIBS="$cf_save_LIBS_CF_XKB_BELL_EXT" +CFLAGS="$cf_save_CFLAGS_CF_XKB_BELL_EXT" +CPPFLAGS="$cf_save_CPPFLAGS_CF_XKB_BELL_EXT" + for ac_func in Xutf8LookupString do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:14430: checking for $ac_func" >&5 +echo "$as_me:16675: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 14436 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 16681 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14467: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:16712: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14470: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14473: \"$ac_try\"") >&5 + echo "$as_me:16715: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:16718: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14476: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:16721: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:14486: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:16731: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:16747: checking if you want narrow prototypes for X libraries" >&5 echo $ECHO_N "checking if you want narrow prototypes for X libraries... $ECHO_C" >&6 case `$ac_config_guess` in -(*freebsd*|*gnu*|*irix5*|*irix6*|*linux-gnu*|*netbsd*|*openbsd*|*qnx*|*sco*|*sgi*) +(*freebsd*|*gnu*|*irix5*|*irix6*|*netbsd*|*openbsd*|*qnx*|*sco*|*sgi*) cf_default_narrowproto=yes ;; (*) @@ -14515,37 +16760,37 @@ esac if test "${enable_narrowproto+set}" = set; then enableval="$enable_narrowproto" test "$enableval" != no && enableval=yes - if test "$enableval" != "$cf_default_narrowproto" ; then + if test "$enableval" != "$cf_default_narrowproto" ; then enable_narrowproto=$enableval - else - enable_narrowproto=$cf_default_narrowproto - fi + else + enable_narrowproto=$cf_default_narrowproto + fi else enableval=$cf_default_narrowproto - enable_narrowproto=$cf_default_narrowproto + enable_narrowproto=$cf_default_narrowproto fi; -echo "$as_me:14528: result: $enable_narrowproto" >&5 +echo "$as_me:16773: result: $enable_narrowproto" >&5 echo "${ECHO_T}$enable_narrowproto" >&6 -echo "$as_me:14531: checking if we should use imake to help" >&5 +echo "$as_me:16776: checking if we should use imake to help" >&5 echo $ECHO_N "checking if we should use imake to help... $ECHO_C" >&6 # Check whether --enable-imake or --disable-imake was given. if test "${enable_imake+set}" = set; then enableval="$enable_imake" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_imake=no - else - enable_imake=yes - fi + else + enable_imake=yes + fi else enableval=yes - enable_imake=yes + enable_imake=yes fi; -echo "$as_me:14548: result: $enable_imake" >&5 +echo "$as_me:16793: result: $enable_imake" >&5 echo "${ECHO_T}$enable_imake" >&6 if test "$enable_imake" = yes ; then @@ -14554,7 +16799,7 @@ for ac_prog in xmkmf imake do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:14557: checking for $ac_word" >&5 +echo "$as_me:16802: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_IMAKE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14571,7 +16816,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_IMAKE="$ac_dir/$ac_word" - echo "$as_me:14574: found $ac_dir/$ac_word" >&5 + echo "$as_me:16819: found $ac_dir/$ac_word" >&5 break fi done @@ -14582,10 +16827,10 @@ fi IMAKE=$ac_cv_path_IMAKE if test -n "$IMAKE"; then - echo "$as_me:14585: result: $IMAKE" >&5 + echo "$as_me:16830: result: $IMAKE" >&5 echo "${ECHO_T}$IMAKE" >&6 else - echo "$as_me:14588: result: no" >&5 + echo "$as_me:16833: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14600,7 +16845,7 @@ case $IMAKE in ;; (*/util/xmkmf) # A single parameter tells xmkmf where the config-files are: - cf_imake_opts="`echo $IMAKE|sed -e s,/config/util/xmkmf,,`" + cf_imake_opts="`echo "$IMAKE"|sed -e s,/config/util/xmkmf,,`" ;; (*) cf_imake_opts= @@ -14611,7 +16856,7 @@ esac # config directory. if mkdir conftestdir; then CDPATH=; export CDPATH - cf_makefile=`cd $srcdir;pwd`/Imakefile + cf_makefile=`cd "$srcdir" || exit;pwd`/Imakefile cd conftestdir cat >fix_cflags.sed <<'CF_EOF' @@ -14633,7 +16878,7 @@ s/$/"/ CF_EOF echo >./Imakefile - test -f $cf_makefile && cat $cf_makefile >>./Imakefile + test -f "$cf_makefile" && cat "$cf_makefile" >>./Imakefile cat >> ./Imakefile <<'CF_EOF' findstddefs: @@ -14641,40 +16886,40 @@ findstddefs: @echo IMAKE ${EXTRA_LOAD_FLAGS} | sed -f fix_lflags.sed CF_EOF - if ( $IMAKE $cf_imake_opts 1>/dev/null 2>&5 && test -f Makefile) + if ( $IMAKE "$cf_imake_opts" 1>/dev/null 2>&5 && test -f Makefile) then test -n "$verbose" && echo " Using $IMAKE $cf_imake_opts" 1>&6 -echo "${as_me:-configure}:14648: testing Using $IMAKE $cf_imake_opts ..." 1>&5 +echo "${as_me:-configure}:16893: testing Using $IMAKE $cf_imake_opts ..." 1>&5 else # sometimes imake doesn't have the config path compiled in. Find it. cf_config= for cf_libpath in $X_LIBS $LIBS ; do - case $cf_libpath in + case "$cf_libpath" in (-L*) - cf_libpath=`echo .$cf_libpath | sed -e 's/^...//'` - cf_libpath=$cf_libpath/X11/config - if test -d $cf_libpath ; then - cf_config=$cf_libpath + cf_libpath=`echo ".$cf_libpath" | sed -e 's/^...//'` + cf_libpath="$cf_libpath/X11/config" + if test -d "$cf_libpath" ; then + cf_config="$cf_libpath" break fi ;; esac done if test -z "$cf_config" ; then - { echo "$as_me:14666: WARNING: Could not find imake config-directory" >&5 + { echo "$as_me:16911: WARNING: Could not find imake config-directory" >&5 echo "$as_me: WARNING: Could not find imake config-directory" >&2;} else cf_imake_opts="$cf_imake_opts -I$cf_config" - if ( $IMAKE -v $cf_imake_opts 2>&5) + if ( "$IMAKE" -v "$cf_imake_opts" 2>&5) then test -n "$verbose" && echo " Using $IMAKE $cf_config" 1>&6 -echo "${as_me:-configure}:14674: testing Using $IMAKE $cf_config ..." 1>&5 +echo "${as_me:-configure}:16919: testing Using $IMAKE $cf_config ..." 1>&5 else - { echo "$as_me:14677: WARNING: Cannot run $IMAKE" >&5 + { echo "$as_me:16922: WARNING: Cannot run $IMAKE" >&5 echo "$as_me: WARNING: Cannot run $IMAKE" >&2;} fi fi @@ -14682,7 +16927,7 @@ echo "$as_me: WARNING: Cannot run $IMAKE" >&2;} # GNU make sometimes prints "make[1]: Entering...", which # would confuse us. - eval `make findstddefs 2>/dev/null | grep -v make` + eval "`make findstddefs 2>/dev/null | grep -v make`" cd .. rm -rf conftestdir @@ -14718,7 +16963,7 @@ echo "$as_me: WARNING: Cannot run $IMAKE" >&2;} else test -n "$verbose" && echo " suppressed \"$cf_nostdinc\" and \"$cf_std_incl\"" 1>&6 -echo "${as_me:-configure}:14721: testing suppressed \"$cf_nostdinc\" and \"$cf_std_incl\" ..." 1>&5 +echo "${as_me:-configure}:16966: testing suppressed \"$cf_nostdinc\" and \"$cf_std_incl\" ..." 1>&5 IMAKE_CFLAGS="$cf_cpp_opts" fi @@ -14740,11 +16985,11 @@ fi test -n "$verbose" && echo " IMAKE_CFLAGS $IMAKE_CFLAGS" 1>&6 -echo "${as_me:-configure}:14743: testing IMAKE_CFLAGS $IMAKE_CFLAGS ..." 1>&5 +echo "${as_me:-configure}:16988: testing IMAKE_CFLAGS $IMAKE_CFLAGS ..." 1>&5 test -n "$verbose" && echo " IMAKE_LOADFLAGS $IMAKE_LOADFLAGS" 1>&6 -echo "${as_me:-configure}:14747: testing IMAKE_LOADFLAGS $IMAKE_LOADFLAGS ..." 1>&5 +echo "${as_me:-configure}:16992: testing IMAKE_LOADFLAGS $IMAKE_LOADFLAGS ..." 1>&5 fi @@ -14757,23 +17002,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $IMAKE_CFLAGS do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -14782,7 +17033,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -14792,19 +17043,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -14815,17 +17074,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi else @@ -14833,7 +17098,7 @@ else IMAKE_LOADFLAGS= test -n "$verbose" && echo " make fallback definitions" 1>&6 -echo "${as_me:-configure}:14836: testing make fallback definitions ..." 1>&5 +echo "${as_me:-configure}:17101: testing make fallback definitions ..." 1>&5 # We prefer config.guess' values when we can get them, to avoid # inconsistent results with uname (AIX for instance). However, @@ -14878,6 +17143,23 @@ echo "${as_me:-configure}:14836: testing make fallback definitions ..." 1>&5 ;; esac + # "modern" systems install X applications in /usr/bin. Other systems may + # use one of the X release-based directories. + case "$CFLAGS $CPPFLAGS $IMAKE_CFLAGS" in + (*-DPROJECTROOT*) + ;; + (*) + for cf_dir in /usr/X11R7 /usr/X11R6 /usr/X11R5 + do + if test -d "$cf_dir/bin" + then + IMAKE_CFLAGS="$IMAKE_CFLAGS -DPROJECTROOT=\\\"$cf_dir\\\"" + break + fi + done + ;; + esac + cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= @@ -14885,23 +17167,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $IMAKE_CFLAGS do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -14910,7 +17198,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -14920,19 +17208,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -14943,24 +17239,30 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 -echo "$as_me:14963: checking for $ac_word" >&5 +echo "$as_me:17265: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14977,7 +17279,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:14980: found $ac_dir/$ac_word" >&5 + echo "$as_me:17282: found $ac_dir/$ac_word" >&5 break fi done @@ -14989,10 +17291,91 @@ fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then - echo "$as_me:14992: result: $GROFF_PATH" >&5 + echo "$as_me:17294: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else - echo "$as_me:14995: result: no" >&5 + echo "$as_me:17297: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +for ac_prog in nroff mandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:17305: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NROFF_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NROFF_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_NROFF_PATH="$NROFF_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" + echo "$as_me:17322: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +NROFF_PATH=$ac_cv_path_NROFF_PATH + +if test -n "$NROFF_PATH"; then + echo "$as_me:17333: result: $NROFF_PATH" >&5 +echo "${ECHO_T}$NROFF_PATH" >&6 +else + echo "$as_me:17336: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NROFF_PATH" && break +done +test -n "$NROFF_PATH" || NROFF_PATH="no" + +# Extract the first word of "tbl", so it can be a program name with args. +set dummy tbl; ac_word=$2 +echo "$as_me:17346: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TBL_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TBL_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_TBL_PATH="$TBL_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_TBL_PATH="$ac_dir/$ac_word" + echo "$as_me:17363: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_TBL_PATH" && ac_cv_path_TBL_PATH="cat" + ;; +esac +fi +TBL_PATH=$ac_cv_path_TBL_PATH + +if test -n "$TBL_PATH"; then + echo "$as_me:17375: result: $TBL_PATH" >&5 +echo "${ECHO_T}$TBL_PATH" >&6 +else + echo "$as_me:17378: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15005,26 +17388,74 @@ else GROFF_NOTE= fi -echo "$as_me:15008: checking for program to convert manpage to html" >&5 -echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 - -# Check whether --with-man2html or --without-man2html was given. -if test "${with_man2html+set}" = set; then - withval="$with_man2html" - cf_man2html=$withval +echo "$as_me:17391: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_path_FGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cf_man2html=$GROFF_PATH -fi; + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + for ac_prog in gfgrep fgrep +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:17403: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_FGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $FGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_FGREP="$ac_dir/$ac_word" + echo "$as_me:17420: found $ac_dir/$ac_word" >&5 + break +fi +done -cf_with_groff=no + ;; +esac +fi +FGREP=$ac_cv_path_FGREP -case $cf_man2html in -(yes) - echo "$as_me:15023: result: man2html" >&5 -echo "${ECHO_T}man2html" >&6 +if test -n "$FGREP"; then + echo "$as_me:17431: result: $FGREP" >&5 +echo "${ECHO_T}$FGREP" >&6 +else + echo "$as_me:17434: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$FGREP" && break +done +test -n "$FGREP" || FGREP=": " + + test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:17442: error: cannot find workable fgrep" >&5 +echo "$as_me: error: cannot find workable fgrep" >&2;} + { (exit 1); exit 1; }; } + fi +fi +echo "$as_me:17447: result: $ac_cv_path_FGREP" >&5 +echo "${ECHO_T}$ac_cv_path_FGREP" >&6 + FGREP="$ac_cv_path_FGREP" + +case "x${with_man2html}" in +(xno) + cf_man2html=no + ;; +(x|xyes) # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 -echo "$as_me:15027: checking for $ac_word" >&5 +echo "$as_me:17458: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15041,7 +17472,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" - echo "$as_me:15044: found $ac_dir/$ac_word" >&5 + echo "$as_me:17475: found $ac_dir/$ac_word" >&5 break fi done @@ -15053,10 +17484,85 @@ fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then - echo "$as_me:15056: result: $cf_man2html" >&5 + echo "$as_me:17487: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else - echo "$as_me:15059: result: no" >&5 + echo "$as_me:17490: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + case "x$cf_man2html" in + (x/*) + echo "$as_me:17496: checking for the modified Earl Hood script" >&5 +echo $ECHO_N "checking for the modified Earl Hood script... $ECHO_C" >&6 + if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) + then + cf_man2html_ok=yes + else + cf_man2html=no + cf_man2html_ok=no + fi + echo "$as_me:17505: result: $cf_man2html_ok" >&5 +echo "${ECHO_T}$cf_man2html_ok" >&6 + ;; + (*) + cf_man2html=no + ;; + esac +esac + +echo "$as_me:17514: checking for program to convert manpage to html" >&5 +echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 + +# Check whether --with-man2html or --without-man2html was given. +if test "${with_man2html+set}" = set; then + withval="$with_man2html" + cf_man2html=$withval +else + cf_man2html=$cf_man2html +fi; + +cf_with_groff=no + +case $cf_man2html in +(yes) + echo "$as_me:17529: result: man2html" >&5 +echo "${ECHO_T}man2html" >&6 + # Extract the first word of "man2html", so it can be a program name with args. +set dummy man2html; ac_word=$2 +echo "$as_me:17533: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_cf_man2html+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $cf_man2html in + [\\/]* | ?:[\\/]*) + ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_cf_man2html="$ac_dir/$ac_word" + echo "$as_me:17550: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" + ;; +esac +fi +cf_man2html=$ac_cv_path_cf_man2html + +if test -n "$cf_man2html"; then + echo "$as_me:17562: result: $cf_man2html" >&5 +echo "${ECHO_T}$cf_man2html" >&6 +else + echo "$as_me:17565: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15064,25 +17570,25 @@ fi (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH - echo "$as_me:15067: result: $cf_man2html" >&5 + echo "$as_me:17573: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) - echo "$as_me:15071: result: $cf_man2html" >&5 + echo "$as_me:17577: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <&5 +echo $ECHO_N "checking if nroff is really groff... $ECHO_C" >&6 + cf_check_groff="`$NROFF_PATH --version 2>/dev/null | grep groff`" + test -n "$cf_check_groff" && cf_check_groff=yes + test -n "$cf_check_groff" || cf_check_groff=no + echo "$as_me:17623: result: $cf_check_groff" >&5 +echo "${ECHO_T}$cf_check_groff" >&6 + test "x$cf_check_groff" = xyes && NROFF_OPTS="-rHY=0" + fi MAN2HTML_NOTE="" if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_man2html" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_man2html="$cf_man2html" - case ".$cf_man2html" in - (.NONE/*) - cf_man2html=`echo $cf_man2html | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_man2html="$cf_man2html" + case ".$cf_man2html" in + (.NONE/*) + cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_man2html=`echo $cf_man2html | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - { { echo "$as_me:15135: error: expected a pathname, not \"$cf_man2html\"" >&5 + { { echo "$as_me:17654: error: expected a pathname, not \"$cf_man2html\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_man2html\"" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac MAN2HTML_PATH="$cf_man2html" - echo "$as_me:15142: checking for $cf_man2html top/bottom margins" >&5 + echo "$as_me:17661: checking for $cf_man2html top/bottom margins" >&5 echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 # for this example, expect 3 lines of content, the remainder is head/foot @@ -15149,18 +17668,18 @@ echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 MARKER CF_EOF - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out - cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[^0-9]*://' -e 's/:.*//'` - cf_man2html_top=`expr $cf_man2html_1st - 2` - cf_man2html_bot=`wc -l conftest.out |sed -e 's/[^0-9]//g'` - cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` + cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[^0-9]*://' -e 's/:.*//'`" + cf_man2html_top=`expr "$cf_man2html_1st" - 2` + cf_man2html_bot="`wc -l conftest.out |sed -e 's/[^0-9]//g'`" + cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" - echo "$as_me:15160: result: $cf_man2html_top_bot" >&5 + echo "$as_me:17679: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 - echo "$as_me:15163: checking for pagesize to use" >&5 + echo "$as_me:17682: checking for pagesize to use" >&5 echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do @@ -15179,24 +17698,24 @@ echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 CF_EOF done - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out - cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[^0-9]*://' -e 's/:.*//'` + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out + cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[^0-9]*://' -e 's/:.*//'`" test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* - echo "$as_me:15188: result: $cf_man2html_page" >&5 + echo "$as_me:17707: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <&6 -echo "${as_me:-configure}:15216: testing removing terminfo flags from IMAKE_CFLAGS ..." 1>&5 +echo "${as_me:-configure}:17735: testing removing terminfo flags from IMAKE_CFLAGS ..." 1>&5 IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" | sed -e 's/-DUSE_TERMINFO[ ]*-DHAVE_TIGETSTR[ ]*//'` test -n "$verbose" && echo " ...result $IMAKE_CFLAGS" 1>&6 -echo "${as_me:-configure}:15221: testing ...result $IMAKE_CFLAGS ..." 1>&5 +echo "${as_me:-configure}:17740: testing ...result $IMAKE_CFLAGS ..." 1>&5 test -n "$verbose" && echo " removing terminfo flags from CPPFLAGS" 1>&6 -echo "${as_me:-configure}:15225: testing removing terminfo flags from CPPFLAGS ..." 1>&5 +echo "${as_me:-configure}:17744: testing removing terminfo flags from CPPFLAGS ..." 1>&5 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/-DUSE_TERMINFO[ ]*-DHAVE_TIGETSTR[ ]*//'` test -n "$verbose" && echo " ...result $CPPFLAGS" 1>&6 -echo "${as_me:-configure}:15230: testing ...result $CPPFLAGS ..." 1>&5 +echo "${as_me:-configure}:17749: testing ...result $CPPFLAGS ..." 1>&5 ;; esac fi -echo "$as_me:15236: checking for default terminal-id" >&5 +echo "$as_me:17755: checking for default terminal-id" >&5 echo $ECHO_N "checking for default terminal-id... $ECHO_C" >&6 # Check whether --with-terminal-id or --without-terminal-id was given. @@ -15243,7 +17762,7 @@ if test "${with_terminal_id+set}" = set; then else default_termid=vt420 fi; -echo "$as_me:15246: result: $default_termid" >&5 +echo "$as_me:17765: result: $default_termid" >&5 echo "${ECHO_T}$default_termid" >&6 case $default_termid in (vt*) default_termid=`echo $default_termid | sed -e 's/^..//'` @@ -15254,7 +17773,7 @@ cat >>confdefs.h <&5 +echo "$as_me:17776: checking for default terminal-type" >&5 echo $ECHO_N "checking for default terminal-type... $ECHO_C" >&6 # Check whether --with-terminal-type or --without-terminal-type was given. @@ -15264,7 +17783,7 @@ if test "${with_terminal_type+set}" = set; then else default_TERM=xterm fi; -echo "$as_me:15267: result: $default_TERM" >&5 +echo "$as_me:17786: result: $default_TERM" >&5 echo "${ECHO_T}$default_TERM" >&6 cat >>confdefs.h <>confdefs.h <&5 +echo "$as_me:17794: checking if backarrow-key should be BS" >&5 echo $ECHO_N "checking if backarrow-key should be BS... $ECHO_C" >&6 # Check whether --enable-backarrow-key or --disable-backarrow-key was given. if test "${enable_backarrow_key+set}" = set; then enableval="$enable_backarrow_key" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then backarrow_is_bs=$enableval - else - backarrow_is_bs=yes - fi + else + backarrow_is_bs=yes + fi else enableval=yes - backarrow_is_bs=yes + backarrow_is_bs=yes fi; -echo "$as_me:15293: result: $backarrow_is_bs" >&5 +echo "$as_me:17812: result: $backarrow_is_bs" >&5 echo "${ECHO_T}$backarrow_is_bs" >&6 case $backarrow_is_bs in (yes) @@ -15311,25 +17830,25 @@ cat >>confdefs.h <&5 +echo "$as_me:17833: checking if backarrow-key should be treated as erase" >&5 echo $ECHO_N "checking if backarrow-key should be treated as erase... $ECHO_C" >&6 # Check whether --enable-backarrow-is-erase or --disable-backarrow-is-erase was given. if test "${enable_backarrow_is_erase+set}" = set; then enableval="$enable_backarrow_is_erase" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then backarrow_is_erase=$enableval - else - backarrow_is_erase=no - fi + else + backarrow_is_erase=no + fi else enableval=no - backarrow_is_erase=no + backarrow_is_erase=no fi; -echo "$as_me:15332: result: $backarrow_is_erase" >&5 +echo "$as_me:17851: result: $backarrow_is_erase" >&5 echo "${ECHO_T}$backarrow_is_erase" >&6 case $backarrow_is_erase in (yes) @@ -15350,7 +17869,7 @@ cat >>confdefs.h <&5 +echo "$as_me:17872: checking for default backspace/DEL setting" >&5 echo $ECHO_N "checking for default backspace/DEL setting... $ECHO_C" >&6 # Check whether --enable-delete-is-del or --disable-delete-is-del was given. @@ -15361,7 +17880,7 @@ else delete_is_del=maybe fi; -echo "$as_me:15364: result: $delete_is_del" >&5 +echo "$as_me:17883: result: $delete_is_del" >&5 echo "${ECHO_T}$delete_is_del" >&6 case $delete_is_del in (yes) @@ -15382,7 +17901,7 @@ cat >>confdefs.h <&5 +echo "$as_me:17904: checking for default pty initial erase setting" >&5 echo $ECHO_N "checking for default pty initial erase setting... $ECHO_C" >&6 # Check whether --enable-pty-erase or --disable-pty-erase was given. @@ -15393,7 +17912,7 @@ else initial_erase=False fi; -echo "$as_me:15396: result: $initial_erase" >&5 +echo "$as_me:17915: result: $initial_erase" >&5 echo "${ECHO_T}$initial_erase" >&6 case $initial_erase in (yes) @@ -15414,25 +17933,25 @@ cat >>confdefs.h <&5 +echo "$as_me:17936: checking if alt should send ESC" >&5 echo $ECHO_N "checking if alt should send ESC... $ECHO_C" >&6 # Check whether --enable-alt-sends-esc or --disable-alt-sends-esc was given. if test "${enable_alt_sends_esc+set}" = set; then enableval="$enable_alt_sends_esc" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then alt_sends_esc=$enableval - else - alt_sends_esc=no - fi + else + alt_sends_esc=no + fi else enableval=no - alt_sends_esc=no + alt_sends_esc=no fi; -echo "$as_me:15435: result: $alt_sends_esc" >&5 +echo "$as_me:17954: result: $alt_sends_esc" >&5 echo "${ECHO_T}$alt_sends_esc" >&6 case $alt_sends_esc in (yes) @@ -15453,25 +17972,25 @@ cat >>confdefs.h <&5 +echo "$as_me:17975: checking if meta should send ESC" >&5 echo $ECHO_N "checking if meta should send ESC... $ECHO_C" >&6 # Check whether --enable-meta-sends-esc or --disable-meta-sends-esc was given. if test "${enable_meta_sends_esc+set}" = set; then enableval="$enable_meta_sends_esc" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then meta_sends_esc=$enableval - else - meta_sends_esc=no - fi + else + meta_sends_esc=no + fi else enableval=no - meta_sends_esc=no + meta_sends_esc=no fi; -echo "$as_me:15474: result: $meta_sends_esc" >&5 +echo "$as_me:17993: result: $meta_sends_esc" >&5 echo "${ECHO_T}$meta_sends_esc" >&6 case $meta_sends_esc in (yes) @@ -15495,7 +18014,7 @@ EOF ############################################################################### # Extract the first word of "tic", so it can be a program name with args. set dummy tic; ac_word=$2 -echo "$as_me:15498: checking for $ac_word" >&5 +echo "$as_me:18017: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_cf_tic_prog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15510,7 +18029,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_cf_tic_prog="yes" -echo "$as_me:15513: found $ac_dir/$ac_word" >&5 +echo "$as_me:18032: found $ac_dir/$ac_word" >&5 break done @@ -15519,15 +18038,26 @@ fi fi cf_tic_prog=$ac_cv_prog_cf_tic_prog if test -n "$cf_tic_prog"; then - echo "$as_me:15522: result: $cf_tic_prog" >&5 + echo "$as_me:18041: result: $cf_tic_prog" >&5 echo "${ECHO_T}$cf_tic_prog" >&6 else - echo "$as_me:15525: result: no" >&5 + echo "$as_me:18044: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_tic_prog" = yes ; then - echo "$as_me:15530: checking for private terminfo-directory" >&5 + if test -n "$TERMINFO" + then + case "$TERMINFO" in + (/*) + test -d "$TERMINFO" || unset TERMINFO + ;; + (*) + unset TERMINFO + ;; + esac + fi + echo "$as_me:18060: checking for private terminfo-directory" >&5 echo $ECHO_N "checking for private terminfo-directory... $ECHO_C" >&6 # Check whether --with-own-terminfo or --without-own-terminfo was given. @@ -15537,20 +18067,38 @@ if test "${with_own_terminfo+set}" = set; then else TERMINFO_DIR=${TERMINFO-none} fi; - echo "$as_me:15540: result: $TERMINFO_DIR" >&5 + echo "$as_me:18070: result: $TERMINFO_DIR" >&5 echo "${ECHO_T}$TERMINFO_DIR" >&6 if test "$TERMINFO_DIR" = yes ; then - { echo "$as_me:15543: WARNING: no value given" >&5 + { echo "$as_me:18073: WARNING: no value given" >&5 echo "$as_me: WARNING: no value given" >&2;} elif test "$TERMINFO_DIR" != none ; then - if test -d $TERMINFO_DIR ; then + if test -d "$TERMINFO_DIR" ; then cat >>confdefs.h <&5 +echo $ECHO_N "checking if \$TERMINFO should also be set... $ECHO_C" >&6 + +# Check whether --enable-env-terminfo or --disable-env-terminfo was given. +if test "${enable_env_terminfo+set}" = set; then + enableval="$enable_env_terminfo" + cf_env_terminfo=yes +else + cf_env_terminfo=no +fi; + echo "$as_me:18092: result: $cf_env_terminfo" >&5 +echo "${ECHO_T}$cf_env_terminfo" >&6 + test $cf_env_terminfo = yes && + +cat >>confdefs.h <<\EOF +#define OWN_TERMINFO_ENV 1 EOF else - { echo "$as_me:15553: WARNING: not a directory" >&5 + { echo "$as_me:18101: WARNING: not a directory" >&5 echo "$as_me: WARNING: not a directory" >&2;} fi elif test "$prefix" != NONE ; then @@ -15574,24 +18122,24 @@ fi ############################################################################### -echo "$as_me:15577: checking if you want active-icons" >&5 +echo "$as_me:18125: checking if you want active-icons" >&5 echo $ECHO_N "checking if you want active-icons... $ECHO_C" >&6 # Check whether --enable-active-icon or --disable-active-icon was given. if test "${enable_active_icon+set}" = set; then enableval="$enable_active_icon" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_active_icon=no - else - enable_active_icon=yes - fi + else + enable_active_icon=yes + fi else enableval=yes - enable_active_icon=yes + enable_active_icon=yes fi; -echo "$as_me:15594: result: $enable_active_icon" >&5 +echo "$as_me:18142: result: $enable_active_icon" >&5 echo "${ECHO_T}$enable_active_icon" >&6 if test "$enable_active_icon" = no ; then @@ -15601,24 +18149,24 @@ EOF fi -echo "$as_me:15604: checking if you want ANSI color" >&5 +echo "$as_me:18152: checking if you want ANSI color" >&5 echo $ECHO_N "checking if you want ANSI color... $ECHO_C" >&6 # Check whether --enable-ansi-color or --disable-ansi-color was given. if test "${enable_ansi_color+set}" = set; then enableval="$enable_ansi_color" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_ansi_color=no - else - enable_ansi_color=yes - fi + else + enable_ansi_color=yes + fi else enableval=yes - enable_ansi_color=yes + enable_ansi_color=yes fi; -echo "$as_me:15621: result: $enable_ansi_color" >&5 +echo "$as_me:18169: result: $enable_ansi_color" >&5 echo "${ECHO_T}$enable_ansi_color" >&6 test "$enable_ansi_color" = no && cat >>confdefs.h <<\EOF @@ -15627,50 +18175,52 @@ EOF if test "$enable_ansi_color" = yes ; then - echo "$as_me:15630: checking if you want 16 colors like aixterm" >&5 + echo "$as_me:18178: checking if you want 16 colors like aixterm" >&5 echo $ECHO_N "checking if you want 16 colors like aixterm... $ECHO_C" >&6 # Check whether --enable-16-color or --disable-16-color was given. if test "${enable_16_color+set}" = set; then enableval="$enable_16_color" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_16_color=no - else - enable_16_color=yes - fi + else + enable_16_color=yes + fi else enableval=yes - enable_16_color=yes + enable_16_color=yes fi; - echo "$as_me:15647: result: $enable_16_color" >&5 + echo "$as_me:18195: result: $enable_16_color" >&5 echo "${ECHO_T}$enable_16_color" >&6 test "$enable_16_color" = no && cat >>confdefs.h <<\EOF #define OPT_AIX_COLORS 0 EOF - echo "$as_me:15654: checking if you want 256 colors" >&5 + echo "$as_me:18202: checking if you want 256 colors" >&5 echo $ECHO_N "checking if you want 256 colors... $ECHO_C" >&6 # Check whether --enable-256-color or --disable-256-color was given. if test "${enable_256_color+set}" = set; then enableval="$enable_256_color" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_256_color=yes - else + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then enable_256_color=no - fi + else + enable_256_color=yes + fi else - enableval=no - enable_256_color=no + enableval=yes + enable_256_color=yes fi; - echo "$as_me:15671: result: $enable_256_color" >&5 + echo "$as_me:18219: result: $enable_256_color" >&5 echo "${ECHO_T}$enable_256_color" >&6 + if test "$enable_256_color" = yes ; then + CHARPROC_DEPS="$CHARPROC_DEPS 256colres.h" EXTRAHDRS="$EXTRAHDRS 256colres.h" @@ -15678,64 +18228,93 @@ cat >>confdefs.h <<\EOF #define OPT_256_COLORS 1 EOF + echo "$as_me:18231: checking if you want direct-color support" >&5 +echo $ECHO_N "checking if you want direct-color support... $ECHO_C" >&6 + +# Check whether --enable-direct-color or --disable-direct-color was given. +if test "${enable_direct_color+set}" = set; then + enableval="$enable_direct_color" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + enable_direct_color=no else - echo "$as_me:15682: checking if you want 88 colors" >&5 + enable_direct_color=yes + fi +else + enableval=yes + enable_direct_color=yes + +fi; + echo "$as_me:18248: result: $enable_direct_color" >&5 +echo "${ECHO_T}$enable_direct_color" >&6 + if test "$enable_direct_color" = yes ; then + +cat >>confdefs.h <<\EOF +#define OPT_DIRECT_COLOR 1 +EOF + + fi + + else + + echo "$as_me:18260: checking if you want 88 colors" >&5 echo $ECHO_N "checking if you want 88 colors... $ECHO_C" >&6 # Check whether --enable-88-color or --disable-88-color was given. if test "${enable_88_color+set}" = set; then enableval="$enable_88_color" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_88_color=yes - else + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then enable_88_color=no - fi + else + enable_88_color=yes + fi else - enableval=no - enable_88_color=no + enableval=yes + enable_88_color=yes fi; - echo "$as_me:15699: result: $enable_88_color" >&5 + echo "$as_me:18277: result: $enable_88_color" >&5 echo "${ECHO_T}$enable_88_color" >&6 - if test "$enable_88_color" = yes ; then - CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h" - EXTRAHDRS="$EXTRAHDRS 88colres.h" + if test "$enable_88_color" = yes ; then + CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h" + EXTRAHDRS="$EXTRAHDRS 88colres.h" cat >>confdefs.h <<\EOF #define OPT_88_COLORS 1 EOF - fi + fi + fi fi -echo "$as_me:15714: checking if you want blinking cursor" >&5 +echo "$as_me:18293: checking if you want blinking cursor" >&5 echo $ECHO_N "checking if you want blinking cursor... $ECHO_C" >&6 # Check whether --enable-blink-cursor or --disable-blink-cursor was given. if test "${enable_blink_cursor+set}" = set; then enableval="$enable_blink_cursor" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_blink_curs=no - else - enable_blink_curs=yes - fi + else + enable_blink_curs=yes + fi else enableval=yes - enable_blink_curs=yes + enable_blink_curs=yes fi; -echo "$as_me:15731: result: $enable_blink_curs" >&5 +echo "$as_me:18310: result: $enable_blink_curs" >&5 echo "${ECHO_T}$enable_blink_curs" >&6 test "$enable_blink_curs" = no && cat >>confdefs.h <<\EOF #define OPT_BLINK_CURS 0 EOF -echo "$as_me:15738: checking if you want to ignore Linux's broken palette-strings" >&5 +echo "$as_me:18317: checking if you want to ignore Linux's broken palette-strings" >&5 echo $ECHO_N "checking if you want to ignore Linux's broken palette-strings... $ECHO_C" >&6 case $host_os in @@ -15749,17 +18328,17 @@ esac if test "${enable_broken_osc+set}" = set; then enableval="$enable_broken_osc" test "$enableval" != no && enableval=yes - if test "$enableval" != "$assume_broken_osc" ; then + if test "$enableval" != "$assume_broken_osc" ; then enable_broken_osc=$enableval - else - enable_broken_osc=$enableval - fi + else + enable_broken_osc=$enableval + fi else enableval=$assume_broken_osc - enable_broken_osc=$enableval + enable_broken_osc=$enableval fi; -echo "$as_me:15762: result: $enable_broken_osc" >&5 +echo "$as_me:18341: result: $enable_broken_osc" >&5 echo "${ECHO_T}$enable_broken_osc" >&6 if test "$enable_broken_osc" = yes ; then @@ -15775,72 +18354,72 @@ EOF fi -echo "$as_me:15778: checking if you want to allow broken string-terminators" >&5 +echo "$as_me:18357: checking if you want to allow broken string-terminators" >&5 echo $ECHO_N "checking if you want to allow broken string-terminators... $ECHO_C" >&6 # Check whether --enable-broken-st or --disable-broken-st was given. if test "${enable_broken_st+set}" = set; then enableval="$enable_broken_st" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_broken_st=no - else - enable_broken_st=yes - fi + else + enable_broken_st=yes + fi else enableval=no - enable_broken_st=yes + enable_broken_st=yes fi; -echo "$as_me:15795: result: $enable_broken_st" >&5 +echo "$as_me:18374: result: $enable_broken_st" >&5 echo "${ECHO_T}$enable_broken_st" >&6 test "$enable_broken_st" = no && cat >>confdefs.h <<\EOF #define OPT_BROKEN_ST 0 EOF -echo "$as_me:15802: checking if you want to compile-in icon data" >&5 +echo "$as_me:18381: checking if you want to compile-in icon data" >&5 echo $ECHO_N "checking if you want to compile-in icon data... $ECHO_C" >&6 # Check whether --enable-builtin-xpms or --disable-builtin-xpms was given. if test "${enable_builtin_xpms+set}" = set; then enableval="$enable_builtin_xpms" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_builtin_xpms=yes - else - enable_builtin_xpms=no - fi + else + enable_builtin_xpms=no + fi else enableval=no - enable_builtin_xpms=no + enable_builtin_xpms=no fi; -echo "$as_me:15819: result: $enable_builtin_xpms" >&5 +echo "$as_me:18398: result: $enable_builtin_xpms" >&5 echo "${ECHO_T}$enable_builtin_xpms" >&6 test "$enable_builtin_xpms" = yes && cat >>confdefs.h <<\EOF #define OPT_BUILTIN_XPMS 1 EOF -echo "$as_me:15826: checking if you want printable 128-159" >&5 +echo "$as_me:18405: checking if you want printable 128-159" >&5 echo $ECHO_N "checking if you want printable 128-159... $ECHO_C" >&6 # Check whether --enable-c1-print or --disable-c1-print was given. if test "${enable_c1_print+set}" = set; then enableval="$enable_c1_print" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_c1_print=no - else - enable_c1_print=yes - fi + else + enable_c1_print=yes + fi else enableval=yes - enable_c1_print=yes + enable_c1_print=yes fi; -echo "$as_me:15843: result: $enable_c1_print" >&5 +echo "$as_me:18422: result: $enable_c1_print" >&5 echo "${ECHO_T}$enable_c1_print" >&6 test "$enable_c1_print" = no && cat >>confdefs.h <<\EOF @@ -15849,72 +18428,72 @@ EOF if test "$enable_ansi_color" = yes ; then - echo "$as_me:15852: checking if you want bold colors mapped like IBM PC" >&5 + echo "$as_me:18431: checking if you want bold colors mapped like IBM PC" >&5 echo $ECHO_N "checking if you want bold colors mapped like IBM PC... $ECHO_C" >&6 # Check whether --enable-bold-color or --disable-bold-color was given. if test "${enable_bold_color+set}" = set; then enableval="$enable_bold_color" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_pc_color=no - else - enable_pc_color=yes - fi + else + enable_pc_color=yes + fi else enableval=yes - enable_pc_color=yes + enable_pc_color=yes fi; - echo "$as_me:15869: result: $enable_pc_color" >&5 + echo "$as_me:18448: result: $enable_pc_color" >&5 echo "${ECHO_T}$enable_pc_color" >&6 test "$enable_pc_color" = no && cat >>confdefs.h <<\EOF #define OPT_PC_COLORS 0 EOF - echo "$as_me:15876: checking if you want separate color-classes" >&5 + echo "$as_me:18455: checking if you want separate color-classes" >&5 echo $ECHO_N "checking if you want separate color-classes... $ECHO_C" >&6 # Check whether --enable-color-class or --disable-color-class was given. if test "${enable_color_class+set}" = set; then enableval="$enable_color_class" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_color_class=no - else - enable_color_class=yes - fi + else + enable_color_class=yes + fi else enableval=yes - enable_color_class=yes + enable_color_class=yes fi; - echo "$as_me:15893: result: $enable_color_class" >&5 + echo "$as_me:18472: result: $enable_color_class" >&5 echo "${ECHO_T}$enable_color_class" >&6 test "$enable_color_class" = no && cat >>confdefs.h <<\EOF #define OPT_COLOR_CLASS 0 EOF - echo "$as_me:15900: checking if you want color-mode enabled by default" >&5 + echo "$as_me:18479: checking if you want color-mode enabled by default" >&5 echo $ECHO_N "checking if you want color-mode enabled by default... $ECHO_C" >&6 # Check whether --enable-color-mode or --disable-color-mode was given. if test "${enable_color_mode+set}" = set; then enableval="$enable_color_mode" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then default_colormode=no - else - default_colormode=yes - fi + else + default_colormode=yes + fi else enableval=yes - default_colormode=yes + default_colormode=yes fi; - echo "$as_me:15917: result: $default_colormode" >&5 + echo "$as_me:18496: result: $default_colormode" >&5 echo "${ECHO_T}$default_colormode" >&6 test "$default_colormode" = no && cat >>confdefs.h <<\EOF @@ -15923,100 +18502,100 @@ EOF fi -echo "$as_me:15926: checking if you want support for color highlighting" >&5 +echo "$as_me:18505: checking if you want support for color highlighting" >&5 echo $ECHO_N "checking if you want support for color highlighting... $ECHO_C" >&6 # Check whether --enable-highlighting or --disable-highlighting was given. if test "${enable_highlighting+set}" = set; then enableval="$enable_highlighting" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then default_highlight=no - else - default_highlight=yes - fi + else + default_highlight=yes + fi else enableval=yes - default_highlight=yes + default_highlight=yes fi; -echo "$as_me:15943: result: $default_highlight" >&5 +echo "$as_me:18522: result: $default_highlight" >&5 echo "${ECHO_T}$default_highlight" >&6 test "$default_highlight" = no && cat >>confdefs.h <<\EOF #define OPT_HIGHLIGHT_COLOR 0 EOF -echo "$as_me:15950: checking if you want support for doublesize characters" >&5 +echo "$as_me:18529: checking if you want support for doublesize characters" >&5 echo $ECHO_N "checking if you want support for doublesize characters... $ECHO_C" >&6 # Check whether --enable-doublechars or --disable-doublechars was given. if test "${enable_doublechars+set}" = set; then enableval="$enable_doublechars" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_doublechars=no - else - enable_doublechars=yes - fi + else + enable_doublechars=yes + fi else enableval=yes - enable_doublechars=yes + enable_doublechars=yes fi; -echo "$as_me:15967: result: $enable_doublechars" >&5 +echo "$as_me:18546: result: $enable_doublechars" >&5 echo "${ECHO_T}$enable_doublechars" >&6 test "$enable_doublechars" = no && cat >>confdefs.h <<\EOF #define OPT_DEC_CHRSET 0 EOF -echo "$as_me:15974: checking if you want fallback-support for box characters" >&5 +echo "$as_me:18553: checking if you want fallback-support for box characters" >&5 echo $ECHO_N "checking if you want fallback-support for box characters... $ECHO_C" >&6 # Check whether --enable-boxchars or --disable-boxchars was given. if test "${enable_boxchars+set}" = set; then enableval="$enable_boxchars" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_boxchars=no - else - enable_boxchars=yes - fi + else + enable_boxchars=yes + fi else enableval=yes - enable_boxchars=yes + enable_boxchars=yes fi; -echo "$as_me:15991: result: $enable_boxchars" >&5 +echo "$as_me:18570: result: $enable_boxchars" >&5 echo "${ECHO_T}$enable_boxchars" >&6 test "$enable_boxchars" = no && cat >>confdefs.h <<\EOF #define OPT_BOX_CHARS 0 EOF -echo "$as_me:15998: checking if you want to allow spawning new xterms" >&5 +echo "$as_me:18577: checking if you want to allow spawning new xterms" >&5 echo $ECHO_N "checking if you want to allow spawning new xterms... $ECHO_C" >&6 # Check whether --enable-exec-xterm or --disable-exec-xterm was given. if test "${enable_exec_xterm+set}" = set; then enableval="$enable_exec_xterm" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_exec_xterm=yes - else - enable_exec_xterm=no - fi + else + enable_exec_xterm=no + fi else enableval=no - enable_exec_xterm=no + enable_exec_xterm=no fi; -echo "$as_me:16015: result: $enable_exec_xterm" >&5 +echo "$as_me:18594: result: $enable_exec_xterm" >&5 echo "${ECHO_T}$enable_exec_xterm" >&6 if test "$enable_exec_xterm" = yes ; then -echo "$as_me:16019: checking for proc tree with cwd-support" >&5 +echo "$as_me:18598: checking for proc tree with cwd-support" >&5 echo $ECHO_N "checking for proc tree with cwd-support... $ECHO_C" >&6 if test "${cf_cv_procfs_cwd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16025,21 +18604,21 @@ else cf_cv_procfs_cwd=no for cf_path in /proc /compat/linux/proc /usr/compat/linux/proc do - if test -d $cf_path && \ - test -d $cf_path/$$ && \ - ( test -d $cf_path/$$/cwd || \ - test -L $cf_path/$$/cwd ); then - cf_cv_procfs_cwd=$cf_path + if test -d "$cf_path" && \ + test -d "$cf_path"/$$ && \ + { test -d "$cf_path"/$$/cwd || \ + test -L "$cf_path"/$$/cwd; }; then + cf_cv_procfs_cwd="$cf_path" break fi done fi -echo "$as_me:16038: result: $cf_cv_procfs_cwd" >&5 +echo "$as_me:18617: result: $cf_cv_procfs_cwd" >&5 echo "${ECHO_T}$cf_cv_procfs_cwd" >&6 if test "$cf_cv_procfs_cwd" = no ; then - { echo "$as_me:16042: WARNING: no suitable proc filesystem found" >&5 + { echo "$as_me:18621: WARNING: no suitable proc filesystem found" >&5 echo "$as_me: WARNING: no suitable proc filesystem found" >&2;} else @@ -16054,45 +18633,20 @@ EOF fi fi -echo "$as_me:16057: checking if you want to use double-buffering" >&5 -echo $ECHO_N "checking if you want to use double-buffering... $ECHO_C" >&6 - -# Check whether --enable-double-buffer or --disable-double-buffer was given. -if test "${enable_double_buffer+set}" = set; then - enableval="$enable_double_buffer" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_double_bfr=yes - else - enable_double_bfr=no - fi -else - enableval=no - enable_double_bfr=no - -fi; -echo "$as_me:16074: result: $enable_double_bfr" >&5 -echo "${ECHO_T}$enable_double_bfr" >&6 -if test "$enable_double_bfr" = yes ; then - case "x$LIBS" in - (*Xext*) - ;; - (*) - -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then test -n "$verbose" && echo " found package Xext" 1>&6 -echo "${as_me:-configure}:16085: testing found package Xext ..." 1>&5 +echo "${as_me:-configure}:18639: testing found package Xext ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs Xext 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "Xext" 2>/dev/null`" test -n "$verbose" && echo " package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:16091: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:18645: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package Xext LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:16095: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:18649: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -16101,23 +18655,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -16126,7 +18686,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -16136,19 +18696,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -16159,32 +18727,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -16193,15 +18767,15 @@ else cf_pkgconfig_incs= cf_pkgconfig_libs= - echo "$as_me:16196: checking for XextCreateExtension in -lXext" >&5 + echo "$as_me:18770: checking for XextCreateExtension in -lXext" >&5 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 16204 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 18778 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -16212,51 +18786,51 @@ extern "C" builtin and then its argument prototype would still apply. */ char XextCreateExtension (); int -main () +main (void) { XextCreateExtension (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16223: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:18797: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16226: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16229: \"$ac_try\"") >&5 + echo "$as_me:18800: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:18803: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16232: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:18806: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_Xext_XextCreateExtension=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_Xext_XextCreateExtension=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:16243: result: $ac_cv_lib_Xext_XextCreateExtension" >&5 +echo "$as_me:18817: result: $ac_cv_lib_Xext_XextCreateExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6 -if test $ac_cv_lib_Xext_XextCreateExtension = yes; then +if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then -cf_add_libs="-lXext" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -16264,33 +18838,167 @@ fi fi - ;; - esac +echo "$as_me:18841: checking for X11/extensions/Xdbe.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xdbe.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xdbe_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 18847 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:18851: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + $EGREP -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:18857: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_X11_extensions_Xdbe_h=yes +else + echo "$as_me: failed program was:" >&5 + cat "conftest.$ac_ext" >&5 + ac_cv_header_X11_extensions_Xdbe_h=no +fi +rm -f conftest.err "conftest.$ac_ext" +fi +echo "$as_me:18876: result: $ac_cv_header_X11_extensions_Xdbe_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xdbe_h" >&6 +if test "$ac_cv_header_X11_extensions_Xdbe_h" = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_X11_EXTENSIONS_XDBE_H 1 +EOF + + echo "$as_me:18884: checking for XdbeSwapBuffers" >&5 +echo $ECHO_N "checking for XdbeSwapBuffers... $ECHO_C" >&6 +if test "${ac_cv_func_XdbeSwapBuffers+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 18890 "configure" +#include "confdefs.h" +#define XdbeSwapBuffers autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef XdbeSwapBuffers + +#ifdef __cplusplus +extern "C" +#endif + +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XdbeSwapBuffers (void); + +int +main (void) +{ + +/* The GNU C library defines stubs for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_XdbeSwapBuffers) || defined (__stub___XdbeSwapBuffers) +#error found stub for XdbeSwapBuffers +#endif + + return XdbeSwapBuffers (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:18921: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:18924: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:18927: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:18930: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_func_XdbeSwapBuffers=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_func_XdbeSwapBuffers=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +fi +echo "$as_me:18940: result: $ac_cv_func_XdbeSwapBuffers" >&5 +echo "${ECHO_T}$ac_cv_func_XdbeSwapBuffers" >&6 +if test "$ac_cv_func_XdbeSwapBuffers" = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_XDBESWAPBUFFERS 1 +EOF + + cf_x_ext_double_buffer=yes +fi + +fi + +double_buffer=False +if test "$cf_x_ext_double_buffer" = yes ; then + echo "$as_me:18955: checking if you want to enable double-buffering in default resources" >&5 +echo $ECHO_N "checking if you want to enable double-buffering in default resources... $ECHO_C" >&6 + +# Check whether --enable-double-buffer or --disable-double-buffer was given. +if test "${enable_double_buffer+set}" = set; then + enableval="$enable_double_buffer" + test "$enableval" != yes && enableval=no + if test "$enableval" != "no" ; then + enable_double_bfr=yes + else + enable_double_bfr=no + fi +else + enableval=no + enable_double_bfr=no + +fi; + echo "$as_me:18972: result: $enable_double_bfr" >&5 +echo "${ECHO_T}$enable_double_bfr" >&6 + if test "$enable_double_bfr" = yes ; then cat >>confdefs.h <<\EOF #define OPT_DOUBLE_BUFFER 1 EOF + double_buffer=True + fi fi -echo "$as_me:16276: checking if you want to use FreeType library" >&5 +echo "$as_me:18984: checking if you want to use FreeType library" >&5 echo $ECHO_N "checking if you want to use FreeType library... $ECHO_C" >&6 # Check whether --enable-freetype or --disable-freetype was given. if test "${enable_freetype+set}" = set; then enableval="$enable_freetype" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_freetype=no - else - enable_freetype=yes - fi + else + enable_freetype=yes + fi else enableval=yes - enable_freetype=yes + enable_freetype=yes fi; -echo "$as_me:16293: result: $enable_freetype" >&5 +echo "$as_me:19001: result: $enable_freetype" >&5 echo "${ECHO_T}$enable_freetype" >&6 if test "$enable_freetype" = yes ; then @@ -16300,7 +19008,7 @@ cf_extra_freetype_libs= FREETYPE_CONFIG=none FREETYPE_PARAMS= -echo "$as_me:16303: checking for FreeType configuration script" >&5 +echo "$as_me:19011: checking for FreeType configuration script" >&5 echo $ECHO_N "checking for FreeType configuration script... $ECHO_C" >&6 # Check whether --with-freetype-config or --without-freetype-config was given. @@ -16312,12 +19020,12 @@ else fi; test -z $cf_cv_x_freetype_cfgs && cf_cv_x_freetype_cfgs=auto test $cf_cv_x_freetype_cfgs = no && cf_cv_x_freetype_cfgs=none -echo "$as_me:16315: result: $cf_cv_x_freetype_cfgs" >&5 +echo "$as_me:19023: result: $cf_cv_x_freetype_cfgs" >&5 echo "${ECHO_T}$cf_cv_x_freetype_cfgs" >&6 case $cf_cv_x_freetype_cfgs in (none) - echo "$as_me:16320: checking if you specified -D/-I options for FreeType" >&5 + echo "$as_me:19028: checking if you specified -D/-I options for FreeType" >&5 echo $ECHO_N "checking if you specified -D/-I options for FreeType... $ECHO_C" >&6 # Check whether --with-freetype-cflags or --without-freetype-cflags was given. @@ -16327,10 +19035,10 @@ if test "${with_freetype_cflags+set}" = set; then else cf_cv_x_freetype_incs=no fi; - echo "$as_me:16330: result: $cf_cv_x_freetype_incs" >&5 + echo "$as_me:19038: result: $cf_cv_x_freetype_incs" >&5 echo "${ECHO_T}$cf_cv_x_freetype_incs" >&6 - echo "$as_me:16333: checking if you specified -L/-l options for FreeType" >&5 + echo "$as_me:19041: checking if you specified -L/-l options for FreeType" >&5 echo $ECHO_N "checking if you specified -L/-l options for FreeType... $ECHO_C" >&6 # Check whether --with-freetype-libs or --without-freetype-libs was given. @@ -16340,7 +19048,7 @@ if test "${with_freetype_libs+set}" = set; then else cf_cv_x_freetype_libs=no fi; - echo "$as_me:16343: result: $cf_cv_x_freetype_libs" >&5 + echo "$as_me:19051: result: $cf_cv_x_freetype_libs" >&5 echo "${ECHO_T}$cf_cv_x_freetype_libs" >&6 ;; (auto) @@ -16350,7 +19058,7 @@ echo "${ECHO_T}$cf_cv_x_freetype_libs" >&6 else # Extract the first word of "freetype-config", so it can be a program name with args. set dummy freetype-config; ac_word=$2 -echo "$as_me:16353: checking for $ac_word" >&5 +echo "$as_me:19061: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_FREETYPE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16367,7 +19075,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_FREETYPE_CONFIG="$ac_dir/$ac_word" - echo "$as_me:16370: found $ac_dir/$ac_word" >&5 + echo "$as_me:19078: found $ac_dir/$ac_word" >&5 break fi done @@ -16379,10 +19087,10 @@ fi FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG if test -n "$FREETYPE_CONFIG"; then - echo "$as_me:16382: result: $FREETYPE_CONFIG" >&5 + echo "$as_me:19090: result: $FREETYPE_CONFIG" >&5 echo "${ECHO_T}$FREETYPE_CONFIG" >&6 else - echo "$as_me:16385: result: no" >&5 + echo "$as_me:19093: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -16392,7 +19100,7 @@ fi else # Extract the first word of "xft-config", so it can be a program name with args. set dummy xft-config; ac_word=$2 -echo "$as_me:16395: checking for $ac_word" >&5 +echo "$as_me:19103: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_FREETYPE_OLD_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16409,7 +19117,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_FREETYPE_OLD_CONFIG="$ac_dir/$ac_word" - echo "$as_me:16412: found $ac_dir/$ac_word" >&5 + echo "$as_me:19120: found $ac_dir/$ac_word" >&5 break fi done @@ -16421,10 +19129,10 @@ fi FREETYPE_OLD_CONFIG=$ac_cv_path_FREETYPE_OLD_CONFIG if test -n "$FREETYPE_OLD_CONFIG"; then - echo "$as_me:16424: result: $FREETYPE_OLD_CONFIG" >&5 + echo "$as_me:19132: result: $FREETYPE_OLD_CONFIG" >&5 echo "${ECHO_T}$FREETYPE_OLD_CONFIG" >&6 else - echo "$as_me:16427: result: no" >&5 + echo "$as_me:19135: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -16439,14 +19147,14 @@ fi FREETYPE_CONFIG=$cf_cv_x_freetype_cfgs FREETYPE_PARAMS=xft else - { echo "$as_me:16442: WARNING: cannot find pkg-config for Xft" >&5 + { echo "$as_me:19150: WARNING: cannot find pkg-config for Xft" >&5 echo "$as_me: WARNING: cannot find pkg-config for Xft" >&2;} fi ;; (*) # Extract the first word of "$cf_cv_x_freetype_cfgs", so it can be a program name with args. set dummy $cf_cv_x_freetype_cfgs; ac_word=$2 -echo "$as_me:16449: checking for $ac_word" >&5 +echo "$as_me:19157: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_FREETYPE_XFT_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16463,7 +19171,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_FREETYPE_XFT_CONFIG="$ac_dir/$ac_word" - echo "$as_me:16466: found $ac_dir/$ac_word" >&5 + echo "$as_me:19174: found $ac_dir/$ac_word" >&5 break fi done @@ -16475,41 +19183,41 @@ fi FREETYPE_XFT_CONFIG=$ac_cv_path_FREETYPE_XFT_CONFIG if test -n "$FREETYPE_XFT_CONFIG"; then - echo "$as_me:16478: result: $FREETYPE_XFT_CONFIG" >&5 + echo "$as_me:19186: result: $FREETYPE_XFT_CONFIG" >&5 echo "${ECHO_T}$FREETYPE_XFT_CONFIG" >&6 else - echo "$as_me:16481: result: no" >&5 + echo "$as_me:19189: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$FREETYPE_XFT_CONFIG" != none; then FREETYPE_CONFIG=$FREETYPE_XFT_CONFIG else - { echo "$as_me:16488: WARNING: cannot find config script for Xft" >&5 + { echo "$as_me:19196: WARNING: cannot find config script for Xft" >&5 echo "$as_me: WARNING: cannot find config script for Xft" >&2;} fi ;; esac if test "$FREETYPE_CONFIG" != none ; then - echo "$as_me:16495: checking for FreeType config" >&5 + echo "$as_me:19203: checking for FreeType config" >&5 echo $ECHO_N "checking for FreeType config... $ECHO_C" >&6 - echo "$as_me:16497: result: $FREETYPE_CONFIG $FREETYPE_PARAMS" >&5 + echo "$as_me:19205: result: $FREETYPE_CONFIG $FREETYPE_PARAMS" >&5 echo "${ECHO_T}$FREETYPE_CONFIG $FREETYPE_PARAMS" >&6 if test "$cf_cv_x_freetype_incs" = no ; then - echo "$as_me:16501: checking for $FREETYPE_CONFIG cflags" >&5 + echo "$as_me:19209: checking for $FREETYPE_CONFIG cflags" >&5 echo $ECHO_N "checking for $FREETYPE_CONFIG cflags... $ECHO_C" >&6 cf_cv_x_freetype_incs="`$FREETYPE_CONFIG $FREETYPE_PARAMS --cflags 2>/dev/null`" - echo "$as_me:16504: result: $cf_cv_x_freetype_incs" >&5 + echo "$as_me:19212: result: $cf_cv_x_freetype_incs" >&5 echo "${ECHO_T}$cf_cv_x_freetype_incs" >&6 fi if test "$cf_cv_x_freetype_libs" = no ; then - echo "$as_me:16509: checking for $FREETYPE_CONFIG libs" >&5 + echo "$as_me:19217: checking for $FREETYPE_CONFIG libs" >&5 echo $ECHO_N "checking for $FREETYPE_CONFIG libs... $ECHO_C" >&6 cf_cv_x_freetype_libs="$cf_extra_freetype_libs `$FREETYPE_CONFIG $FREETYPE_PARAMS --libs 2>/dev/null`" - echo "$as_me:16512: result: $cf_cv_x_freetype_libs" >&5 + echo "$as_me:19220: result: $cf_cv_x_freetype_libs" >&5 echo "${ECHO_T}$cf_cv_x_freetype_libs" >&6 fi fi @@ -16522,66 +19230,66 @@ if test "$cf_cv_x_freetype_libs" = no ; then cf_cv_x_freetype_libs=-lXft fi -echo "$as_me:16525: checking if we can link with FreeType libraries" >&5 +echo "$as_me:19233: checking if we can link with FreeType libraries" >&5 echo $ECHO_N "checking if we can link with FreeType libraries... $ECHO_C" >&6 cf_save_LIBS="$LIBS" cf_save_INCS="$CPPFLAGS" -cf_add_libs="$cf_cv_x_freetype_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_cv_x_freetype_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" CPPFLAGS="$CPPFLAGS $cf_cv_x_freetype_incs" -cat >conftest.$ac_ext <<_ACEOF -#line 16550 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 19258 "configure" #include "confdefs.h" #include #include #include int -main () +main (void) { - XftPattern *pat = XftNameParse ("name"); + XftPattern *pat = XftNameParse ("name"); (void)pat ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16566: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:19274: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16569: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16572: \"$ac_try\"") >&5 + echo "$as_me:19277: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:19280: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16575: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:19283: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_found_freetype=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_found_freetype=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -echo "$as_me:16584: result: $cf_cv_found_freetype" >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +echo "$as_me:19292: result: $cf_cv_found_freetype" >&5 echo "${ECHO_T}$cf_cv_found_freetype" >&6 LIBS="$cf_save_LIBS" @@ -16589,19 +19297,19 @@ CPPFLAGS="$cf_save_INCS" if test "$cf_cv_found_freetype" = yes ; then -cf_add_libs="$cf_cv_x_freetype_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_cv_x_freetype_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -16612,23 +19320,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_x_freetype_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -16637,7 +19351,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -16647,19 +19361,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -16670,17 +19392,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi cat >>confdefs.h <<\EOF @@ -16694,65 +19422,65 @@ for ac_func in \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:16697: checking for $ac_func" >&5 +echo "$as_me:19425: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 16703 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 19431 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16734: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:19462: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16737: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16740: \"$ac_try\"") >&5 + echo "$as_me:19465: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:19468: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16743: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:19471: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:16753: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:19481: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 + { echo "$as_me:19492: WARNING: No libraries found for FreeType" >&5 echo "$as_me: WARNING: No libraries found for FreeType" >&2;} CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//` fi @@ -16769,23 +19497,23 @@ fi # FIXME: revisit this if needed if test "$cf_cv_found_freetype" = yes ; then -echo "$as_me:16772: checking for usable Xft/fontconfig package" >&5 +echo "$as_me:19500: checking for usable Xft/fontconfig package" >&5 echo $ECHO_N "checking for usable Xft/fontconfig package... $ECHO_C" >&6 if test "${cf_cv_xft_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 16779 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 19507 "configure" #include "confdefs.h" #include int -main () +main (void) { - XftPattern *pat; + XftPattern *pat = 0; XftPatternBuild(pat, XFT_FAMILY, XftTypeString, "mono", (void *) 0); @@ -16794,28 +19522,28 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16798: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:19526: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16801: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16804: \"$ac_try\"") >&5 + echo "$as_me:19529: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:19532: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16807: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:19535: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_xft_compat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_xft_compat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:16818: result: $cf_cv_xft_compat" >&5 +echo "$as_me:19546: result: $cf_cv_xft_compat" >&5 echo "${ECHO_T}$cf_cv_xft_compat" >&6 if test "$cf_cv_xft_compat" = no @@ -16827,24 +19555,24 @@ then (*) test -n "$verbose" && echo " work around broken package" 1>&6 -echo "${as_me:-configure}:16830: testing work around broken package ..." 1>&5 +echo "${as_me:-configure}:19558: testing work around broken package ..." 1>&5 cf_save_fontconfig="$LIBS" -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists fontconfig; then +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "fontconfig"; then test -n "$verbose" && echo " found package fontconfig" 1>&6 -echo "${as_me:-configure}:16837: testing found package fontconfig ..." 1>&5 +echo "${as_me:-configure}:19565: testing found package fontconfig ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags fontconfig 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs fontconfig 2>/dev/null`" + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "fontconfig" 2>/dev/null`" test -n "$verbose" && echo " package fontconfig CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:16843: testing package fontconfig CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:19571: testing package fontconfig CFLAGS: $cf_pkgconfig_incs ..." 1>&5 test -n "$verbose" && echo " package fontconfig LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:16847: testing package fontconfig LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:19575: testing package fontconfig LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -16853,23 +19581,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -16878,7 +19612,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -16888,19 +19622,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -16911,32 +19653,38 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -16947,23 +19695,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -16972,7 +19726,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -16982,19 +19736,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -17005,29 +19767,35 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi LIBS="$cf_save_fontconfig" test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:17025: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:19793: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXft %-lXft $cf_pkgconfig_libs %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:17030: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:19798: testing ...after $LIBS ..." 1>&5 else cf_pkgconfig_incs= @@ -17035,12 +19803,12 @@ else test -n "$verbose" && echo " ...before $LIBS" 1>&6 -echo "${as_me:-configure}:17038: testing ...before $LIBS ..." 1>&5 +echo "${as_me:-configure}:19806: testing ...before $LIBS ..." 1>&5 LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXft %-lXft -lfontconfig %" -e 's% % %g'` test -n "$verbose" && echo " ...after $LIBS" 1>&6 -echo "${as_me:-configure}:17043: testing ...after $LIBS ..." 1>&5 +echo "${as_me:-configure}:19811: testing ...after $LIBS ..." 1>&5 fi @@ -17053,24 +19821,24 @@ else CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//` fi -echo "$as_me:17056: checking if you want support for HP-style function keys" >&5 +echo "$as_me:19824: checking if you want support for HP-style function keys" >&5 echo $ECHO_N "checking if you want support for HP-style function keys... $ECHO_C" >&6 # Check whether --enable-hp-fkeys or --disable-hp-fkeys was given. if test "${enable_hp_fkeys+set}" = set; then enableval="$enable_hp_fkeys" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_hp_fkeys=yes - else - enable_hp_fkeys=no - fi + else + enable_hp_fkeys=no + fi else enableval=no - enable_hp_fkeys=no + enable_hp_fkeys=no fi; -echo "$as_me:17073: result: $enable_hp_fkeys" >&5 +echo "$as_me:19841: result: $enable_hp_fkeys" >&5 echo "${ECHO_T}$enable_hp_fkeys" >&6 if test "$enable_hp_fkeys" = yes ; then @@ -17080,24 +19848,24 @@ EOF fi -echo "$as_me:17083: checking if you want support for SCO-style function keys" >&5 +echo "$as_me:19851: checking if you want support for SCO-style function keys" >&5 echo $ECHO_N "checking if you want support for SCO-style function keys... $ECHO_C" >&6 # Check whether --enable-sco-fkeys or --disable-sco-fkeys was given. if test "${enable_sco_fkeys+set}" = set; then enableval="$enable_sco_fkeys" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_sco_fkeys=yes - else - enable_sco_fkeys=no - fi + else + enable_sco_fkeys=no + fi else enableval=no - enable_sco_fkeys=no + enable_sco_fkeys=no fi; -echo "$as_me:17100: result: $enable_sco_fkeys" >&5 +echo "$as_me:19868: result: $enable_sco_fkeys" >&5 echo "${ECHO_T}$enable_sco_fkeys" >&6 if test "$enable_sco_fkeys" = yes ; then @@ -17107,24 +19875,24 @@ EOF fi -echo "$as_me:17110: checking if you want support for Sun-style function keys" >&5 +echo "$as_me:19878: checking if you want support for Sun-style function keys" >&5 echo $ECHO_N "checking if you want support for Sun-style function keys... $ECHO_C" >&6 # Check whether --enable-sun-fkeys or --disable-sun-fkeys was given. if test "${enable_sun_fkeys+set}" = set; then enableval="$enable_sun_fkeys" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_sun_fkeys=no - else - enable_sun_fkeys=yes - fi + else + enable_sun_fkeys=yes + fi else enableval=yes - enable_sun_fkeys=yes + enable_sun_fkeys=yes fi; -echo "$as_me:17127: result: $enable_sun_fkeys" >&5 +echo "$as_me:19895: result: $enable_sun_fkeys" >&5 echo "${ECHO_T}$enable_sun_fkeys" >&6 if test "$enable_sun_fkeys" = no ; then @@ -17134,51 +19902,48 @@ EOF fi -echo "$as_me:17137: checking if you want saved-lines stored as a FIFO" >&5 +echo "$as_me:19905: checking if you want saved-lines stored as a FIFO" >&5 echo $ECHO_N "checking if you want saved-lines stored as a FIFO... $ECHO_C" >&6 # Check whether --enable-fifo-lines or --disable-fifo-lines was given. if test "${enable_fifo_lines+set}" = set; then enableval="$enable_fifo_lines" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_fifo_lines=no - else - enable_fifo_lines=yes - fi + else + enable_fifo_lines=yes + fi else enableval=yes - enable_fifo_lines=yes + enable_fifo_lines=yes fi; -echo "$as_me:17154: result: $enable_fifo_lines" >&5 +echo "$as_me:19922: result: $enable_fifo_lines" >&5 echo "${ECHO_T}$enable_fifo_lines" >&6 -if test "$enable_fifo_lines" = yes ; then - -cat >>confdefs.h <<\EOF -#define OPT_FIFO_LINES 1 -EOF - +if test "$enable_fifo_lines" != yes ; then + { echo "$as_me:19925: WARNING: this option has been deprecated" >&5 +echo "$as_me: WARNING: this option has been deprecated" >&2;} fi -echo "$as_me:17164: checking if you want support for internationalization" >&5 +echo "$as_me:19929: checking if you want support for internationalization" >&5 echo $ECHO_N "checking if you want support for internationalization... $ECHO_C" >&6 # Check whether --enable-i18n or --disable-i18n was given. if test "${enable_i18n+set}" = set; then enableval="$enable_i18n" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_i18n=no - else - enable_i18n=yes - fi + else + enable_i18n=yes + fi else enableval=yes - enable_i18n=yes + enable_i18n=yes fi; -echo "$as_me:17181: result: $enable_i18n" >&5 +echo "$as_me:19946: result: $enable_i18n" >&5 echo "${ECHO_T}$enable_i18n" >&6 if test "$enable_i18n" = no ; then @@ -17188,24 +19953,24 @@ EOF fi -echo "$as_me:17191: checking if you want support for initial-erase setup" >&5 +echo "$as_me:19956: checking if you want support for initial-erase setup" >&5 echo $ECHO_N "checking if you want support for initial-erase setup... $ECHO_C" >&6 # Check whether --enable-initial-erase or --disable-initial-erase was given. if test "${enable_initial_erase+set}" = set; then enableval="$enable_initial_erase" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_ie=no - else - enable_ie=yes - fi + else + enable_ie=yes + fi else enableval=yes - enable_ie=yes + enable_ie=yes fi; -echo "$as_me:17208: result: $enable_ie" >&5 +echo "$as_me:19973: result: $enable_ie" >&5 echo "${ECHO_T}$enable_ie" >&6 if test "$enable_ie" = no ; then @@ -17215,34 +19980,34 @@ EOF fi -echo "$as_me:17218: checking if you want support for input-method" >&5 +echo "$as_me:19983: checking if you want support for input-method" >&5 echo $ECHO_N "checking if you want support for input-method... $ECHO_C" >&6 # Check whether --enable-input-method or --disable-input-method was given. if test "${enable_input_method+set}" = set; then enableval="$enable_input_method" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_ximp=no - else - enable_ximp=yes - fi + else + enable_ximp=$enable_i18n + fi else enableval=yes - enable_ximp=yes + enable_ximp=$enable_i18n fi; -echo "$as_me:17235: result: $enable_ximp" >&5 +echo "$as_me:20000: result: $enable_ximp" >&5 echo "${ECHO_T}$enable_ximp" >&6 -echo "$as_me:17238: checking if X libraries support input-method" >&5 +echo "$as_me:20003: checking if X libraries support input-method" >&5 echo $ECHO_N "checking if X libraries support input-method... $ECHO_C" >&6 if test "${cf_cv_input_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 17245 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 20010 "configure" #include "confdefs.h" #include @@ -17253,50 +20018,59 @@ cat >conftest.$ac_ext <<_ACEOF #include int -main () +main (void) { { XIM xim; XIMStyles *xim_styles = 0; XIMStyle input_style; - Widget w = 0; + Widget w = XtCreateWidget("none", (WidgetClass)0, None, (ArgList)0, 0); XSetLocaleModifiers("@im=none"); xim = XOpenIM(XtDisplay(w), NULL, NULL, NULL); XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL); XCloseIM(xim); input_style = (XIMPreeditNothing | XIMStatusNothing); + (void)xim_styles; + (void)input_style; } ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17277: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:20044: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17280: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17283: \"$ac_try\"") >&5 + echo "$as_me:20047: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:20050: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17286: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:20053: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_input_method=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_input_method=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:17296: result: $cf_cv_input_method" >&5 +echo "$as_me:20063: result: $cf_cv_input_method" >&5 echo "${ECHO_T}$cf_cv_input_method" >&6 test "$cf_cv_input_method" = no && enable_ximp=no +if test "$enable_ximp" != no ; then + if test "$enable_i18n" = no ; then + { echo "$as_me:20069: WARNING: input-methor relies upon internationalization" >&5 +echo "$as_me: WARNING: input-methor relies upon internationalization" >&2;} + enable_ximp=no + fi +fi if test "$enable_ximp" = no ; then cat >>confdefs.h <<\EOF @@ -17305,24 +20079,24 @@ EOF fi -echo "$as_me:17308: checking if you want support for load-vt-fonts" >&5 +echo "$as_me:20082: checking if you want support for load-vt-fonts" >&5 echo $ECHO_N "checking if you want support for load-vt-fonts... $ECHO_C" >&6 # Check whether --enable-load-vt-fonts or --disable-load-vt-fonts was given. if test "${enable_load_vt_fonts+set}" = set; then enableval="$enable_load_vt_fonts" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_load_vt_fonts=yes - else - enable_load_vt_fonts=no - fi + else + enable_load_vt_fonts=no + fi else enableval=no - enable_load_vt_fonts=no + enable_load_vt_fonts=no fi; -echo "$as_me:17325: result: $enable_load_vt_fonts" >&5 +echo "$as_me:20099: result: $enable_load_vt_fonts" >&5 echo "${ECHO_T}$enable_load_vt_fonts" >&6 if test "$enable_load_vt_fonts" = yes ; then @@ -17332,24 +20106,24 @@ EOF fi -echo "$as_me:17335: checking if you want support for logging" >&5 +echo "$as_me:20109: checking if you want support for logging" >&5 echo $ECHO_N "checking if you want support for logging... $ECHO_C" >&6 # Check whether --enable-logging or --disable-logging was given. if test "${enable_logging+set}" = set; then enableval="$enable_logging" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_logging=yes - else - enable_logging=no - fi + else + enable_logging=no + fi else enableval=no - enable_logging=no + enable_logging=no fi; -echo "$as_me:17352: result: $enable_logging" >&5 +echo "$as_me:20126: result: $enable_logging" >&5 echo "${ECHO_T}$enable_logging" >&6 if test "$enable_logging" = yes ; then @@ -17357,24 +20131,24 @@ cat >>confdefs.h <<\EOF #define ALLOWLOGGING 1 EOF - echo "$as_me:17360: checking if you want to allow logging via a pipe" >&5 + echo "$as_me:20134: checking if you want to allow logging via a pipe" >&5 echo $ECHO_N "checking if you want to allow logging via a pipe... $ECHO_C" >&6 # Check whether --enable-logfile-exec or --disable-logfile-exec was given. if test "${enable_logfile_exec+set}" = set; then enableval="$enable_logfile_exec" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_log_exec=yes - else - enable_log_exec=no - fi + else + enable_log_exec=no + fi else enableval=no - enable_log_exec=no + enable_log_exec=no fi; - echo "$as_me:17377: result: $enable_log_exec" >&5 + echo "$as_me:20151: result: $enable_log_exec" >&5 echo "${ECHO_T}$enable_log_exec" >&6 if test "$enable_log_exec" = yes ; then @@ -17385,72 +20159,72 @@ EOF fi fi -echo "$as_me:17388: checking if you want support for iconify/maximize translations" >&5 +echo "$as_me:20162: checking if you want support for iconify/maximize translations" >&5 echo $ECHO_N "checking if you want support for iconify/maximize translations... $ECHO_C" >&6 # Check whether --enable-maximize or --disable-maximize was given. if test "${enable_maximize+set}" = set; then enableval="$enable_maximize" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_maximize=no - else - enable_maximize=yes - fi + else + enable_maximize=yes + fi else enableval=yes - enable_maximize=yes + enable_maximize=yes fi; -echo "$as_me:17405: result: $enable_maximize" >&5 +echo "$as_me:20179: result: $enable_maximize" >&5 echo "${ECHO_T}$enable_maximize" >&6 test "$enable_maximize" = no && cat >>confdefs.h <<\EOF #define OPT_MAXIMIZE 0 EOF -echo "$as_me:17412: checking if you want NumLock to override keyboard tables" >&5 +echo "$as_me:20186: checking if you want NumLock to override keyboard tables" >&5 echo $ECHO_N "checking if you want NumLock to override keyboard tables... $ECHO_C" >&6 # Check whether --enable-num-lock or --disable-num-lock was given. if test "${enable_num_lock+set}" = set; then enableval="$enable_num_lock" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_numlock=no - else - enable_numlock=yes - fi + else + enable_numlock=yes + fi else enableval=yes - enable_numlock=yes + enable_numlock=yes fi; -echo "$as_me:17429: result: $enable_numlock" >&5 +echo "$as_me:20203: result: $enable_numlock" >&5 echo "${ECHO_T}$enable_numlock" >&6 test "$enable_numlock" = no && cat >>confdefs.h <<\EOF #define OPT_NUM_LOCK 0 EOF -echo "$as_me:17436: checking if you want support for get/set of base64 selection data" >&5 +echo "$as_me:20210: checking if you want support for get/set of base64 selection data" >&5 echo $ECHO_N "checking if you want support for get/set of base64 selection data... $ECHO_C" >&6 # Check whether --enable-paste64 or --disable-paste64 was given. if test "${enable_paste64+set}" = set; then enableval="$enable_paste64" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_paste64=no - else - enable_paste64=yes - fi + else + enable_paste64=yes + fi else enableval=yes - enable_paste64=yes + enable_paste64=yes fi; -echo "$as_me:17453: result: $enable_paste64" >&5 +echo "$as_me:20227: result: $enable_paste64" >&5 echo "${ECHO_T}$enable_paste64" >&6 if test "$enable_paste64" = yes ; then @@ -17466,24 +20240,24 @@ EOF fi -echo "$as_me:17469: checking if you want support for pty-handshaking" >&5 +echo "$as_me:20243: checking if you want support for pty-handshaking" >&5 echo $ECHO_N "checking if you want support for pty-handshaking... $ECHO_C" >&6 # Check whether --enable-pty-handshake or --disable-pty-handshake was given. if test "${enable_pty_handshake+set}" = set; then enableval="$enable_pty_handshake" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_pty_handshake=no - else - enable_pty_handshake=yes - fi + else + enable_pty_handshake=yes + fi else enableval=yes - enable_pty_handshake=yes + enable_pty_handshake=yes fi; -echo "$as_me:17486: result: $enable_pty_handshake" >&5 +echo "$as_me:20260: result: $enable_pty_handshake" >&5 echo "${ECHO_T}$enable_pty_handshake" >&6 if test "$enable_pty_handshake" = yes ; then @@ -17499,24 +20273,24 @@ EOF fi -echo "$as_me:17502: checking if you want support for mouse in readline applications" >&5 +echo "$as_me:20276: checking if you want support for mouse in readline applications" >&5 echo $ECHO_N "checking if you want support for mouse in readline applications... $ECHO_C" >&6 # Check whether --enable-readline-mouse or --disable-readline-mouse was given. if test "${enable_readline_mouse+set}" = set; then enableval="$enable_readline_mouse" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_readline_mouse=yes - else - enable_readline_mouse=no - fi + else + enable_readline_mouse=no + fi else enableval=no - enable_readline_mouse=no + enable_readline_mouse=no fi; -echo "$as_me:17519: result: $enable_readline_mouse" >&5 +echo "$as_me:20293: result: $enable_readline_mouse" >&5 echo "${ECHO_T}$enable_readline_mouse" >&6 if test "$enable_readline_mouse" = yes ; then @@ -17526,55 +20300,58 @@ EOF fi -echo "$as_me:17529: checking if you want support for regular-expression selections" >&5 +echo "$as_me:20303: checking if you want support for regular-expression selections" >&5 echo $ECHO_N "checking if you want support for regular-expression selections... $ECHO_C" >&6 # Check whether --enable-regex or --disable-regex was given. if test "${enable_regex+set}" = set; then enableval="$enable_regex" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_regex=no - else - enable_regex=yes - fi + else + enable_regex=yes + fi else enableval=yes - enable_regex=yes + enable_regex=yes fi; -echo "$as_me:17546: result: $enable_regex" >&5 +echo "$as_me:20320: result: $enable_regex" >&5 echo "${ECHO_T}$enable_regex" >&6 if test "$enable_regex" = yes ; then -echo "$as_me:17550: checking if you want to use PCRE for regular-expressions" >&5 -echo $ECHO_N "checking if you want to use PCRE for regular-expressions... $ECHO_C" >&6 +echo "$as_me:20324: checking if you want to use PCRE2 for regular-expressions" >&5 +echo $ECHO_N "checking if you want to use PCRE2 for regular-expressions... $ECHO_C" >&6 -# Check whether --with-pcre or --without-pcre was given. -if test "${with_pcre+set}" = set; then - withval="$with_pcre" +# Check whether --with-pcre2 or --without-pcre2 was given. +if test "${with_pcre2+set}" = set; then + withval="$with_pcre2" fi; -test -z "$with_pcre" && with_pcre=no -echo "$as_me:17559: result: $with_pcre" >&5 -echo "${ECHO_T}$with_pcre" >&6 +test -z "$with_pcre2" && with_pcre2=no +echo "$as_me:20333: result: $with_pcre2" >&5 +echo "${ECHO_T}$with_pcre2" >&6 -if test "$with_pcre" != no ; then +if test "x$with_pcre2" != xno ; then + cf_with_pcre2_ok=no + for cf_with_pcre2 in libpcre2 libpcre2-posix libpcre + do -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists libpcre; then - test -n "$verbose" && echo " found package libpcre" 1>&6 +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_with_pcre2"; then + test -n "$verbose" && echo " found package $cf_with_pcre2" 1>&6 -echo "${as_me:-configure}:17567: testing found package libpcre ..." 1>&5 +echo "${as_me:-configure}:20344: testing found package $cf_with_pcre2 ..." 1>&5 - cf_pkgconfig_incs="`$PKG_CONFIG --cflags libpcre 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs libpcre 2>/dev/null`" - test -n "$verbose" && echo " package libpcre CFLAGS: $cf_pkgconfig_incs" 1>&6 + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_with_pcre2" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "$cf_with_pcre2" 2>/dev/null`" + test -n "$verbose" && echo " package $cf_with_pcre2 CFLAGS: $cf_pkgconfig_incs" 1>&6 -echo "${as_me:-configure}:17573: testing package libpcre CFLAGS: $cf_pkgconfig_incs ..." 1>&5 +echo "${as_me:-configure}:20350: testing package $cf_with_pcre2 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 - test -n "$verbose" && echo " package libpcre LIBS: $cf_pkgconfig_libs" 1>&6 + test -n "$verbose" && echo " package $cf_with_pcre2 LIBS: $cf_pkgconfig_libs" 1>&6 -echo "${as_me:-configure}:17577: testing package libpcre LIBS: $cf_pkgconfig_libs ..." 1>&5 +echo "${as_me:-configure}:20354: testing package $cf_with_pcre2 LIBS: $cf_pkgconfig_libs ..." 1>&5 cf_fix_cppflags=no cf_new_cflags= @@ -17583,23 +20360,29 @@ cf_new_extra_cppflags= for cf_add_cflags in $cf_pkgconfig_incs do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -17608,7 +20391,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -17618,19 +20401,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -17641,32 +20432,471 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + + cf_with_pcre2_ok=yes; break +else + cf_pkgconfig_incs= + cf_pkgconfig_libs= + : +fi + + done + cf_with_pcre2_ok=yes || { { echo "$as_me:20478: error: Cannot find PCRE2 library" >&5 +echo "$as_me: error: Cannot find PCRE2 library" >&2;} + { (exit 1); exit 1; }; } + +cat >>confdefs.h <<\EOF +#define HAVE_LIB_PCRE2 1 +EOF + + # if pkgconfig gave no results, look for the libraries directly + case "$LIBS" in + (*pcre2-posix*|*pcreposix*) + ;; + (*) + echo "$as_me:20491: checking for regcomp in -lpcre2-posix" >&5 +echo $ECHO_N "checking for regcomp in -lpcre2-posix... $ECHO_C" >&6 +if test "${ac_cv_lib_pcre2_posix_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcre2-posix $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 20499 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regcomp (); +int +main (void) +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:20518: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:20521: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:20524: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:20527: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_pcre2_posix_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_pcre2_posix_regcomp=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:20538: result: $ac_cv_lib_pcre2_posix_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_pcre2_posix_regcomp" >&6 +if test "$ac_cv_lib_pcre2_posix_regcomp" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lpcre2-posix; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +else + echo "$as_me:20559: checking for regcomp in -lpcreposix" >&5 +echo $ECHO_N "checking for regcomp in -lpcreposix... $ECHO_C" >&6 +if test "${ac_cv_lib_pcreposix_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcreposix $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 20567 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regcomp (); +int +main (void) +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:20586: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:20589: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:20592: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:20595: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_pcreposix_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_pcreposix_regcomp=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:20606: result: $ac_cv_lib_pcreposix_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_pcreposix_regcomp" >&6 +if test "$ac_cv_lib_pcreposix_regcomp" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lpcreposix; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +else + { { echo "$as_me:20627: error: Cannot find PCRE2 POSIX library" >&5 +echo "$as_me: error: Cannot find PCRE2 POSIX library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + ;; + esac + + # either way, check for the library header files + +for ac_header in pcre2posix.h pcreposix.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:20642: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 20648 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:20652: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + $EGREP -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:20658: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat "conftest.$ac_ext" >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err "conftest.$ac_ext" +fi +echo "$as_me:20677: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 20696 "configure" +#include "confdefs.h" +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + +#ifdef __cplusplus +extern "C" +#endif + +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (void); + +int +main (void) +{ + +/* The GNU C library defines stubs for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#error found stub for $ac_func +#endif + + return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:20727: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:20730: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:20733: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:20736: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +eval "$as_ac_var=no" +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +fi +echo "$as_me:20746: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking if you want to use PCRE for regular-expressions... $ECHO_C" >&6 + +# Check whether --with-pcre or --without-pcre was given. +if test "${with_pcre+set}" = set; then + withval="$with_pcre" + +fi; +test -z "$with_pcre" && with_pcre=no +echo "$as_me:20769: result: $with_pcre" >&5 +echo "${ECHO_T}$with_pcre" >&6 + +if test "$with_pcre" != no ; then + +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "libpcre"; then + test -n "$verbose" && echo " found package libpcre" 1>&6 + +echo "${as_me:-configure}:20777: testing found package libpcre ..." 1>&5 + + cf_pkgconfig_incs="`$PKG_CONFIG --cflags "libpcre" 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs "libpcre" 2>/dev/null`" + test -n "$verbose" && echo " package libpcre CFLAGS: $cf_pkgconfig_incs" 1>&6 + +echo "${as_me:-configure}:20783: testing package libpcre CFLAGS: $cf_pkgconfig_incs ..." 1>&5 + + test -n "$verbose" && echo " package libpcre LIBS: $cf_pkgconfig_libs" 1>&6 + +echo "${as_me:-configure}:20787: testing package libpcre LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_pkgconfig_incs +do +case "$cf_fix_cppflags" in +(no) + case "$cf_add_cflags" in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case "$cf_add_cflags" in + (-D*) + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case "$cf_add_cflags" in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -17675,15 +20905,15 @@ else cf_pkgconfig_incs= cf_pkgconfig_libs= -echo "$as_me:17678: checking for pcre_compile in -lpcre" >&5 +echo "$as_me:20908: checking for pcre_compile in -lpcre" >&5 echo $ECHO_N "checking for pcre_compile in -lpcre... $ECHO_C" >&6 if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcre $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 17686 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 20916 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -17694,37 +20924,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char pcre_compile (); int -main () +main (void) { pcre_compile (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17705: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:20935: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17708: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17711: \"$ac_try\"") >&5 + echo "$as_me:20938: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:20941: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17714: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:20944: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_pcre_pcre_compile=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_pcre_pcre_compile=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:17725: result: $ac_cv_lib_pcre_pcre_compile" >&5 +echo "$as_me:20955: result: $ac_cv_lib_pcre_pcre_compile" >&5 echo "${ECHO_T}$ac_cv_lib_pcre_pcre_compile" >&6 -if test $ac_cv_lib_pcre_pcre_compile = yes; then +if test "$ac_cv_lib_pcre_pcre_compile" = yes; then cat >>confdefs.h <&5 + { { echo "$as_me:20965: error: Cannot find PCRE library" >&5 echo "$as_me: error: Cannot find PCRE library" >&2;} { (exit 1); exit 1; }; } fi @@ -17743,19 +20973,19 @@ cat >>confdefs.h <<\EOF #define HAVE_LIB_PCRE 1 EOF - case $LIBS in - (*pcreposix*) - ;; - (*) - echo "$as_me:17750: checking for pcreposix_regcomp in -lpcreposix" >&5 + case $LIBS in + (*pcreposix*) + ;; + (*) + echo "$as_me:20980: checking for pcreposix_regcomp in -lpcreposix" >&5 echo $ECHO_N "checking for pcreposix_regcomp in -lpcreposix... $ECHO_C" >&6 if test "${ac_cv_lib_pcreposix_pcreposix_regcomp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcreposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 17758 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 20988 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -17766,68 +20996,68 @@ extern "C" builtin and then its argument prototype would still apply. */ char pcreposix_regcomp (); int -main () +main (void) { pcreposix_regcomp (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17777: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21007: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17780: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17783: \"$ac_try\"") >&5 + echo "$as_me:21010: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21013: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17786: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21016: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_pcreposix_pcreposix_regcomp=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_pcreposix_pcreposix_regcomp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:17797: result: $ac_cv_lib_pcreposix_pcreposix_regcomp" >&5 +echo "$as_me:21027: result: $ac_cv_lib_pcreposix_pcreposix_regcomp" >&5 echo "${ECHO_T}$ac_cv_lib_pcreposix_pcreposix_regcomp" >&6 -if test $ac_cv_lib_pcreposix_pcreposix_regcomp = yes; then +if test "$ac_cv_lib_pcreposix_pcreposix_regcomp" = yes; then cat >>confdefs.h <<\EOF #define HAVE_PCREPOSIX_H 1 EOF -cf_add_libs="-lpcreposix" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lpcreposix; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" else - echo "$as_me:17822: checking for regcomp in -lpcreposix" >&5 + echo "$as_me:21052: checking for regcomp in -lpcreposix" >&5 echo $ECHO_N "checking for regcomp in -lpcreposix... $ECHO_C" >&6 if test "${ac_cv_lib_pcreposix_regcomp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcreposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 17830 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21060 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -17838,155 +21068,86 @@ extern "C" builtin and then its argument prototype would still apply. */ char regcomp (); int -main () +main (void) { regcomp (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17849: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21079: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17852: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17855: \"$ac_try\"") >&5 + echo "$as_me:21082: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21085: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17858: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21088: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_pcreposix_regcomp=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_pcreposix_regcomp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:17869: result: $ac_cv_lib_pcreposix_regcomp" >&5 +echo "$as_me:21099: result: $ac_cv_lib_pcreposix_regcomp" >&5 echo "${ECHO_T}$ac_cv_lib_pcreposix_regcomp" >&6 -if test $ac_cv_lib_pcreposix_regcomp = yes; then +if test "$ac_cv_lib_pcreposix_regcomp" = yes; then cat >>confdefs.h <<\EOF #define HAVE_PCREPOSIX_H 1 EOF -cf_add_libs="-lpcreposix" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lpcreposix; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" else - { { echo "$as_me:17894: error: Cannot find PCRE POSIX library" >&5 + { { echo "$as_me:21124: error: Cannot find PCRE POSIX library" >&5 echo "$as_me: error: Cannot find PCRE POSIX library" >&2;} { (exit 1); exit 1; }; } fi fi - ;; - esac + ;; + esac fi - if test "$with_pcre" = no ; then + if test "$with_pcre" = no ; then cf_regex_func=no - -cf_regex_libs="regex re" -case $host_os in +cf_regex_libs= +case "$host_os" in (mingw*) - cf_regex_libs="gnurx $cf_regex_libs" - ;; -esac - -echo "$as_me:17916: checking for regcomp" >&5 -echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 -if test "${ac_cv_func_regcomp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 17922 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char regcomp (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char regcomp (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_regcomp) || defined (__stub___regcomp) -choke me -#else -f = regcomp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17953: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17956: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17959: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17962: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_regcomp=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_regcomp=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:17972: result: $ac_cv_func_regcomp" >&5 -echo "${ECHO_T}$ac_cv_func_regcomp" >&6 -if test $ac_cv_func_regcomp = yes; then - cf_regex_func=regcomp -else - - for cf_regex_lib in $cf_regex_libs - do - as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` -echo "$as_me:17981: checking for regcomp in -l$cf_regex_lib" >&5 -echo $ECHO_N "checking for regcomp in -l$cf_regex_lib... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Lib+set}\" = set"; then + # -lsystre -ltre -lintl -liconv + echo "$as_me:21142: checking for regcomp in -lsystre" >&5 +echo $ECHO_N "checking for regcomp in -lsystre... $ECHO_C" >&6 +if test "${ac_cv_lib_systre_regcomp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-l$cf_regex_lib $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 17989 "configure" +LIBS="-lsystre $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21150 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -17997,134 +21158,555 @@ extern "C" builtin and then its argument prototype would still apply. */ char regcomp (); int -main () +main (void) { regcomp (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18008: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21169: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18011: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18014: \"$ac_try\"") >&5 + echo "$as_me:21172: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21175: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18017: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Lib=yes" + echo "$as_me:21178: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_systre_regcomp=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_Lib=no" +cat "conftest.$ac_ext" >&5 +ac_cv_lib_systre_regcomp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:18028: result: `eval echo '${'$as_ac_Lib'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 -if test `eval echo '${'$as_ac_Lib'}'` = yes; then +echo "$as_me:21189: result: $ac_cv_lib_systre_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_systre_regcomp" >&6 +if test "$ac_cv_lib_systre_regcomp" = yes; then -cf_add_libs="-l$cf_regex_lib" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then - cf_add_1lib= - break - fi - done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" -done -LIBS="$cf_add_libs" - - cf_regex_func=regcomp - break -fi - - done - -fi - -if test "$cf_regex_func" = no ; then - echo "$as_me:18057: checking for compile" >&5 -echo $ECHO_N "checking for compile... $ECHO_C" >&6 -if test "${ac_cv_func_compile+set}" = set; then + echo "$as_me:21193: checking for libiconv_open in -liconv" >&5 +echo $ECHO_N "checking for libiconv_open in -liconv... $ECHO_C" >&6 +if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 18063 "configure" + ac_check_lib_save_LIBS=$LIBS +LIBS="-liconv $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21201 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char compile (); below. */ -#include + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char compile (); -char (*f) (); - +char libiconv_open (); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_compile) || defined (__stub___compile) -choke me -#else -f = compile; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; -#endif - +libiconv_open (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18094: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21220: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18097: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18100: \"$ac_try\"") >&5 + echo "$as_me:21223: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21226: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18103: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21229: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_iconv_libiconv_open=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_iconv_libiconv_open=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:21240: result: $ac_cv_lib_iconv_libiconv_open" >&5 +echo "${ECHO_T}$ac_cv_lib_iconv_libiconv_open" >&6 +if test "$ac_cv_lib_iconv_libiconv_open" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -liconv; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +fi + + echo "$as_me:21262: checking for libintl_gettext in -lintl" >&5 +echo $ECHO_N "checking for libintl_gettext in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_libintl_gettext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21270 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char libintl_gettext (); +int +main (void) +{ +libintl_gettext (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21289: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21292: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21295: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21298: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_intl_libintl_gettext=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_intl_libintl_gettext=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:21309: result: $ac_cv_lib_intl_libintl_gettext" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_libintl_gettext" >&6 +if test "$ac_cv_lib_intl_libintl_gettext" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lintl; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +fi + + echo "$as_me:21331: checking for tre_regcomp in -ltre" >&5 +echo $ECHO_N "checking for tre_regcomp in -ltre... $ECHO_C" >&6 +if test "${ac_cv_lib_tre_tre_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltre $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21339 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tre_regcomp (); +int +main (void) +{ +tre_regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21358: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21361: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21364: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21367: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_tre_tre_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_tre_tre_regcomp=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:21378: result: $ac_cv_lib_tre_tre_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_tre_tre_regcomp" >&6 +if test "$ac_cv_lib_tre_tre_regcomp" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -ltre; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + +fi + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lsystre; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + + cf_regex_func=regcomp + +else + + echo "$as_me:21420: checking for regcomp in -lgnurx" >&5 +echo $ECHO_N "checking for regcomp in -lgnurx... $ECHO_C" >&6 +if test "${ac_cv_lib_gnurx_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnurx $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21428 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regcomp (); +int +main (void) +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21447: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21450: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21453: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21456: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_lib_gnurx_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_lib_gnurx_regcomp=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:21467: result: $ac_cv_lib_gnurx_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_gnurx_regcomp" >&6 +if test "$ac_cv_lib_gnurx_regcomp" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lgnurx; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + + cf_regex_func=regcomp +fi + +fi + + ;; +(*) + cf_regex_libs="regex re" + echo "$as_me:21495: checking for regcomp" >&5 +echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 +if test "${ac_cv_func_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 21501 "configure" +#include "confdefs.h" +#define regcomp autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef regcomp + +#ifdef __cplusplus +extern "C" +#endif + +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regcomp (void); + +int +main (void) +{ + +/* The GNU C library defines stubs for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_regcomp) || defined (__stub___regcomp) +#error found stub for regcomp +#endif + + return regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21532: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21535: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21538: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21541: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + ac_cv_func_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +ac_cv_func_regcomp=no +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +fi +echo "$as_me:21551: result: $ac_cv_func_regcomp" >&5 +echo "${ECHO_T}$ac_cv_func_regcomp" >&6 +if test "$ac_cv_func_regcomp" = yes; then + cf_regex_func=regcomp +else + + for cf_regex_lib in $cf_regex_libs + do + as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` +echo "$as_me:21560: checking for regcomp in -l$cf_regex_lib" >&5 +echo $ECHO_N "checking for regcomp in -l$cf_regex_lib... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Lib+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$cf_regex_lib $LIBS" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21568 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regcomp (); +int +main (void) +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21587: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21590: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21593: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21596: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + eval "$as_ac_Lib=yes" +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +eval "$as_ac_Lib=no" +fi +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:21607: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6 +if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then + +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -l$cf_regex_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" +done +LIBS="$cf_add_libs" + + cf_regex_func=regcomp + break +fi + + done + +fi + + ;; +esac + +if test "$cf_regex_func" = no ; then + echo "$as_me:21639: checking for compile" >&5 +echo $ECHO_N "checking for compile... $ECHO_C" >&6 +if test "${ac_cv_func_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 21645 "configure" +#include "confdefs.h" +#define compile autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef compile + +#ifdef __cplusplus +extern "C" +#endif + +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char compile (void); + +int +main (void) +{ + +/* The GNU C library defines stubs for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_compile) || defined (__stub___compile) +#error found stub for compile +#endif + + return compile (); + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21676: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:21679: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21682: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:21685: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_func_compile=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_func_compile=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:18113: result: $ac_cv_func_compile" >&5 +echo "$as_me:21695: result: $ac_cv_func_compile" >&5 echo "${ECHO_T}$ac_cv_func_compile" >&6 -if test $ac_cv_func_compile = yes; then +if test "$ac_cv_func_compile" = yes; then cf_regex_func=compile else - echo "$as_me:18119: checking for compile in -lgen" >&5 + echo "$as_me:21701: checking for compile in -lgen" >&5 echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 if test "${ac_cv_lib_gen_compile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 18127 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 21709 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -18135,51 +21717,51 @@ extern "C" builtin and then its argument prototype would still apply. */ char compile (); int -main () +main (void) { compile (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18146: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21728: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18149: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18152: \"$ac_try\"") >&5 + echo "$as_me:21731: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21734: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18155: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21737: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_gen_compile=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_gen_compile=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:18166: result: $ac_cv_lib_gen_compile" >&5 +echo "$as_me:21748: result: $ac_cv_lib_gen_compile" >&5 echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 -if test $ac_cv_lib_gen_compile = yes; then +if test "$ac_cv_lib_gen_compile" = yes; then -cf_add_libs="-lgen" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lgen; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -18191,133 +21773,138 @@ fi fi if test "$cf_regex_func" = no ; then - { echo "$as_me:18194: WARNING: cannot find regular expression library" >&5 + { echo "$as_me:21776: WARNING: cannot find regular expression library" >&5 echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi -echo "$as_me:18198: checking for regular-expression headers" >&5 +echo "$as_me:21780: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 if test "${cf_cv_regex_hdrs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_regex_hdrs=no -case $cf_regex_func in +case "$cf_regex_func" in (compile) for cf_regex_hdr in regexp.h regexpr.h do - cat >conftest.$ac_ext <<_ACEOF -#line 18210 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 21792 "configure" #include "confdefs.h" #include <$cf_regex_hdr> int -main () +main (void) { char *p = compile("", "", "", 0); int x = step("", ""); + (void)p; + (void)x; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18225: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21809: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18228: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18231: \"$ac_try\"") >&5 + echo "$as_me:21812: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18234: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21818: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_regex_hdrs=$cf_regex_hdr break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" done ;; (*) for cf_regex_hdr in regex.h do - cat >conftest.$ac_ext <<_ACEOF -#line 18251 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 21835 "configure" #include "confdefs.h" #include #include <$cf_regex_hdr> int -main () +main (void) { - regex_t *p; + regex_t *p = 0; int x = regcomp(p, "", 0); int y = regexec(p, "", 0, 0, 0); + (void)x; + (void)y; regfree(p); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18269: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:21855: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18272: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18275: \"$ac_try\"") >&5 + echo "$as_me:21858: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:21861: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18278: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:21864: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_regex_hdrs=$cf_regex_hdr break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" done ;; esac fi -echo "$as_me:18294: result: $cf_cv_regex_hdrs" >&5 +echo "$as_me:21880: result: $cf_cv_regex_hdrs" >&5 echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 -case $cf_cv_regex_hdrs in - (no) { echo "$as_me:18298: WARNING: no regular expression header found" >&5 +case "$cf_cv_regex_hdrs" in + (no) { echo "$as_me:21884: WARNING: no regular expression header found" >&5 echo "$as_me: WARNING: no regular expression header found" >&2;} ;; - (regex.h) + (regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF ;; - (regexp.h) + (regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF ;; - (regexpr.h) + (regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; esac - if test "X$cf_cv_regex_hdrs" != "Xregex.h" ; then - { { echo "$as_me:18318: error: Only POSIX or PCRE regular expressions are supported" >&5 -echo "$as_me: error: Only POSIX or PCRE regular expressions are supported" >&2;} + if test "X$cf_cv_regex_hdrs" != "Xregex.h" ; then + { { echo "$as_me:21904: error: Only POSIX, PCRE, or PCRE2 regular expressions are supported" >&5 +echo "$as_me: error: Only POSIX, PCRE, or PCRE2 regular expressions are supported" >&2;} { (exit 1); exit 1; }; } + fi fi fi @@ -18327,24 +21914,24 @@ EOF fi -echo "$as_me:18330: checking if you want support for right-scrollbar" >&5 +echo "$as_me:21917: checking if you want support for right-scrollbar" >&5 echo $ECHO_N "checking if you want support for right-scrollbar... $ECHO_C" >&6 # Check whether --enable-rightbar or --disable-rightbar was given. if test "${enable_rightbar+set}" = set; then enableval="$enable_rightbar" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_rightbar=no - else - enable_rightbar=yes - fi + else + enable_rightbar=yes + fi else enableval=yes - enable_rightbar=yes + enable_rightbar=yes fi; -echo "$as_me:18347: result: $enable_rightbar" >&5 +echo "$as_me:21934: result: $enable_rightbar" >&5 echo "${ECHO_T}$enable_rightbar" >&6 if test "$enable_rightbar" = yes ; then @@ -18354,144 +21941,168 @@ EOF fi -echo "$as_me:18357: checking if you want check for redundant name-change" >&5 +echo "$as_me:21944: checking if you want check for redundant name-change" >&5 echo $ECHO_N "checking if you want check for redundant name-change... $ECHO_C" >&6 # Check whether --enable-samename or --disable-samename was given. if test "${enable_samename+set}" = set; then enableval="$enable_samename" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_samename=no - else - enable_samename=yes - fi + else + enable_samename=yes + fi else enableval=yes - enable_samename=yes + enable_samename=yes fi; -echo "$as_me:18374: result: $enable_samename" >&5 +echo "$as_me:21961: result: $enable_samename" >&5 echo "${ECHO_T}$enable_samename" >&6 test "$enable_samename" = no && cat >>confdefs.h <<\EOF #define OPT_SAME_NAME 0 EOF -echo "$as_me:18381: checking if you want support for selection-actions" >&5 +echo "$as_me:21968: checking if you want support for selection-actions" >&5 echo $ECHO_N "checking if you want support for selection-actions... $ECHO_C" >&6 # Check whether --enable-selection-ops or --disable-selection-ops was given. if test "${enable_selection_ops+set}" = set; then enableval="$enable_selection_ops" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_selection_ops=no - else - enable_selection_ops=yes - fi + else + enable_selection_ops=yes + fi else enableval=yes - enable_selection_ops=yes + enable_selection_ops=yes fi; -echo "$as_me:18398: result: $enable_selection_ops" >&5 +echo "$as_me:21985: result: $enable_selection_ops" >&5 echo "${ECHO_T}$enable_selection_ops" >&6 test "$enable_selection_ops" = no && cat >>confdefs.h <<\EOF #define OPT_SELECTION_OPS 0 EOF -echo "$as_me:18405: checking if you want support for session management" >&5 +echo "$as_me:21992: checking if you want support for session management" >&5 echo $ECHO_N "checking if you want support for session management... $ECHO_C" >&6 # Check whether --enable-session-mgt or --disable-session-mgt was given. if test "${enable_session_mgt+set}" = set; then enableval="$enable_session_mgt" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_session_mgt=no - else - enable_session_mgt=yes - fi + else + enable_session_mgt=yes + fi else enableval=yes - enable_session_mgt=yes + enable_session_mgt=yes fi; -echo "$as_me:18422: result: $enable_session_mgt" >&5 +echo "$as_me:22009: result: $enable_session_mgt" >&5 echo "${ECHO_T}$enable_session_mgt" >&6 test "$enable_session_mgt" = no && cat >>confdefs.h <<\EOF #define OPT_SESSION_MGT 0 EOF -echo "$as_me:18429: checking if you want to use termcap function-keys" >&5 +echo "$as_me:22016: checking if you want support for status-line" >&5 +echo $ECHO_N "checking if you want support for status-line... $ECHO_C" >&6 + +# Check whether --enable-status-line or --disable-status-line was given. +if test "${enable_status_line+set}" = set; then + enableval="$enable_status_line" + test "$enableval" != yes && enableval=no + if test "$enableval" != "no" ; then + enable_status_line=yes + else + enable_status_line=no + fi +else + enableval=no + enable_status_line=no + +fi; +echo "$as_me:22033: result: $enable_status_line" >&5 +echo "${ECHO_T}$enable_status_line" >&6 +test "$enable_status_line" = yes && +cat >>confdefs.h <<\EOF +#define OPT_STATUS_LINE 1 +EOF + +echo "$as_me:22040: checking if you want to use termcap function-keys" >&5 echo $ECHO_N "checking if you want to use termcap function-keys... $ECHO_C" >&6 # Check whether --enable-tcap-fkeys or --disable-tcap-fkeys was given. if test "${enable_tcap_fkeys+set}" = set; then enableval="$enable_tcap_fkeys" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_tcap_fkeys=no - else - enable_tcap_fkeys=yes - fi + else + enable_tcap_fkeys=yes + fi else enableval=yes - enable_tcap_fkeys=yes + enable_tcap_fkeys=yes fi; -echo "$as_me:18446: result: $enable_tcap_fkeys" >&5 +echo "$as_me:22057: result: $enable_tcap_fkeys" >&5 echo "${ECHO_T}$enable_tcap_fkeys" >&6 -test "$enable_tcap_fkeys" = yes && +test "$enable_tcap_fkeys" = no && cat >>confdefs.h <<\EOF -#define OPT_TCAP_FKEYS 1 +#define OPT_TCAP_FKEYS 0 EOF -echo "$as_me:18453: checking if you want to use termcap-query/report" >&5 +echo "$as_me:22064: checking if you want to use termcap-query/report" >&5 echo $ECHO_N "checking if you want to use termcap-query/report... $ECHO_C" >&6 # Check whether --enable-tcap-query or --disable-tcap-query was given. if test "${enable_tcap_query+set}" = set; then enableval="$enable_tcap_query" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_tcap_query=no - else - enable_tcap_query=yes - fi + else + enable_tcap_query=yes + fi else enableval=yes - enable_tcap_query=yes + enable_tcap_query=yes fi; -echo "$as_me:18470: result: $enable_tcap_query" >&5 +echo "$as_me:22081: result: $enable_tcap_query" >&5 echo "${ECHO_T}$enable_tcap_query" >&6 -test "$enable_tcap_query" = yes && +test "$enable_tcap_query" = no && cat >>confdefs.h <<\EOF -#define OPT_TCAP_QUERY 1 +#define OPT_TCAP_QUERY 0 EOF -echo "$as_me:18477: checking if you want support for tek4014" >&5 +echo "$as_me:22088: checking if you want support for tek4014" >&5 echo $ECHO_N "checking if you want support for tek4014... $ECHO_C" >&6 # Check whether --enable-tek4014 or --disable-tek4014 was given. if test "${enable_tek4014+set}" = set; then enableval="$enable_tek4014" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_tek4014=no - else - enable_tek4014=yes - fi + else + enable_tek4014=yes + fi else enableval=yes - enable_tek4014=yes + enable_tek4014=yes fi; -echo "$as_me:18494: result: $enable_tek4014" >&5 +echo "$as_me:22105: result: $enable_tek4014" >&5 echo "${ECHO_T}$enable_tek4014" >&6 if test "$enable_tek4014" = no ; then @@ -18505,24 +22116,24 @@ else EXTRAOBJS="$EXTRAOBJS TekPrsTbl.o Tekproc.o" fi -echo "$as_me:18508: checking if you want pulldown menus with a toolbar" >&5 +echo "$as_me:22119: checking if you want pulldown menus with a toolbar" >&5 echo $ECHO_N "checking if you want pulldown menus with a toolbar... $ECHO_C" >&6 # Check whether --enable-toolbar or --disable-toolbar was given. if test "${enable_toolbar+set}" = set; then enableval="$enable_toolbar" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_toolbar=yes - else - enable_toolbar=no - fi + else + enable_toolbar=no + fi else enableval=no - enable_toolbar=no + enable_toolbar=no fi; -echo "$as_me:18525: result: $enable_toolbar" >&5 +echo "$as_me:22136: result: $enable_toolbar" >&5 echo "${ECHO_T}$enable_toolbar" >&6 if test "$enable_toolbar" = yes ; then @@ -18532,92 +22143,98 @@ EOF fi -echo "$as_me:18535: checking if you want VT52 emulation" >&5 +echo "$as_me:22146: checking if you want VT52 emulation" >&5 echo $ECHO_N "checking if you want VT52 emulation... $ECHO_C" >&6 # Check whether --enable-vt52 or --disable-vt52 was given. if test "${enable_vt52+set}" = set; then enableval="$enable_vt52" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_vt52=no - else - enable_vt52=yes - fi + else + enable_vt52=yes + fi else enableval=yes - enable_vt52=yes + enable_vt52=yes fi; -echo "$as_me:18552: result: $enable_vt52" >&5 +echo "$as_me:22163: result: $enable_vt52" >&5 echo "${ECHO_T}$enable_vt52" >&6 test "$enable_vt52" = no && cat >>confdefs.h <<\EOF #define OPT_VT52_MODE 0 EOF -echo "$as_me:18559: checking if you want wide-attribute support" >&5 +echo "$as_me:22170: checking if you want wide-attribute support" >&5 echo $ECHO_N "checking if you want wide-attribute support... $ECHO_C" >&6 # Check whether --enable-wide-attrs or --disable-wide-attrs was given. if test "${enable_wide_attrs+set}" = set; then enableval="$enable_wide_attrs" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_wattr=no - else - enable_wattr=yes - fi + else + enable_wattr=yes + fi else enableval=yes - enable_wattr=yes + enable_wattr=yes fi; -echo "$as_me:18576: result: $enable_wattr" >&5 +echo "$as_me:22187: result: $enable_wattr" >&5 echo "${ECHO_T}$enable_wattr" >&6 -echo "$as_me:18579: checking if you want wide-character support" >&5 +if test x$enable_wattr = xno && test x$enable_direct_color = xyes ; then + { echo "$as_me:22191: WARNING: overriding wide-attributes to support direct color" >&5 +echo "$as_me: WARNING: overriding wide-attributes to support direct color" >&2;} + enable_wattr=yes +fi + +echo "$as_me:22196: checking if you want wide-character support" >&5 echo $ECHO_N "checking if you want wide-character support... $ECHO_C" >&6 # Check whether --enable-wide-chars or --disable-wide-chars was given. if test "${enable_wide_chars+set}" = set; then enableval="$enable_wide_chars" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_wchar=no - else - enable_wchar=yes - fi + else + enable_wchar=yes + fi else enableval=yes - enable_wchar=yes + enable_wchar=yes fi; -echo "$as_me:18596: result: $enable_wchar" >&5 +echo "$as_me:22213: result: $enable_wchar" >&5 echo "${ECHO_T}$enable_wchar" >&6 -test "$enable_wattr" = no && +test "x$enable_wattr" = xno && cat >>confdefs.h <<\EOF #define OPT_WIDE_ATTRS 0 EOF -echo "$as_me:18603: checking if you want only 16-bit character support" >&5 +echo "$as_me:22220: checking if you want only 16-bit character support" >&5 echo $ECHO_N "checking if you want only 16-bit character support... $ECHO_C" >&6 # Check whether --enable-16bit-chars or --disable-16bit-chars was given. if test "${enable_16bit_chars+set}" = set; then enableval="$enable_16bit_chars" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_16bit_chars=yes - else - enable_16bit_chars=no - fi + else + enable_16bit_chars=no + fi else enableval=no - enable_16bit_chars=no + enable_16bit_chars=no fi; -echo "$as_me:18620: result: $enable_16bit_chars" >&5 +echo "$as_me:22237: result: $enable_16bit_chars" >&5 echo "${ECHO_T}$enable_16bit_chars" >&6 if test "$enable_16bit_chars" = yes ; then @@ -18631,24 +22248,24 @@ fi if test "$enable_wchar" = yes ; then -echo "$as_me:18634: checking if you want to use mini-luit/Latin9 built-in support" >&5 +echo "$as_me:22251: checking if you want to use mini-luit/Latin9 built-in support" >&5 echo $ECHO_N "checking if you want to use mini-luit/Latin9 built-in support... $ECHO_C" >&6 # Check whether --enable-mini-luit or --disable-mini-luit was given. if test "${enable_mini_luit+set}" = set; then enableval="$enable_mini_luit" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_mini_luit=yes - else - enable_mini_luit=no - fi + else + enable_mini_luit=no + fi else enableval=no - enable_mini_luit=no + enable_mini_luit=no fi; -echo "$as_me:18651: result: $enable_mini_luit" >&5 +echo "$as_me:22268: result: $enable_mini_luit" >&5 echo "${ECHO_T}$enable_mini_luit" >&6 if test "$enable_mini_luit" = yes ; then @@ -18658,24 +22275,24 @@ EOF fi -echo "$as_me:18661: checking if you want to use luit" >&5 +echo "$as_me:22278: checking if you want to use luit" >&5 echo $ECHO_N "checking if you want to use luit... $ECHO_C" >&6 # Check whether --enable-luit or --disable-luit was given. if test "${enable_luit+set}" = set; then enableval="$enable_luit" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_luit=no - else - enable_luit=yes - fi + else + enable_luit=yes + fi else enableval=yes - enable_luit=yes + enable_luit=yes fi; -echo "$as_me:18678: result: $enable_luit" >&5 +echo "$as_me:22295: result: $enable_luit" >&5 echo "${ECHO_T}$enable_luit" >&6 if test "$enable_luit" = yes ; then @@ -18683,12 +22300,12 @@ cat >>confdefs.h <<\EOF #define OPT_LUIT_PROG 1 EOF -test -z "$LUIT" && LUIT=xterm-filter +test -z "$LUIT" && LUIT="xterm-filter" for ac_prog in $LUIT xterm-filter bluit luit do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:18691: checking for $ac_word" >&5 +echo "$as_me:22308: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LUIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18705,7 +22322,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_LUIT="$ac_dir/$ac_word" - echo "$as_me:18708: found $ac_dir/$ac_word" >&5 + echo "$as_me:22325: found $ac_dir/$ac_word" >&5 break fi done @@ -18716,10 +22333,10 @@ fi LUIT=$ac_cv_path_LUIT if test -n "$LUIT"; then - echo "$as_me:18719: result: $LUIT" >&5 + echo "$as_me:22336: result: $LUIT" >&5 echo "${ECHO_T}$LUIT" >&6 else - echo "$as_me:18722: result: no" >&5 + echo "$as_me:22339: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -18736,37 +22353,37 @@ do if test "$with_full_paths" = yes ; then if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" + cf_path_syntax="$prefix" else - cf_path_syntax="$ac_default_prefix" + cf_path_syntax="$ac_default_prefix" fi case ".$cf_temp" in (.\$\(*\)*|.\'*\'*) - ;; + ;; (..|./*|.\\*) - ;; + ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX - ;; -(.\${*prefix}*|.\${*dir}*) - eval cf_temp="$cf_temp" - case ".$cf_temp" in - (.NONE/*) - cf_temp=`echo $cf_temp | sed -e s%NONE%$cf_path_syntax%` - ;; - esac - ;; + ;; +(.\$\{*prefix\}*|.\$\{*dir\}*) + eval cf_temp="$cf_temp" + case ".$cf_temp" in + (.NONE/*) + cf_temp=`echo "$cf_temp" | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; (.no|.NONE/*) - cf_temp=`echo $cf_temp | sed -e s%NONE%$cf_path_syntax%` - ;; + cf_temp=`echo "$cf_temp" | sed -e s%NONE%$cf_path_syntax%` + ;; (*) - break - ;; + break + ;; esac cf_path_prog="$cf_temp" else - cf_path_prog="`basename $cf_temp`" + cf_path_prog="`basename "$cf_temp"`" fi elif test -z "$cf_path_args" ; then cf_path_args="$cf_temp" @@ -18778,7 +22395,7 @@ IFS="$cf_save_ifs" if test -n "$cf_path_prog" ; then -echo "${as_me:-configure}:18781: testing defining path for ${cf_path_prog} ..." 1>&5 +echo "${as_me:-configure}:22398: testing defining path for ${cf_path_prog} ..." 1>&5 cat >>confdefs.h <&5 +echo "$as_me:22422: checking if you want dynamic-abbreviation support" >&5 echo $ECHO_N "checking if you want dynamic-abbreviation support... $ECHO_C" >&6 # Check whether --enable-dabbrev or --disable-dabbrev was given. if test "${enable_dabbrev+set}" = set; then enableval="$enable_dabbrev" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_dabbrev=yes - else - enable_dabbrev=no - fi + else + enable_dabbrev=no + fi else enableval=no - enable_dabbrev=no + enable_dabbrev=no fi; -echo "$as_me:18822: result: $enable_dabbrev" >&5 +echo "$as_me:22439: result: $enable_dabbrev" >&5 echo "${ECHO_T}$enable_dabbrev" >&6 if test "$enable_dabbrev" = yes ; then @@ -18829,24 +22446,24 @@ EOF fi -echo "$as_me:18832: checking if you want DECterm Locator support" >&5 +echo "$as_me:22449: checking if you want DECterm Locator support" >&5 echo $ECHO_N "checking if you want DECterm Locator support... $ECHO_C" >&6 # Check whether --enable-dec-locator or --disable-dec-locator was given. if test "${enable_dec_locator+set}" = set; then enableval="$enable_dec_locator" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_dec_locator=yes - else - enable_dec_locator=no - fi + else + enable_dec_locator=no + fi else enableval=no - enable_dec_locator=no + enable_dec_locator=no fi; -echo "$as_me:18849: result: $enable_dec_locator" >&5 +echo "$as_me:22466: result: $enable_dec_locator" >&5 echo "${ECHO_T}$enable_dec_locator" >&6 if test "$enable_dec_locator" = yes ; then @@ -18856,24 +22473,54 @@ EOF fi -echo "$as_me:18859: checking if you want ReGIS graphics support" >&5 +echo "$as_me:22476: checking if you want XHTML and SVG screen dump support" >&5 +echo $ECHO_N "checking if you want XHTML and SVG screen dump support... $ECHO_C" >&6 + +# Check whether --enable-screen-dumps or --disable-screen-dumps was given. +if test "${enable_screen_dumps+set}" = set; then + enableval="$enable_screen_dumps" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + enable_screen_dumps=no + else + enable_screen_dumps=yes + fi +else + enableval=yes + enable_screen_dumps=yes + +fi; +echo "$as_me:22493: result: $enable_screen_dumps" >&5 +echo "${ECHO_T}$enable_screen_dumps" >&6 +if test "$enable_screen_dumps" = yes ; then + EXTRASRCS="$EXTRASRCS html.c svg.c" + EXTRAOBJS="$EXTRAOBJS html.o svg.o" +else + +cat >>confdefs.h <<\EOF +#define OPT_SCREEN_DUMPS 0 +EOF + +fi + +echo "$as_me:22506: checking if you want ReGIS graphics support" >&5 echo $ECHO_N "checking if you want ReGIS graphics support... $ECHO_C" >&6 # Check whether --enable-regis-graphics or --disable-regis-graphics was given. if test "${enable_regis_graphics+set}" = set; then enableval="$enable_regis_graphics" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_regis_graphics=yes - else - enable_regis_graphics=no - fi + else + enable_regis_graphics=no + fi else enableval=no - enable_regis_graphics=no + enable_regis_graphics=no fi; -echo "$as_me:18876: result: $enable_regis_graphics" >&5 +echo "$as_me:22523: result: $enable_regis_graphics" >&5 echo "${ECHO_T}$enable_regis_graphics" >&6 if test "$enable_regis_graphics" = yes ; then @@ -18885,65 +22532,66 @@ EOF EXTRASRCS="$EXTRASRCS graphics_regis.c" EXTRAOBJS="$EXTRAOBJS graphics_regis.o" -echo "$as_me:18888: checking if -lm needed for math functions" >&5 +echo "$as_me:22535: checking if -lm needed for math functions" >&5 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6 if test "${cf_cv_need_libm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 18895 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 22542 "configure" #include "confdefs.h" #include + #include #include int -main () +main (void) { -double x = rand(); printf("result = %g\n", sin(x)) +double x = rand(); printf("result = %g\\n", sin(x)) ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18910: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:22558: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18913: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18916: \"$ac_try\"") >&5 + echo "$as_me:22561: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:22564: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18919: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:22567: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_cv_need_libm=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_cv_need_libm=yes fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:18929: result: $cf_cv_need_libm" >&5 +echo "$as_me:22577: result: $cf_cv_need_libm" >&5 echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then -cf_add_libs="-lm" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in -lm; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" @@ -18951,24 +22599,24 @@ fi fi -echo "$as_me:18954: checking if you want sixel graphics support" >&5 +echo "$as_me:22602: checking if you want sixel graphics support" >&5 echo $ECHO_N "checking if you want sixel graphics support... $ECHO_C" >&6 # Check whether --enable-sixel-graphics or --disable-sixel-graphics was given. if test "${enable_sixel_graphics+set}" = set; then enableval="$enable_sixel_graphics" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_sixel_graphics=yes - else + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then enable_sixel_graphics=no - fi + else + enable_sixel_graphics=yes + fi else - enableval=no - enable_sixel_graphics=no + enableval=yes + enable_sixel_graphics=yes fi; -echo "$as_me:18971: result: $enable_sixel_graphics" >&5 +echo "$as_me:22619: result: $enable_sixel_graphics" >&5 echo "${ECHO_T}$enable_sixel_graphics" >&6 if test "$enable_sixel_graphics" = yes ; then @@ -18992,51 +22640,78 @@ EOF EXTRAOBJS="$EXTRAOBJS graphics.o" fi -echo "$as_me:18995: checking if you want VT420 rectangle support" >&5 +echo "$as_me:22643: checking if you want sixel screen dump support" >&5 +echo $ECHO_N "checking if you want sixel screen dump support... $ECHO_C" >&6 + +# Check whether --enable-print-graphics or --disable-print-graphics was given. +if test "${enable_print_graphics+set}" = set; then + enableval="$enable_print_graphics" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + enable_print_graphics=no + else + enable_print_graphics=$enable_regis_graphics + fi +else + enableval=yes + enable_print_graphics=$enable_regis_graphics + +fi; +echo "$as_me:22660: result: $enable_print_graphics" >&5 +echo "${ECHO_T}$enable_print_graphics" >&6 +if test "$enable_print_graphics" = yes ; then + +cat >>confdefs.h <<\EOF +#define OPT_PRINT_GRAPHICS 1 +EOF + +fi + +echo "$as_me:22670: checking if you want VT420 rectangle support" >&5 echo $ECHO_N "checking if you want VT420 rectangle support... $ECHO_C" >&6 # Check whether --enable-rectangles or --disable-rectangles was given. if test "${enable_rectangles+set}" = set; then enableval="$enable_rectangles" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_rectangles=no - else - enable_rectangles=yes - fi + else + enable_rectangles=yes + fi else enableval=yes - enable_rectangles=yes + enable_rectangles=yes fi; -echo "$as_me:19012: result: $enable_rectangles" >&5 +echo "$as_me:22687: result: $enable_rectangles" >&5 echo "${ECHO_T}$enable_rectangles" >&6 -if test "$enable_rectangles" = yes ; then +if test "$enable_rectangles" = no ; then cat >>confdefs.h <<\EOF -#define OPT_DEC_RECTOPS 1 +#define OPT_DEC_RECTOPS 0 EOF fi -echo "$as_me:19022: checking if you want -ziconbeep option" >&5 +echo "$as_me:22697: checking if you want -ziconbeep option" >&5 echo $ECHO_N "checking if you want -ziconbeep option... $ECHO_C" >&6 # Check whether --enable-ziconbeep or --disable-ziconbeep was given. if test "${enable_ziconbeep+set}" = set; then enableval="$enable_ziconbeep" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then enable_ziconbeep=no - else - enable_ziconbeep=yes - fi + else + enable_ziconbeep=yes + fi else enableval=yes - enable_ziconbeep=yes + enable_ziconbeep=yes fi; -echo "$as_me:19039: result: $enable_ziconbeep" >&5 +echo "$as_me:22714: result: $enable_ziconbeep" >&5 echo "${ECHO_T}$enable_ziconbeep" >&6 test "$enable_ziconbeep" = no && cat >>confdefs.h <<\EOF @@ -19045,264 +22720,24 @@ EOF ############################################################################### -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xinerama; then - test -n "$verbose" && echo " found package xinerama" 1>&6 - -echo "${as_me:-configure}:19051: testing found package xinerama ..." 1>&5 - - cf_pkgconfig_incs="`$PKG_CONFIG --cflags xinerama 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs xinerama 2>/dev/null`" - test -n "$verbose" && echo " package xinerama CFLAGS: $cf_pkgconfig_incs" 1>&6 - -echo "${as_me:-configure}:19057: testing package xinerama CFLAGS: $cf_pkgconfig_incs ..." 1>&5 - - test -n "$verbose" && echo " package xinerama LIBS: $cf_pkgconfig_libs" 1>&6 - -echo "${as_me:-configure}:19061: testing package xinerama LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -cf_new_extra_cppflags= - -for cf_add_cflags in $cf_pkgconfig_incs -do -case $cf_fix_cppflags in -(no) - case $cf_add_cflags in - (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in - (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - fi - ;; - esac - case "$CPPFLAGS" in - (*$cf_add_cflags) - ;; - (*) - case $cf_add_cflags in - (-D*) - cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` - -CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` - - ;; - esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -(yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -cf_add_libs="$cf_pkgconfig_libs" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then - cf_add_1lib= - break - fi - done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" -done -LIBS="$cf_add_libs" - - cat >>confdefs.h <<\EOF -#define HAVE_X11_EXTENSIONS_XINERAMA_H 1 -EOF - -else - cf_pkgconfig_incs= - cf_pkgconfig_libs= - - echo "$as_me:19165: checking for XineramaQueryScreens in -lXinerama" >&5 -echo $ECHO_N "checking for XineramaQueryScreens in -lXinerama... $ECHO_C" >&6 -if test "${ac_cv_lib_Xinerama_XineramaQueryScreens+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXinerama $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 19173 "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XineramaQueryScreens (); -int -main () -{ -XineramaQueryScreens (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19192: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:19195: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19198: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:19201: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xinerama_XineramaQueryScreens=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_Xinerama_XineramaQueryScreens=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:19212: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5 -echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6 -if test $ac_cv_lib_Xinerama_XineramaQueryScreens = yes; then - -cf_add_libs="-lXinerama" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then - cf_add_1lib= - break - fi - done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" -done -LIBS="$cf_add_libs" - -for ac_header in \ - X11/extensions/Xinerama.h \ - -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:19237: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 19243 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:19247: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:19253: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:19272: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <&5 +echo "$as_me:22723: checking if you want debugging traces" >&5 echo $ECHO_N "checking if you want debugging traces... $ECHO_C" >&6 # Check whether --enable-trace or --disable-trace was given. if test "${enable_trace+set}" = set; then enableval="$enable_trace" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_trace=yes - else - enable_trace=no - fi + else + enable_trace=no + fi else enableval=no - enable_trace=no + enable_trace=no fi; -echo "$as_me:19305: result: $enable_trace" >&5 +echo "$as_me:22740: result: $enable_trace" >&5 echo "${ECHO_T}$enable_trace" >&6 if test "$enable_trace" = yes ; then @@ -19314,27 +22749,32 @@ EOF EXTRAOBJS="$EXTRAOBJS trace.o" fi -echo "$as_me:19317: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:22752: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval="$with_dmalloc" + case "x$withval" in + (x|xno) ;; + (*) + : "${with_cflags:=-g}" + : "${enable_leaks:=no}" + with_dmalloc=yes cat >>confdefs.h <&5 +echo "$as_me:22774: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 -case .$with_cflags in +case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) @@ -19348,23 +22788,29 @@ cf_new_extra_cppflags= for cf_add_cflags in -g do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -19373,7 +22819,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -19383,19 +22829,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -19406,17 +22860,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -19425,24 +22885,24 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:19428: checking for dmalloc.h" >&5 + echo "$as_me:22888: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 19434 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 22894 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:19438: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:22898: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:19444: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:22904: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -19455,24 +22915,24 @@ if test -z "$ac_cpp_err"; then ac_cv_header_dmalloc_h=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 ac_cv_header_dmalloc_h=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:19463: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:22923: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 -if test $ac_cv_header_dmalloc_h = yes; then +if test "$ac_cv_header_dmalloc_h" = yes; then -echo "$as_me:19467: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:22927: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 19475 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 22935 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -19483,37 +22943,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char dmalloc_debug (); int -main () +main (void) { dmalloc_debug (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19494: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:22954: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19497: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19500: \"$ac_try\"") >&5 + echo "$as_me:22957: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:22960: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19503: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:22963: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_dmalloc_dmalloc_debug=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:19514: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:22974: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 -if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then +if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then cat >>confdefs.h <&5 +echo "$as_me:22989: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then withval="$with_dbmalloc" + case "x$withval" in + (x|xno) ;; + (*) + : "${with_cflags:=-g}" + : "${enable_leaks:=no}" + with_dbmalloc=yes cat >>confdefs.h <&5 +echo "$as_me:23011: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 -case .$with_cflags in +case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) @@ -19560,23 +23025,29 @@ cf_new_extra_cppflags= for cf_add_cflags in -g do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -19585,7 +23056,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -19595,19 +23066,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -19618,17 +23097,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -19637,24 +23122,24 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:19640: checking for dbmalloc.h" >&5 + echo "$as_me:23125: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 19646 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 23131 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:19650: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (eval echo "$as_me:23135: \"$ac_cpp "conftest.$ac_ext"\"") >&5 + (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:19656: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then + echo "$as_me:23141: \$? = $ac_status" >&5 + (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else @@ -19667,24 +23152,24 @@ if test -z "$ac_cpp_err"; then ac_cv_header_dbmalloc_h=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 + cat "conftest.$ac_ext" >&5 ac_cv_header_dbmalloc_h=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err "conftest.$ac_ext" fi -echo "$as_me:19675: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:23160: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 -if test $ac_cv_header_dbmalloc_h = yes; then +if test "$ac_cv_header_dbmalloc_h" = yes; then -echo "$as_me:19679: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:23164: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 19687 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 23172 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -19695,37 +23180,37 @@ extern "C" builtin and then its argument prototype would still apply. */ char debug_malloc (); int -main () +main (void) { debug_malloc (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19706: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:23191: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19709: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19712: \"$ac_try\"") >&5 + echo "$as_me:23194: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:23197: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19715: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:23200: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 ac_cv_lib_dbmalloc_debug_malloc=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:19726: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:23211: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 -if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then +if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then cat >>confdefs.h <&5 +echo "$as_me:23226: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. if test "${with_valgrind+set}" = set; then withval="$with_valgrind" + case "x$withval" in + (x|xno) ;; + (*) + : "${with_cflags:=-g}" + : "${enable_leaks:=no}" + with_valgrind=yes cat >>confdefs.h <&5 +echo "$as_me:23248: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 -case .$with_cflags in +case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) @@ -19772,23 +23262,29 @@ cf_new_extra_cppflags= for cf_add_cflags in -g do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + if test "$cf_fix_cppflags" = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -19797,7 +23293,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` @@ -19807,19 +23303,27 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -19830,17 +23334,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -19848,20 +23358,21 @@ fi ;; esac -echo "$as_me:19851: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:23361: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi + enable_leaks=$enableval else - : ${with_no_leaks:=no} + enable_leaks=yes fi; -echo "$as_me:19861: result: $with_no_leaks" >&5 +if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi +echo "$as_me:23372: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 -if test "$with_no_leaks" = yes ; then +if test "$enable_leaks" = no ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 @@ -19873,61 +23384,61 @@ EOF fi -echo "$as_me:19876: checking if you want to see long compiling messages" >&5 +echo "$as_me:23387: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then + if test "$enableval" != "yes" ; then - ECHO_LT='--silent' - ECHO_LD='@echo linking $@;' - RULE_CC='@echo compiling $<' - SHOW_CC='@echo compiling $@' - ECHO_CC='@' + ECHO_LT='--silent' + ECHO_LD='@echo linking $@;' + RULE_CC='@echo compiling $<' + SHOW_CC='@echo compiling $@' + ECHO_CC='@' - else + else - ECHO_LT='' - ECHO_LD='' - RULE_CC='' - SHOW_CC='' - ECHO_CC='' + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' - fi + fi else enableval=yes - ECHO_LT='' - ECHO_LD='' - RULE_CC='' - SHOW_CC='' - ECHO_CC='' + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' fi; -echo "$as_me:19910: result: $enableval" >&5 +echo "$as_me:23421: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 -echo "$as_me:19913: checking if you want magic cookie emulation" >&5 +echo "$as_me:23424: checking if you want magic cookie emulation" >&5 echo $ECHO_N "checking if you want magic cookie emulation... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. if test "${enable_xmc_glitch+set}" = set; then enableval="$enable_xmc_glitch" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then + if test "$enableval" != "no" ; then enable_xmc=yes - else - enable_xmc=no - fi + else + enable_xmc=no + fi else enableval=no - enable_xmc=no + enable_xmc=no fi; -echo "$as_me:19930: result: $enable_xmc" >&5 +echo "$as_me:23441: result: $enable_xmc" >&5 echo "${ECHO_T}$enable_xmc" >&6 if test "$enable_xmc" = yes ; then @@ -19942,65 +23453,65 @@ fi for ac_func in tigetstr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:19945: checking for $ac_func" >&5 +echo "$as_me:23456: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 19951 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 23462 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19982: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:23493: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19985: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19988: \"$ac_try\"") >&5 + echo "$as_me:23496: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:23499: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19991: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:23502: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:20001: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:23512: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:23527: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 20022 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 23533 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:20053: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:23564: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:20056: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:20059: \"$ac_try\"") >&5 + echo "$as_me:23567: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:23570: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:20062: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:23573: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi -echo "$as_me:20072: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:23583: result: `eval echo '${'"$as_ac_var"'}'`" >&5 +echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 +if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 +echo "$as_me:23595: checking if you want to use C11 _Noreturn feature" >&5 +echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6 + +# Check whether --enable-stdnoreturn or --disable-stdnoreturn was given. +if test "${enable_stdnoreturn+set}" = set; then + enableval="$enable_stdnoreturn" + test "$enableval" != yes && enableval=no + if test "$enableval" != "no" ; then + enable_stdnoreturn=yes + else + enable_stdnoreturn=no + fi +else + enableval=no + enable_stdnoreturn=no + +fi; +echo "$as_me:23612: result: $enable_stdnoreturn" >&5 +echo "${ECHO_T}$enable_stdnoreturn" >&6 + +if test $enable_stdnoreturn = yes; then +echo "$as_me:23616: checking for C11 _Noreturn feature" >&5 +echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6 +if test "${cf_cv_c11_noreturn+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >"conftest.$ac_ext" <<_ACEOF +#line 23622 "configure" +#include "confdefs.h" + +#include +#include +#include +static _Noreturn void giveup(void) { exit(0); } + +int +main (void) +{ +if (feof(stdin)) giveup() + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:23639: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:23642: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:23645: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:23648: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_cv_c11_noreturn=yes +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +cf_cv_c11_noreturn=no +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + +fi +echo "$as_me:23659: result: $cf_cv_c11_noreturn" >&5 +echo "${ECHO_T}$cf_cv_c11_noreturn" >&6 +else + cf_cv_c11_noreturn=no, +fi + +if test "$cf_cv_c11_noreturn" = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_STDNORETURN_H 1 +EOF + +cat >>confdefs.h <&6 + +echo "${as_me:-configure}:23715: testing repairing CFLAGS: $CFLAGS ..." 1>&5 + + CFLAGS="$cf_temp_flags" + test -n "$verbose" && echo " ... fixed $CFLAGS" 1>&6 + +echo "${as_me:-configure}:23720: testing ... fixed $CFLAGS ..." 1>&5 + + test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 + +echo "${as_me:-configure}:23724: testing ... extra $EXTRA_CFLAGS ..." 1>&5 + + fi + ;; + esac +fi + +if test "$GCC" = yes || test "$GXX" = yes +then + case $CPPFLAGS in + (*-Werror=*) + cf_temp_flags= + for cf_temp_scan in $CPPFLAGS + do + case "x$cf_temp_scan" in + (x-Werror=format*) + + test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " + cf_temp_flags="${cf_temp_flags}$cf_temp_scan" + + ;; + (x-Werror=*) + + test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS " + EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan" + + ;; + (*) + + test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " + cf_temp_flags="${cf_temp_flags}$cf_temp_scan" + + ;; + esac + done + if test "x$CPPFLAGS" != "x$cf_temp_flags" + then + test -n "$verbose" && echo " repairing CPPFLAGS: $CPPFLAGS" 1>&6 + +echo "${as_me:-configure}:23763: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5 + + CPPFLAGS="$cf_temp_flags" + test -n "$verbose" && echo " ... fixed $CPPFLAGS" 1>&6 + +echo "${as_me:-configure}:23768: testing ... fixed $CPPFLAGS ..." 1>&5 + + test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 + +echo "${as_me:-configure}:23772: testing ... extra $EXTRA_CFLAGS ..." 1>&5 + + fi + ;; + esac +fi + +if test "$GCC" = yes || test "$GXX" = yes +then + case $LDFLAGS in + (*-Werror=*) + cf_temp_flags= + for cf_temp_scan in $LDFLAGS + do + case "x$cf_temp_scan" in + (x-Werror=format*) + + test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " + cf_temp_flags="${cf_temp_flags}$cf_temp_scan" + + ;; + (x-Werror=*) + + test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS " + EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan" + + ;; + (*) + + test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " + cf_temp_flags="${cf_temp_flags}$cf_temp_scan" + + ;; + esac + done + if test "x$LDFLAGS" != "x$cf_temp_flags" + then + test -n "$verbose" && echo " repairing LDFLAGS: $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:23811: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5 + + LDFLAGS="$cf_temp_flags" + test -n "$verbose" && echo " ... fixed $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:23816: testing ... fixed $LDFLAGS ..." 1>&5 + + test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 + +echo "${as_me:-configure}:23820: testing ... extra $EXTRA_CFLAGS ..." 1>&5 + + fi + ;; + esac +fi + +echo "$as_me:23827: checking if you want to turn on gcc warnings" >&5 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - with_warnings=yes - else - with_warnings=no - fi + if test "$enableval" != "no" ; then + enable_warnings=yes + else + enable_warnings=no + fi else enableval=no - with_warnings=no + enable_warnings=no fi; -echo "$as_me:20102: result: $with_warnings" >&5 -echo "${ECHO_T}$with_warnings" >&6 -if test "$with_warnings" = yes +echo "$as_me:23844: result: $enable_warnings" >&5 +echo "${ECHO_T}$enable_warnings" >&6 +if test "$enable_warnings" = "yes" then -if test "$GCC" = yes +if test "$GCC" = yes || test "$GXX" = yes then cat > conftest.i < conftest.i <&5 + { echo "$as_me:23867: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} -cat > conftest.$ac_ext < "conftest.$ac_ext" < conftest.$ac_ext <&5 - case $cf_attribute in + case "$cf_attribute" in (printf) cf_printf_attribute=yes cat >conftest.h <&5 + if { (eval echo "$as_me:23919: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:20180: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:20182: result: ... $cf_attribute" >&5 + echo "$as_me:23922: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then + test -n "$verbose" && echo "$as_me:23924: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h - case $cf_attribute in + case "$cf_attribute" in (noreturn) cat >>confdefs.h <>confdefs.h + ${FGREP-fgrep} define conftest.i >>confdefs.h fi -rm -rf conftest* +rm -rf ./conftest* fi -INTEL_COMPILER=no +if test "x$have_x" = xyes; then -if test "$GCC" = yes ; then - case $host_os in - (linux*|gnu*) - echo "$as_me:20246: checking if this is really Intel C compiler" >&5 -echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 - cf_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -no-gcc" - cat >conftest.$ac_ext <<_ACEOF -#line 20251 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifdef __INTEL_COMPILER -#else -make an error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:20268: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:20271: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:20274: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:20277: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - INTEL_COMPILER=yes -cf_save_CFLAGS="$cf_save_CFLAGS -we147" - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" - echo "$as_me:20288: result: $INTEL_COMPILER" >&5 -echo "${ECHO_T}$INTEL_COMPILER" >&6 +cf_save_LIBS_CF_CONST_X_STRING="$LIBS" +cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS" +cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS" +LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" +for cf_X_CFLAGS in $X_CFLAGS +do + case "x$cf_X_CFLAGS" in + x-[IUD]*) + CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" + ;; + *) + CFLAGS="$CFLAGS $cf_X_CFLAGS" ;; esac -fi +done -CLANG_COMPILER=no - -if test "$GCC" = yes ; then - echo "$as_me:20297: checking if this is really Clang C compiler" >&5 -echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 - cf_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Qunused-arguments" - cat >conftest.$ac_ext <<_ACEOF -#line 20302 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 24002 "configure" #include "confdefs.h" +#include +#include + int -main () +main (void) { - -#ifdef __clang__ -#else -make an error -#endif - +String foo = malloc(1); free((void*)foo) ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:20319: \"$ac_compile\"") >&5 +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:24017: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:20322: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:20325: \"$ac_try\"") >&5 + echo "$as_me:24020: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:24023: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:20328: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - CLANG_COMPILER=yes -cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" + echo "$as_me:24026: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + +echo "$as_me:24029: checking for X11/Xt const-feature" >&5 +echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6 +if test "${cf_cv_const_x_string+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >"conftest.$ac_ext" <<_ACEOF +#line 24036 "configure" +#include "confdefs.h" + +#define _CONST_X_STRING /* X11R7.8 (perhaps) */ +#undef XTSTRINGDEFINES /* X11R5 and later */ +#include +#include + +int +main (void) +{ +String foo = malloc(1); *foo = 0 + ; + return 0; +} +_ACEOF +rm -f "conftest.$ac_objext" +if { (eval echo "$as_me:24053: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:24056: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest.$ac_objext"' + { (eval echo "$as_me:24059: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:24062: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + + cf_cv_const_x_string=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" - echo "$as_me:20339: result: $CLANG_COMPILER" >&5 -echo "${ECHO_T}$CLANG_COMPILER" >&6 -fi +cat "conftest.$ac_ext" >&5 -cat > conftest.$ac_ext <&5 +echo "${ECHO_T}$cf_cv_const_x_string" >&6 + +LIBS="$cf_save_LIBS_CF_CONST_X_STRING" +CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING" +CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING" + +case "$cf_cv_const_x_string" in +(no) + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES" + + ;; +(*) + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING" + + ;; +esac + +else + echo "$as_me: failed program was:" >&5 +cat "conftest.$ac_ext" >&5 +fi +rm -f "conftest.$ac_objext" "conftest.$ac_ext" + fi +cat > "conftest.$ac_ext" <&5 + { echo "$as_me:24122: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS="-Wall" + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" for cf_opt in \ wd1419 \ wd1683 \ @@ -20374,24 +24135,22 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:20377: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:24138: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:20380: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:20382: result: ... -$cf_opt" >&5 + echo "$as_me:24141: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then + test -n "$verbose" && echo "$as_me:24143: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" - -elif test "$GCC" = yes +elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then - { echo "$as_me:20391: checking for $CC warning options..." >&5 + { echo "$as_me:24151: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" @@ -20409,36 +24168,33 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_gcc_warnings $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum + Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum Wno-cast-qual do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:20415: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:24174: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:20418: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:20420: result: ... -$cf_opt" >&5 + echo "$as_me:24177: \$? = $ac_status" >&5 + (exit "$ac_status"); }; then + test -n "$verbose" && echo "$as_me:24179: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 - case $cf_opt in - (Wcast-qual) - CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" - ;; + case "$cf_opt" in (Winline) - case $GCC_VERSION in + case "$GCC_VERSION" in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:20431: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:24187: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; (Wpointer-arith) - case $GCC_VERSION in + case "$GCC_VERSION" in ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:20441: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:24197: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -20449,9 +24205,10 @@ echo "${as_me:-configure}:20441: testing feature is broken in gcc $GCC_VERSION . done CFLAGS="$cf_save_CFLAGS" fi -rm -rf conftest* +rm -rf ./conftest* fi + fi test "$disable_setuid" = yes && @@ -20491,15 +24248,15 @@ do CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-D$cf_def//` done -echo "$as_me:20494: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:24251: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes ; then - case $target_alias in - (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) + case "$target_alias" in + (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*) cf_cv_mixedcase=no ;; (*) @@ -20518,7 +24275,7 @@ else fi fi -echo "$as_me:20521: result: $cf_cv_mixedcase" >&5 +echo "$as_me:24278: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF @@ -20529,7 +24286,7 @@ for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:20532: checking for $ac_word" >&5 +echo "$as_me:24289: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -20544,7 +24301,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" -echo "$as_me:20547: found $ac_dir/$ac_word" >&5 +echo "$as_me:24304: found $ac_dir/$ac_word" >&5 break done @@ -20552,10 +24309,10 @@ fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then - echo "$as_me:20555: result: $CTAGS" >&5 + echo "$as_me:24312: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else - echo "$as_me:20558: result: no" >&5 + echo "$as_me:24315: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -20566,7 +24323,7 @@ for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:20569: checking for $ac_word" >&5 +echo "$as_me:24326: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -20581,7 +24338,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" -echo "$as_me:20584: found $ac_dir/$ac_word" >&5 +echo "$as_me:24341: found $ac_dir/$ac_word" >&5 break done @@ -20589,10 +24346,10 @@ fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then - echo "$as_me:20592: result: $ETAGS" >&5 + echo "$as_me:24349: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else - echo "$as_me:20595: result: no" >&5 + echo "$as_me:24352: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -20601,7 +24358,7 @@ done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 -echo "$as_me:20604: checking for $ac_word" >&5 +echo "$as_me:24361: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -20616,7 +24373,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" -echo "$as_me:20619: found $ac_dir/$ac_word" >&5 +echo "$as_me:24376: found $ac_dir/$ac_word" >&5 break done @@ -20625,17 +24382,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:20628: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:24385: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:20631: result: no" >&5 + echo "$as_me:24388: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 -echo "$as_me:20638: checking for $ac_word" >&5 +echo "$as_me:24395: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -20650,7 +24407,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" -echo "$as_me:20653: found $ac_dir/$ac_word" >&5 +echo "$as_me:24410: found $ac_dir/$ac_word" >&5 break done @@ -20659,10 +24416,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:20662: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:24419: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:20665: result: no" >&5 + echo "$as_me:24422: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -20683,132 +24440,137 @@ else fi LD_RPATH_OPT= -echo "$as_me:20686: checking for an rpath option" >&5 +if test "x$cf_cv_enable_rpath" != xno +then + echo "$as_me:24445: checking for an rpath option" >&5 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 -case $cf_cv_system_name in -(irix*) - if test "$GCC" = yes; then + case "$cf_cv_system_name" in + (irix*) + if test "$GCC" = yes; then + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; + (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," - else + ;; + (openbsd[2-9].*|mirbsd*) + LD_RPATH_OPT="-Wl,-rpath," + ;; + (dragonfly*) LD_RPATH_OPT="-rpath " - fi - ;; -(linux*|gnu*|k*bsd*-gnu) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(openbsd[2-9].*|mirbsd*) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(dragonfly*|freebsd*) - LD_RPATH_OPT="-rpath " - ;; -(netbsd*) - LD_RPATH_OPT="-Wl,-rpath," - ;; -(osf*|mls+*) - LD_RPATH_OPT="-rpath " - ;; -(solaris2*) - LD_RPATH_OPT="-R" - ;; -(*) - ;; -esac -echo "$as_me:20717: result: $LD_RPATH_OPT" >&5 + ;; + (netbsd*) + LD_RPATH_OPT="-Wl,-rpath," + ;; + (osf*|mls+*) + LD_RPATH_OPT="-rpath " + ;; + (solaris2*) + LD_RPATH_OPT="-R" + ;; + (*) + ;; + esac + echo "$as_me:24476: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 -case "x$LD_RPATH_OPT" in -(x-R*) - echo "$as_me:20722: checking if we need a space after rpath option" >&5 + case "x$LD_RPATH_OPT" in + (x-R*) + echo "$as_me:24481: checking if we need a space after rpath option" >&5 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 - cf_save_LIBS="$LIBS" + cf_save_LIBS="$LIBS" -cf_add_libs="${LD_RPATH_OPT}$libdir" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in $LIBS -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="$LIBS" +# reverse order +cf_add_0lib= +for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" - cat >conftest.$ac_ext <<_ACEOF -#line 20743 "configure" + cat >"conftest.$ac_ext" <<_ACEOF +#line 24502 "configure" #include "confdefs.h" int -main () +main (void) { ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:20755: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:24514: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:20758: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:20761: \"$ac_try\"") >&5 + echo "$as_me:24517: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:24520: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:20764: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + echo "$as_me:24523: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then cf_rpath_space=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 cf_rpath_space=yes fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS="$cf_save_LIBS" - echo "$as_me:20774: result: $cf_rpath_space" >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" + LIBS="$cf_save_LIBS" + echo "$as_me:24533: result: $cf_rpath_space" >&5 echo "${ECHO_T}$cf_rpath_space" >&6 - test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " - ;; -esac + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; + esac +fi -echo "$as_me:20780: checking if rpath-hack should be disabled" >&5 +echo "$as_me:24540: checking if rpath-hack should be disabled" >&5 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6 # Check whether --enable-rpath-hack or --disable-rpath-hack was given. if test "${enable_rpath_hack+set}" = set; then enableval="$enable_rpath_hack" test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then - cf_disable_rpath_hack=yes - else - cf_disable_rpath_hack=no - fi + if test "$enableval" != "yes" ; then + enable_rpath_hack=no + else + enable_rpath_hack=yes + fi else enableval=yes - cf_disable_rpath_hack=no + enable_rpath_hack=yes fi; -echo "$as_me:20797: result: $cf_disable_rpath_hack" >&5 +if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi +echo "$as_me:24558: result: $cf_disable_rpath_hack" >&5 echo "${ECHO_T}$cf_disable_rpath_hack" >&6 -if test "$cf_disable_rpath_hack" = no ; then -echo "$as_me:20801: checking for updated LDFLAGS" >&5 +if test "$enable_rpath_hack" = yes ; then + +echo "$as_me:24563: checking for updated LDFLAGS" >&5 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 if test -n "$LD_RPATH_OPT" ; then - echo "$as_me:20804: result: maybe" >&5 + echo "$as_me:24566: result: maybe" >&5 echo "${ECHO_T}maybe" >&6 for ac_prog in ldd do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:20811: checking for $ac_word" >&5 +echo "$as_me:24573: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -20823,7 +24585,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_cf_ldd_prog="$ac_prog" -echo "$as_me:20826: found $ac_dir/$ac_word" >&5 +echo "$as_me:24588: found $ac_dir/$ac_word" >&5 break done @@ -20831,10 +24593,10 @@ fi fi cf_ldd_prog=$ac_cv_prog_cf_ldd_prog if test -n "$cf_ldd_prog"; then - echo "$as_me:20834: result: $cf_ldd_prog" >&5 + echo "$as_me:24596: result: $cf_ldd_prog" >&5 echo "${ECHO_T}$cf_ldd_prog" >&6 else - echo "$as_me:20837: result: no" >&5 + echo "$as_me:24599: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -20847,37 +24609,37 @@ test -n "$cf_ldd_prog" || cf_ldd_prog="no" then cf_rpath_oops= -cat >conftest.$ac_ext <<_ACEOF -#line 20851 "configure" +cat >"conftest.$ac_ext" <<_ACEOF +#line 24613 "configure" #include "confdefs.h" #include int -main () +main (void) { printf("Hello"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:20863: \"$ac_link\"") >&5 +rm -f "conftest.$ac_objext" "conftest$ac_exeext" +if { (eval echo "$as_me:24625: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:20866: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:20869: \"$ac_try\"") >&5 + echo "$as_me:24628: \$? = $ac_status" >&5 + (exit "$ac_status"); } && + { ac_try='test -s "conftest$ac_exeext"' + { (eval echo "$as_me:24631: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:20872: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq` - cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq` + echo "$as_me:24634: \$? = $ac_status" >&5 + (exit "$ac_status"); }; }; then + cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq` + cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq` else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +cat "conftest.$ac_ext" >&5 fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" # If we passed the link-test, but get a "not found" on a given library, # this could be due to inept reconfiguration of gcc to make it only @@ -20893,11 +24655,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext /usr/pkg \ /opt/sfw do - if test -f $cf_rpath_dir/lib/$cf_rpath_src + if test -f "$cf_rpath_dir/lib/$cf_rpath_src" then test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 -echo "${as_me:-configure}:20900: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 +echo "${as_me:-configure}:24662: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" break @@ -20909,16 +24671,16 @@ echo "${as_me:-configure}:20900: testing ...adding -L$cf_rpath_dir/lib to LDFLAG test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 -echo "${as_me:-configure}:20912: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:24674: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 -echo "${as_me:-configure}:20916: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:24678: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LDFLAGS do - case $cf_rpath_src in + case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore @@ -20950,7 +24712,7 @@ do then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 -echo "${as_me:-configure}:20953: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 +echo "${as_me:-configure}:24715: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi @@ -20963,16 +24725,16 @@ LDFLAGS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 -echo "${as_me:-configure}:20966: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:24728: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 -echo "${as_me:-configure}:20970: testing ...checking LIBS $LIBS ..." 1>&5 +echo "${as_me:-configure}:24732: testing ...checking LIBS $LIBS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LIBS do - case $cf_rpath_src in + case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore @@ -21004,7 +24766,7 @@ do then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 -echo "${as_me:-configure}:21007: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 +echo "${as_me:-configure}:24769: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi @@ -21017,14 +24779,14 @@ LIBS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 -echo "${as_me:-configure}:21020: testing ...checked LIBS $LIBS ..." 1>&5 +echo "${as_me:-configure}:24782: testing ...checked LIBS $LIBS ..." 1>&5 test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 -echo "${as_me:-configure}:21024: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:24786: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 else - echo "$as_me:21027: result: no" >&5 + echo "$as_me:24789: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -21116,12 +24878,12 @@ fi DEFS=-DHAVE_CONFIG_H -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:21122: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:24884: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +cat >"$CONFIG_STATUS" <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. @@ -21132,9 +24894,11 @@ debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>"$CONFIG_STATUS" <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh @@ -21174,9 +24938,9 @@ as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset + as_unset="unset" else - as_unset=false + as_unset="false" fi # NLS nuisances. @@ -21204,22 +24968,22 @@ _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS + echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS" fi if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS + echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS" fi if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS + echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS" fi if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS + echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS" fi -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the @@ -21245,21 +25009,22 @@ $config_headers Report bugs to ." EOF -cat >>$CONFIG_STATUS <>"$CONFIG_STATUS" <>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: @@ -21282,17 +25047,17 @@ do case $1 in # Handling of the options. EOF -cat >>$CONFIG_STATUS <>"$CONFIG_STATUS" <>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:21295: error: ambiguous option: $1 + { { echo "$as_me:25060: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -21311,7 +25076,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:21314: error: unrecognized option: $1 + -*) { { echo "$as_me:25079: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -21330,18 +25095,18 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20141204, executed with +This file was extended by $as_me 2.52.20210509, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS - > $ac_cs_invocation + > "$ac_cs_invocation" on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in @@ -21350,7 +25115,7 @@ do "df-install" ) CONFIG_FILES="$CONFIG_FILES df-install" ;; "minstall" ) CONFIG_FILES="$CONFIG_FILES minstall:minstall.in" ;; "xtermcfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS xtermcfg.h:xtermcfg.hin" ;; - *) { { echo "$as_me:21353: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:25118: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -21360,7 +25125,7 @@ done # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then +if "$ac_need_defaults"; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi @@ -21389,7 +25154,7 @@ $debug || EOF -cat >>$CONFIG_STATUS <>"$CONFIG_STATUS" <>$CONFIG_STATUS <<\EOF + cat >>"$CONFIG_STATUS" <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 @@ -21539,8 +25314,8 @@ EOF ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then + while "$ac_more_lines"; do + if test "$ac_beg" -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag @@ -21554,14 +25329,32 @@ EOF # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + # It is possible to make a multiline substitution using escaped newlines. + # Ensure that we do not split the substitution between script fragments. + ac_BEG=$ac_end + ac_END=`expr "$ac_end" + "$ac_max_sed_lines"` + sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next + if test -s $tmp/subs.next; then + grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit + if test ! -s $tmp/subs.edit; then + grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit + if test ! -s $tmp/subs.edit; then + if test "$ac_beg" -gt 1; then + ac_end=`expr "$ac_end" - 1` + continue + fi + fi + fi fi - ac_sed_frag=`expr $ac_sed_frag + 1` + + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr "$ac_sed_frag" + 1` ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` + ac_end=`expr "$ac_end" + "$ac_max_sed_lines"` fi done if test -z "$ac_sed_cmds"; then @@ -21570,10 +25363,10 @@ EOF fi # test -n "$CONFIG_FILES" EOF -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in + case "$ac_file" in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` @@ -21619,19 +25412,19 @@ done; } ac_dir_suffix= ac_dots= fi - case $srcdir in + case "$srcdir" in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else - ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; + ac_srcdir="$srcdir$ac_dir_suffix"; + ac_top_srcdir="$srcdir" ;; *) # Relative path. - ac_srcdir=$ac_dots$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_dots$srcdir ;; + ac_srcdir="$ac_dots$srcdir$ac_dir_suffix" + ac_top_srcdir="$ac_dots$srcdir" ;; esac case $INSTALL in @@ -21640,7 +25433,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:21643: creating $ac_file" >&5 + { echo "$as_me:25436: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -21658,7 +25451,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:21661: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:25454: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -21668,35 +25461,35 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $f elif test -f "$srcdir/$f"; then # Source tree - echo $srcdir/$f + echo "$srcdir/$f" else # /dev/null tree - { { echo "$as_me:21674: error: cannot find input file: $f" >&5 + { { echo "$as_me:25467: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF ac_warn_datarootdir=no if test x"$ac_file" != x-; then for ac_item in $ac_file_inputs do - ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item` + ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"` if test -n "$ac_seen"; then - ac_used=`grep '@datarootdir@' $ac_item` + ac_used=`grep '@datarootdir@' "$ac_item"` if test -z "$ac_used"; then - { echo "$as_me:21690: WARNING: datarootdir was used implicitly but not set: + { echo "$as_me:25483: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi fi - ac_seen=`grep '${datarootdir}' $ac_item` + ac_seen=`grep '${datarootdir}' "$ac_item"` if test -n "$ac_seen"; then - { echo "$as_me:21699: WARNING: datarootdir was used explicitly but not set: + { echo "$as_me:25492: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} @@ -21710,11 +25503,11 @@ if test "x$ac_warn_datarootdir" = xyes; then fi EOF -cat >>$CONFIG_STATUS <>"$CONFIG_STATUS" <>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t @@ -21724,27 +25517,27 @@ s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then - cp $tmp/out $ac_file + cp "$tmp/out" "$ac_file" for ac_name in prefix exec_prefix datarootdir do - ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file` + ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"` if test -n "$ac_seen"; then - ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` + ac_init=`${EGREP-egrep} '[ ]*'$ac_name'[ ]*=' "$ac_file"` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` - { echo "$as_me:21736: WARNING: Variable $ac_name is used but was not set: + { echo "$as_me:25529: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} fi fi done - egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out - egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out + ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out + ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` - { echo "$as_me:21747: WARNING: Some variables may not be substituted: + { echo "$as_me:25540: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} @@ -21756,7 +25549,7 @@ $ac_seen" >&2;} done EOF -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF # # CONFIG_HEADER section. @@ -21783,7 +25576,7 @@ ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in + case "$ac_file" in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` @@ -21793,7 +25586,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:21796: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:25589: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -21804,7 +25597,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:21807: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:25600: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -21814,10 +25607,10 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $f elif test -f "$srcdir/$f"; then # Source tree - echo $srcdir/$f + echo "$srcdir/$f" else # /dev/null tree - { { echo "$as_me:21820: error: cannot find input file: $f" >&5 + { { echo "$as_me:25613: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -21869,60 +25662,60 @@ EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS +echo ' # Handle all the #define templates only if necessary.' >>"$CONFIG_STATUS" +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>"$CONFIG_STATUS" +echo ' # If there are no defines, we may have an empty if/fi' >>"$CONFIG_STATUS" +echo ' :' >>"$CONFIG_STATUS" rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + echo ' cat >$tmp/defines.sed <>"$CONFIG_STATUS" # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*define/!b' >>"$CONFIG_STATUS" # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 't clr' >>"$CONFIG_STATUS" + echo ': clr' >>"$CONFIG_STATUS" + sed "${ac_max_here_lines}q" conftest.defines >>"$CONFIG_STATUS" echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail +' >>"$CONFIG_STATUS" + sed "1,${ac_max_here_lines}d" conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS +echo ' fi # egrep' >>"$CONFIG_STATUS" +echo >>"$CONFIG_STATUS" # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +echo ' # Handle all the #undef templates' >>"$CONFIG_STATUS" rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + echo ' cat >$tmp/undefs.sed <>"$CONFIG_STATUS" # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*undef/!b' >>"$CONFIG_STATUS" # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 't clr' >>"$CONFIG_STATUS" + echo ': clr' >>"$CONFIG_STATUS" + sed "${ac_max_here_lines}q" conftest.undefs >>"$CONFIG_STATUS" echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail +' >>"$CONFIG_STATUS" + sed "1,${ac_max_here_lines}d" conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ @@ -21934,8 +25727,8 @@ cat >>$CONFIG_STATUS <<\EOF cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:21938: $ac_file is unchanged" >&5 + if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then + { echo "$as_me:25731: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -21967,8 +25760,8 @@ for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do done; } fi - rm -f $ac_file - mv $tmp/config.h $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" fi else cat $tmp/config.h @@ -21977,11 +25770,11 @@ done; } done EOF -cat >>$CONFIG_STATUS <<\EOF +cat >>"$CONFIG_STATUS" <<\EOF { (exit 0); exit 0; } EOF -chmod +x $CONFIG_STATUS +chmod +x "$CONFIG_STATUS" ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. @@ -21995,10 +25788,10 @@ ac_clean_files=$ac_clean_files_save if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false + $SHELL "$CONFIG_STATUS" || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + "$ac_cs_success" || { (exit 1); exit 1; } fi diff --git a/app/xterm/configure.in b/app/xterm/configure.in index c468c45b8..ee3fed407 100644 --- a/app/xterm/configure.in +++ b/app/xterm/configure.in @@ -1,9 +1,9 @@ -dnl $XTermId: configure.in,v 1.380 2021/08/22 19:49:13 tom Exp $ +dnl $XTermId: configure.in,v 1.383 2022/02/20 14:18:05 tom Exp $ dnl dnl ----------------------------------------------------------------------------- dnl this file is part of xterm dnl -dnl Copyright 1997-2020,2021 by Thomas E. Dickey +dnl Copyright 1997-2021,2022 by Thomas E. Dickey dnl dnl All Rights Reserved dnl @@ -33,7 +33,7 @@ dnl authorization. dnl --------------------------------------------------------------------------- dnl Process this file with autoconf to produce a configure script. dnl -AC_PREREQ(2.52.20210105) +AC_PREREQ(2.52.20210509) AC_INIT AC_CONFIG_SRCDIR([charproc.c]) AC_CONFIG_HEADER(xtermcfg.h:xtermcfg.hin) @@ -891,13 +891,21 @@ CF_ARG_DISABLE(session-mgt, AC_MSG_RESULT($enable_session_mgt) test "$enable_session_mgt" = no && AC_DEFINE(OPT_SESSION_MGT,0,[Define to 0 to disable support for session management]) +AC_MSG_CHECKING(if you want support for status-line) +CF_ARG_ENABLE(status-line, + [ --enable-status-line enable support for status-line], + [enable_status_line=yes], + [enable_status_line=no]) +AC_MSG_RESULT($enable_status_line) +test "$enable_status_line" = yes && AC_DEFINE(OPT_STATUS_LINE,1,[Define to 1 to enable support for status-line]) + AC_MSG_CHECKING(if you want to use termcap function-keys) CF_ARG_DISABLE(tcap-fkeys, [ --disable-tcap-fkeys disable termcap function-keys support], [enable_tcap_fkeys=no], [enable_tcap_fkeys=yes]) AC_MSG_RESULT($enable_tcap_fkeys) -test "$enable_tcap_fkeys" = yes && AC_DEFINE(OPT_TCAP_FKEYS,1,[Define to 1 to disable termcap function-keys support]) +test "$enable_tcap_fkeys" = no && AC_DEFINE(OPT_TCAP_FKEYS,0,[Define to 0 to disable termcap function-keys support]) AC_MSG_CHECKING(if you want to use termcap-query/report) CF_ARG_DISABLE(tcap-query, @@ -905,7 +913,7 @@ CF_ARG_DISABLE(tcap-query, [enable_tcap_query=no], [enable_tcap_query=yes]) AC_MSG_RESULT($enable_tcap_query) -test "$enable_tcap_query" = yes && AC_DEFINE(OPT_TCAP_QUERY,1,[Define to 1 to disable compiled-in termcap-query support]) +test "$enable_tcap_query" = no && AC_DEFINE(OPT_TCAP_QUERY,0,[Define to 0 to disable compiled-in termcap-query support]) AC_MSG_CHECKING(if you want support for tek4014) CF_ARG_DISABLE(tek4014, @@ -1083,8 +1091,8 @@ CF_ARG_DISABLE(rectangles, [enable_rectangles=no], [enable_rectangles=yes]) AC_MSG_RESULT($enable_rectangles) -if test "$enable_rectangles" = yes ; then - AC_DEFINE(OPT_DEC_RECTOPS,1,[Define to 1 to disable VT420 rectangle support]) +if test "$enable_rectangles" = no ; then + AC_DEFINE(OPT_DEC_RECTOPS,0,[Define to 0 to disable VT420 rectangle support]) fi AC_MSG_CHECKING(if you want -ziconbeep option) diff --git a/app/xterm/ctlseqs.ms b/app/xterm/ctlseqs.ms index 5af46fac0..d1031b761 100644 --- a/app/xterm/ctlseqs.ms +++ b/app/xterm/ctlseqs.ms @@ -1,6 +1,6 @@ .\"#! troff -ms $1 -*- Nroff -*- .\" "Xterm Control Sequences" document -.\" $XTermId: ctlseqs.ms,v 1.633 2021/09/11 23:17:26 tom Exp $ +.\" $XTermId: ctlseqs.ms,v 1.636 2021/12/26 21:57:14 tom Exp $ .\" .\" .\" Copyright 1996-2020,2021 by Thomas E. Dickey @@ -69,8 +69,8 @@ .\" .ds XT XTerm .ds xt xterm -.ds LF Patch #369 -.ds RF 2021/09/11 +.ds LF Patch #371 +.ds RF 2021/12/26 .\" .if n .pl 9999v \" no page breaks in nroff .ND @@ -877,6 +877,8 @@ The string following the \*(``q\*('' is one of the following: \*(cs \(-> DECSLRM \*t \(-> DECSLPP \*$\*| \(-> DECSCPP + \*$\*} \(-> DECSASD + \*$\*~ \(-> DECSSDT \**\*| \(-> DECSNLS .br \fI\*(xt\fP responds with @@ -1118,14 +1120,32 @@ but disallows modifying those sizes because that is done once, using resource-values. .bP Graphics geometry is not necessarily the same as \*(``window size\*('' -(see the dtterm window manipulation extensions). -For example, \fI\*(xt\fP limits the maximum graphics geometry at compile time -(1000x1000 as of version 328) -although the window size can be larger. +(see the \fBdtterm\fP window manipulation extensions). +\fI\*(XT\fP limits the maximum graphics geometry +according to the \fBmaxGraphicSize\fP resource. +.IP +The \fBmaxGraphicSize\fP resource can be +either an explicit \fIheight\fPx\fIwidth\fP +(default: 1000x1000 as of version 328) +or the word \*(``auto\*('' +(telling \fI\*(XT\fP to use limits +the \fBdecGraphicsID\fP +or \fBdecTerminalID\fP resource to determine the limits). +.bP +\fI\*(XT\fP uses the minimum of the window size and the graphic size +to obtain the maximum geometry. .bP While resizing a window will always change the current graphics geometry, the reverse is not true. Setting graphics geometry does not affect the window size. +.bP +If \fI\*(xt\fP is able to support graphics (compile-time), +but is not configured (runtime) for graphics, +these responses will indicate a failure. +Other implementations which do not use the maximum graphics dimensions +but are configured for graphics +should report zeroes for the maximum geometry +rather than a failure. .RE . .iP @@ -1955,10 +1975,10 @@ specific settings can be saved and restored independently. Only those modes listed as parameters are restored. . .iP -.IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*;\\*(Ps\\*s\\*$\\*r +.IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*;\\*(Pm\\*s\\*$\\*r Change Attributes in Rectangular Area (DECCARA), VT400 and up. \*(Pt\*s\*;\*(Pl\*s\*;\*(Pb\*s\*;\*(Pr denotes the rectangle. - \*(Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. + \*(Pm denotes the SGR attributes to change: 0, 1, 4, 5, 7. . .iP .IP \\*(Cs\\*(cs @@ -2115,10 +2135,10 @@ Set warning-bell volume (DECSWBV), VT520. \*(Ps = \*5, \*6, \*7, or \*8 \(-> high. . .iP -.IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*;\\*(Ps\\*s\\*$\\*t +.IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*;\\*(Pm\\*s\\*$\\*t Reverse Attributes in Rectangular Area (DECRARA), VT400 and up. \*(Pt\*s\*;\*(Pl\*s\*;\*(Pb\*s\*;\*(Pr denotes the rectangle. - \*(Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. + \*(Pm denotes the attributes to reverse, i.e., 1, 4, 5, 7. . .iP .IP \\*(Cs\\*u @@ -2359,9 +2379,22 @@ to their previous state. Insert \*(Ps Column(s) (default = 1) (DECIC), VT420 and up. . .iP +.IP \\*(Cs\\*(Ps\\*s\\*$\\*} +Select active status display (DECSASD), VT320 and up. + \*(Ps = \*0 \(-> main (default) + \*(Ps = \*1 \(-> status line +. +.iP .IP \\*(Cs\\*(Ps\\*s\\*(qu\\*~ Delete \*(Ps Column(s) (default = 1) (DECDC), VT420 and up. . +.iP +.IP \\*(Cs\\*(Ps\\*s\\*$\\*~ +Select status line type (DECSSDT), VT320 and up. + \*(Ps = \*0 \(-> none + \*(Ps = \*1 \(-> indicator (default) + \*(Ps = \*2 \(-> host-writable. +. .Ed . .Ss Operating System Commands diff --git a/app/xterm/ctlseqs.txt b/app/xterm/ctlseqs.txt index 68939f5a4..c425ed534 100644 --- a/app/xterm/ctlseqs.txt +++ b/app/xterm/ctlseqs.txt @@ -21,7 +21,7 @@ Thomas Dickey XFree86 Project (1996-2006) invisible-island.net (2006-2021) - updated for XTerm Patch #369 (2021/09/11) + updated for XTerm Patch #371 (2021/12/26) @@ -424,6 +424,8 @@ DCS $ q Pt ST s -> DECSLRM t -> DECSLPP $ | -> DECSCPP + $ } -> DECSASD + $ ~ -> DECSSDT * | -> DECSNLS xterm responds with DCS 1 $ r Pt ST for valid requests, replacing the Pt with the corresponding CSI string, or DCS 0 $ @@ -601,12 +603,23 @@ CSI ? Pi ; Pa ; Pv S done once, using resource-values. o Graphics geometry is not necessarily the same as "window size" (see the dtterm window manipulation extensions). - For example, xterm limits the maximum graphics geometry at - compile time (1000x1000 as of version 328) although the - window size can be larger. + XTerm limits the maximum graphics geometry according to + the maxGraphicSize resource. + The maxGraphicSize resource can be either an explicit + heightxwidth (default: 1000x1000 as of version 328) or the + word "auto" (telling XTerm to use limits the decGraphicsID + or decTerminalID resource to determine the limits). + o XTerm uses the minimum of the window size and the graphic + size to obtain the maximum geometry. o While resizing a window will always change the current graphics geometry, the reverse is not true. Setting graphics geometry does not affect the window size. + o If xterm is able to support graphics (compile-time), but + is not configured (runtime) for graphics, these responses + will indicate a failure. Other implementations which do + not use the maximum graphics dimensions but are configured + for graphics should report zeroes for the maximum geometry + rather than a failure. CSI Ps T Scroll down Ps lines (default = 1) (SD), VT420. @@ -1333,10 +1346,10 @@ CSI ? Pm r restored independently. Only those modes listed as parameters are restored. -CSI Pt ; Pl ; Pb ; Pr ; Ps $ r +CSI Pt ; Pl ; Pb ; Pr ; Pm $ r Change Attributes in Rectangular Area (DECCARA), VT400 and up. Pt ; Pl ; Pb ; Pr denotes the rectangle. - Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. + Pm denotes the SGR attributes to change: 0, 1, 4, 5, 7. CSI s Save cursor, available only when DECLRMM is disabled (SCOSC, also ANSI.SYS). @@ -1463,11 +1476,11 @@ CSI Ps SP t Ps = 2 , 3 or 4 -> low. Ps = 5 , 6 , 7 , or 8 -> high. -CSI Pt ; Pl ; Pb ; Pr ; Ps $ t +CSI Pt ; Pl ; Pb ; Pr ; Pm $ t Reverse Attributes in Rectangular Area (DECRARA), VT400 and up. Pt ; Pl ; Pb ; Pr denotes the rectangle. - Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. + Pm denotes the attributes to reverse, i.e., 1, 4, 5, 7. CSI u Restore cursor (SCORC, also ANSI.SYS). @@ -1668,9 +1681,20 @@ CSI # } Pop video attributes from stack (XTPOPSGR), xterm. Popping CSI Ps ' } Insert Ps Column(s) (default = 1) (DECIC), VT420 and up. +CSI Ps $ } + Select active status display (DECSASD), VT320 and up. + Ps = 0 -> main (default) + Ps = 1 -> status line + CSI Ps ' ~ Delete Ps Column(s) (default = 1) (DECDC), VT420 and up. +CSI Ps $ ~ + Select status line type (DECSSDT), VT320 and up. + Ps = 0 -> none + Ps = 1 -> indicator (default) + Ps = 2 -> host-writable. + Operating System Commands diff --git a/app/xterm/cursor.c b/app/xterm/cursor.c index 6867c0faa..3234b7b66 100644 --- a/app/xterm/cursor.c +++ b/app/xterm/cursor.c @@ -1,10 +1,10 @@ -/* $XTermId: cursor.c,v 1.77 2019/07/12 01:11:59 tom Exp $ */ +/* $XTermId: cursor.c,v 1.82 2022/02/13 18:20:53 tom Exp $ */ /* - * Copyright 2002-2018,2019 by Thomas E. Dickey - * + * Copyright 2002-2021,2022 by Thomas E. Dickey + * * All Rights Reserved - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -12,10 +12,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -23,12 +23,12 @@ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the * sale, use or other dealings in this Software without prior written * authorization. - * + * * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved @@ -316,10 +316,9 @@ AdjustSavedCursor(XtermWidget xw, int adjust) * Save Cursor and Attributes */ void -CursorSave(XtermWidget xw) +CursorSave2(XtermWidget xw, SavedCursor * sc) { TScreen *screen = TScreenOf(xw); - SavedCursor *sc = &screen->sc[screen->whichBuf]; sc->saved = True; sc->row = screen->cur_row; @@ -337,9 +336,47 @@ CursorSave(XtermWidget xw) saveCharsets(screen, sc->gsets); } +void +CursorSave(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + CursorSave2(xw, &screen->sc[screen->whichBuf]); +} + /* * We save/restore all visible attributes, plus wrapping, origin mode, and the * selective erase attribute. + * + * This is documented, but some of the documentation is incorrect. + * + * Page 270 of the VT420 manual (2nd edition) says that DECSC saves these + * items: + * + * Cursor position + * * Character attributes set by the SGR command + * * Character sets (G0, G1, G2, or G3) currently in GL and GR + * * Wrap flag (autowrap or no autowrap) + * * State of origin mode (DECOM) + * * Selective erase attribute + * * Any single shift 2 (SS2) or single shift 3 (SS3) functions sent + * + * The VT520 manual has the same information (page 5-120). + * + * However, DEC 070 (29-June-1990), pages 5-186 to 5-191, describes + * save/restore operations, but makes no mention of "wrap". + * + * Mattias Engdegård, who has investigated wrapping behavior of different + * terminals, + * + * https://github.com/mattiase/wraptest + * + * states + * The LCF is saved/restored by the Save/Restore Cursor (DECSC/DECRC) + * control sequences. The DECAWM flag is not included in the state + * managed by these operations. + * + * DEC 070 does mention the ANSI color text extension saying that it, too, is + * saved/restored. */ #define DECSC_FLAGS (ATTRIBUTES|ORIGIN|PROTECTED) @@ -347,10 +384,9 @@ CursorSave(XtermWidget xw) * Restore Cursor and Attributes */ void -CursorRestore(XtermWidget xw) +CursorRestore2(XtermWidget xw, SavedCursor * sc) { TScreen *screen = TScreenOf(xw); - SavedCursor *sc = &screen->sc[screen->whichBuf]; /* Restore the character sets, unless we never did a save-cursor op. * In that case, we'll reset the character sets. @@ -385,6 +421,13 @@ CursorRestore(XtermWidget xw) #endif } +void +CursorRestore(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + CursorRestore2(xw, &screen->sc[screen->whichBuf]); +} + /* * Move the cursor to the first column of the n-th next line. */ @@ -445,11 +488,14 @@ CursorRow(XtermWidget xw) int set_cur_row(TScreen *screen, int value) { - TRACE(("set_cur_row %d vs %d\n", value, screen ? screen->max_row : -1)); + TRACE(("set_cur_row %d vs %d\n", value, screen ? LastRowNumber(screen) : -1)); assert(screen != 0); assert(value >= 0); - assert(value <= screen->max_row); + assert(value <= LastRowNumber(screen)); + if_STATUS_LINE(screen, { + value = LastRowNumber(screen); + }); screen->cur_row = value; return value; } @@ -466,3 +512,6 @@ set_cur_col(TScreen *screen, int value) return value; } #endif /* OPT_TRACE */ +/* + * vile:cmode fk=utf-8 + */ diff --git a/app/xterm/fontutils.c b/app/xterm/fontutils.c index 770b33682..1646b4be0 100644 --- a/app/xterm/fontutils.c +++ b/app/xterm/fontutils.c @@ -1,7 +1,7 @@ -/* $XTermId: fontutils.c,v 1.706 2021/09/12 18:38:50 Martijn.van.Duren Exp $ */ +/* $XTermId: fontutils.c,v 1.712 2022/02/23 00:46:08 tom Exp $ */ /* - * Copyright 1998-2020,2021 by Thomas E. Dickey + * Copyright 1998-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -180,7 +180,7 @@ set_font_width(TScreen *screen, VTwin *win, int width) SetFontWidth(screen, win, width); TRACE(("SetFontWidth %d\n", win->f_width)); #undef SetFontWidth -#define SetFontWidth(screen, win, height) set_font_width(screen, win, height) +#define SetFontWidth(screen, win, width) set_font_width(screen, win, width) } #endif @@ -470,15 +470,17 @@ alloca_fontname(char **result, size_t next) size_t want = last + next + 2; if (want >= have) { + char *save = *result; want = ALLOCHUNK(want); if (last != 0) { - char *save = *result; *result = TypeRealloc(char, want, *result); if (*result == 0) free(save); } else { - if ((*result = TypeMallocN(char, want)) != 0) + if ((*result = TypeMallocN(char, want)) != 0) { + free(save); **result = '\0'; + } } } } @@ -1282,11 +1284,16 @@ xtermUpdateFontGCs(XtermWidget xw, MyGetFont myfunc) unsigned xtermUpdateItalics(XtermWidget xw, unsigned new_attrs, unsigned old_attrs) { - if ((new_attrs & ATR_ITALIC) && !(old_attrs & ATR_ITALIC)) { - xtermLoadItalics(xw); - xtermUpdateFontGCs(xw, getItalicFont); - } else if (!(new_attrs & ATR_ITALIC) && (old_attrs & ATR_ITALIC)) { - xtermUpdateFontGCs(xw, getNormalFont); + TScreen *screen = TScreenOf(xw); + + (void) screen; + if (UseItalicFont(screen)) { + if ((new_attrs & ATR_ITALIC) && !(old_attrs & ATR_ITALIC)) { + xtermLoadItalics(xw); + xtermUpdateFontGCs(xw, getItalicFont); + } else if (!(new_attrs & ATR_ITALIC) && (old_attrs & ATR_ITALIC)) { + xtermUpdateFontGCs(xw, getNormalFont); + } } return new_attrs; } @@ -1449,6 +1456,15 @@ loadWideFP(XtermWidget xw, } else { xtermCopyFontInfo(infoOut, infoRef); } +#define MinWidthOf(fs) fs->min_bounds.width +#define MaxWidthOf(fs) fs->max_bounds.width + xw->work.force_wideFont = False; + if (MaxWidthOf(infoOut->fs) != (2 * MaxWidthOf(infoRef->fs))) { + TRACE(("...reference width %d\n", MaxWidthOf(infoRef->fs))); + TRACE(("...?? double-width %d\n", 2 * MaxWidthOf(infoRef->fs))); + TRACE(("...actual width %d\n", MaxWidthOf(infoOut->fs))); + xw->work.force_wideFont = True; + } return status; } @@ -1842,7 +1858,7 @@ xtermLoadItalics(XtermWidget xw) { TScreen *screen = TScreenOf(xw); - if (!screen->ifnts_ok) { + if (UseItalicFont(screen) && !screen->ifnts_ok) { int n; FontNameProperties *fp; XTermFonts *data; diff --git a/app/xterm/graphics.c b/app/xterm/graphics.c index cde00e842..77658fa24 100644 --- a/app/xterm/graphics.c +++ b/app/xterm/graphics.c @@ -1,8 +1,8 @@ -/* $XTermId: graphics.c,v 1.95 2021/09/19 18:57:09 tom Exp $ */ +/* $XTermId: graphics.c,v 1.117 2022/02/24 09:28:54 tom Exp $ */ /* - * Copyright 2013-2020,2021 by Ross Combs - * Copyright 2013-2020,2021 by Thomas E. Dickey + * Copyright 2013-2021,2022 by Ross Combs + * Copyright 2013-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -151,6 +151,12 @@ static Graphic *displayed_graphics[MAX_GRAPHICS]; static unsigned next_graphic_id = 0U; static unsigned used_graphics; /* 0 to MAX_GRAPHICS */ +static int valid_graphics; +static GC graphics_gc; +static XGCValues xgcv; +static ColorRegister last_color; +static ColorRegister gc_color; + #define DiffColor(this,that) \ (this.r != that.r || \ this.g != that.g || \ @@ -236,17 +242,18 @@ deactivateSlot(unsigned n) extern RegisterNum read_pixel(Graphic *graphic, int x, int y) { - if (x < 0 || x >= graphic->actual_width || - y < 0 || y >= graphic->actual_height) { - return COLOR_HOLE; - } - - return graphic->pixels[y * graphic->max_width + x]; + return (((x) >= 0 && + (x) < (graphic)->actual_width && + (y) >= 0 && + (y) < (graphic)->actual_height) + ? (graphic)->pixels[(y) * (graphic)->max_width + (x)] + : (RegisterNum) COLOR_HOLE); } #define _draw_pixel(G, X, Y, C) \ do { \ - (G)->pixels[(Y) * (G)->max_width + (X)] = (RegisterNum) (C); \ + unsigned _cell = (unsigned)((Y) * (G)->max_width + (X)); \ + SetSpixel(G, _cell, (RegisterNum) (C)); \ } while (0) void @@ -310,69 +317,6 @@ draw_solid_rectangle(Graphic *graphic, int x1, int y1, int x2, int y2, unsigned _draw_pixel(graphic, x, y, color); } -#if 0 /* unused */ -void -draw_solid_line(Graphic *graphic, int x1, int y1, int x2, int y2, unsigned color) -{ - int x, y; - int dx, dy; - int dir, diff; - - assert(color <= MAX_COLOR_REGISTERS); - - dx = abs(x1 - x2); - dy = abs(y1 - y2); - - if (dx > dy) { - if (x1 > x2) { - int tmp; - EXCHANGE(x1, x2, tmp); - EXCHANGE(y1, y2, tmp); - } - if (y1 < y2) - dir = 1; - else if (y1 > y2) - dir = -1; - else - dir = 0; - - diff = 0; - y = y1; - for (x = x1; x <= x2; x++) { - if (diff >= dx) { - diff -= dx; - y += dir; - } - diff += dy; - draw_solid_pixel(graphic, x, y, color); - } - } else { - if (y1 > y2) { - int tmp; - EXCHANGE(x1, x2, tmp); - EXCHANGE(y1, y2, tmp); - } - if (x1 < x2) - dir = 1; - else if (x1 > x2) - dir = -1; - else - dir = 0; - - diff = 0; - x = x1; - for (y = y1; y <= y2; y++) { - if (diff >= dy) { - diff -= dy; - x += dir; - } - diff += dx; - draw_solid_pixel(graphic, x, y, color); - } - } -} -#endif - void copy_overlapping_area(Graphic *graphic, int src_ul_x, int src_ul_y, int dst_ul_x, int dst_ul_y, unsigned w, unsigned h, @@ -412,6 +356,7 @@ copy_overlapping_area(Graphic *graphic, int src_ul_x, int src_ul_y, for (xx = sx; xx != ex + dx; xx += dx) { int dst_x = dst_ul_x + xx; int src_x = src_ul_x + xx; + int cell; if (dst_x < 0 || dst_x >= (int) graphic->actual_width) continue; @@ -423,24 +368,20 @@ copy_overlapping_area(Graphic *graphic, int src_ul_x, int src_ul_y, graphic->max_width) + (unsigned) src_x]; - graphic->pixels[(unsigned) (dst_y * graphic->max_width) + - (unsigned) dst_x] = color; + cell = (int) ((unsigned) (dst_y * graphic->max_width) + + (unsigned) dst_x); + SetSpixel(graphic, cell, color); } } } -static void -set_color_register(ColorRegister *color_registers, - unsigned color, - int r, - int g, - int b) -{ - ColorRegister *reg = &color_registers[color]; - reg->r = (short) r; - reg->g = (short) g; - reg->b = (short) b; -} +#define set_color_register(color_registers, color, pr, pg, pb) \ +do { \ + ColorRegister *reg = &color_registers[color]; \ + reg->r = (short) pr; \ + reg->g = (short) pg; \ + reg->b = (short) pb; \ +} while (0) /* Graphics which don't use private colors will act as if they are using a * device-wide color palette. @@ -466,7 +407,7 @@ set_shared_color_register(unsigned color, int r, int g, int b) continue; if (graphic->color_registers_used[ii]) { - graphic->dirty = 1; + graphic->dirty = True; } } } @@ -484,7 +425,7 @@ update_color_register(Graphic *graphic, set_color_register(graphic->private_color_registers, color, r, g, b); if (graphic->color_registers_used[color]) { - graphic->dirty = 1; + graphic->dirty = True; } graphic->color_registers_used[color] = 1; } else { @@ -700,14 +641,12 @@ init_graphic(Graphic *graphic, { const unsigned max_pixels = (unsigned) (graphic->max_width * graphic->max_height); - unsigned i; - TRACE(("init_graphic at %d,%d\n", charrow, charcol)); + TRACE(("init_graphic %u pixels at %d,%d\n", max_pixels, charrow, charcol)); - graphic->hidden = 0; - graphic->dirty = 1; - for (i = 0U; i < max_pixels; i++) - graphic->pixels[i] = COLOR_HOLE; + graphic->hidden = False; + graphic->dirty = True; + memset(graphic->pixels, COLOR_HOLE & 0xff, max_pixels * sizeof(RegisterNum)); memset(graphic->color_registers_used, 0, sizeof(graphic->color_registers_used)); /* @@ -752,15 +691,15 @@ init_graphic(Graphic *graphic, graphic->charrow = charrow; graphic->charcol = charcol; graphic->type = type; - graphic->valid = 0; + graphic->valid = False; } Graphic * get_new_graphic(XtermWidget xw, int charrow, int charcol, unsigned type) { TScreen const *screen = TScreenOf(xw); - int bufferid = screen->whichBuf; - int graphics_termid = GraphicsTermId(screen); + const int bufferid = screen->whichBuf; + const int graphics_termid = GraphicsTermId(screen); Graphic *graphic = NULL; unsigned ii; @@ -814,7 +753,7 @@ get_new_or_matching_graphic(XtermWidget xw, unsigned type) { TScreen const *screen = TScreenOf(xw); - int bufferid = screen->whichBuf; + const int bufferid = screen->whichBuf; Graphic *graphic; unsigned ii; @@ -863,11 +802,13 @@ save_allocated_color(const ColorRegister *reg, XtermWidget xw, Pixel *pix) XColor xcolor; AllocatedColorRegister *new_color; + /* *INDENT-EQLS* */ xcolor.pixel = 0UL; - xcolor.red = ScaleForXColor(reg->r); + xcolor.red = ScaleForXColor(reg->r); xcolor.green = ScaleForXColor(reg->g); - xcolor.blue = ScaleForXColor(reg->b); + xcolor.blue = ScaleForXColor(reg->b); xcolor.flags = DoRed | DoGreen | DoBlue; + if (!allocateBestRGB(xw, &xcolor)) { TRACE(("unable to allocate xcolor\n")); *pix = 0UL; @@ -936,10 +877,15 @@ refresh_graphic(TScreen const *screen, int const graph_w = graphic->actual_width; int const graph_h = graphic->actual_height; int const mw = graphic->max_width; + int r, c; - int holes, total, out_of_range; + int pmy; RegisterNum regnum; + if_TRACE(int holes = 0); + if_TRACE(int total = 0); + if_TRACE(int out_of_range = 0); + TRACE(("refreshing graphic %u from %d,%d %dx%d (valid=%d, size=%dx%d, scale=%dx%d max=%dx%d)\n", graphic->id, graph_x, graph_y, draw_w, draw_h, @@ -952,43 +898,43 @@ refresh_graphic(TScreen const *screen, TRACE(("refresh pixmap starts at %d,%d\n", refresh_x, refresh_y)); - holes = total = 0; - out_of_range = 0; - for (r = 0; r < graph_h; r++) { - int pmy = graph_y + r * ph; + for (r = 0, pmy = graph_y; r < graph_h; r++, pmy += ph) { + int pmx, buffer_y, pixel_y; if (pmy + ph - 1 < draw_y) continue; if (pmy > draw_y + draw_h - 1) break; - if (pmy < draw_y || pmy > draw_y + draw_h - 1 || - pmy < refresh_y || pmy > refresh_y + refresh_h - 1) { - out_of_range++; + if (pmy < draw_y || + pmy < refresh_y || + pmy > refresh_y + refresh_h - 1) { + if_TRACE(out_of_range++); continue; } + pixel_y = r * mw; + buffer_y = (pmy - refresh_y) * refresh_w; - for (c = 0; c < graph_w; c++) { - int pmx = graph_x + c * pw; + for (c = 0, pmx = graph_x; c < graph_w; c++, pmx += pw) { if (pmx + pw - 1 < draw_x) continue; if (pmx > draw_x + draw_w - 1) break; - if (pmx < draw_x || pmx > draw_x + draw_w - 1 || - pmx < refresh_x || pmx > refresh_x + refresh_w - 1) { - out_of_range++; + if (pmx < draw_x || + pmx < refresh_x || + pmx > refresh_x + refresh_w - 1) { + if_TRACE(out_of_range++); continue; } - total++; - regnum = graphic->pixels[r * mw + c]; + if_TRACE(total++); + regnum = graphic->pixels[pixel_y + c]; if (regnum == COLOR_HOLE) { - holes++; + if_TRACE(holes++); } else { - buffer[(pmy - refresh_y) * refresh_w + - (pmx - refresh_x)] = + buffer[buffer_y + (pmx - refresh_x)] = graphic->color_registers[regnum]; } } @@ -998,81 +944,6 @@ refresh_graphic(TScreen const *screen, holes, total, out_of_range)); } -#ifdef DEBUG_REFRESH - -#define BASEX(X) ( (draw_x - base_x) + (X) ) -#define BASEY(Y) ( (draw_y - base_y) + (Y) ) - -static void -outline_refresh(TScreen const *screen, - Graphic const *graphic, - Pixmap output_pm, - GC graphics_gc, - int base_x, - int base_y, - int draw_x, - int draw_y, - int draw_w, - int draw_h) -{ - Display *const display = screen->display; - int const pw = graphic->pixw; - int const ph = graphic->pixh; - XGCValues xgcv; - XColor def; - - def.red = (unsigned short) ((1.0 - 0.1 * (rand() / (double) - RAND_MAX) * 65535.0)); - def.green = (unsigned short) ((0.7 + 0.2 * (rand() / (double) - RAND_MAX)) * 65535.0); - def.blue = (unsigned short) ((0.1 + 0.1 * (rand() / (double) - RAND_MAX)) * 65535.0); - def.flags = DoRed | DoGreen | DoBlue; - if (allocateBestRGB(graphic->xw, &def)) { - xgcv.foreground = def.pixel; - XChangeGC(display, graphics_gc, GCForeground, &xgcv); - } - - XDrawLine(display, output_pm, graphics_gc, - BASEX(0), BASEY(0), - BASEX(draw_w - 1), BASEY(0)); - XDrawLine(display, output_pm, graphics_gc, - BASEX(0), BASEY(draw_h - 1), - BASEX(draw_w - 1), BASEY(draw_h - 1)); - - XDrawLine(display, output_pm, graphics_gc, - BASEX(0), BASEY(0), - BASEX(0), BASEY(draw_h - 1)); - XDrawLine(display, output_pm, graphics_gc, - BASEX(draw_w - 1), BASEY(0), - BASEX(draw_w - 1), BASEY(draw_h - 1)); - - XDrawLine(display, output_pm, graphics_gc, - BASEX(draw_w - 1), BASEY(0), - BASEX(0), BASEY(draw_h - 1)); - XDrawLine(display, output_pm, graphics_gc, - BASEX(draw_w - 1), BASEY(draw_h - 1), - BASEX(0), BASEY(0)); - - def.red = (short) (0.7 * MAX_U_COLOR); - def.green = (short) (0.1 * MAX_U_COLOR); - def.blue = (short) (1.0 * MAX_U_COLOR); - def.flags = DoRed | DoGreen | DoBlue; - if (allocateBestRGB(graphic->xw, &def)) { - xgcv.foreground = def.pixel; - XChangeGC(display, graphics_gc, GCForeground, &xgcv); - } - XFillRectangle(display, output_pm, graphics_gc, - BASEX(0), - BASEY(0), - (unsigned) pw, (unsigned) ph); - XFillRectangle(display, output_pm, graphics_gc, - BASEX(draw_w - 1 - pw), - BASEY(draw_h - 1 - ph), - (unsigned) pw, (unsigned) ph); -} -#endif - /* * Primary color hues: * blue: 0 degrees @@ -1226,25 +1097,28 @@ dump_graphic(Graphic const *graphic) static void erase_graphic(Graphic *graphic, int x, int y, int w, int h) { - RegisterNum hole = COLOR_HOLE; - int pw, ph; - int r, c; - int rbase, cbase; + const int pw = graphic->pixw; + const int ph = graphic->pixh; + const int r_min = y - ph + 1; + const int r_max = y + h - 1; + const int c_min = x - pw + 1; + const int c_max = x + w - 1; - pw = graphic->pixw; - ph = graphic->pixh; + int r; + int rbase = 0; TRACE(("erasing graphic %d,%d %dx%d\n", x, y, w, h)); - rbase = 0; for (r = 0; r < graphic->actual_height; r++) { - if (rbase + ph - 1 >= y - && rbase <= y + h - 1) { - cbase = 0; + if (rbase >= r_min + && rbase <= r_max) { + int c; + int cbase = 0; for (c = 0; c < graphic->actual_width; c++) { - if (cbase + pw - 1 >= x - && cbase <= x + w - 1) { - graphic->pixels[r * graphic->max_width + c] = hole; + if (cbase >= c_min + && cbase <= c_max) { + const int cell = r * graphic->max_width + c; + ClrSpixel(graphic, cell); } cbase += pw; } @@ -1296,33 +1170,16 @@ clip_area(int *orig_x, int *orig_y, int *orig_w, int *orig_h, } } -/* the coordinates are relative to the screen */ -static void -refresh_graphics(XtermWidget xw, - int leftcol, - int toprow, - int ncols, - int nrows, - int skip_clean) +static Bool +GetGraphicsOrder(TScreen *screen, + int skip_clean, + Graphic *ordered_graphics[MAX_GRAPHICS], + unsigned *resultp) { - TScreen *const screen = TScreenOf(xw); - Display *const display = screen->display; - Window const drawable = VDrawable(screen); - int const scroll_y = screen->topline * FontHeight(screen); - int const refresh_x = leftcol * FontWidth(screen); - int const refresh_y = toprow * FontHeight(screen) + scroll_y; - int const refresh_w = ncols * FontWidth(screen); - int const refresh_h = nrows * FontHeight(screen); - int draw_x_min, draw_x_max; - int draw_y_min, draw_y_max; - Graphic *ordered_graphics[MAX_GRAPHICS]; - unsigned ii, jj; + unsigned ii; unsigned active_count; - unsigned holes, non_holes; - int xx, yy; - ColorRegister *buffer; - active_count = 0; + *resultp = active_count = 0; FOR_EACH_SLOT(ii) { Graphic *graphic; if (!(graphic = getActiveSlot(ii))) @@ -1356,7 +1213,7 @@ refresh_graphics(XtermWidget xw, } if (active_count == 0) - return; + return False; if (active_count > 1) { qsort(ordered_graphics, (size_t) active_count, @@ -1365,6 +1222,7 @@ refresh_graphics(XtermWidget xw, } if (skip_clean) { + unsigned jj; unsigned skip_count; for (jj = 0; jj < active_count; ++jj) { @@ -1373,25 +1231,240 @@ refresh_graphics(XtermWidget xw, } skip_count = jj; if (skip_count == active_count) - return; + return False; active_count -= skip_count; for (jj = 0; jj < active_count; ++jj) { ordered_graphics[jj] = ordered_graphics[jj + skip_count]; } } + *resultp = active_count; + return True; +} - if (!(buffer = malloc(sizeof(*buffer) * +static ColorRegister * +AllocGraphicsBuffer(TScreen *screen, + int ncols, + int nrows) +{ + int xx, yy; + int const refresh_w = ncols * FontWidth(screen); + int const refresh_h = nrows * FontHeight(screen); + ColorRegister *buffer; + + if (!(buffer = malloc(sizeof(ColorRegister) * (unsigned) refresh_w * (unsigned) refresh_h))) { TRACE(("unable to allocate %dx%d buffer for graphics refresh\n", refresh_w, refresh_h)); - return; - } - for (yy = 0; yy < refresh_h; yy++) { - for (xx = 0; xx < refresh_w; xx++) { - buffer[yy * refresh_w + xx] = null_color; + } else { + /* assuming two's complement, the memset will be much faster than loop */ + if ((unsigned short) null_color.r == 0xffff) { + memset(buffer, 0xff, + sizeof(ColorRegister) * (size_t) (refresh_h * refresh_w)); + } else { + for (yy = 0; yy < refresh_h; yy++) { + for (xx = 0; xx < refresh_w; xx++) { + buffer[yy * refresh_w + xx] = null_color; + } + } } } + return buffer; +} + +typedef struct { + int x_min; + int x_max; + int y_min; + int y_max; +} ClipLimits; + +static Boolean +RefreshClipped(TScreen *screen, + int leftcol, + int toprow, + int ncols, + int nrows, + Graphic *ordered_graphics[MAX_GRAPHICS], + unsigned active_count, + ColorRegister *buffer, + ClipLimits * result) +{ + int const scroll_y = screen->topline * FontHeight(screen); + int const refresh_x = leftcol * FontWidth(screen); + int const refresh_y = toprow * FontHeight(screen) + scroll_y; + int const refresh_w = ncols * FontWidth(screen); + int const refresh_h = nrows * FontHeight(screen); + ClipLimits my_limits; + unsigned jj; + + int const altarea_x = 0; + int const altarea_y = 0; + int const altarea_w = Width(screen) * FontWidth(screen); + int const altarea_h = Height(screen) * FontHeight(screen); + + int const scrollarea_x = 0; + int const scrollarea_y = scroll_y; + int const scrollarea_w = Width(screen) * FontWidth(screen); + int const scrollarea_h = -scroll_y; + + int const mainarea_x = 0; + int const mainarea_y = scroll_y; + int const mainarea_w = Width(screen) * FontWidth(screen); + int const mainarea_h = -scroll_y + Height(screen) * FontHeight(screen); + + my_limits.x_min = refresh_x + refresh_w; + my_limits.x_max = refresh_x - 1; + my_limits.y_min = refresh_y + refresh_h; + my_limits.y_max = refresh_y - 1; + for (jj = 0; jj < active_count; ++jj) { + Graphic *graphic = ordered_graphics[jj]; + int draw_x = graphic->charcol * FontWidth(screen); + int draw_y = graphic->charrow * FontHeight(screen); + int draw_w = graphic->actual_width; + int draw_h = graphic->actual_height; + + if (screen->whichBuf != 0) { + if (graphic->bufferid != 0) { + /* clip to alt buffer */ + clip_area(&draw_x, &draw_y, &draw_w, &draw_h, + altarea_x, altarea_y, altarea_w, altarea_h); + } else { + /* clip to scrollback area */ + clip_area(&draw_x, &draw_y, &draw_w, &draw_h, + scrollarea_x, scrollarea_y, + scrollarea_w, scrollarea_h); + } + } else { + /* clip to scrollback + normal area */ + clip_area(&draw_x, &draw_y, &draw_w, &draw_h, + mainarea_x, mainarea_y, + mainarea_w, mainarea_h); + } + + clip_area(&draw_x, &draw_y, &draw_w, &draw_h, + refresh_x, refresh_y, refresh_w, refresh_h); + + TRACE(("refresh: graph=%u\n", jj)); + TRACE((" refresh_x=%d refresh_y=%d refresh_w=%d refresh_h=%d\n", + refresh_x, refresh_y, refresh_w, refresh_h)); + TRACE((" draw_x=%d draw_y=%d draw_w=%d draw_h=%d\n", + draw_x, draw_y, draw_w, draw_h)); + + if (draw_w > 0 && draw_h > 0) { + refresh_graphic(screen, graphic, buffer, + refresh_x, refresh_y, + refresh_w, refresh_h, + draw_x, draw_y, + draw_w, draw_h); + if (draw_x < my_limits.x_min) + my_limits.x_min = draw_x; + if (draw_x + draw_w - 1 > my_limits.x_max) + my_limits.x_max = draw_x + draw_w - 1; + if (draw_y < my_limits.y_min) + my_limits.y_min = draw_y; + if (draw_y + draw_h - 1 > my_limits.y_max) + my_limits.y_max = draw_y + draw_h - 1; + } + graphic->dirty = False; + } + + if (my_limits.x_max < refresh_x || + my_limits.x_min > refresh_x + refresh_w - 1 || + my_limits.y_max < refresh_y || + my_limits.y_min > refresh_y + refresh_h - 1) { + return False; + } + *result = my_limits; + return True; +} + +static Boolean +FindGraphicHoles(int refresh_x, + int refresh_y, + int refresh_w, + ColorRegister *buffer, + ClipLimits * limits, + unsigned *result) +{ + const int y_min = limits->y_min - refresh_y; + const int y_max = limits->y_max - refresh_y; + const int x_min = limits->x_min - refresh_x; + const int x_max = limits->x_max - refresh_x; + const ColorRegister *base = buffer + (y_min * refresh_w); + int xx, yy; + + unsigned holes = 0U; + unsigned non_holes = 0U; + + for (yy = y_min; yy <= y_max; yy++) { + const ColorRegister *scan = base + x_min; + for (xx = x_min; xx <= x_max; xx++) { + if (scan->r < 0 || scan->g < 0 || scan->b < 0) { + holes++; + } else { + non_holes++; + } + if (non_holes && holes) + goto finish; + ++scan; + } + base += refresh_w; + } + + finish: + *result = holes; + return (non_holes != 0); +} + +/* the coordinates are relative to the screen */ +static void +refresh_graphics(XtermWidget xw, + int leftcol, + int toprow, + int ncols, + int nrows, + int skip_clean) +{ + TScreen *const screen = TScreenOf(xw); + Display *const display = screen->display; + Window const drawable = VDrawable(screen); + int const scroll_y = screen->topline * FontHeight(screen); + int const refresh_x = leftcol * FontWidth(screen); + int const refresh_y = toprow * FontHeight(screen) + scroll_y; + int const refresh_w = ncols * FontWidth(screen); + + Graphic *ordered_graphics[MAX_GRAPHICS]; + unsigned active_count; + unsigned holes; + int xx, yy; + + ColorRegister *buffer; + ClipLimits clip_limits; + + if_TRACE(int const refresh_h = nrows * FontHeight(screen)); + + if (!GetGraphicsOrder(screen, skip_clean, ordered_graphics, &active_count)) + return; + + if (!valid_graphics) { + memset(&xgcv, 0, sizeof(xgcv)); + xgcv.graphics_exposures = False; + graphics_gc = XCreateGC(display, drawable, GCGraphicsExposures, &xgcv); + last_color = null_color; + gc_color = null_color; + if (graphics_gc == None) { + TRACE(("unable to allocate GC for graphics refresh\n")); + valid_graphics = -1; + } else { + valid_graphics = 1; + } + } + if (valid_graphics < 0) + return; + + if ((buffer = AllocGraphicsBuffer(screen, ncols, nrows)) == NULL) + return; TRACE(("refresh: screen->topline=%d leftcol=%d toprow=%d nrows=%d ncols=%d (%d,%d %dx%d)\n", screen->topline, @@ -1400,111 +1473,21 @@ refresh_graphics(XtermWidget xw, refresh_x, refresh_y, refresh_w, refresh_h)); - { - int const altarea_x = 0; - int const altarea_y = 0; - int const altarea_w = Width(screen) * FontWidth(screen); - int const altarea_h = Height(screen) * FontHeight(screen); - - int const scrollarea_x = 0; - int const scrollarea_y = scroll_y; - int const scrollarea_w = Width(screen) * FontWidth(screen); - int const scrollarea_h = -scroll_y; - - int const mainarea_x = 0; - int const mainarea_y = scroll_y; - int const mainarea_w = Width(screen) * FontWidth(screen); - int const mainarea_h = -scroll_y + Height(screen) * FontHeight(screen); - - draw_x_min = refresh_x + refresh_w; - draw_x_max = refresh_x - 1; - draw_y_min = refresh_y + refresh_h; - draw_y_max = refresh_y - 1; - for (jj = 0; jj < active_count; ++jj) { - Graphic *graphic = ordered_graphics[jj]; - int draw_x = graphic->charcol * FontWidth(screen); - int draw_y = graphic->charrow * FontHeight(screen); - int draw_w = graphic->actual_width; - int draw_h = graphic->actual_height; - - if (screen->whichBuf != 0) { - if (graphic->bufferid != 0) { - /* clip to alt buffer */ - clip_area(&draw_x, &draw_y, &draw_w, &draw_h, - altarea_x, altarea_y, altarea_w, altarea_h); - } else { - /* clip to scrollback area */ - clip_area(&draw_x, &draw_y, &draw_w, &draw_h, - scrollarea_x, scrollarea_y, - scrollarea_w, scrollarea_h); - } - } else { - /* clip to scrollback + normal area */ - clip_area(&draw_x, &draw_y, &draw_w, &draw_h, - mainarea_x, mainarea_y, - mainarea_w, mainarea_h); - } - - clip_area(&draw_x, &draw_y, &draw_w, &draw_h, - refresh_x, refresh_y, refresh_w, refresh_h); - - TRACE(("refresh: graph=%u\n", jj)); - TRACE((" refresh_x=%d refresh_y=%d refresh_w=%d refresh_h=%d\n", - refresh_x, refresh_y, refresh_w, refresh_h)); - TRACE((" draw_x=%d draw_y=%d draw_w=%d draw_h=%d\n", - draw_x, draw_y, draw_w, draw_h)); - - if (draw_w > 0 && draw_h > 0) { - refresh_graphic(screen, graphic, buffer, - refresh_x, refresh_y, - refresh_w, refresh_h, - draw_x, draw_y, - draw_w, draw_h); - if (draw_x < draw_x_min) - draw_x_min = draw_x; - if (draw_x + draw_w - 1 > draw_x_max) - draw_x_max = draw_x + draw_w - 1; - if (draw_y < draw_y_min) - draw_y_min = draw_y; - if (draw_y + draw_h - 1 > draw_y_max) - draw_y_max = draw_y + draw_h - 1; - } - graphic->dirty = 0; - } - } - - if (draw_x_max < refresh_x || - draw_x_min > refresh_x + refresh_w - 1 || - draw_y_max < refresh_y || - draw_y_min > refresh_y + refresh_h - 1) { + if (!RefreshClipped(screen, leftcol, toprow, ncols, nrows, + ordered_graphics, + active_count, + buffer, + &clip_limits)) { free(buffer); return; } - holes = 0U; - non_holes = 0U; - { - int y_min = draw_y_min - refresh_y; - int y_max = draw_y_max - refresh_y; - int x_min = draw_x_min - refresh_x; - int x_max = draw_x_max - refresh_x; - const ColorRegister *base = buffer + (y_min * refresh_w); - - for (yy = y_min; yy <= y_max; yy++) { - const ColorRegister *scan = base + x_min; - for (xx = x_min; xx <= x_max; xx++) { - if (scan->r < 0 || scan->g < 0 || scan->b < 0) { - holes++; - } else { - non_holes++; - } - ++scan; - } - base += refresh_w; - } - } - - if (non_holes < 1U) { + if (!FindGraphicHoles(refresh_x, + refresh_y, + refresh_w, + buffer, + &clip_limits, + &holes)) { TRACE(("refresh: visible graphics areas are erased; nothing to do\n")); free(buffer); return; @@ -1519,26 +1502,14 @@ refresh_graphics(XtermWidget xw, * once.) */ if (holes > 0U) { - GC graphics_gc; - XGCValues xgcv; - ColorRegister last_color; - ColorRegister gc_color; int run; - memset(&xgcv, 0, sizeof(xgcv)); - xgcv.graphics_exposures = False; - graphics_gc = XCreateGC(display, drawable, GCGraphicsExposures, &xgcv); - if (graphics_gc == None) { - TRACE(("unable to allocate GC for graphics refresh\n")); - free(buffer); - return; - } - - last_color = null_color; - gc_color = null_color; run = 0; - for (yy = draw_y_min - refresh_y; yy <= draw_y_max - refresh_y; yy++) { - for (xx = draw_x_min - refresh_x; xx <= draw_x_max - refresh_x; + for (yy = clip_limits.y_min - refresh_y; + yy <= clip_limits.y_max - refresh_y; + yy++) { + for (xx = clip_limits.x_min - refresh_x; + xx <= clip_limits.x_max - refresh_x; xx++) { const ColorRegister color = buffer[yy * refresh_w + xx]; @@ -1585,31 +1556,17 @@ refresh_graphics(XtermWidget xw, run = 0; } } - - XFreeGC(display, graphics_gc); } else { - XGCValues xgcv; - GC graphics_gc; ColorRegister old_colors[2]; Pixel fg, old_result[2]; XImage *image; char *imgdata; - unsigned image_w, image_h; + const unsigned image_w = ((unsigned) clip_limits.x_max + 1U - + (unsigned) clip_limits.x_min); + const unsigned image_h = ((unsigned) clip_limits.y_max + 1U - + (unsigned) clip_limits.y_min); int nn; - memset(&xgcv, 0, sizeof(xgcv)); - xgcv.graphics_exposures = False; - graphics_gc = XCreateGC(display, drawable, GCGraphicsExposures, &xgcv); - if (graphics_gc == None) { - TRACE(("unable to allocate GC for graphics refresh\n")); - free(buffer); - return; - } - - /* FIXME: is it worth reusing the GC/Image/imagedata across calls? */ - /* FIXME: is it worth using shared memory when available? */ - image_w = (unsigned) draw_x_max + 1U - (unsigned) draw_x_min; - image_h = (unsigned) draw_y_max + 1U - (unsigned) draw_y_min; image = XCreateImage(display, xw->visInfo->visual, (unsigned) xw->visInfo->depth, ZPixmap, 0, NULL, @@ -1617,7 +1574,6 @@ refresh_graphics(XtermWidget xw, (int) (sizeof(int) * 8U), 0); if (!image) { TRACE(("unable to allocate XImage for graphics refresh\n")); - XFreeGC(display, graphics_gc); free(buffer); return; } @@ -1625,7 +1581,6 @@ refresh_graphics(XtermWidget xw, if (!imgdata) { TRACE(("unable to allocate XImage for graphics refresh\n")); XDestroyImage(image); - XFreeGC(display, graphics_gc); free(buffer); return; } @@ -1640,8 +1595,11 @@ refresh_graphics(XtermWidget xw, old_colors[0] = null_color; old_colors[1] = null_color; - for (yy = draw_y_min - refresh_y; yy <= draw_y_max - refresh_y; yy++) { - for (xx = draw_x_min - refresh_x; xx <= draw_x_max - refresh_x; + for (yy = clip_limits.y_min - refresh_y; + yy <= clip_limits.y_max - refresh_y; + yy++) { + for (xx = clip_limits.x_min - refresh_x; + xx <= clip_limits.x_max - refresh_x; xx++) { const ColorRegister color = buffer[yy * refresh_w + xx]; @@ -1658,20 +1616,19 @@ refresh_graphics(XtermWidget xw, } XPutPixel(image, - xx + refresh_x - draw_x_min, - yy + refresh_y - draw_y_min, fg); + xx + refresh_x - clip_limits.x_min, + yy + refresh_y - clip_limits.y_min, fg); } } XPutImage(display, drawable, graphics_gc, image, 0, 0, - OriginX(screen) + draw_x_min, - (OriginY(screen) - scroll_y) + draw_y_min, + OriginX(screen) + clip_limits.x_min, + (OriginY(screen) - scroll_y) + clip_limits.y_min, image_w, image_h); free(imgdata); image->data = NULL; XDestroyImage(image); - XFreeGC(display, graphics_gc); } free(buffer); @@ -1802,12 +1759,14 @@ reset_displayed_graphics(TScreen const *screen) #ifdef NO_LEAKS void -noleaks_graphics(void) +noleaks_graphics(Display *dpy) { unsigned ii; FOR_EACH_SLOT(ii) { deactivateSlot(ii); } + if (valid_graphics > 0) + XFreeGC(dpy, graphics_gc); } #endif diff --git a/app/xterm/graphics.h b/app/xterm/graphics.h index 90bedf4c0..7131e1603 100644 --- a/app/xterm/graphics.h +++ b/app/xterm/graphics.h @@ -1,8 +1,8 @@ -/* $XTermId: graphics.h,v 1.23 2016/05/29 16:11:41 tom Exp $ */ +/* $XTermId: graphics.h,v 1.29 2022/02/22 23:36:19 tom Exp $ */ /* - * Copyright 2013-2015,2016 by Ross Combs - * Copyright 2013-2015,2016 by Thomas E. Dickey + * Copyright 2013-2016,2022 by Ross Combs + * Copyright 2013-2016,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -47,11 +47,21 @@ typedef struct { typedef unsigned short RegisterNum; -#define MAX_COLOR_REGISTERS 1024U -#define COLOR_HOLE ((RegisterNum)MAX_COLOR_REGISTERS) +#define MAX_COLOR_REGISTERS 0x400 /* 1024U */ +#define COLOR_HOLE 0x404 /* bytable above MAX_COLOR_REGISTERS */ #define MAX_GRAPHICS 16U +#define ClrSpixel(graphic, cell) \ + do { \ + (graphic)->pixels[cell] = COLOR_HOLE; \ + } while (0) + +#define SetSpixel(graphic, cell, value) \ + do { \ + (graphic)->pixels[cell] = value; \ + } while (0) + typedef struct { RegisterNum *pixels; ColorRegister *private_color_registers; @@ -71,9 +81,9 @@ typedef struct { int bufferid; /* which screen buffer the graphic is associated with */ unsigned type; /* type of graphic 0==sixel, 1...NUM_REGIS_PAGES==ReGIS page */ unsigned id; /* sequential id used for preserving layering */ - int valid; /* if the graphic has been initialized */ - int dirty; /* if the graphic needs to be redrawn */ - int hidden; /* if the graphic should not be displayed */ + Boolean valid; /* if the graphic has been initialized */ + Boolean dirty; /* if the graphic needs to be redrawn */ + Boolean hidden; /* if the graphic should not be displayed */ } Graphic; extern Graphic *get_new_graphic(XtermWidget /* xw */, int /* charrow */, int /* charcol */, unsigned /* type */); @@ -81,7 +91,6 @@ extern Graphic *get_new_or_matching_graphic(XtermWidget /* xw */, int /* charrow extern RegisterNum read_pixel(Graphic */* graphic */, int /* x */, int /* y */); extern void draw_solid_pixel(Graphic */* graphic */, int /* x */, int /* y */, unsigned /* color */); extern void draw_solid_rectangle(Graphic */* graphic */, int /* x1 */, int /* y1 */, int /* x2 */, int /* y2 */, unsigned /* color */); -extern void draw_solid_line(Graphic */* graphic */, int /* x1 */, int /* y1 */, int /* x2 */, int /* y2 */, unsigned /* color */); extern void copy_overlapping_area(Graphic */* graphic */, int /* src_x */, int /* src_y */, int /* dst_x */, int /* dst_y */, unsigned /* w */, unsigned /* h */, unsigned /* default_color */); extern void hls2rgb(int /* h */, int /* l */, int /* s */, short */* r */, short */* g */, short */* b */); extern void dump_graphic(Graphic const */* graphic */); @@ -96,7 +105,7 @@ extern void reset_displayed_graphics(TScreen const */* screen */); extern void scroll_displayed_graphics(XtermWidget /* xw */, int /* rows */); #ifdef NO_LEAKS -extern void noleaks_graphics(void); +extern void noleaks_graphics(Display */* dpy */); #endif #else @@ -106,7 +115,6 @@ extern void noleaks_graphics(void); #define read_pixel(graphic, x, y) /* nothing */ #define draw_solid_pixel(graphic, x, y, color) /* nothing */ #define draw_solid_rectangle(graphic, x1, y1, x2, y2, color) /* nothing */ -#define draw_solid_line(graphic, x1, y1, x2, y2, color) /* nothing */ #define copy_overlapping_area(graphic, src_x, src_y, dst_x, dst_y, w, h, default_color) /* nothing */ #define hls2rgb(h, l, s, r, g, b) /* nothing */ #define dump_graphic(graphic) /* nothing */ diff --git a/app/xterm/graphics_regis.c b/app/xterm/graphics_regis.c index b6a8cc9c6..479bb7960 100644 --- a/app/xterm/graphics_regis.c +++ b/app/xterm/graphics_regis.c @@ -1,8 +1,8 @@ -/* $XTermId: graphics_regis.c,v 1.128 2021/02/25 23:17:48 tom Exp $ */ +/* $XTermId: graphics_regis.c,v 1.129 2022/02/21 13:33:08 tom Exp $ */ /* - * Copyright 2014-2020,2021 by Ross Combs - * Copyright 2014-2020,2021 by Thomas E. Dickey + * Copyright 2014-2021,2022 by Ross Combs + * Copyright 2014-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -223,7 +223,7 @@ typedef struct RegisGraphicsContext { unsigned fill_point_count; unsigned destination_page; unsigned display_page; - int force_refresh; + Boolean force_refresh; } RegisGraphicsContext; static RegisGraphicsContext persistent_context; @@ -623,7 +623,7 @@ draw_shaded_polygon(RegisGraphicsContext *context) old_y = new_y; } - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; } static void @@ -683,7 +683,7 @@ draw_filled_polygon(RegisGraphicsContext *context) old_y = new_y; } - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; } static void @@ -745,7 +745,7 @@ draw_patterned_line(RegisGraphicsContext *context, int x1, int y1, } } - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; } typedef struct { @@ -904,7 +904,7 @@ draw_patterned_arc(RegisGraphicsContext *context, while (rx <= 0); } - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; } /* @@ -2750,7 +2750,7 @@ draw_text(RegisGraphicsContext *context, char const *str) } #endif - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; return; } @@ -4599,9 +4599,9 @@ map_regis_graphics_pages(XtermWidget xw, RegisGraphicsContext *context) unsigned old_display_id = ~0U; if (context->destination_graphic) - context->destination_graphic->hidden = 1; + context->destination_graphic->hidden = True; if (context->display_graphic) { - context->display_graphic->hidden = 1; + context->display_graphic->hidden = True; old_display_id = context->display_graphic->id; } @@ -4612,8 +4612,8 @@ map_regis_graphics_pages(XtermWidget xw, RegisGraphicsContext *context) context->height, context->destination_page); if (context->destination_graphic) { - context->destination_graphic->hidden = 1; - context->destination_graphic->valid = 1; + context->destination_graphic->hidden = True; + context->destination_graphic->valid = True; } context->display_graphic = @@ -4623,22 +4623,22 @@ map_regis_graphics_pages(XtermWidget xw, RegisGraphicsContext *context) context->height, context->display_page); if (context->display_graphic) { - context->display_graphic->hidden = 0; + context->display_graphic->hidden = False; if (old_display_id != context->display_graphic->id) { if (!context->display_graphic->valid) { draw_solid_rectangle(context->display_graphic, 0, 0, context->width, context->height, context->background); } - context->display_graphic->dirty = 1; - context->force_refresh = 1; + context->display_graphic->dirty = True; + context->force_refresh = True; /* FIXME: This isn't really enough. If there are holes in the new * graphic they should be cleared and set to the text from the same * page. But we don't have pages for text in xterm (the alt buffer * is similar though). */ } - context->display_graphic->valid = 1; + context->display_graphic->valid = True; } TRACE(("using graphics destination=[%d -> %u] display=[%d -> %u]\n", @@ -4773,7 +4773,7 @@ init_regis_graphics_context(int graphics_termid, int width, int height, context->graphics_output_cursor_y = 0; /* FIXME: output cursor style */ - context->force_refresh = 0; + context->force_refresh = False; } static int @@ -5966,7 +5966,7 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) context->height = height; context->destination_graphic->actual_width = width; context->destination_graphic->actual_height = height; - context->destination_graphic->dirty = 1; + context->destination_graphic->dirty = True; TRACE(("conversion factors: off=%+d,%+d div=%+d,%+d width=%d, height=%d\n", context->x_off, context->y_off, @@ -6005,8 +6005,8 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) context->fill_mode = 0; state->num_points = 0U; state->stack_next = 0U; - context->destination_graphic->dirty = 1; - context->force_refresh = 1; + context->destination_graphic->dirty = True; + context->force_refresh = True; break; case 'F': case 'f': @@ -6019,8 +6019,8 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) } /* We aren't going to print anything so no need to deduplicate. */ DRAW_ALL(context, context->background); - context->destination_graphic->dirty = 1; - context->force_refresh = 1; + context->destination_graphic->dirty = True; + context->force_refresh = True; break; case 'H': case 'h': @@ -7044,8 +7044,8 @@ parse_regis_items(RegisParseState *state, RegisGraphicsContext *context) 0, 0, (unsigned) copy_w, (unsigned) copy_h, context->background); - context->destination_graphic->dirty = 1; - context->force_refresh = 1; + context->destination_graphic->dirty = True; + context->force_refresh = True; } break; case 't': @@ -7160,8 +7160,8 @@ parse_regis_items(RegisParseState *state, RegisGraphicsContext *context) 0, 0, (unsigned) copy_w, (unsigned) copy_h, context->background); - context->destination_graphic->dirty = 1; - context->force_refresh = 1; + context->destination_graphic->dirty = True; + context->force_refresh = True; } break; case 't': diff --git a/app/xterm/graphics_sixel.c b/app/xterm/graphics_sixel.c index ebdecda21..410199eec 100644 --- a/app/xterm/graphics_sixel.c +++ b/app/xterm/graphics_sixel.c @@ -1,4 +1,4 @@ -/* $XTermId: graphics_sixel.c,v 1.31 2022/01/31 08:53:42 tom Exp $ */ +/* $XTermId: graphics_sixel.c,v 1.36 2022/02/21 23:13:48 tom Exp $ */ /* * Copyright 2014-2021,2022 by Ross Combs @@ -149,40 +149,42 @@ init_sixel_background(Graphic *graphic, SixelContext const *context) graphic->color_registers_used[context->background] = 1; } +#define ValidColumn(graphic, context) \ + ((context)->col >= 0 && \ + (context)->col < (graphic)->max_width) + static Boolean set_sixel(Graphic *graphic, SixelContext const *context, int sixel) { const int mh = graphic->max_height; const int mw = graphic->max_width; - RegisterNum color; + const RegisterNum color = context->current_register; int pix; + int pix_row = context->row; + int pix_col = context->col + (pix_row * mw); - color = context->current_register; - TRACE(("drawing sixel at pos=%d,%d color=%hu (hole=%d, [%d,%d,%d])\n", - context->col, - context->row, - color, - color == COLOR_HOLE, - ((color != COLOR_HOLE) - ? (unsigned) graphic->color_registers[color].r : 0U), - ((color != COLOR_HOLE) - ? (unsigned) graphic->color_registers[color].g : 0U), - ((color != COLOR_HOLE) - ? (unsigned) graphic->color_registers[color].b : 0U))); - for (pix = 0; pix < 6; pix++) { - if (context->col >= 0 && - context->col < mw && - context->row + pix >= 0 && - context->row + pix < mh) { + TRACE2(("drawing sixel at pos=%d,%d color=%hu (hole=%d, [%d,%d,%d])\n", + context->col, + context->row, + color, + color == COLOR_HOLE, + ((color != COLOR_HOLE) + ? (unsigned) graphic->color_registers[color].r : 0U), + ((color != COLOR_HOLE) + ? (unsigned) graphic->color_registers[color].g : 0U), + ((color != COLOR_HOLE) + ? (unsigned) graphic->color_registers[color].b : 0U))); + for (pix = 0; pix < 6; pix++, pix_row++, pix_col += mw) { + if (pix_row >= 0 && + pix_row < mh) { if (sixel & (1 << pix)) { - if (context->col + 1 > graphic->actual_width) { + if (context->col >= graphic->actual_width) { graphic->actual_width = context->col + 1; } - if (context->row + pix + 1 > graphic->actual_height) { - graphic->actual_height = context->row + pix + 1; + if (pix_row >= graphic->actual_height) { + graphic->actual_height = pix_row + 1; } - graphic->pixels[((context->row + pix) * mw) + context->col] = - color; + SetSpixel(graphic, pix_col, color); } } else { TRACE(("sixel pixel %d out of bounds\n", pix)); @@ -295,7 +297,7 @@ finished_parsing(XtermWidget xw, Graphic *graphic) } } - graphic->dirty = 1; + graphic->dirty = True; refresh_modified_displayed_graphics(xw); TRACE(("DONE parsed sixel data\n")); @@ -465,10 +467,11 @@ parse_sixel(XtermWidget xw, ANSI *params, char const *string) TRACE(("sixel=%x (%c)\n", sixel, (char) ch)); if (!graphic->valid) { init_sixel_background(graphic, &context); - graphic->valid = 1; + graphic->valid = True; } if (sixel) { - if (!set_sixel(graphic, &context, sixel)) { + if (!ValidColumn(graphic, &context) || + !set_sixel(graphic, &context, sixel)) { context.col = 0; break; } @@ -535,12 +538,13 @@ parse_sixel(XtermWidget xw, ANSI *params, char const *string) sixel, (char) ch, Pcount)); if (!graphic->valid) { init_sixel_background(graphic, &context); - graphic->valid = 1; + graphic->valid = True; } if (sixel) { int i; for (i = 0; i < Pcount; i++) { - if (set_sixel(graphic, &context, sixel)) { + if (ValidColumn(graphic, &context) && + set_sixel(graphic, &context, sixel)) { context.col++; } else { context.col = 0; diff --git a/app/xterm/icons/make-xpms b/app/xterm/icons/make-xpms new file mode 100755 index 000000000..31cb56065 --- /dev/null +++ b/app/xterm/icons/make-xpms @@ -0,0 +1,26 @@ +#!/bin/sh +# $XTermId: make-xpms,v 1.6 2012/10/07 22:50:56 tom Exp $ +# some files are generated from other icons... +for name in mini.xterm filled-xterm xterm xterm-color +do + target=${name}.xpms + NAME=`echo "$target" | sed -e 's/[\.-]/_/g'` + LIST= + echo "** creating $target" + rm -f $target + echo "/* @XTermId@ */" | sed -e 's/@/$/g' >$target + echo "/* generated by $0 $* */" >>$target + echo "/* vile:xpmmode */" >>$target + for source in ${name}_*[0-9]x[1-9]*.xpm + do + echo ".. from $source" + BASE=`basename "$source" .xpm` + PART=`echo "$source" | sed -e 's/[\.-]/_/g'` + test -n "$LIST" && LIST="$LIST, " + LIST="$LIST + { \"$BASE\", $PART }" + sed -e 's/char \*/const char * const/' $source >>$target + done + echo "static const XPM_DATA $NAME[] = {$LIST +};" >>$target +done diff --git a/app/xterm/linedata.c b/app/xterm/linedata.c index 22f5908f3..7d9ce29b6 100644 --- a/app/xterm/linedata.c +++ b/app/xterm/linedata.c @@ -1,4 +1,4 @@ -/* $XTermId: linedata.c,v 1.100 2021/08/22 20:02:23 tom Exp $ */ +/* $XTermId: linedata.c,v 1.101 2021/12/27 23:43:28 tom Exp $ */ /* * Copyright 2009-2019,2021 by Thomas E. Dickey @@ -46,7 +46,7 @@ getLineData(TScreen *screen, int row) { LineData *result = 0; ScrnBuf buffer; - int max_row = screen->max_row; + int max_row = LastRowNumber(screen); if (row >= 0) { buffer = screen->visbuf; diff --git a/app/xterm/main.c b/app/xterm/main.c index 7bfb7fcac..b6e4e8f58 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,7 +1,7 @@ -/* $XTermId: main.c,v 1.882 2021/09/16 19:49:13 tom Exp $ */ +/* $XTermId: main.c,v 1.886 2022/02/22 23:35:41 tom Exp $ */ /* - * Copyright 2002-2020,2021 by Thomas E. Dickey + * Copyright 2002-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -2897,7 +2897,6 @@ main(int argc, char *argv[]ENVP_ARG) NonNull(TScreenOf(term)->Tcolors[TEXT_FG].resource), NonNull(TScreenOf(term)->Tcolors[TEXT_BG].resource))); } - #if OPT_MAXIMIZE if (resource.maximized) RequestMaximize(term, True); @@ -3707,6 +3706,72 @@ resetShell(char *oldPath) return newPath; } +/* + * Trim unwanted environment variables: + * + * DESKTOP_STARTUP_ID + * standards.freedesktop.org/startup-notification-spec/ + * notes that this variable is used when a "reliable" mechanism is + * not available; in practice it must be unset to avoid confusing + * GTK applications. + * + * XCURSOR_PATH + * We set this temporarily to work around poor design of Xcursor. Unset it + * here to avoid confusion. + * + * Other... + * These are set by other terminal emulators or non-standard libraries, and are + * a nuisance if one starts xterm from a shell inside one of those. + */ +static void +xtermTrimEnv(void) +{ +#define DATA(wild,name) { wild, #name } + static struct { + int wild; + const char *name; + } table[] = { + DATA(0, DEFAULT_COLORS), + DATA(0, DESKTOP_STARTUP_ID), + DATA(0, WCWIDTH_CJK_LEGACY), + DATA(0, XCURSOR_PATH), + DATA(1, COLORFGBG), + DATA(1, COLORTERM), + DATA(1, ITERM2_), + DATA(1, MC_), + DATA(1, PUTTY), + DATA(1, RXVT_), + DATA(1, URXVT_), + DATA(1, VTE_), + }; +#undef DATA + Cardinal n; + + for (n = 0; n < XtNumber(table); ++n) { + int s; + if (table[n].wild) { + size_t srclen = strlen(table[n].name); + for (s = 0; environ[s] != NULL; ++s) { + size_t dstlen = strlen(environ[s]); + if (dstlen > srclen) { + char *dstend = strchr(environ[s], '='); + char *my_var; + if (dstend != NULL && + (dstlen = (size_t) (dstend - environ[s])) >= srclen && + !strncmp(table[n].name, environ[s], dstlen) && + (my_var = x_strdup(environ[s])) != NULL) { + my_var[dstlen] = '\0'; + xtermUnsetenv(my_var); + free(my_var); + } + } + } + } else if (getenv(table[n].name) != NULL) { + xtermUnsetenv(table[n].name); + } + } +} + /* * Inits pty and tty and forks a login process. * Does not close fd Xsocket. @@ -4623,19 +4688,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) #endif xtermCopyEnv(environ); - - /* - * standards.freedesktop.org/startup-notification-spec/ - * notes that this variable is used when a "reliable" mechanism is - * not available; in practice it must be unset to avoid confusing - * GTK applications. - */ - xtermUnsetenv("DESKTOP_STARTUP_ID"); - /* - * We set this temporarily to work around poor design of Xcursor. - * Unset it here to avoid confusion. - */ - xtermUnsetenv("XCURSOR_PATH"); + xtermTrimEnv(); xtermSetenv("TERM", resource.term_name); if (!resource.term_name) @@ -5503,7 +5556,7 @@ Exit(int n) noleaks_charproc(); noleaks_ptydata(); #if OPT_GRAPHICS - noleaks_graphics(); + noleaks_graphics(dpy); #endif #if OPT_WIDE_CHARS noleaks_CharacterClass(); diff --git a/app/xterm/main.h b/app/xterm/main.h index 41cb4b243..1769dd407 100644 --- a/app/xterm/main.h +++ b/app/xterm/main.h @@ -1,7 +1,7 @@ -/* $XTermId: main.h,v 1.77 2021/08/24 09:45:41 tom Exp $ */ +/* $XTermId: main.h,v 1.80 2022/01/31 00:42:27 tom Exp $ */ /* - * Copyright 2000-2020,2021 by Thomas E. Dickey + * Copyright 2000-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -227,6 +227,10 @@ #define DEF_SCROLL_LINES 1 #endif +#ifndef DEF_SL_FORMAT +#define DEF_SL_FORMAT "%{version%} %{position%} %{unixtime%}" +#endif + #ifndef DEF_TITLE_MODES #define DEF_TITLE_MODES 0 #endif @@ -240,7 +244,7 @@ #endif #ifndef PROJECTROOT -#define PROJECTROOT "/usr/X11R6" +#define PROJECTROOT "/usr" #endif /* diff --git a/app/xterm/misc.c b/app/xterm/misc.c index 12b88ded2..89eee4880 100644 --- a/app/xterm/misc.c +++ b/app/xterm/misc.c @@ -1,7 +1,7 @@ -/* $XTermId: misc.c,v 1.1001 2021/09/19 19:49:40 tom Exp $ */ +/* $XTermId: misc.c,v 1.1015 2022/02/18 09:08:10 tom Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -1844,18 +1844,20 @@ xtermIsIconified(XtermWidget xw) &actual_format_return, &nitems_return, &bytes_after_return, - &prop_return) - && prop_return != 0 - && actual_return_type == requested_type - && actual_format_return == 32) { - unsigned long n; - for (n = 0; n < nitems_return; ++n) { - unsigned long check = (((unsigned long *) - (void *) prop_return)[n]); - if (check == is_hidden) { - result = True; - break; + &prop_return)) { + if (prop_return != 0 + && actual_return_type == requested_type + && actual_format_return == 32) { + unsigned long n; + for (n = 0; n < nitems_return; ++n) { + unsigned long check = (((unsigned long *) + (void *) prop_return)[n]); + if (check == is_hidden) { + result = True; + break; + } } + XFree(prop_return); } } } @@ -2634,7 +2636,9 @@ rgb masks (%04lx/%04lx/%04lx)\n" (vi->blue_mask != 0) && ((vi->red_mask & vi->green_mask) == 0) && ((vi->green_mask & vi->blue_mask) == 0) && - ((vi->blue_mask & vi->red_mask) == 0)); + ((vi->blue_mask & vi->red_mask) == 0) && + (vi->class == TrueColor + || vi->class == DirectColor)); if (resource.reportColors) { printf(MYFMT, MYARG); @@ -2644,6 +2648,10 @@ rgb masks (%04lx/%04lx/%04lx)\n" xw->rgb_shifts[0], xw->rgb_shifts[1], xw->rgb_shifts[2])); + TRACE(("...widths %u/%u/%u\n", + xw->rgb_widths[0], + xw->rgb_widths[1], + xw->rgb_widths[2])); } } return (xw->visInfo != 0) && (xw->numVisuals > 0) ? xw->visInfo : NULL; @@ -2740,7 +2748,6 @@ Boolean AllocOneColor(XtermWidget xw, XColor *def) { TScreen *screen = TScreenOf(xw); - XVisualInfo *visInfo; Boolean result = True; #define MaskIt(name,nn) \ @@ -2748,7 +2755,7 @@ AllocOneColor(XtermWidget xw, XColor *def) << xw->rgb_shifts[nn]) \ & xw->visInfo->name ##_mask) - if ((visInfo = getVisualInfo(xw)) != NULL && visInfo->class == TrueColor) { + if (getVisualInfo(xw) != NULL && xw->has_rgb) { def->pixel = MaskIt(red, 0) | MaskIt(green, 1) | MaskIt(blue, 2); } else { Display *dpy = screen->display; @@ -2777,16 +2784,15 @@ AllocOneColor(XtermWidget xw, XColor *def) Boolean QueryOneColor(XtermWidget xw, XColor *def) { - XVisualInfo *visInfo; Boolean result = True; #define UnMaskIt(name,nn) \ ((unsigned short)((def->pixel & xw->visInfo->name ##_mask) >> xw->rgb_shifts[nn])) #define UnMaskIt2(name,nn) \ - ((unsigned short)((UnMaskIt(name,nn) << 8) \ - |UnMaskIt(name,nn))) + (unsigned short)((((UnMaskIt(name,nn) << 8) \ + |UnMaskIt(name,nn))) << (8 - xw->rgb_widths[nn])) - if ((visInfo = getVisualInfo(xw)) != NULL && visInfo->class == TrueColor) { + if (getVisualInfo(xw) != NULL && xw->has_rgb) { /* *INDENT-EQLS* */ def->red = UnMaskIt2(red, 0); def->green = UnMaskIt2(green, 1); @@ -3205,19 +3211,48 @@ xtermClosestColor(XtermWidget xw, int find_red, int find_green, int find_blue) int getDirectColor(XtermWidget xw, int red, int green, int blue) { -#define nRGB(name,shift) \ - ((unsigned long)(name << xw->rgb_shifts[shift]) \ - & xw->visInfo->name ##_mask) - MyPixel result = (MyPixel) (nRGB(red, 0) | nRGB(green, 1) | nRGB(blue, 2)); + Pixel result = 0; + +#define getRGB(name,shift) \ + do { \ + Pixel value = (Pixel) name & 0xff; \ + if (xw->rgb_widths[shift] < 8) { \ + value >>= (int) (8 - xw->rgb_widths[shift]); \ + } \ + value <<= xw->rgb_shifts[shift]; \ + value &= xw->visInfo->name ##_mask; \ + result |= value; \ + } while (0) + + getRGB(red, 0); + getRGB(green, 1); + getRGB(blue, 2); + +#undef getRGB + return (int) result; } static void formatDirectColor(char *target, XtermWidget xw, unsigned value) { -#define fRGB(name, shift) \ - (value & xw->visInfo->name ## _mask) >> xw->rgb_shifts[shift] - sprintf(target, "%lu:%lu:%lu", fRGB(red, 0), fRGB(green, 1), fRGB(blue, 2)); + Pixel result[3]; + +#define getRGB(name, shift) \ + do { \ + result[shift] = value & xw->visInfo->name ## _mask; \ + result[shift] >>= xw->rgb_shifts[shift]; \ + if (xw->rgb_widths[shift] < 8) \ + result[shift] <<= (int) (8 - xw->rgb_widths[shift]); \ + } while(0) + + getRGB(red, 0); + getRGB(green, 1); + getRGB(blue, 2); + +#undef getRGB + + sprintf(target, "%lu:%lu:%lu", result[0], result[1], result[2]); } #endif /* OPT_DIRECT_COLOR */ @@ -3931,7 +3966,7 @@ do_osc(XtermWidget xw, Char *oscbuf, size_t len, int final) Char *cp; int state = 0; char *buf = 0; - char temp[2]; + char temp[20]; #if OPT_ISO_COLORS int ansi_colors = 0; #endif @@ -4066,11 +4101,20 @@ do_osc(XtermWidget xw, Char *oscbuf, size_t len, int final) */ if (IsEmpty(buf)) { if (need_data) { - TRACE(("do_osc found no data\n")); - return; + switch (mode) { + case 0: + case 1: + case 2: + buf = strcpy(temp, "xterm"); + break; + default: + TRACE(("do_osc found no data\n")); + return; + } + } else { + temp[0] = '\0'; + buf = temp; } - temp[0] = '\0'; - buf = temp; } else if (!need_data && !optional_data) { TRACE(("do_osc found unwanted data\n")); return; @@ -4729,7 +4773,21 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) sprintf(reply, "%d%s", ((xw->flags & IN132COLUMNS) ? 132 : 80), cp); - } else if (!strcmp(cp, "*|")) { /* DECSNLS */ + } else +#if OPT_STATUS_LINE + if (!strcmp(cp, "$}")) { /* DECSASD */ + TRACE(("reply DECSASD\n")); + sprintf(reply, "%d%s", + screen->status_active, + cp); + } else if (!strcmp(cp, "$~")) { /* DECSSDT */ + TRACE(("reply DECSASD\n")); + sprintf(reply, "%d%s", + screen->status_type, + cp); + } else +#endif + if (!strcmp(cp, "*|")) { /* DECSNLS */ TRACE(("reply DECSNLS\n")); sprintf(reply, "%d%s", screen->max_row + 1, @@ -5819,13 +5877,15 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value) &actual_format, &nitems, &bytes_after, - &prop) - && actual_type == requested_type - && actual_format == 8 - && prop != 0 - && nitems == strlen(value) - && memcmp(value, prop, nitems) == 0) { - changed = False; + &prop)) { + if (actual_type == requested_type + && actual_format == 8 + && prop != 0 + && nitems == strlen(value) + && memcmp(value, prop, nitems) == 0) { + changed = False; + } + XFree(prop); } } #endif /* OPT_SAME_NAME */ @@ -6730,19 +6790,6 @@ sortedOpts(OptionHelp * options, XrmOptionDescRec * descs, Cardinal numDescs) } else { mesg = "turn off/on"; } - if (strncmp(mesg, opt_array[j].desc, strlen(mesg))) { - if (strncmp(opt_array[j].desc, "turn ", (size_t) 5)) { - char *s = malloc(strlen(mesg) - + strlen(opt_array[j].desc) - + 2); - if (s != 0) { - sprintf(s, "%s %s", mesg, opt_array[j].desc); - opt_array[j].desc = s; - } - } else { - TRACE(("OOPS ")); - } - } TRACE(("%s: %s %s: %s (%s)\n", mesg, res_array[k].option, @@ -7407,7 +7454,7 @@ free_string(String value) /* Set tty's idea of window size, using the given file descriptor 'fd'. */ int -update_winsize(int fd, int rows, int cols, int height, int width) +update_winsize(TScreen *screen, int rows, int cols, int height, int width) { int code = -1; #ifdef TTYSIZE_STRUCT @@ -7430,8 +7477,16 @@ update_winsize(int fd, int rows, int cols, int height, int width) last_cols = cols; last_high = height; last_wide = width; +#if OPT_STATUS_LINE + if (IsStatusShown(screen)) { + ++rows; + height += FontHeight(screen); + TRACE(("... account for status-line -> %dx%d (%dx%d)\n", + rows, cols, height, width)); + } +#endif setup_winsize(ts, rows, cols, height, width); - TRACE_RC(code, SET_TTYSIZE(fd, ts)); + TRACE_RC(code, SET_TTYSIZE(screen->respond, ts)); trace_winsize(ts, "from SET_TTYSIZE"); } #endif @@ -7458,7 +7513,7 @@ xtermSetWinSize(XtermWidget xw) TScreen *screen = TScreenOf(xw); TRACE(("xtermSetWinSize\n")); - update_winsize(screen->respond, + update_winsize(screen, MaxRows(screen), MaxCols(screen), Height(screen), diff --git a/app/xterm/package/debian/changelog b/app/xterm/package/debian/changelog index 56e05dbee..05addf845 100644 --- a/app/xterm/package/debian/changelog +++ b/app/xterm/package/debian/changelog @@ -1,3 +1,21 @@ +xterm-dev (372) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Fri, 04 Mar 2022 16:37:03 -0500 + +xterm-dev (371) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Thu, 25 Nov 2021 17:42:23 -0500 + +xterm-dev (370) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Wed, 22 Sep 2021 18:23:43 -0400 + xterm-dev (369) unstable; urgency=low * maintenance updates @@ -232,12 +250,6 @@ xterm-dev (331) unstable; urgency=low -- Thomas E. Dickey Tue, 08 Aug 2017 19:08:43 -0400 -xterm-dev (331) unstable; urgency=low - - * maintenance updates - - -- Thomas E. Dickey Tue, 08 Aug 2017 19:08:43 -0400 - xterm-dev (330) unstable; urgency=low * maintenance updates diff --git a/app/xterm/package/debian/copyright b/app/xterm/package/debian/copyright index f4ece9c70..97493e07e 100644 --- a/app/xterm/package/debian/copyright +++ b/app/xterm/package/debian/copyright @@ -35,7 +35,7 @@ authorization. Files: * */* License: MIT-X11 -Copyright 1996-2020,2021 by Thomas E. Dickey +Copyright 1996-2021,2022 by Thomas E. Dickey (date ranges vary, depending on when the respective files were first changed significantly, and run through the most recent change date). diff --git a/app/xterm/package/debian/rules b/app/xterm/package/debian/rules index a0de82cc1..5dffe59c4 100644 --- a/app/xterm/package/debian/rules +++ b/app/xterm/package/debian/rules @@ -66,7 +66,6 @@ configure-stamp: --disable-imake \ --enable-dabbrev \ --enable-dec-locator \ - --enable-double-buffer \ --enable-exec-xterm \ --enable-hp-fkeys \ --enable-load-vt-fonts \ @@ -75,6 +74,7 @@ configure-stamp: --enable-mini-luit \ --enable-regis-graphics \ --enable-sco-fkeys \ + --enable-status-line \ --enable-toolbar \ --enable-xmc-glitch \ --with-app-defaults=$(PKG_APPDEFAULTS) \ diff --git a/app/xterm/package/freebsd/Makefile b/app/xterm/package/freebsd/Makefile index 54e6b2506..a301cf751 100644 --- a/app/xterm/package/freebsd/Makefile +++ b/app/xterm/package/freebsd/Makefile @@ -1,4 +1,4 @@ -# $XTermId: Makefile,v 1.90 2021/06/10 08:13:52 tom Exp $ +# $XTermId: Makefile,v 1.93 2022/03/04 21:39:26 tom Exp $ # $FreeBSD: head/x11/xterm/Makefile 492827 2019-02-13 06:43:36Z ehaupt $ # This is adapted from the FreeBSD port, installing as "xterm-dev" with @@ -7,7 +7,7 @@ # and "make makesum". PORTNAME= xterm -PORTVERSION= 369 +PORTVERSION= 372 CATEGORIES= x11 MASTER_SITES= ftp://ftp.invisible-island.net/xterm/:src1 \ https://invisible-mirror.net/archives/xterm/:src1 diff --git a/app/xterm/package/pkgsrc/Makefile b/app/xterm/package/pkgsrc/Makefile index cf24008e2..f9b7ece60 100644 --- a/app/xterm/package/pkgsrc/Makefile +++ b/app/xterm/package/pkgsrc/Makefile @@ -1,6 +1,6 @@ # $NetBSD: Makefile,v 1.117 2018/03/12 11:18:00 wiz Exp $ -DISTNAME= xterm-369 +DISTNAME= xterm-372 PKGREVISION= 1 CATEGORIES= x11 MASTER_SITES= ftp://ftp.invisible-island.net/xterm/ diff --git a/app/xterm/package/xterm.spec b/app/xterm/package/xterm.spec index e98bbd023..883482d53 100644 --- a/app/xterm/package/xterm.spec +++ b/app/xterm/package/xterm.spec @@ -1,16 +1,16 @@ -# $XTermId: xterm.spec,v 1.144 2021/06/10 08:13:52 tom Exp $ +# $XTermId: xterm.spec,v 1.149 2022/03/04 21:39:26 tom Exp $ Summary: X terminal emulator (development version) %global my_middle xterm %global my_suffix -dev %global fullname %{my_middle}%{my_suffix} %global my_class XTermDev Name: %{fullname} -Version: 369 +Version: 372 Release: 1 License: X11 Group: User Interface/X Source: xterm-%{version}.tgz -URL: ftp://ftp.invisible-island.net/xterm/ +URL: https://invisible-island.net/xterm/ Provides: x-terminal-emulator >= %{version} # This part (the build-requires) would be useful if the various distributions @@ -114,7 +114,6 @@ CPPFLAGS="-DMISC_EXP -DEXP_HTTP_HEADERS" \ --disable-imake \ --enable-dabbrev \ --enable-dec-locator \ - --enable-double-buffer \ --enable-exec-xterm \ --enable-hp-fkeys \ --enable-load-vt-fonts \ @@ -246,6 +245,9 @@ exit 0 %changelog +* Thu Feb 24 2022 Thomas E. Dickey +- double-buffer is not enabled by default + * Sat Jul 25 2020 Thomas E. Dickey - sixels are enabled by default diff --git a/app/xterm/plink.sh b/app/xterm/plink.sh index f526ce74c..045f3a23a 100644 --- a/app/xterm/plink.sh +++ b/app/xterm/plink.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: plink.sh,v 1.12 2021/01/27 00:18:09 tom Exp $ +# $XTermId: plink.sh,v 1.16 2022/02/13 14:30:17 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2001-2013,2021 by Thomas E. Dickey +# Copyright 2001-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -35,15 +35,28 @@ # Reduce the number of dynamic libraries used to link an executable. LINKIT= ASNEED=no -while test $# != 0 +NO_LTO= + +# gcc's link-time optimization is very slow - reduce usage of that. +case "$*" in +*-flto=*|-flto\ ) + NO_LTO=-fno-lto + ;; +esac + +while [ $# != 0 ] do - if test $ASNEED = no && test -n "$LINKIT" + if [ $ASNEED = no ] && [ -n "$LINKIT" ] then ASNEED=yes OPT=-Wl,-as-needed - if ( eval $LINKIT $OPT "$@" >/dev/null 2>/dev/null ) + warned=`mktemp` + trap "rm -f $warned; exit 1" 1 2 3 15 + trap "rm -f $warned" 0 + if ( eval $LINKIT $OPT $NO_LTO "$@" >"$warned" 2>&1 ) then - WARNED=`eval $LINKIT $OPT "$@" 2>&1` + WARNED=`cat "$warned"` + rm -f "$warned" case ".$WARNED" in *Warning*|*nsupported*|*nrecognized*|*nknown*) ;; @@ -52,6 +65,8 @@ do break ;; esac + else + rm -f "$warned" fi fi @@ -65,7 +80,7 @@ do ;; -l*) echo "testing if $OPT is needed" - if ( eval $LINKIT "$@" >/dev/null 2>/dev/null ) + if ( eval $LINKIT $NO_LTO "$@" >/dev/null 2>&1 ) then : echo ...no else diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h index 14100f1d5..037f4ae55 100644 --- a/app/xterm/ptyx.h +++ b/app/xterm/ptyx.h @@ -1,7 +1,7 @@ -/* $XTermId: ptyx.h,v 1.1040 2021/09/16 20:43:29 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.1060 2022/03/08 23:31:40 tom Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -776,6 +776,10 @@ typedef enum { #define OPT_SHIFT_FONTS 1 /* true if xterm interprets fontsize-shifting */ #endif +#ifndef OPT_STATUS_LINE +#define OPT_STATUS_LINE 0 /* true if xterm supports status-line controls */ +#endif + #ifndef OPT_SUNPC_KBD #define OPT_SUNPC_KBD 1 /* true if xterm supports Sun/PC keyboard map */ #endif @@ -2721,6 +2725,44 @@ typedef struct { Boolean graphics_rotated_print_mode; #endif +#define StatusLineRows 1 /* number of rows in status-line */ + +#if OPT_STATUS_LINE +#define AddStatusLineRows(nrow) nrow += StatusLineRows +#define LastRowNumber(screen) \ + ( (screen)->max_row \ + + (IsStatusShown(screen) ? StatusLineRows : 0) ) +#define FirstRowNumber(screen) \ + ( (screen)->status_active \ + ? LastRowNumber(screen) \ + : 0 ) +#define IsStatusShown(screen) \ + ( ( (screen)->status_type == 2) || \ + ( (screen)->status_type == 1) ) +#define PlusStatusLine(screen,expr) \ + ( (screen)->status_shown \ + ? (expr) + StatusLineRows \ + : (expr) ) +#define if_STATUS_LINE(screen,stmt) \ + if (IsStatusShown(screen) && (screen)->status_active) stmt + + Boolean status_timeout; /* status timeout needs service */ + Boolean status_active; /* DECSASD */ + int status_type; /* DECSSDT */ + int status_shown; /* last-displayed type */ + SavedCursor status_data[2]; + char * status_fmt; /* format for indicator-status */ + +#else /* !OPT_STATUS_LINE */ + +#define AddStatusLineRows(nrow) /* nothing */ +#define LastRowNumber(screen) (screen)->max_row +#define FirstRowNumber(screen) 0 +#define PlusStatusLine(screen,expr) (expr) +#define if_STATUS_LINE(screen,stmt) /* nothing */ + +#endif /* OPT_STATUS_LINE */ + #if OPT_VT52_MODE IFlags vt52_save_flags; Char vt52_save_curgl; @@ -3189,6 +3231,7 @@ typedef struct _Work { unsigned meta_mods; /* modifier for Meta_L or Meta_R */ #endif XtermFontNames fonts; + Boolean force_wideFont; /* true to single-step wideFont */ #if OPT_RENDERFONT Boolean render_font; unsigned max_fontsets; @@ -3317,11 +3360,12 @@ typedef struct _TekWidgetRec { /* * terminal flags - * There are actually two namespaces mixed together here. - * One is the set of flags that can go in screen->visbuf attributes - * and which must fit in a char (see OFF_ATTRS). - * The other is the global setting stored in - * term->flags and screen->save_modes. This need only fit in an unsigned. + * There are actually two namespaces mixed together here: + * a) One is the set of flags that can go in screen->visbuf attributes and + * which must fit in an IAttr (either a char or short, depending on whether + * wide-attributes are used). + * b) The other is the global setting stored in term->flags and + * screen->save_modes, which fits in an unsigned (IFlags). */ #define AttrBIT(n) xBIT(n) /* text-attributes */ diff --git a/app/xterm/resize.c b/app/xterm/resize.c index 6d7d871f9..860311ccc 100644 --- a/app/xterm/resize.c +++ b/app/xterm/resize.c @@ -1,7 +1,7 @@ -/* $XTermId: resize.c,v 1.145 2021/03/21 20:03:17 tom Exp $ */ +/* $XTermId: resize.c,v 1.148 2022/02/18 20:32:48 tom Exp $ */ /* - * Copyright 2003-2020,2021 by Thomas E. Dickey + * Copyright 2003-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -264,6 +264,13 @@ checkdigits(char *str) return (1); } +static void +unexpected_char(int c) +{ + fprintf(stderr, "%s: unknown character %#x, exiting.\r\n", myname, c); + onintr(0); +} + static void readstring(FILE *fp, char *buf, const char *str) { @@ -272,6 +279,7 @@ readstring(FILE *fp, char *buf, const char *str) /* What is the advantage of setitimer() over alarm()? */ struct itimerval it; #endif + int limit = (BUFSIZ - 3); signal(SIGALRM, resize_timeout); #if defined(USG) || defined(__minix) @@ -289,12 +297,20 @@ readstring(FILE *fp, char *buf, const char *str) *buf++ = (char) c; } if (c != *str) { - fprintf(stderr, "%s: unknown character, exiting.\r\n", myname); - onintr(0); + unexpected_char(c); } last = str[strlen(str) - 1]; - while ((*buf++ = (char) getc(fp)) != last) { - ; + while ((c = getc(fp)) != EOF) { + if (--limit <= 0) { + fprintf(stderr, "%s: unexpected response\n", myname); + onintr(0); + } + if (c < 32 || c > 126) { + unexpected_char(c); + } + *buf++ = (char) c; + if (c == last) + break; } #if defined(USG) || defined(__minix) alarm(0); diff --git a/app/xterm/run-tic.sh b/app/xterm/run-tic.sh index 343edd67d..43a544d36 100644 --- a/app/xterm/run-tic.sh +++ b/app/xterm/run-tic.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: run-tic.sh,v 1.14 2021/09/21 08:03:03 tom Exp $ +# $XTermId: run-tic.sh,v 1.15 2022/02/13 14:30:33 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2006-2020,2021 by Thomas E. Dickey +# Copyright 2006-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -61,7 +61,8 @@ then MYTEMP=${TMPDIR:-/tmp}/run-tic$$ fi mkdir -p "$MYTEMP" || failed "cannot mkdir $MYTEMP" -trap "rm -rf $MYTEMP" EXIT INT QUIT HUP TERM +trap "rm -rf $MYTEMP; exit 1" 1 2 3 15 +trap "rm -rf $MYTEMP" 0 STDERR=$MYTEMP/run-tic$$.log VER=`tic -V 2>/dev/null` diff --git a/app/xterm/screen.c b/app/xterm/screen.c index ed4234754..93e36b3b8 100644 --- a/app/xterm/screen.c +++ b/app/xterm/screen.c @@ -1,7 +1,7 @@ -/* $XTermId: screen.c,v 1.602 2021/08/22 20:30:10 tom Exp $ */ +/* $XTermId: screen.c,v 1.623 2022/03/09 01:20:09 tom Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -176,7 +176,12 @@ scrnHeadAddr(TScreen *screen, ScrnBuf base, unsigned offset) * Given a block of data, build index to it in the 'base' parameter. */ void -setupLineData(TScreen *screen, ScrnBuf base, Char *data, unsigned nrow, unsigned ncol) +setupLineData(TScreen *screen, + ScrnBuf base, + Char *data, + unsigned nrow, + unsigned ncol, + Bool bottom) { unsigned i; unsigned offset = 0; @@ -195,6 +200,13 @@ setupLineData(TScreen *screen, ScrnBuf base, Char *data, unsigned nrow, unsigned (void) screen; AlignValue(ncol); + (void) bottom; +#if OPT_STATUS_LINE + if (bottom) { + AddStatusLineRows(nrow); + } +#endif + skipNcolIAttr = (ncol * SizeofScrnPtr(attribs)); skipNcolCharData = (ncol * SizeofScrnPtr(charData)); #if OPT_ISO_COLORS @@ -230,8 +242,7 @@ setupLineData(TScreen *screen, ScrnBuf base, Char *data, unsigned nrow, unsigned #define ExtractScrnData(name) \ memcpy(dstPtrs->name, \ ((LineData *) srcPtrs)->name,\ - dstCols * sizeof(dstPtrs->name[0])); \ - nextPtr += (srcCols * sizeof(dstPtrs->name[0])) + dstCols * sizeof(dstPtrs->name[0])) /* * As part of reallocating the screen buffer when resizing, extract from @@ -266,6 +277,7 @@ allocScrnHead(TScreen *screen, unsigned nrow) unsigned size = scrnHeadSize(screen, 1); (void) screen; + AddStatusLineRows(nrow); result = (ScrnPtr *) calloc((size_t) nrow, (size_t) size); if (result == 0) SysError(ERROR_SCALLOC); @@ -313,13 +325,16 @@ sizeofScrnRow(TScreen *screen, unsigned ncol) } Char * -allocScrnData(TScreen *screen, unsigned nrow, unsigned ncol) +allocScrnData(TScreen *screen, unsigned nrow, unsigned ncol, Bool bottom) { Char *result = 0; size_t length; AlignValue(ncol); - length = ((nrow + 1) * sizeofScrnRow(screen, ncol)); + if (bottom) { + AddStatusLineRows(nrow); + } + length = (nrow * sizeofScrnRow(screen, ncol)); if (length == 0 || (result = (Char *) calloc(length, sizeof(Char))) == 0) SysError(ERROR_SCALLOC2); @@ -350,9 +365,9 @@ allocScrnBuf(XtermWidget xw, unsigned nrow, unsigned ncol, Char **addr) if (nrow != 0) { base = allocScrnHead(screen, nrow); - *addr = allocScrnData(screen, nrow, ncol); + *addr = allocScrnData(screen, nrow, ncol, True); - setupLineData(screen, base, *addr, nrow, ncol); + setupLineData(screen, base, *addr, nrow, ncol, True); } TRACE(("allocScrnBuf %dx%d ->%p\n", nrow, ncol, (void *) base)); @@ -469,7 +484,7 @@ Reallocate(XtermWidget xw, * Create the new buffer space and copy old buffer contents there, line by * line. */ - newBufData = allocScrnData(screen, nrow, ncol); + newBufData = allocScrnData(screen, nrow, ncol, True); *sbufaddr = newBufData; minrows = (oldrow < nrow) ? oldrow : nrow; @@ -480,7 +495,7 @@ Reallocate(XtermWidget xw, } } - setupLineData(screen, newBufHead, *sbufaddr, nrow, ncol); + setupLineData(screen, newBufHead, *sbufaddr, nrow, ncol, True); extractScrnData(screen, newBufHead, oldBufHead, minrows, 0); /* Now free the old data */ @@ -511,12 +526,9 @@ ReallocateBufOffsets(XtermWidget xw, unsigned old_jump = scrnHeadSize(screen, 1); unsigned new_jump; - unsigned new_ptrs = 1 + (unsigned) (screen->max_combining); unsigned dstCols = ncol; - unsigned srcCols = ncol; LineData *dstPtrs; LineData *srcPtrs; - Char *nextPtr; assert(nrow != 0); assert(ncol != 0); @@ -536,13 +548,11 @@ ReallocateBufOffsets(XtermWidget xw, new_jump = scrnHeadSize(screen, 1); newBufHead = allocScrnHead(screen, nrow); - *sbufaddr = allocScrnData(screen, nrow, ncol); - setupLineData(screen, newBufHead, *sbufaddr, nrow, ncol); + *sbufaddr = allocScrnData(screen, nrow, ncol, True); + setupLineData(screen, newBufHead, *sbufaddr, nrow, ncol, True); screen->wide_chars = False; - nextPtr = *sbufaddr; - srcPtrs = (LineData *) oldBufHead; dstPtrs = (LineData *) newBufHead; for (i = 0; i < nrow; i++) { @@ -553,7 +563,6 @@ ReallocateBufOffsets(XtermWidget xw, #endif ExtractScrnData(charData); - nextPtr += ncol * new_ptrs; srcPtrs = LineDataAddr(srcPtrs, old_jump); dstPtrs = LineDataAddr(dstPtrs, new_jump); } @@ -976,10 +985,6 @@ ScrnWriteText(XtermWidget xw, screen->last_written_row = screen->cur_row; #endif - TRACE(("text erasing cur_col=%d cur_row=%d real_width=%d\n", - screen->cur_col, - screen->cur_row, - real_width)); chararea_clear_displayed_graphics(screen, screen->cur_col, screen->cur_row, @@ -1056,11 +1061,6 @@ ScrnClearLines(XtermWidget xw, ScrnBuf sb, int where, unsigned n, unsigned size) base = ScrnBufAddr(base, jump); } - TRACE(("clear lines erasing where=%d screen->savelines=%d n=%d screen->max_col=%d\n", - where, - screen->savelines, - n, - screen->max_col)); /* FIXME: this looks wrong -- rcombs */ chararea_clear_displayed_graphics(screen, where + screen->savelines, @@ -1292,7 +1292,7 @@ void ScrnDeleteChar(XtermWidget xw, unsigned n) { #define MemMove(data) \ - for (j = col; j <= last - (int) n; ++j) \ + for (j = col; j < last - (int) n; ++j) \ data[j] = data[j + (int) n] TScreen *screen = TScreenOf(xw); @@ -1395,7 +1395,7 @@ void ShowWrapMarks(XtermWidget xw, int row, CLineData *ld) { TScreen *screen = TScreenOf(xw); - if (screen->show_wrap_marks) { + if (screen->show_wrap_marks && row >= 0 && row <= screen->max_row) { Bool set = (Bool) LineTstWrapped(ld); int y = row * FontHeight(screen) + screen->border; int x = LineCursorX(screen, ld, screen->max_col + 1); @@ -1447,6 +1447,14 @@ ScrnRefresh(XtermWidget xw, nrows, ncols, force ? " force" : "")); +#if OPT_STATUS_LINE + if (!recurse && (maxrow == screen->max_row) && IsStatusShown(screen)) { + TRACE(("...allow a row for status-line\n")); + nrows += StatusLineRows; + maxrow += StatusLineRows; + } +#endif + ++recurse; if (screen->cursorp.col >= leftcol @@ -1489,7 +1497,7 @@ ScrnRefresh(XtermWidget xw, else lastind = row - scrollamt; - if (lastind < 0 || lastind > screen->max_row) + if (lastind < 0 || lastind > LastRowNumber(screen)) continue; TRACE2(("ScrnRefresh row=%d lastind=%d ->%d\n", @@ -1797,11 +1805,12 @@ ScrnRefresh(XtermWidget xw, if (gc_changes & BG_COLOR) SGR_Background(xw, xw->cur_background); }); + (void) gc_changes; #if defined(__CYGWIN__) && defined(TIOCSWINSZ) if (first_time == 1) { first_time = 0; - update_winsize(screen->respond, nrows, ncols, xw->core.height, xw->core.width); + update_winsize(screen, nrows, ncols, xw->core.height, xw->core.width); } #endif recurse--; @@ -1860,6 +1869,72 @@ ClearBufRows(XtermWidget xw, } } +#if OPT_STATUS_LINE +static LineData * +freeLineData(TScreen *screen, LineData *source) +{ + (void) screen; + if (source != NULL) { + free(source->attribs); + free(source->charData); +#if OPT_ISO_COLORS + free(source->color); +#endif +#if OPT_WIDE_CHARS + if_OPT_WIDE_CHARS(screen, { + size_t off; + for_each_combData(off, source) { + free(source->combData[off]); + } + }); +#endif + free(source); + source = NULL; + } + return source; +} + +#define ALLOC_IT(field) \ + if (result != NULL) { \ + if ((result->field = calloc(ncol, sizeof(*result->field))) == NULL) { \ + result = freeLineData(screen, result); \ + } \ + } + +/* + * Allocate a temporary LineData structure, which is not part of the index. + */ +static LineData * +allocLineData(TScreen *screen, LineData *source) +{ + LineData *result = NULL; + Dimension ncol = (Dimension) (source->lineSize + 1); + size_t size = sizeof(*result); +#if OPT_WIDE_CHARS + size += source->combSize * sizeof(result->combData[0]); +#endif + if ((result = calloc(1, size)) != NULL) { + result->lineSize = ncol; + ALLOC_IT(attribs); +#if OPT_ISO_COLORS + ALLOC_IT(color); +#endif + ALLOC_IT(charData); +#if OPT_WIDE_CHARS + if_OPT_WIDE_CHARS(screen, { + size_t off; + for_each_combData(off, source) { + ALLOC_IT(combData[off]); + } + }); +#endif + } + return result; +} + +#undef ALLOC_IT +#endif /* OPT_STATUS_LINE */ + /* Resizes screen: 1. If new window would have fractional characters, sets window size so as to @@ -1874,9 +1949,8 @@ ClearBufRows(XtermWidget xw, 5. Sets screen->max_row and screen->max_col to reflect new size 6. Maintains the inner border (and clears the border on the screen). 7. Clears origin mode and sets scrolling region to be entire screen. - 8. Returns 0 */ -int +void ScreenResize(XtermWidget xw, int width, int height, @@ -1886,6 +1960,11 @@ ScreenResize(XtermWidget xw, int rows, cols; const int border = 2 * screen->border; int move_down_by = 0; + Boolean forced = False; + +#if OPT_STATUS_LINE + LineData *savedStatus = NULL; +#endif TRACE(("ScreenResize %dx%d border 2*%d font %dx%d\n", height, width, screen->border, @@ -1894,6 +1973,43 @@ ScreenResize(XtermWidget xw, assert(width > 0); assert(height > 0); + TRACE(("...computing rows/cols: %.2f %.2f\n", + (double) (height - border) / FontHeight(screen), + (double) (width - border - ScrollbarWidth(screen)) / FontWidth(screen))); + + rows = (height - border) / FontHeight(screen); + cols = (width - border - ScrollbarWidth(screen)) / FontWidth(screen); + if (rows < 1) + rows = 1; + if (cols < 1) + cols = 1; + +#if OPT_STATUS_LINE + TRACE(("...StatusShown %d/%d\n", IsStatusShown(screen), screen->status_shown)); + if (IsStatusShown(screen)) { + int oldRow = MaxRows(screen); + TRACE(("...status line is currently on row %d(%d-%d) vs %d\n", + oldRow, + MaxRows(screen), + (screen->status_shown ? 0 : StatusLineRows), + rows)); + if (1 || rows != oldRow) { + LineData *oldLD = getLineData(screen, oldRow); + TRACE(("...will move status-line from row %d to %d\n", + oldRow, + rows)); + savedStatus = allocLineData(screen, oldLD); + copyLineData(savedStatus, oldLD); + TRACE(("...copied::%s\n", + visibleIChars(savedStatus->charData, + savedStatus->lineSize))); + } + TRACE(("...discount a row for status-line\n")); + rows -= StatusLineRows; + height -= FontHeight(screen) * StatusLineRows; + } +#endif + if (screen->is_running) { /* clear the right and bottom internal border because of NorthWest gravity might have left junk on the right and bottom edges */ @@ -1909,19 +2025,10 @@ ScreenResize(XtermWidget xw, } } - TRACE(("...computing rows/cols: %.2f %.2f\n", - (double) (height - border) / FontHeight(screen), - (double) (width - border - ScrollbarWidth(screen)) / FontWidth(screen))); - - rows = (height - border) / FontHeight(screen); - cols = (width - border - ScrollbarWidth(screen)) / FontWidth(screen); - if (rows < 1) - rows = 1; - if (cols < 1) - cols = 1; - /* update buffers if the screen has changed size */ - if (MaxRows(screen) != rows || MaxCols(screen) != cols) { + if (forced) { + ; + } else if (MaxRows(screen) != rows || MaxCols(screen) != cols) { int delta_rows = rows - MaxRows(screen); #if OPT_TRACE int delta_cols = cols - MaxCols(screen); @@ -2085,8 +2192,15 @@ ScreenResize(XtermWidget xw, screen->fullVwin.width = width - border - screen->fullVwin.sb_info.width; scroll_displayed_graphics(xw, -move_down_by); - } else if (FullHeight(screen) == height && FullWidth(screen) == width) - return (0); /* nothing has changed at all */ + } else if (FullHeight(screen) == height && FullWidth(screen) == width) { +#if OPT_STATUS_LINE + if (savedStatus != NULL) { + TRACE(("...status line is currently saved!\n")); + freeLineData(screen, savedStatus); + } +#endif + return; /* nothing has changed at all */ + } screen->fullVwin.fullheight = (Dimension) height; screen->fullVwin.fullwidth = (Dimension) width; @@ -2119,8 +2233,19 @@ ScreenResize(XtermWidget xw, } #endif /* NO_ACTIVE_ICON */ +#if OPT_STATUS_LINE + if (savedStatus != NULL) { + int newRow = LastRowNumber(screen); + LineData *newLD = getLineData(screen, newRow); + TRACE(("...status line is currently on row %d\n", + LastRowNumber(screen))); + copyLineData(newLD, savedStatus); + freeLineData(screen, savedStatus); + } +#endif + #ifdef TTYSIZE_STRUCT - if (update_winsize(screen->respond, rows, cols, height, width) == 0) { + if (update_winsize(screen, rows, cols, height, width) == 0) { #if defined(SIGWINCH) && defined(TIOCGPGRP) if (screen->pid > 1) { int pgrp; @@ -2136,7 +2261,7 @@ ScreenResize(XtermWidget xw, #else TRACE(("ScreenResize cannot do anything to pty\n")); #endif /* TTYSIZE_STRUCT */ - return (0); + return; } /* @@ -2341,6 +2466,10 @@ ScrnFillRectangle(XtermWidget xw, } }) } + chararea_clear_displayed_graphics(screen, + left, + top, + numcols, numrows); ScrnUpdate(xw, top, left - b_left, @@ -2643,6 +2772,10 @@ ScrnWipeRectangle(XtermWidget xw, } } } + chararea_clear_displayed_graphics(screen, + left, + top, + numcols, numrows); ScrnUpdate(xw, top, left - b_left, diff --git a/app/xterm/scrollback.c b/app/xterm/scrollback.c index 6d255cf2d..6967567fe 100644 --- a/app/xterm/scrollback.c +++ b/app/xterm/scrollback.c @@ -1,7 +1,7 @@ -/* $XTermId: scrollback.c,v 1.21 2020/10/12 19:22:13 tom Exp $ */ +/* $XTermId: scrollback.c,v 1.23 2022/03/09 00:38:51 tom Exp $ */ /* - * Copyright 2009-2019,2020 by Thomas E. Dickey + * Copyright 2009-2020,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -95,10 +95,10 @@ addScrollback(TScreen *screen) } /* allocate the new data */ - block = allocScrnData(screen, 1, ncols); + block = allocScrnData(screen, 1, ncols, False); /* record the new data in the index */ - setupLineData(screen, where, (Char *) block, 1, ncols); + setupLineData(screen, where, (Char *) block, 1, ncols, False); TRACE(("...storing new FIFO data in slot %d: %p->%p\n", which, (void *) where, block)); diff --git a/app/xterm/scrollbar.c b/app/xterm/scrollbar.c index f3d5c8730..1b0a0ac2e 100644 --- a/app/xterm/scrollbar.c +++ b/app/xterm/scrollbar.c @@ -1,4 +1,4 @@ -/* $XTermId: scrollbar.c,v 1.212 2021/06/06 23:14:52 Stelios.Bounanos Exp $ */ +/* $XTermId: scrollbar.c,v 1.214 2021/12/31 23:35:02 tom Exp $ */ /* * Copyright 2000-2020,2021 by Thomas E. Dickey @@ -384,7 +384,9 @@ WindowScroll(XtermWidget xw, int top, Bool always) && !always) { if (screen->scroll_dirty) { screen->scroll_dirty = False; - ScrnRefresh(xw, 0, 0, MaxRows(screen), MaxCols(screen), False); + ScrnRefresh(xw, 0, 0, + LastRowNumber(screen) + 1, + MaxCols(screen), False); } } else #endif @@ -839,6 +841,7 @@ have_xkb(Display *dpy) (unsigned) (1 << n), &mask); TRACE((" name[%d] %s (%#x)\n", n, modStr, mask)); + XFree(modStr); } } } diff --git a/app/xterm/terminfo b/app/xterm/terminfo index 00827a50c..3b874ce76 100644 --- a/app/xterm/terminfo +++ b/app/xterm/terminfo @@ -1,10 +1,10 @@ -# $XTermId: terminfo,v 1.200 2021/09/21 20:22:27 tom Exp $ +# $XTermId: terminfo,v 1.203 2022/02/01 00:35:15 tom Exp $ # # Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color) # - Thomas E. Dickey # #------------------------------------------------------------------------------ -# Copyright 1996-2020,2021 by Thomas E. Dickey +# Copyright 1996-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -135,6 +135,7 @@ xterm-new|modern xterm terminal emulator, kcbt=\E[Z, kent=\EOM, nel=\EE, + use=dec+sl, use=ecma+index, use=xterm+keypad, use=vt420+lrmm, @@ -147,7 +148,8 @@ xterm-new|modern xterm terminal emulator, # Left/right margins are supported in xterm since patch #279 (2012/05/10) vt420+lrmm|VT420 left/right margins, - mgc=\E[?69l, smglp=\E[?69h\E[%i%p1%ds, + mgc=\E[?69l, + smglp=\E[?69h\E[%i%p1%ds, smglr=\E[?69h\E[%i%p1%d;%p2%ds, smgrp=\E[?69h\E[%i;%p1%ds, @@ -932,7 +934,9 @@ xterm+sm+1006|xterm SGR-mouse, l %;, xm=\E[<%i - %p3%d;%p1%d;%p2%d; + %p3%d; + %p1%d; + %p2%d; %? %p4 %tM @@ -954,11 +958,13 @@ xterm+x11mouse|X11 xterm mouse protocol, xm=\E[M %? %p4 - %t%p3 + %t + %p3 %e%{3} %; %'\s'%+%c - %p2%'!'%+%c%p1%'!'%+%c, + %p2%'!'%+%c + %p1%'!'%+%c, # This chunk is used for building the VT220/Sun/PC keyboard variants. xterm-basic|modern xterm terminal emulator - common, @@ -1095,7 +1101,8 @@ xterm-basic|modern xterm terminal emulator - common, %t;4 %; %? - %p1%p3%| + %p1 + %p3%| %t;7 %; %? @@ -1488,7 +1495,8 @@ xterm-bold|xterm with bold instead of underline (X Window System), %t;1 %; %? - %p1%p3%| + %p1 + %p3%| %t;7 %; m, @@ -1691,7 +1699,7 @@ xterm+nopcfkeys|fragment without PC-style fkeys, # equivalent) is provided. xterm+keypad|xterm emulating VT100/VT220 numeric keypad, - kbeg=\EOE, + kbeg=\EOE, kp5=\EOE, kpADD=\EOk, kpCMA=\EOl, @@ -1903,7 +1911,8 @@ xterm-16color|xterm with 16 colors, setab=\E[ %? %p1%{8}%< - %t%p1%{40}%+ + %t + %p1%{40}%+ %e %p1%{92}%+ %; @@ -1911,13 +1920,15 @@ xterm-16color|xterm with 16 colors, setaf=\E[ %? %p1%{8}%< - %t%p1%{30}%+ + %t + %p1%{30}%+ %e %p1%{82}%+ %; %dm, setb= - %p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa + %p1%{8}%/%{6}%*%{4}%+\E[%d + %p1%{8}%m%Pa %?%ga%{1}%= %t4 %e%ga%{3}%= @@ -1930,7 +1941,8 @@ xterm-16color|xterm with 16 colors, %; m, setf= - %p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa + %p1%{8}%/%{6}%*%{3}%+\E[%d + %p1%{8}%m%Pa %?%ga%{1}%= %t4 %e%ga%{3}%= @@ -1970,15 +1982,20 @@ xterm+256color|original xterm 256-color feature, colors#0x100, pairs#0x10000, initc=\E]4; - %p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, + %p1%d;rgb: + %p2%{255}%*%{1000}%/%2.2X/ + %p3%{255}%*%{1000}%/%2.2X/ + %p4%{255}%*%{1000}%/%2.2X\E\\, oc=\E]104\007, setab=\E[ %? %p1%{8}%< - %t4%p1%d + %t4 + %p1%d %e %p1%{16}%< - %t10%p1%{8}%-%d + %t10 + %p1%{8}%-%d %e48;5; %p1%d %; @@ -1986,10 +2003,12 @@ xterm+256color|original xterm 256-color feature, setaf=\E[ %? %p1%{8}%< - %t3%p1%d + %t3 + %p1%d %e %p1%{16}%< - %t9%p1%{8}%-%d + %t9 + %p1%{8}%-%d %e38;5; %p1%d %; @@ -2000,22 +2019,26 @@ xterm+256color2|xterm 256-color feature, setab=\E[ %? %p1%{8}%< - %t4%p1%d + %t4 + %p1%d %e %p1%{16}%< - %t10%p1%{8}%-%d - %e48\:5\: + %t10 + %p1%{8}%-%d + %e48:5: %p1%d %; m, setaf=\E[ %? %p1%{8}%< - %t3%p1%d + %t3 + %p1%d %e %p1%{16}%< - %t9%p1%{8}%-%d - %e38\:5\: + %t9 + %p1%{8}%-%d + %e38:5: %p1%d %; m, @@ -2053,17 +2076,23 @@ xterm+direct|xterm with direct-color indexing, setab=\E[ %? %p1%{8}%< - %t4%p1%d - %e48\:2\:\: - %p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d + %t4 + %p1%d + %e48:2:: + %p1%{65536}%/%d: + %p1%{256}%/%{255}%&%d: + %p1%{255}%&%d %; m, setaf=\E[ %? %p1%{8}%< - %t3%p1%d - %e38\:2\:\: - %p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d + %t3 + %p1%d + %e38:2:: + %p1%{65536}%/%d: + %p1%{256}%/%{255}%&%d: + %p1%{255}%&%d %; m, setb@, @@ -2245,7 +2274,8 @@ xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System), %t;4 %; %? - %p1%p3%| + %p1 + %p3%| %t;7 %; %? @@ -2473,7 +2503,8 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), %t;4 %; %? - %p1%p3%| + %p1 + %p3%| %t;7 %; %? @@ -2736,6 +2767,14 @@ xterm-r5|xterm R5 version, u8=\E[?1;2c, u9=\E[c, use=xterm+kbs, + +# DEC status-line is an extension for VT220, and standard with VT320 and up. +dec+sl|DEC VTxx status line, + eslok, + hs, + dsl=\E[1$~, + fsl=\E[0$}, + tsl=\E[2$~\E[1$}\E[%i%p1%d`, # # # Customization begins here. diff --git a/app/xterm/trace.c b/app/xterm/trace.c index 377faede1..bdbde61a2 100644 --- a/app/xterm/trace.c +++ b/app/xterm/trace.c @@ -1,7 +1,7 @@ -/* $XTermId: trace.c,v 1.234 2021/09/14 20:09:56 tom Exp $ */ +/* $XTermId: trace.c,v 1.236 2022/02/18 08:48:47 tom Exp $ */ /* - * Copyright 1997-2020,2021 by Thomas E. Dickey + * Copyright 1997-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -91,38 +91,44 @@ TraceOpen(void) if (!trace_fp) { static char dot[] = "."; mode_t oldmask = umask(077); + char *home; + char *name; /* * Put the trace-file in user's home-directory if the current * directory is not writable. */ - char *home = (access(dot, R_OK | W_OK) == 0) ? dot : getenv("HOME"); - char *name = malloc(strlen(home) + strlen(trace_who) + 50); + home = ((access(dot, R_OK | W_OK) == 0) + ? dot + : getenv("HOME")); + if (home != NULL && + (name = malloc(strlen(home) + strlen(trace_who) + 50)) != NULL) { #if OPT_TRACE_UNIQUE /* usually I do not want unique names */ - int unique; - for (unique = 0;; ++unique) { - if (unique) - sprintf(name, "%s/Trace-%s.out-%d", home, trace_who, unique); - else - sprintf(name, "%s/Trace-%s.out", home, trace_who); - if ((trace_fp = fopen(name, "r")) == 0) { - break; + int unique; + for (unique = 0;; ++unique) { + if (unique) + sprintf(name, "%s/Trace-%s.out-%d", home, trace_who, unique); + else + sprintf(name, "%s/Trace-%s.out", home, trace_who); + if ((trace_fp = fopen(name, "r")) == 0) { + break; + } + fclose(trace_fp); } - fclose(trace_fp); - } #else - sprintf(name, "%s/Trace-%s.out", home, trace_who); + sprintf(name, "%s/Trace-%s.out", home, trace_who); #endif - trace_fp = fopen(name, "w"); - if (trace_fp != 0) { - fprintf(trace_fp, "%s\n", xtermVersion()); - TraceIds(NULL, 0); + trace_fp = fopen(name, "w"); + if (trace_fp != 0) { + fprintf(trace_fp, "%s\n", xtermVersion()); + TraceIds(NULL, 0); + } + if (!trace_fp) { + xtermWarning("Cannot open \"%s\"\n", name); + exit(EXIT_FAILURE); + } + (void) umask(oldmask); + free(name); } - if (!trace_fp) { - xtermWarning("Cannot open \"%s\"\n", name); - exit(EXIT_FAILURE); - } - (void) umask(oldmask); - free(name); } return trace_fp; } @@ -658,7 +664,7 @@ TraceScreen(XtermWidget xw, int whichBuf) int row; TRACE(("TraceScreen %d:\n", whichBuf)); - for (row = 0; row <= screen->max_row; ++row) { + for (row = 0; row <= LastRowNumber(screen); ++row) { LineData *ld = getLineData(screen, row); TRACE((" %3d:", row)); diff --git a/app/xterm/trace.h b/app/xterm/trace.h index 2d1b70f35..224bd6c16 100644 --- a/app/xterm/trace.h +++ b/app/xterm/trace.h @@ -1,7 +1,7 @@ -/* $XTermId: trace.h,v 1.92 2021/02/01 23:58:05 tom Exp $ */ +/* $XTermId: trace.h,v 1.93 2022/02/21 22:54:05 tom Exp $ */ /* - * Copyright 1997-2020,2021 by Thomas E. Dickey + * Copyright 1997-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -47,6 +47,9 @@ extern void Trace ( const char *, ... ) GCC_PRINTFLIKE(1,2); extern void TraceVA ( const char *fmt, va_list ap ); extern void TraceXError (Display *d, XErrorEvent *ev); +#undef if_TRACE +#define if_TRACE(stmt) stmt + #undef TRACE #define TRACE(p) Trace p @@ -165,6 +168,7 @@ extern const char * ModifierName(unsigned /* modifier */); (Dimension) (reqwide), (Dimension) (reqhigh), \ (gotwide), (gothigh)) +#define if_TRACE(stmt) /*nothing*/ #define TRACE(p) /*nothing*/ #define TRACE_CLOSE() /*nothing*/ #define TRACE_ARGV(tag,argv) /*nothing*/ diff --git a/app/xterm/util.c b/app/xterm/util.c index 2cc80bda1..b5e43debd 100644 --- a/app/xterm/util.c +++ b/app/xterm/util.c @@ -1,7 +1,7 @@ -/* $XTermId: util.c,v 1.887 2021/09/19 18:22:57 tom Exp $ */ +/* $XTermId: util.c,v 1.898 2022/03/08 00:48:22 tom Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -356,7 +356,7 @@ AddToVisible(XtermWidget xw) TScreen *screen = TScreenOf(xw); Bool result = False; - if (INX2ROW(screen, screen->cur_row) <= screen->max_row) { + if (INX2ROW(screen, screen->cur_row) <= LastRowNumber(screen)) { if (!AddToRefresh(xw)) { result = True; } @@ -1114,7 +1114,8 @@ WriteText(XtermWidget xw, IChar *str, Cardinal len) cells = (unsigned) (MaxCols(screen) - screen->cur_col); } - if (ScrnHaveSelection(screen) + if (screen->cur_row <= screen->max_row + && ScrnHaveSelection(screen) && ScrnIsRowInSelection(screen, INX2ROW(screen, screen->cur_row))) { ScrnDisownSelection(xw); } @@ -1201,7 +1202,10 @@ WriteText(XtermWidget xw, IChar *str, Cardinal len) ScrnWriteText(xw, str, attr_flags, fg_bg, len); CursorForward(xw, (int) cells); - setZIconBeep(xw); + + if (screen->cur_row <= screen->max_row) { + setZIconBeep(xw); + } return; } @@ -1849,7 +1853,7 @@ ClearLeft(XtermWidget xw) /* * Erase the cursor's line. */ -static void +void ClearLine(XtermWidget xw) { TScreen *screen = TScreenOf(xw); @@ -2046,15 +2050,15 @@ static void do_extra_scroll(XtermWidget xw, Bool trimmed) { TScreen *screen = TScreenOf(xw); - int row; if (screen_has_data(xw)) { TRACE(("do_extra_scroll buffer=%d, trimmed=%s\n", screen->whichBuf, BtoS(trimmed))); if (trimmed) { - Boolean hadData = ((screen->saved_fifo > 0) - ? row_has_data(screen, -1) - : False); + int row; + Boolean hadData = (Boolean) ((screen->saved_fifo > 0) + ? row_has_data(screen, -1) + : False); for (row = 0; row < screen->max_row; ++row) { Boolean hasData = row_has_data(screen, row); @@ -2476,10 +2480,10 @@ handle_translated_exposure(XtermWidget xw, y0 = (rect_y - OriginY(screen)); y1 = (y0 + rect_height); - if ((x0 < 0 || - y0 < 0 || - x1 > Width(screen) || - y1 > Height(screen))) { + if (x0 < 0 || + y0 < 0 || + x1 > Width(screen) || + y1 > PlusStatusLine(screen, Height(screen))) { set_background(xw, -1); xtermClear2(xw, rect_x, @@ -2502,8 +2506,8 @@ handle_translated_exposure(XtermWidget xw, nrows += toprow; toprow = 0; } - if (toprow + nrows > MaxRows(screen)) - nrows = MaxRows(screen) - toprow; + if (toprow + nrows > PlusStatusLine(screen, MaxRows(screen))) + nrows = PlusStatusLine(screen, MaxRows(screen)) - toprow; if (leftcol + ncols > MaxCols(screen)) ncols = MaxCols(screen) - leftcol; @@ -2679,7 +2683,7 @@ xtermRepaint(XtermWidget xw) TRACE(("xtermRepaint\n")); xtermClear(xw); - ScrnRefresh(xw, 0, 0, MaxRows(screen), MaxCols(screen), True); + ScrnRefresh(xw, 0, 0, LastRowNumber(screen) + 1, MaxCols(screen), True); } /***====================================================================***/ @@ -2922,6 +2926,7 @@ getXftColor(XtermWidget xw, Pixel pixel) XColor color; Boolean found = False; + (void) xw; oldest_use = XFT_CACHE_LIMIT; oldest = 0; if (latest_use == XFT_CACHE_LIMIT) { @@ -3765,10 +3770,15 @@ drawXtermText(XTermDraw * params, * screen->fnt_wide); Bool did_ul = False; XTermFonts *curFont; + #if OPT_WIDE_ATTRS int need_clipping = 0; #endif +#if OPT_WIDE_CHARS + Bool need_wide; +#endif + #if OPT_WIDE_CHARS if (text == 0) return 0; @@ -3941,6 +3951,8 @@ drawXtermText(XTermDraw * params, #if OPT_RENDERWIDE wfont = getWideXftFont(&recur, recur.attr_flags); wfont0 = IS_BOLD ? getWideXftFont(&recur, NOT_BOLD) : wfont; + + (void) wfont0; #endif #define GET_XFT_FG() getXftColor(recur.xw, values.foreground) @@ -4218,6 +4230,7 @@ drawXtermText(XTermDraw * params, && !(recur.draw_flags & NOTRANSLATION) && (!screen->fnt_boxes || (FontIsIncomplete(curFont) && !screen->assume_all_chars) + || recur.xw->work.force_wideFont || screen->force_box_chars)) { /* * Fill in missing box-characters. Find regions without missing @@ -4302,6 +4315,22 @@ drawXtermText(XTermDraw * params, x += (ch_width * FontWidth(screen)); first = last + 1; drewBoxes = True; + } else if (ch_width == 2 + && recur.xw->work.force_wideFont + && !(recur.draw_flags & NOTRANSLATION)) { + XTermDraw param2 = recur; + param2.draw_flags |= NOTRANSLATION; + /* + * Not a "box" character, but a special case treated similarly. + */ + (void) drawXtermText(¶m2, + gc, + x, y, + text + first, + (unsigned) (1 + last - first)); + x += (ch_width * FontWidth(screen)); + first = last + 1; + drewBoxes = True; } } if (last <= first) { @@ -4346,7 +4375,19 @@ drawXtermText(XTermDraw * params, #if OPT_WIDE_CHARS + need_wide = False; if (screen->wide_chars || screen->unicode_font) { + int src; + for (src = 0; src < (int) len; src++) { + IChar ch = text[src]; + if (ch > 0xff) { + need_wide = True; + break; + } + } + } + + if (need_wide) { XChar2b *buffer; Bool needWide = False; int src, dst; @@ -4431,6 +4472,7 @@ drawXtermText(XTermDraw * params, XTermFonts *bold = 0; Bool noBold, noNorm; + (void) norm; if (needWide && okFont(BoldWFont(screen))) { norm = WhichVFontData(screen, fWide); bold = WhichVFontData(screen, fWBold); @@ -4970,7 +5012,7 @@ ClearCurBackground(XtermWidget xw, assert((int) width > 0); assert((left + (int) width) <= screen->max_col + 1); - assert((int) height <= screen->max_row + 1); + assert((int) (height + top) <= screen->max_row + 1); if (VWindow(screen)) { set_background(xw, xw->cur_background); diff --git a/app/xterm/version.h b/app/xterm/version.h index cf303f275..8a8726efc 100644 --- a/app/xterm/version.h +++ b/app/xterm/version.h @@ -1,7 +1,7 @@ -/* $XTermId: version.h,v 1.516 2021/09/21 23:46:34 tom Exp $ */ +/* $XTermId: version.h,v 1.522 2022/03/10 00:58:00 tom Exp $ */ /* - * Copyright 1998-2020,2021 by Thomas E. Dickey + * Copyright 1998-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -38,8 +38,8 @@ * version of X to which this version of xterm has been built. The resulting * number in parentheses is my patch number (Thomas E. Dickey). */ -#define XTERM_PATCH 369 -#define XTERM_DATE 2021-09-21 +#define XTERM_PATCH 372 +#define XTERM_DATE 2022-03-09 #ifndef __vendorversion__ #define __vendorversion__ "XTerm/OpenBSD" diff --git a/app/xterm/vttests/16colors.sh b/app/xterm/vttests/16colors.sh index cb6fd7cab..6654f9c86 100644 --- a/app/xterm/vttests/16colors.sh +++ b/app/xterm/vttests/16colors.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: 16colors.sh,v 1.19 2021/03/03 01:15:53 tom Exp $ +# $XTermId: 16colors.sh,v 1.20 2022/02/13 14:33:35 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2011,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -58,12 +58,8 @@ for verb in "printf" "print" ; do done rm -f $TMP -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD "${CSI}0m"; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD "${CSI}0m"; exit' 0 1 2 3 15 -fi +trap '$CMD "${CSI}0m"; exit 1' 1 2 3 15 +trap '$CMD "${CSI}0m"' 0 echo "${CSI}0m" while true diff --git a/app/xterm/vttests/8colors.sh b/app/xterm/vttests/8colors.sh index c7cbfd4c9..af8b7d0e2 100644 --- a/app/xterm/vttests/8colors.sh +++ b/app/xterm/vttests/8colors.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: 8colors.sh,v 1.19 2021/03/03 01:16:53 tom Exp $ +# $XTermId: 8colors.sh,v 1.21 2022/02/13 14:42:02 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2011,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -55,12 +55,8 @@ for verb in "printf" "print" ; do done rm -f $TMP -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "${CSI}0m"; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "${CSI}0m"; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "${CSI}0m"; exit 1' 1 2 3 15 +trap '$CMD $OPT "${CSI}0m"' 0 echo "${CSI}0m" while true diff --git a/app/xterm/vttests/acolors.sh b/app/xterm/vttests/acolors.sh index 7b810868f..bcda9a3ac 100644 --- a/app/xterm/vttests/acolors.sh +++ b/app/xterm/vttests/acolors.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: acolors.sh,v 1.12 2021/03/03 01:16:53 tom Exp $ +# $XTermId: acolors.sh,v 1.13 2022/02/13 14:34:17 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2002-2011,2021 by Thomas E. Dickey +# Copyright 2002-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -66,12 +66,8 @@ read original stty $old original=${original}${SUF} -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 echo "${CSI}0;1;34mThis message is BLUE" echo "${CSI}0;1;31mThis message is RED ${CSI}0;31m(sometimes)" diff --git a/app/xterm/vttests/acs.pl b/app/xterm/vttests/acs.pl new file mode 100644 index 000000000..d2e76a62a --- /dev/null +++ b/app/xterm/vttests/acs.pl @@ -0,0 +1,77 @@ +#!/usr/bin/env perl +# $XTermId: acs.pl,v 1.3 2018/04/22 15:14:45 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2018 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Assuming at least 24x80, print an array of the printable characters and their +# mapping to alternate character-set. This also requires cursor-addressing. + +use strict; +use warnings; +use diagnostics; + +sub failed() { + my $args = shift; + printf STDERR "? %s\n", $args; + exit 1; +} + +sub need() { + my $cap = shift; + my $check = `tput $cap 0 0`; + chomp $check; + &failed("missing capability: $cap") if ( $check eq "" ); +} + +&need("cup"); +&need("clear"); +&need("smacs"); +&need("rmacs"); + +system("tput clear"); +system("tput enacs"); +my $smacs = `tput smacs`; +my $rmacs = `tput rmacs`; + +for my $row ( 0 .. 15 ) { + for my $col ( 0 .. 5 ) { + my $ch = 32 + $row + $col * 16; + last if ( $ch >= 127 ); + system( sprintf( "tput cup %d %d", $row, 4 + $col * 12 ) ); + my $xx = chr($ch); + printf '%2x:%s{%s%s%s}', $ch, $xx, $smacs, $xx . $xx . $xx . $xx, + $rmacs; + } +} + +printf "\n"; + +1; diff --git a/app/xterm/vttests/altchars.sh b/app/xterm/vttests/altchars.sh new file mode 100644 index 000000000..a849c6d38 --- /dev/null +++ b/app/xterm/vttests/altchars.sh @@ -0,0 +1,62 @@ +#!/bin/sh +# $XTermId: altchars.sh,v 1.4 2020/10/29 00:32:02 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2020 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +echo +tput enacs +tput smacs +#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */ +#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */ +#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */ +#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */ +#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */ +#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */ +#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */ +#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */ +#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */ +#define ACS_VLINE NCURSES_ACS('x') /* vertical line */ +#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */ +cat <<'EOF' +XlqqqqwqqqqwqqqqwqqqqkX +XxaaaaxaaaaxaaaaxaaaaxX +XtqqqqnqqqqnqqqqnqqqquX +XxaaaaxaaaaxaaaaxaaaaxX +XmqqqqvqqqqvqqqqvqqqqjX + +X _`abcdefghijklmn X +X opqrstuvwxyz{|}~ X +X ................ X +EOF +tput rmacs +cat <<'EOF' ++----+----+----+----+ +EOF diff --git a/app/xterm/vttests/blink.pl b/app/xterm/vttests/blink.pl new file mode 100644 index 000000000..f4def18de --- /dev/null +++ b/app/xterm/vttests/blink.pl @@ -0,0 +1,138 @@ +#!/usr/bin/env perl +# $XTermId: blink.pl,v 1.2 2007/07/13 00:28:38 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2007 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Write a test pattern which includes some blinking text in scattered +# locations, to test scrollback of blinking text. +use strict; + +use Getopt::Std; + +our ($opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_width); + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = $_[0]; + if (defined($opt_w)) { + # 0,1,1,2,2,3,3,... + $value = (($value + 1) / 2) % length($test_string); + } else { + $value %= length($test_string); + } + return $value; +} + +# vary the length of each line from $term_width - 5 to $term_width + 5, then +# double it, and then repeat. That's 22/cycle. +sub length_of($) { + my $value = $_[0]; + my $cycle = $value % 22; + if ( $cycle < 11 ) { + $value = $term_width; + } else { + $value = $term_width * 2; + $cycle /= 2; + } + return $value + $cycle - 5; +} + +# write the text for the given line-number +sub testit($) { + my $number = $_[0]; + my $length = length_of($number); + if ( defined($opt_n) ) { + printf "%5d ", $number % 99999; + $length -= 6; + } + # if we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + my $starts = starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ($number % 2 ) != 0); + $length = ($length + (($number + 1) % 2)) / 2; + } + my $string = substr($test_string, $starts); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s\n", $string; +} + +sub main::HELP_MESSAGE() { + printf STDERR <bounce${LOG}.log + LOG=`expr $LOG + 1` +} + +[ -n "$WINDOWID" ] && rm -f bounce*.log + +printf 'Hello ...\n' +logit + +printf '\033[2t' +logit + +printf '\033[1t' +logit + +printf 'World!\n' +logit + +[ -n "$WINDOWID" ] && ls -l bounce*.log diff --git a/app/xterm/vttests/ctlpix.sh b/app/xterm/vttests/ctlpix.sh new file mode 100644 index 000000000..1bfa37f55 --- /dev/null +++ b/app/xterm/vttests/ctlpix.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# $XTermId: ctlpix.sh,v 1.2 2019/05/02 22:02:06 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2019 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +clear +lo=9216 +hi=9232 +for n in `seq $lo $hi` +do + vxt-utf8 $n +done +vxt-altchars diff --git a/app/xterm/vttests/cursor.pl b/app/xterm/vttests/cursor.pl new file mode 100644 index 000000000..c74760df2 --- /dev/null +++ b/app/xterm/vttests/cursor.pl @@ -0,0 +1,184 @@ +#!/usr/bin/env perl +# $XTermId: cursor.pl,v 1.8 2007/12/03 00:56:29 tom Exp $ +# ----------------------------------------------------------------------------- +# Copyright 2007 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Read a file (or pipe from a program) and move the cursor around the screen +# in response to h,j,k,l commands so we can see the colors that affect the +# cursor. Exit on 'q'. Do forward/backward paging to \E[J markers +# in the data with n,p. Ignore other characters. +# +# Use this rather than, say, a curses program since it is much easier to +# construct a particular screen using 'script' or echo commands than to +# guarantee the same screen with curses' optimization. + +use strict; + +use Getopt::Std; +use IO::Handle; + +our ( $opt_x ); +our ( $row_max, $col_max ); +our $old_stty; +our $text_blob; +our $text_1st; +our $text_2nd; +our $text_chop = qw/^\x1b\[H\x1b\[J/; +our $text_mark = "\x1b[H\x1b[J"; + +sub get_screensize() { + my @reply = `resize -u`; + chomp @reply; + for my $n (0..$#reply) { + if ( $reply[$n] =~ /=/ ) { + my $value = $reply[$n]; + $value =~ s/^.*=//; + if ( $reply[$n] =~ /^COLUMNS.*/ ) { + $col_max = $value; + } else { + $row_max = $value; + } + } + } +} + +sub end_cursor($) { + close TTY; + system "stty $old_stty"; + print $_[0]; + exit; +} + +sub begin_cursor() { + open TTY, "+; + # printf "get_char\r\n"; + } while (not defined $reply); + return $reply; +} + +sub move_to($$) { + my $y = $_[0]; + my $x = $_[1]; + if ( $y < 0 ) { + $y = 0; + } elsif ( $x < 0 ) { + $x = 0; + } elsif ( $y >= $row_max ) { + $y -= 1; + } elsif ( $x >= $col_max ) { + $x -= 1; + } else { + printf "\x1b[%d;%dH", $y + 1, $x + 1; + } + return ( $y, $x ); +} + +sub vxt_cursor() { + my $ch; + my $x = 0; + my $y = 0; + my @pages = split $text_chop, $text_blob; + my $page = 1; + +my_page: + move_to ($y, $x); + printf "%s", $text_mark . $pages[$page]; + move_to ($y, $x); +my_loop: + for (;;) { + $ch = get_char(); + if ( $ch eq "q") { + last my_loop; + } elsif ( $ch eq "h" ) { + ($y, $x) = move_to($y, $x - 1); + } elsif ( $ch eq "j" ) { + ($y, $x) = move_to($y + 1, $x); + } elsif ( $ch eq "k" ) { + ($y, $x) = move_to($y - 1, $x); + } elsif ( $ch eq "l" ) { + ($y, $x) = move_to($y, $x + 1); + } elsif ( $ch eq "n" ) { + if ( $page < $#pages ) { + $page += 1; + goto my_page; + } else { + beep(); + } + } elsif ( $ch eq "p" ) { + if ( $page > 1 ) { + $page -= 1; + goto my_page; + } else { + beep(); + } + } else { + beep(); + # printf "got:%s\r\n", $ch; + } + } +} + +sub load_text($) { + my $source = $_[0]; + my $text; + if ( defined($opt_x) ) { + $text = `$source`; + } else { + $text = `cat $source`; + } + $text =~ s/\n/\r\n/g; + if ( $text !~ $text_chop ) { + $text = $text_mark . $text; + } + $text_blob = $text_blob . $text; +} + +&getopts('x') || die(); + +while ( $#ARGV >= 0 ) { + load_text ( shift @ARGV ); +} + +get_screensize(); +begin_cursor(); +vxt_cursor(); +end_cursor("Done\n"); diff --git a/app/xterm/vttests/decsed.pl b/app/xterm/vttests/decsed.pl new file mode 100644 index 000000000..8adf3f5e8 --- /dev/null +++ b/app/xterm/vttests/decsed.pl @@ -0,0 +1,160 @@ +#!/usr/bin/env perl +# $XTermId: decsed.pl,v 1.6 2015/02/22 01:37:20 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2015 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Exercise DECSED (erase display) with or without DECSCA (protect against +# DECSED). +use strict; + +use Getopt::Std; + +our ( $opt_c, $opt_n, $opt_p, $opt_w ); +our ( $lineno, $test_string, $term_wide, $term_high ); + +sub move($$) { + my $y = shift; + my $x = shift; + printf "\x1b[%d;%dH", $y, $x; +} + +sub protect($) { + my $code = shift; + printf "\x1b[%d\"q", $code; +} + +sub set_color($) { + my $code = shift; + if ( $code == 1 ) { + printf "\x1b[0;36;44m"; # cyan-on-blue + } + else { + printf "\x1b[0;39;49m"; + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack( + "U*", + map { + ( $_ <= 32 || $_ > 127 ) # if non-ASCII character... + ? 32 # ...just show a blank + : ( 0xff00 + ( $_ - 32 ) ) # map to "Fullwidth Form" + } unpack( "C*", $value ) + ); # unpack unsigned-char characters +} + +# write the text for the given line-number +sub fill_line($$) { + my $number = shift; + my $offset = shift; + my $length = $opt_w ? ( $term_wide / 2 ) : $term_wide; + my $actual; + my $margin = 0; + $actual = $length; + my $string = $test_string; + while ( ( $opt_w ? ( 2 * length($string) ) : length($string) ) < + ( $offset + $length ) ) + { + $string = $string . $test_string; + } + $string = substr( $string, $offset, $length ); + $string = double_cells($string) if ($opt_w); + printf "%s", $string; + + printf "\n"; + return ++$offset; +} + +sub main::HELP_MESSAGE() { + printf STDERR <= 0 ) ? $ARGV[0] : 2; +my $parm_ycoord = ( $#ARGV >= 1 ) ? $ARGV[1] : $term_high / 2; +my $parm_xcoord = ( $#ARGV >= 2 ) ? $ARGV[2] : $term_wide / 2; + +binmode( STDOUT, ":utf8" ); +&protect(1) if ($opt_p); +&set_color(1) if ($opt_c); +if ( $opt_n or $opt_w ) { + my $offset = 0; + for ( $lineno = 0 ; $lineno < $term_high - 1 ; ++$lineno ) { + $offset = &fill_line( $lineno, $offset ); + } +} +else { + printf "\x1b#8"; # DECALN +} +&move( $parm_ycoord, $parm_xcoord ); +printf '*'; +&move( $parm_ycoord, $parm_xcoord ); +printf "\x1b[?%dJ", $parm_DECSED; +if ( $parm_DECSED == 0 ) { + &move( $parm_ycoord + 1, $parm_xcoord ); +} +elsif ( $parm_DECSED == 1 ) { + &move( $parm_ycoord - 1, $parm_xcoord ); +} +&set_color(0) if ($opt_c); +&protect(0) if ($opt_p); + +exit; diff --git a/app/xterm/vttests/dl.sh b/app/xterm/vttests/dl.sh new file mode 100644 index 000000000..5181b673f --- /dev/null +++ b/app/xterm/vttests/dl.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# $XTermId: dl.sh,v 1.2 2019/11/18 10:13:03 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2019 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +start_test() { + printf '\033[H\033[2J' + printf 'First line\nSecond line\nThird line\nLast line!\n' +} + +actual_test() { + printf '\033[2;8H' + printf '\033[1M' + printf '*' +} + +set_margins() { + printf '\033[?69h' + printf '\033[4;40s' +} + +reset_margins() { + printf '\033[?69l' +} + +finish_test() { + printf '\033[10;1H' + read -p "$*" +} + +start_test +actual_test +finish_test NEXT + +start_test +set_margins +actual_test +reset_margins +finish_test DONE diff --git a/app/xterm/vttests/doublechars.sh b/app/xterm/vttests/doublechars.sh index ba14a1059..74aa9efe9 100644 --- a/app/xterm/vttests/doublechars.sh +++ b/app/xterm/vttests/doublechars.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: doublechars.sh,v 1.21 2021/03/03 01:16:53 tom Exp $ +# $XTermId: doublechars.sh,v 1.22 2022/02/13 14:34:47 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2011,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -85,12 +85,8 @@ if test $SAVE = yes ; then wide=`echo "$wide"|sed -e 's/t.*//'` original=${CSI}8\;${high}\;${wide}t${SUF} - if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null - then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM - else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 - fi + trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 + trap '$CMD $OPT "$original" >/dev/tty' 0 fi diff --git a/app/xterm/vttests/dynamic.sh b/app/xterm/vttests/dynamic.sh index 335f36692..a352852fd 100644 --- a/app/xterm/vttests/dynamic.sh +++ b/app/xterm/vttests/dynamic.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: dynamic.sh,v 1.21 2021/03/03 01:16:53 tom Exp $ +# $XTermId: dynamic.sh,v 1.22 2022/02/13 14:35:09 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2011,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -67,12 +67,8 @@ read original stty $old original=${original}${SUF} -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 while true do diff --git a/app/xterm/vttests/dynamic2.sh b/app/xterm/vttests/dynamic2.sh index 6c636721b..708373f35 100644 --- a/app/xterm/vttests/dynamic2.sh +++ b/app/xterm/vttests/dynamic2.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: dynamic2.sh,v 1.7 2021/03/03 01:16:53 tom Exp $ +# $XTermId: dynamic2.sh,v 1.8 2022/02/13 14:35:30 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2006-2011,2021 by Thomas E. Dickey +# Copyright 2006-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -75,12 +75,8 @@ do done stty $old -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 while true do diff --git a/app/xterm/vttests/erase.pl b/app/xterm/vttests/erase.pl new file mode 100644 index 000000000..911cbc521 --- /dev/null +++ b/app/xterm/vttests/erase.pl @@ -0,0 +1,169 @@ +#!/usr/bin/env perl +# $XTermId: erase.pl,v 1.4 2007/07/18 21:15:08 tom Exp $ +# ----------------------------------------------------------------------------- +# Copyright 2007 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Generate a test-pattern, erasing parts of the text on each line. +# The test-pattern optionally includes double-width or other characters +# encoded in UTF-8. +use strict; + +use Getopt::Std; + +our ($opt_c, $opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_width, $term_height); + +sub set_color($) { + my $code = $_[0]; + if (defined($opt_c)) { + if ($code == 3) { + printf "\x1b[1;33;42m"; # yellow-on-green + } elsif ($code == 2) { + printf "\x1b[0;31;45m"; # red-on-magenta + } elsif ($code == 1) { + printf "\x1b[0;36;44m"; # cyan-on-blue + } else { + printf "\x1b[0;39;49m"; + } + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +sub erase_left() { + set_color(2); + printf "\x1b[1K"; + set_color(1); +} + +sub erase_right() { + set_color(2); + printf "\x1b[0K"; + set_color(1); +} + +sub erase_middle($) { + set_color(3); + printf "\x1b[%dX", $_[0]; + set_color(1); +} + +sub move_to($) { + printf "\x1b[%dG", $_[0] + 1; +} + +# write the text for the given line-number +sub testit($) { + my $number = $_[0]; + my $length = $term_width; + my $actual; + my $margin = 0; + if ( defined($opt_n) ) { + $margin = 6; + move_to($margin); + $length -= $margin; + } + $actual = $length; + if (defined($opt_c)) { + set_color(1); + erase_right(); + } + if ( defined($opt_w) ) { + $length /= 2; + } + my $string = $test_string; + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s", $string; + + move_to($margin + ($number % ($actual / 3))); + erase_left(); + + move_to($margin + ((2 * $actual) / 3) + ($number % ($actual / 3))); + erase_right(); + + move_to($margin + ((1 * $actual) / 3) + ($number % ($actual / 3))); + erase_middle($actual / 10); + + set_color(0); + if ( defined($opt_n) ) { + move_to(0); + printf "%5d ", $number % 99999; + } + printf "\n"; +} + +sub main::HELP_MESSAGE() { + printf STDERR </dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 F=1 D=1 diff --git a/app/xterm/vttests/halves.pl b/app/xterm/vttests/halves.pl new file mode 100644 index 000000000..f8fd99352 --- /dev/null +++ b/app/xterm/vttests/halves.pl @@ -0,0 +1,195 @@ +#!/usr/bin/env perl +# $XTermId: halves.pl,v 1.6 2007/07/18 01:24:37 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2007 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Draw a grid of characters (optionally double-width) and modify it using +# overstrike, insert- and delete-characters to see if the double-width +# characters are completely cleared when "partly" modified. +use strict; + +use Getopt::Std; + +our ($opt_c, $opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_width); + +# returns the number of columns in the screen +sub screen_width() { + my $data = `resize -u |fgrep COLUMNS=`; + $data =~ s/COLUMNS=//; + $data =~ s/;//; + return $data +} + +sub set_color($) { + my $code = $_[0]; + if (defined($opt_c)) { + if ($code == 3) { + printf "\x1b[1;33;42m"; # yellow-on-green + } elsif ($code == 2) { + printf "\x1b[0;31;45m"; # red-on-magenta + } elsif ($code == 1) { + printf "\x1b[0;36;44m"; # cyan-on-blue + } else { + printf "\x1b[0;39;49m"; + } + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +sub move_to($) { + printf "\x1b[%dG", $_[0] + 1; +} + +sub delete_char() { + set_color(2); + printf "\x1b[%dP", 1; + set_color(1); +} + +sub insert_once($) { + set_color(2); + printf "\x1b[%d@%s", length($_[0]); + write_chars($_[0]); +} + +sub insert_mode($) { + set_color(2); + printf "\x1b[%dP", length($_[0]); + printf "\x1b[4h"; + write_chars($_[0]); + printf "\x1b[4l"; +} + +sub write_chars($) { + set_color(3); + printf "%s", $_[0]; + set_color(1); +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = $_[0]; + if (defined($opt_w)) { + # 0,1,1,2,2,3,3,... + $value = (($value + 1) / 2) % length($test_string); + } else { + $value %= length($test_string); + } + return $value; +} + +# write the text for the given line-number +sub testit($) { + my $number = $_[0]; + my $length = $term_width; + if ( defined($opt_n) ) { + printf "%5d ", $number % 99999; + $length -= 6; + } + # if we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + if (defined($opt_c)) { + set_color(1); + printf "\x1b[K"; + } + my $starts = starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ($number % 2 ) != 0); + $length = ($length - (($number) % 2)) / 2; + } + my $string = substr($test_string, $starts); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s", $string; + # now - within the line - modify it + move_to((4 * $term_width) / 5); + insert_mode("XX"); + move_to((3 * $term_width) / 5); + delete_char(); + move_to((2 * $term_width) / 5); + insert_once('~'); + move_to((1 * $term_width) / 5); + write_chars('~'); + move_to(0); + set_color(0); + printf "\n", $string; +} + +sub main::HELP_MESSAGE() { + printf STDERR <autoflush(1); +STDOUT->autoflush(1); + +our ($opt_c, $opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_height, $term_width); + +# returns the number of rows in the screen +sub screen_height() { + my $data = `resize -u |fgrep LINES=`; + $data =~ s/LINES=//; + $data =~ s/;//; + return $data +} + +# returns the number of columns in the screen +sub screen_width() { + my $data = `resize -u |fgrep COLUMNS=`; + $data =~ s/COLUMNS=//; + $data =~ s/;//; + return $data +} + +sub set_color($) { + my $code = $_[0]; + if (defined($opt_c)) { + if ($code == 3) { + printf "\x1b[1;33;42m"; # yellow-on-green + } elsif ($code == 2) { + printf "\x1b[0;31;45m"; # red-on-magenta + } elsif ($code == 1) { + printf "\x1b[0;36;44m"; # cyan-on-blue + } else { + printf "\x1b[0;39;49m"; + } + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +sub clear_screen() { + upper_left(); + printf "\x1b[J"; +} + +sub clr_to_eol() { + printf "\x1b[K"; +} + +sub lower_left() { + printf "\x1b[%dH", $term_height; +} + +sub upper_left() { + printf "\x1b[H"; +} + +sub move_to($) { + printf "\x1b[%dG", $_[0] + 1; +} + +sub insert_lines($) { + #lower_left; + if ($_[0]) { + printf "\x1b[%dL", $_[0]; + } else { + printf "\x1b[L"; + } +} + +sub delete_lines($) { + if ($_[0]) { + printf "\x1b[%dM", $_[0]; + } else { + printf "\x1b[M"; + } +} + +sub delete_char() { + set_color(2); + printf "\x1b[%dP", 1; + set_color(1); +} + +sub insert_once($) { + set_color(2); + printf "\x1b[%d@%s", length($_[0]); + write_chars($_[0]); +} + +sub insert_mode($) { + set_color(2); + printf "\x1b[%dP", length($_[0]); + printf "\x1b[4h"; + write_chars($_[0]); + printf "\x1b[4l"; +} + +sub write_chars($) { + set_color(3); + printf "%s", $_[0]; + set_color(1); +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = $_[0]; + if (defined($opt_w)) { + # 0,1,1,2,2,3,3,... + $value = (($value + 1) / 2) % length($test_string); + } else { + $value %= length($test_string); + } + return $value; +} + +# write the text for the given line-number +sub testit($) { + my $number = $_[0]; + my $length = $term_width; + # use delete-lines to "pull" the screen up, like scrolling. + select(undef, undef, undef, 0.1); + if ((($number / $term_height) % 2) != 0) { + upper_left; + insert_lines(1); + } else { + upper_left; + delete_lines(1); + lower_left; + } + if ( defined($opt_n) ) { + printf "%5d ", $number % 99999; + $length -= 6; + } + # if we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + if (defined($opt_c)) { + set_color(1); + clr_to_eol(); + } + my $starts = starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ($number % 2 ) != 0); + $length = ($length - (($number) % 2)) / 2; + } + my $string = substr($test_string, $starts); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s", $string; + # now - within the line - modify it + move_to((4 * $term_width) / 5); + insert_mode("XX"); + move_to((3 * $term_width) / 5); + delete_char(); + move_to((2 * $term_width) / 5); + insert_once('~'); + move_to((1 * $term_width) / 5); + write_chars('~'); + move_to(0); + set_color(0); +} + +sub main::HELP_MESSAGE() { + printf STDERR <?"; + } + else { + $lo = $opt_k ? 0 : 32; + for my $n ( $lo .. 127 ) { + $GL .= chr($n); + $GL .= "\n" if ( ( ( $n - 31 ) % 16 ) == 0 ); + } + } + my $GR = ""; + for my $n ( 0 .. ( length($GL) - 1 ) ) { + my $c = substr( $GL, $n, 1 ); + if ( ord($c) == 10 and ( not $opt_k or $n != 10 ) ) { + $GR .= $c; + } + else { + $GR .= chr( ord($c) + 128 ); + } + } + if ($opt_s) { + $GL =~ s/([^\n])/ $1/g; + $GR =~ s/([^\n])/ $1/g; + } + printf "GL:\n%s\n", $GL; + printf "GR:\n%s\n", $GR; +} + +sub main::HELP_MESSAGE() { + printf STDERR <autoflush(1); +STDOUT->autoflush(1); + +our ( $opt_8, $opt_c, $opt_l, $opt_o, $opt_r, $opt_s, $opt_w, $opt_x ); +our ( $margins, $test_state, $test_string, $test_width ); +our ( $term_height, $term_width ); + +our $CSI = "\033["; + +# returns the number of rows in the screen +sub screen_height() { + my $data = `resize -u |fgrep LINES=`; + $data =~ s/LINES=//; + $data =~ s/;//; + return $data; +} + +# returns the number of columns in the screen +sub screen_width() { + my $data = `resize -u |fgrep COLUMNS=`; + $data =~ s/COLUMNS=//; + $data =~ s/;//; + return $data; +} + +sub set_color($) { + my $code = shift; + if ( defined($opt_c) ) { + if ( $code == 3 ) { + printf "%s1;33;42m", $CSI; # yellow-on-green + } + elsif ( $code == 2 ) { + printf "%s0;31;45m", $CSI; # red-on-magenta + } + elsif ( $code == 1 ) { + printf "%s0;36;44m", $CSI; # cyan-on-blue + } + else { + printf "%s0;39;49m", $CSI; + } + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack( + "U*", + map { + ( $_ <= 32 || $_ > 127 ) # if non-ASCII character... + ? 32 # ...just show a blank + : ( 0xff00 + ( $_ - 32 ) ) # map to "Fullwidth Form" + } unpack( "C*", $value ) + ); # unpack unsigned-char characters +} + +sub clear_screen() { + &upper_left; + printf "%sJ", $CSI; +} + +sub clr_to_eol() { + printf "%sK", $CSI; +} + +sub lower_left() { + printf "%s%dH", $CSI, $term_height; +} + +sub upper_left() { + printf "%sH", $CSI; +} + +sub move_to($) { + my $value = shift; + $value += ( $opt_l - 1 ) if ( $margins and not $opt_o ); + printf "%s%dG", $CSI, $value + 1; +} + +sub bak_scroll($) { + my $value = shift; + + if ($value) { + printf "%s%dS", $CSI, $value; + } + else { + printf "%sS", $CSI; + } +} + +sub delete_char() { + &set_color(2); + printf "%s%dP", $CSI, 1; + &set_color(1); +} + +sub insert_once($) { + my $value = shift; + &set_color(2); + printf "%s%d@", $CSI, length($value); + &write_chars($value); +} + +sub insert_mode($) { + my $value = shift; + &set_color(2); + printf "%s%dP", $CSI, length($value); + printf "%s4h", $CSI; + &write_chars($value); + printf "%s4l", $CSI; +} + +sub write_chars($) { + &set_color(3); + printf "%s", $_[0]; + &set_color(1); +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = shift; + if ( defined($opt_w) ) { + + # 0,1,1,2,2,3,3,... + $value = ( ( $value + 1 ) / 2 ) % length($test_string); + } + else { + $value %= length($test_string); + } + return $value; +} + +# write the text for the given line-number +sub show_line($) { + my $number = shift; + my $length = $test_width; + + # use delete-lines to "pull" the screen up, like scrolling. + select( undef, undef, undef, 0.05 ) if ($opt_s); + &lower_left; + &bak_scroll(1); + + # if we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + if ( defined($opt_c) ) { + &set_color(1); + printf "%s%dX", $CSI, $length if ($margins); + &clr_to_eol unless ($margins); + } + my $starts = &starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ( $number % 2 ) != 0 ); + $length = ( $length - ( ($number) % 2 ) ) / 2; + } + my $string = substr( $test_string, $starts ); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr( $string, 0, $length ); + if ( defined($opt_w) ) { + $string = &double_cells($string); + } + printf "%s", $string; + + # now - within the line - modify it + if ($opt_x) { + &move_to( ( 4 * $test_width ) / 5 ); + &insert_mode("XX"); + &move_to( ( 3 * $test_width ) / 5 ); + &delete_char; + &move_to( ( 2 * $test_width ) / 5 ); + &insert_once('~'); + &move_to( ( 1 * $test_width ) / 5 ); + &write_chars('~'); + &move_to(0); + } + &set_color(0); +} + +sub show_pattern() { + &set_color(0); + &clear_screen; + for ( my $lineno = 0 ; $lineno < $term_height ; ++$lineno ) { + &show_line($lineno); + } +} + +sub scroll_left($) { + my $value = shift; + printf "%s%d @", $CSI, $value; +} + +sub scroll_right($) { + my $value = shift; + printf "%s%d A", $CSI, $value; +} + +sub show_help() { + &finish_test; + &clear_screen; + printf <', "technical", "DEC Technical" ); + &list_charset( 3, 'A', "latin_1", "United Kingdom (UK)" ); + &list_charset( 1, 'B', "ascii", "United States (USASCII)" ); + &list_charset( 2, '4', "dutch", "Dutch" ); + &list_charset( 2, '5', "finnish", "Finnish" ); + &list_charset( 2, 'C', "finnish2", "Finnish" ); + &list_charset( 2, 'R', "french", "French" ); + &list_charset( 2, 'f', "french2", "French" ); + &list_charset( 2, 'Q', "canadian", "French Canadian " ); + &list_charset( 2, '9', "canadian2", "French Canadian " ); + &list_charset( 2, 'K', "german", "German" ); + &list_charset( 2, 'Y', "italian", "Italian" ); + &list_charset( 3, '`', "danish", "Norwegian/Danish " ); + &list_charset( 2, 'E', "danish2", "Norwegian/Danish" ); + &list_charset( 2, '6', "danish3", "Norwegian/Danish" ); + &list_charset( 3, '%6', "portuguese", "Portuguese " ); + &list_charset( 2, 'Z', "spanish", "Spanish" ); + &list_charset( 2, '7', "swedish", "Swedish" ); + &list_charset( 2, 'H', "swedish2", "Swedish" ); + &list_charset( 2, '=', "swiss", "Swiss" ); +} + +sub show_dialog() { + my $dir = tempdir( CLEANUP => 1 ); + my $in_file = "$dir/input"; + my $out_file = "$dir/output"; + my $exe_file = "$dir/script"; + my $rc_file = "$dir/status"; + my $output = ""; + my $status; + do { + open( FP, ">$in_file" ) || die("cannot create $in_file"); + print FP "#!/bin/sh\n"; + print FP "dialog"; + printf FP "\\\n\t--default-item \"%s\"", $output if ( $output ne "" ); + print FP "\\\n\t--menu \"Select a character set\" 0 0 0 "; + + foreach my $key ( sort keys %short_name ) { + printf FP "\\\n\t%s \"VT%d00: %s\"", $short_name{$key}, + $level{$key}, + $long_name{$key}; + } + printf FP "\\\n 2>$out_file\n"; + printf FP "echo \$? >$rc_file\n"; + close FP; + chmod 0700, $in_file; + system("$in_file"); + $output = `cat $out_file`; + $status = `cat $rc_file`; + chomp $output; + chomp $status; + &show_charset($output) if ( $status == 0 ); + } while ( $status ne "" and $status == 0 ); +} + +&initialize; +if ( $#ARGV >= 0 ) { + while ( $#ARGV >= 0 ) { + &show_charset( shift @ARGV ); + } +} +else { + &show_dialog; +} diff --git a/app/xterm/vttests/other-sgr.sh b/app/xterm/vttests/other-sgr.sh index 2e9751219..de253cee0 100644 --- a/app/xterm/vttests/other-sgr.sh +++ b/app/xterm/vttests/other-sgr.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: other-sgr.sh,v 1.6 2021/03/03 01:16:53 tom Exp $ +# $XTermId: other-sgr.sh,v 1.7 2022/02/13 14:36:10 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2018,2021 by Thomas E. Dickey +# Copyright 2018-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -55,12 +55,8 @@ for verb in "printf" "print" ; do done rm -f $TMP -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "${CSI}0m"; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "${CSI}0m"; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "${CSI}0m"; exit 1' 1 2 3 15 +trap '$CMD $OPT "${CSI}0m"' 0 echo "${CSI}0m" while true diff --git a/app/xterm/vttests/palettes.pl b/app/xterm/vttests/palettes.pl new file mode 100644 index 000000000..320b3b09e --- /dev/null +++ b/app/xterm/vttests/palettes.pl @@ -0,0 +1,1072 @@ +#!/usr/bin/env perl +# $XTermId: palettes.pl,v 1.26 2020/07/01 20:13:58 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2020 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Demonstrate how to set palette colors using xterm's control sequences. + +# TODO: add "-n" option, to show tput in dry-run mode +# TODO: make some way to optimize-out the Tcolors resets, to focus on tput vs hardcoded + +use strict; +use warnings; + +use Getopt::Std; +use Term::ReadKey; +use FileHandle; + +select(STDERR); +$| = 1; +select(STDOUT); +$| = 1; + +our ( + $opt_a, $opt_b, $opt_d, $opt_g, $opt_i, + $opt_s, $opt_T, $opt_v, $opt_x, $opt_8 +); + +our ( $CSI, $OSC, $ST ); + +our %colors; +our @Acolors; +our %Tcolors; +our $dump; + +our %Tcolor_names = qw( + 0 foreground + 1 background + 2 cursorColor + 3 pointerForegroundColor + 4 pointerBackgroundColor + 5 tektronixForegroundColor + 6 tektronixBackgroundColor + 7 highlightColor + 8 tektronixCursorColor + 9 highlightForegroundColor +); + +our $DARK; + +sub isatty() { + my $result = 0; + $result = 1 if ( -t 0 and -t 1 and -t 2 ); + return $result; +} + +# Adapted from +# https://github.com/altercation/solarized (xresources/solarized) +sub init_solarized() { + $colors{S_yellow} = 0xb58900; + $colors{S_orange} = 0xcb4b16; + $colors{S_red} = 0xdc322f; + $colors{S_magenta} = 0xd33682; + $colors{S_violet} = 0x6c71c4; + $colors{S_blue} = 0x268bd2; + $colors{S_cyan} = 0x2aa198; + $colors{S_green} = 0x859900; + + if ($DARK) { + $colors{S_base03} = 0x002b36; + $colors{S_base02} = 0x073642; + $colors{S_base01} = 0x586e75; + $colors{S_base00} = 0x657b83; + $colors{S_base0} = 0x839496; + $colors{S_base1} = 0x93a1a1; + $colors{S_base2} = 0xeee8d5; + $colors{S_base3} = 0xfdf6e3; + } + else { + $colors{S_base03} = 0xfdf6e3; + $colors{S_base02} = 0xeee8d5; + $colors{S_base01} = 0x93a1a1; + $colors{S_base00} = 0x839496; + $colors{S_base0} = 0x657b83; + $colors{S_base1} = 0x586e75; + $colors{S_base2} = 0x073642; + $colors{S_base3} = 0x002b36; + } + + $Acolors[0] = $colors{S_base02}; + $Acolors[1] = $colors{S_red}; + $Acolors[2] = $colors{S_green}; + $Acolors[3] = $colors{S_yellow}; + $Acolors[4] = $colors{S_blue}; + $Acolors[5] = $colors{S_magenta}; + $Acolors[6] = $colors{S_cyan}; + $Acolors[7] = $colors{S_base2}; + $Acolors[9] = $colors{S_orange}; + $Acolors[8] = $colors{S_base03}; + $Acolors[10] = $colors{S_base01}; + $Acolors[11] = $colors{S_base00}; + $Acolors[12] = $colors{S_base0}; + $Acolors[13] = $colors{S_violet}; + $Acolors[14] = $colors{S_base1}; + $Acolors[15] = $colors{S_base3}; + + $Tcolors{background} = $colors{S_base03}; + $Tcolors{foreground} = $colors{S_base0}; + $Tcolors{cursorColor} = $colors{S_base1}; + $Tcolors{pointerColorBackground} = $colors{S_base01}; + $Tcolors{pointerColorForeground} = $colors{S_base1}; +} + +# Most of the "themes" are from this source: +# http://web.archive.org/web/20100329130515/http://phraktured.net:80/terminal-colors +# in turn, that cites Aaron Griffin (2007) and uses colortheme.sh, referring to +# https://github.com/Rydgel/archlinux/blob/master/scripts/colortheme.sh +# https://web.archive.org/web/20060630201817/http://frexx.de/xterm-256-notes/ +sub init_1() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xa8a8a8; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xa80000; + $Acolors[2] = 0x00a800; + $Acolors[3] = 0xa85400; + $Acolors[4] = 0x0000a8; + $Acolors[5] = 0xa800a8; + $Acolors[6] = 0x00a8a8; + $Acolors[7] = 0xa8a8a8; + $Acolors[8] = 0x545054; + $Acolors[9] = 0xf85450; + $Acolors[10] = 0x50fc50; + $Acolors[11] = 0xf8fc50; + $Acolors[12] = 0x5054f8; + $Acolors[13] = 0xf854f8; + $Acolors[14] = 0x50fcf8; + $Acolors[15] = 0xf8fcf8; +} + +sub init_2() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0x7f7f7f; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0xaece92; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x414171; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xcf6171; + $Acolors[10] = 0xc5f779; + $Acolors[11] = 0xfff796; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xcf9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_3() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xcfcfcf; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xe01010; + $Acolors[2] = 0x20ad20; + $Acolors[3] = 0xd4c24f; + $Acolors[4] = 0x231bb8; + $Acolors[5] = 0x9c3885; + $Acolors[6] = 0x1dbdb8; + $Acolors[7] = 0xfefefe; + $Acolors[8] = 0x6a6a6a; + $Acolors[9] = 0xe83a3d; + $Acolors[10] = 0x35e956; + $Acolors[11] = 0xffff2f; + $Acolors[12] = 0x3a53f0; + $Acolors[13] = 0xe628ba; + $Acolors[14] = 0x1cf5f5; + $Acolors[15] = 0xffffff; +} + +sub init_4() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xffffff; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xd36265; + $Acolors[2] = 0xaece91; + $Acolors[3] = 0xe7e18c; + $Acolors[4] = 0x7a7ab0; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xef8171; + $Acolors[10] = 0xe5f779; + $Acolors[11] = 0xfff796; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xef9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_5() { + $Tcolors{background} = 0xadaaad; + $Tcolors{foreground} = 0x000000; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x640f19; + $Acolors[2] = 0x63796b; + $Acolors[3] = 0xad7142; + $Acolors[4] = 0x4f4f89; + $Acolors[5] = 0xb25c7c; + $Acolors[6] = 0x52756b; + $Acolors[7] = 0xadaaad; + $Acolors[8] = 0x525552; + $Acolors[9] = 0xa56163; + $Acolors[10] = 0xcec263; + $Acolors[11] = 0x73ae70; + $Acolors[12] = 0x36709f; + $Acolors[13] = 0xaa829c; + $Acolors[14] = 0x518989; + $Acolors[15] = 0xffffef; +} + +sub init_6() { + $Tcolors{background} = 0xbebebe; + $Tcolors{foreground} = 0x212121; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xbf7276; + $Acolors[2] = 0x86af80; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x3673b5; + $Acolors[5] = 0x9a70b2; + $Acolors[6] = 0x7abecc; + $Acolors[7] = 0xdbdbdb; + $Acolors[8] = 0x6692af; + $Acolors[9] = 0xe5505f; + $Acolors[10] = 0x87bc87; + $Acolors[11] = 0xe0d95c; + $Acolors[12] = 0x1b85d6; + $Acolors[13] = 0xad73ba; + $Acolors[14] = 0x338eaa; + $Acolors[15] = 0xf4f4f4; +} + +sub init_7() { + $Tcolors{background} = 0x676767; + $Tcolors{foreground} = 0xffffff; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xbf4646; + $Acolors[2] = 0x67b25f; + $Acolors[3] = 0xcfc44e; + $Acolors[4] = 0x516083; + $Acolors[5] = 0xca6eff; + $Acolors[6] = 0x92b2f8; + $Acolors[7] = 0xd5d5d5; + $Acolors[8] = 0x000000; + $Acolors[9] = 0xf48a8a; + $Acolors[10] = 0xa5d79f; + $Acolors[11] = 0xe1da84; + $Acolors[12] = 0xa2bbff; + $Acolors[13] = 0xe2b0ff; + $Acolors[14] = 0xbacdf8; + $Acolors[15] = 0xd5d5d5; +} + +sub init_8() { + $Tcolors{background} = 0x101010; + $Tcolors{foreground} = 0xd3d3d3; + + $Acolors[0] = 0x101010; + $Acolors[1] = 0xcd5c5c; + $Acolors[2] = 0x2e8b57; + $Acolors[3] = 0xf0e68c; + $Acolors[4] = 0xb0c4de; + $Acolors[5] = 0xba55d3; + $Acolors[6] = 0x4682b4; + $Acolors[7] = 0xd3d3d3; + $Acolors[8] = 0x4d4d4d; + $Acolors[9] = 0xff6a6a; + $Acolors[10] = 0x8fbc8f; + $Acolors[11] = 0xfffacd; + $Acolors[12] = 0x1e90ff; + $Acolors[13] = 0xdb7093; + $Acolors[14] = 0x5f9ea0; + $Acolors[15] = 0xffffff; +} + +sub init_9() { + $Tcolors{background} = 0x1a1a1a; + $Tcolors{foreground} = 0xd6d6d6; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0x008800; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x414171; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xcf6171; + $Acolors[10] = 0x7cbc8c; + $Acolors[11] = 0xfff796; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xcf9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_10() { + $Tcolors{background} = 0x1a1a1a; + $Tcolors{foreground} = 0xd6d6d6; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x98565e; + $Acolors[2] = 0x66825d; + $Acolors[3] = 0x969176; + $Acolors[4] = 0x4d6585; + $Acolors[5] = 0x967395; + $Acolors[6] = 0x5f7f7b; + $Acolors[7] = 0xb3b3b3; + $Acolors[8] = 0x737373; + $Acolors[9] = 0xcfa3a9; + $Acolors[10] = 0xcaf7bb; + $Acolors[11] = 0xfff8bc; + $Acolors[12] = 0x83a3be; + $Acolors[13] = 0xbba9cf; + $Acolors[14] = 0x96cccc; + $Acolors[15] = 0xffffff; +} + +sub init_11() { + $Tcolors{background} = 0x333333; + $Tcolors{foreground} = 0xffffff; + + $Acolors[0] = 0x333333; + $Acolors[1] = 0xffa0a0; + $Acolors[2] = 0x98fb98; + $Acolors[3] = 0xf0e68c; + $Acolors[4] = 0x87ceeb; + $Acolors[5] = 0xffa0a0; + $Acolors[6] = 0x87ceeb; + $Acolors[7] = 0xffffff; + $Acolors[8] = 0x333333; + $Acolors[9] = 0xffa0a0; + $Acolors[10] = 0x9acd32; + $Acolors[11] = 0xf0e68c; + $Acolors[12] = 0x87ceeb; + $Acolors[13] = 0xffa0a0; + $Acolors[14] = 0x87ceeb; + $Acolors[15] = 0xffffff; +} + +sub init_12() { + $Tcolors{foreground} = 0xffffff; + $Tcolors{background} = 0x000000; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xbf7276; + $Acolors[2] = 0x86af80; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x3673b5; + $Acolors[5] = 0x9a70b2; + $Acolors[6] = 0x7abecc; + $Acolors[7] = 0xdbdbdb; + $Acolors[8] = 0x6692af; + $Acolors[9] = 0xe5505f; + $Acolors[10] = 0x87bc87; + $Acolors[11] = 0xe0d95c; + $Acolors[12] = 0x1b85d6; + $Acolors[13] = 0xad73ba; + $Acolors[14] = 0x338eaa; + $Acolors[15] = 0xf4f4f4; +} + +sub init_13() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xaaaaaa; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0xaece92; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x414171; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x7f9f7f; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xcf6171; + $Acolors[10] = 0xafc5af; + $Acolors[11] = 0xf0dfaf; + $Acolors[12] = 0x8e9fbc; + $Acolors[13] = 0xdca3a3; + $Acolors[14] = 0x95c1c5; + $Acolors[15] = 0xffffff; +} + +sub init_14() { + $Tcolors{background} = 0x959595; + $Tcolors{foreground} = 0x000000; + + $Acolors[0] = 0x7f7f7f; + $Acolors[1] = 0xcd0000; + $Acolors[2] = 0x008b00; + $Acolors[3] = 0xeeee00; + $Acolors[4] = 0x0000cd; + $Acolors[5] = 0xcd00cd; + $Acolors[6] = 0x00eeee; + $Acolors[7] = 0xfaebd7; + $Acolors[8] = 0xe5e5e5; + $Acolors[9] = 0x800000; + $Acolors[10] = 0x005020; + $Acolors[11] = 0x995500; + $Acolors[12] = 0x004080; + $Acolors[13] = 0x443300; + $Acolors[14] = 0x306080; + $Acolors[15] = 0xffffff; +} + +sub init_15() { + $Tcolors{background} = 0x1d2b3a; + $Tcolors{foreground} = 0xbebebe; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xd36265; + $Acolors[2] = 0xaece91; + $Acolors[3] = 0xe7e18c; + $Acolors[4] = 0x7a7ab0; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xef8171; + $Acolors[10] = 0xe5f779; + $Acolors[11] = 0xfff799; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xef9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_16() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xbebebe; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0xaece92; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x414171; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xcf6171; + $Acolors[10] = 0xc5f779; + $Acolors[11] = 0xfff796; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xcf9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_17() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xe5e5e5; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xff0000; + $Acolors[2] = 0x00ff00; + $Acolors[3] = 0xffff00; + $Acolors[4] = 0x0000ff; + $Acolors[5] = 0xff00ff; + $Acolors[6] = 0x00ffff; + $Acolors[7] = 0xffffff; + $Acolors[8] = 0xffd39b; + $Acolors[9] = 0xff8247; + $Acolors[10] = 0xff82ab; + $Acolors[11] = 0x87cefa; + $Acolors[12] = 0xffffff; + $Acolors[13] = 0xffffff; + $Acolors[14] = 0xffffff; + $Acolors[15] = 0xffffff; +} + +sub init_18() { + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0x5cb247; + $Acolors[3] = 0x968a38; + $Acolors[4] = 0x4161a0; + $Acolors[5] = 0x9b768e; + $Acolors[6] = 0x419189; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xcf6171; + $Acolors[10] = 0xc5f779; + $Acolors[11] = 0xfff796; + $Acolors[12] = 0x4186be; + $Acolors[13] = 0xcf9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xdddddd; +} + +sub init_19() { + $Acolors[0] = 0x000000; + $Acolors[1] = 0xb07050; + $Acolors[2] = 0x12914e; + $Acolors[3] = 0xa0a070; + $Acolors[4] = 0x3e4581; + $Acolors[5] = 0xa070a0; + $Acolors[6] = 0x70a0a0; + $Acolors[7] = 0xa0a0a0; + $Acolors[8] = 0x606060; + $Acolors[9] = 0xb07050; + $Acolors[10] = 0x12914e; + $Acolors[11] = 0xc0c090; + $Acolors[12] = 0x3e4581; + $Acolors[13] = 0xc090c0; + $Acolors[14] = 0x90c0c0; + $Acolors[15] = 0xffffff; +} + +sub init_20() { + $Tcolors{foreground} = 0xaaaaaa; + $Tcolors{background} = 0x000000; + + $Acolors[0] = 0x303430; + $Acolors[1] = 0xbf7979; + $Acolors[2] = 0x97b26b; + $Acolors[3] = 0xcdcdc1; + $Acolors[4] = 0x86a2be; + $Acolors[5] = 0xd9b798; + $Acolors[6] = 0xa1b5cd; + $Acolors[7] = 0xffffff; + $Acolors[8] = 0xcdb5cd; + $Acolors[9] = 0xf4a45f; + $Acolors[10] = 0xc5f779; + $Acolors[11] = 0xffffef; + $Acolors[12] = 0x98afd9; + $Acolors[13] = 0xd7d998; + $Acolors[14] = 0xa1b5cd; + $Acolors[15] = 0xdedede; +} + +sub init_21() { + $Tcolors{background} = 0x1a1a1a; + $Tcolors{foreground} = 0xaaaaaa; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0x9e1828; + $Acolors[2] = 0x008800; + $Acolors[3] = 0xd2bb4b; + $Acolors[4] = 0x414171; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x418179; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xbc5766; + $Acolors[10] = 0x61a171; + $Acolors[11] = 0xe7db52; + $Acolors[12] = 0x5085af; + $Acolors[13] = 0xa97a99; + $Acolors[14] = 0x6ba4a4; + $Acolors[15] = 0xffffff; +} + +sub init_22() { + $Tcolors{background} = 0x000000; + $Tcolors{foreground} = 0xbebebe; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xd36265; + $Acolors[2] = 0xaece91; + $Acolors[3] = 0xe7e18c; + $Acolors[4] = 0x7a7ab0; + $Acolors[5] = 0x963c59; + $Acolors[6] = 0x7f9f7f; + $Acolors[7] = 0xbebebe; + $Acolors[8] = 0x666666; + $Acolors[9] = 0xef8171; + $Acolors[10] = 0xe5f779; + $Acolors[11] = 0xf0dfaf; + $Acolors[12] = 0x8e9fbc; + $Acolors[13] = 0xef9ebe; + $Acolors[14] = 0x71bebe; + $Acolors[15] = 0xffffff; +} + +sub init_23() { + $Tcolors{background} = 0x0e0e0e; + $Tcolors{foreground} = 0x4ad5e1; + + $Acolors[0] = 0x000000; + $Acolors[1] = 0xdc74d1; + $Acolors[2] = 0x0eb8c7; + $Acolors[3] = 0xdfe37e; + $Acolors[4] = 0x0; #?? + $Acolors[5] = 0x9e88f0; + $Acolors[6] = 0x73f7ff; + $Acolors[7] = 0xe1dddd; + $Acolors[8] = 0x8b8f93; + $Acolors[9] = 0xdc74d1; + $Acolors[10] = 0x0eb8c7; + $Acolors[11] = 0xdfe37e; + $Acolors[13] = 0x9e88f0; + $Acolors[14] = 0x73f7ff; + $Acolors[15] = 0xe1dddd; +} + +sub init_24() { + $Acolors[0] = 0x000000; + $Acolors[1] = 0xcd5c5c; + $Acolors[2] = 0x8eae71; + $Acolors[3] = 0xd2b48c; + $Acolors[4] = 0x5f7b8a; + $Acolors[5] = 0xcdcdb4; + $Acolors[6] = 0x686868; + $Acolors[7] = 0xffffff; + $Acolors[8] = 0x000000; + $Acolors[9] = 0xee6363; + $Acolors[10] = 0x95c749; + $Acolors[11] = 0xcdcdc1; + $Acolors[12] = 0x6b7b8a; + $Acolors[13] = 0xcdcdb4; + $Acolors[14] = 0x778798; + $Acolors[15] = 0xcacaca; +} + +sub init_25() { + $Acolors[0] = 0x000000; + $Acolors[1] = 0x800000; + $Acolors[2] = 0x008000; + $Acolors[3] = 0xd0d090; + $Acolors[4] = 0x000080; + $Acolors[5] = 0x800080; + $Acolors[6] = 0xa6caf0; + $Acolors[7] = 0xd0d0d0; + $Acolors[8] = 0xb0b0b0; + $Acolors[9] = 0xf08060; + $Acolors[10] = 0x60f080; + $Acolors[11] = 0xe0c060; + $Acolors[12] = 0x80c0e0; + $Acolors[13] = 0xf0c0f0; + $Acolors[14] = 0xc0d8f8; + $Acolors[15] = 0xe0e0e0; +} + +# (Griffin) colors ripped from rezza: http://metawire.org/~rezza/index.php +sub init_rezza() { + $Tcolors{foreground} = 0xdddddd; + $Tcolors{background} = 0x222222; + + $Acolors[0] = 0x191919; + $Acolors[1] = 0x803232; + $Acolors[2] = 0x5b762f; + $Acolors[3] = 0xaa9943; + $Acolors[4] = 0x324c80; + $Acolors[5] = 0x706c9a; + $Acolors[6] = 0x92b19e; + $Acolors[7] = 0xffffff; + $Acolors[8] = 0x252525; + $Acolors[9] = 0x982b2b; + $Acolors[10] = 0x89b83f; + $Acolors[11] = 0xefef60; + $Acolors[12] = 0x2b4f98; + $Acolors[13] = 0x826ab1; + $Acolors[14] = 0xa1cdcd; + $Acolors[15] = 0xdddddd; +} + +sub init_theme($) { + my $theme = shift; + + @Acolors = (); + %Tcolors = (); + + &init_solarized if ( index( "solarized", $theme ) eq 0 ); + &init_rezza if ( index( "rezza", $theme ) eq 0 ); + + &init_1 if ( $theme eq 1 ); + &init_2 if ( $theme eq 2 ); + &init_3 if ( $theme eq 3 ); + &init_4 if ( $theme eq 4 ); + &init_5 if ( $theme eq 5 ); + &init_6 if ( $theme eq 6 ); + &init_7 if ( $theme eq 7 ); + &init_8 if ( $theme eq 8 ); + &init_9 if ( $theme eq 9 ); + &init_10 if ( $theme eq 10 ); + &init_11 if ( $theme eq 11 ); + &init_12 if ( $theme eq 12 ); + &init_13 if ( $theme eq 13 ); + &init_14 if ( $theme eq 14 ); + &init_15 if ( $theme eq 15 ); + &init_16 if ( $theme eq 16 ); + &init_17 if ( $theme eq 17 ); + &init_18 if ( $theme eq 18 ); + &init_19 if ( $theme eq 19 ); + &init_20 if ( $theme eq 20 ); + &init_21 if ( $theme eq 21 ); + &init_22 if ( $theme eq 22 ); + &init_23 if ( $theme eq 23 ); + &init_24 if ( $theme eq 24 ); + &init_25 if ( $theme eq 25 ); +} + +sub all_themes() { + my @result; + push @result, "solarized"; + push @result, "rezza"; + for my $n ( 1 .. 25 ) { + push @result, $n; + } + return \@result; +} + +sub raw() { + ReadMode 'ultra-raw', 'STDIN'; # allow single-character inputs +} + +sub cooked() { + ReadMode 'normal'; +} + +sub get_reply($$) { + my $command = shift; + my $finish = shift; + my $reply = ""; + + &raw; + printf STDERR "%s", $command; + my $start = time; + while ( index( $reply, $finish ) < 0 ) { + my $test = ReadKey 0.1; + last if ( time > ( $start + 3 ) ); + next if not defined $test; + + $reply .= $test; + } + &cooked; + return $reply; +} + +sub query_color($$) { + my $ansi = shift; + my $code = shift; + my @result; + my $parms; + if ($ansi) { + $parms = sprintf( "4;%d", $code ); + } + else { + $parms = sprintf( "%d", 10 + $code ); + } + my $query = sprintf( "%s%s;?%s", $OSC, $parms, $ST ); + my $reply = &get_reply( $query, $ST ); + if ( $reply =~ /^${OSC}${parms};rgb:/ ) { + $reply =~ s/^${OSC}${parms};rgb://; + $reply =~ s/[^[:print:]].*$//; + if ( $reply =~ /^[[:xdigit:]]+(\/[[:xdigit:]]+)+$/ ) { + $reply =~ s/([[:xdigit:]]+)/0x$1/g; + @result = split /\//, $reply; + + # RGB should have 3 values + for my $n ( 0 .. $#result ) { + $result[$n] = hex $result[$n]; + } + + # add the limit based on the number of bits needed to print. + push @result, 2**( 4 * ( length($reply) - 2 ) / 3 ); + } + } + + # this would occur in case of error + push @result, $reply unless ( $#result >= 3 ); + return @result; +} + +sub get_color_string($$) { + my $ansi = shift; + my $color = shift; + my $result; + my @check = &query_color( $ansi, $color ); + if ( $#check == 3 ) { + while ( $check[3] > 0x10000 ) { + $check[0] /= ( 16 * 16 ); + $check[1] /= ( 16 * 16 ); + $check[2] /= ( 16 * 16 ); + $check[3] /= ( 16 * 16 * 16 ); + } + $result = sprintf "( %3d %3d %3d )", $check[0], $check[1], $check[2]; + } + else { + $result = sprintf( "{%s}", $check[0] ); + } + return $result; +} + +sub guess_dark() { + my $result = 0; # assume black-on-white + if (&isatty) { + my @check = &query_color( 0, 1 ); + if ( $#check == 3 ) { + my $value = ( ( $check[0] ) + ( $check[1] ) + ( $check[2] ) ) / 3; + printf "%#x / %#x\n", $value, $check[3]; + $result = 1 if ( $value < ( $check[3] / 2 ) ); + printf "%s\n", $result ? "dark" : "light" if ($opt_v); + } + } + return $result; +} + +sub for_tput($) { + my $value = shift; + $value *= 1000; + $value /= 255; + $value *= 256 / 255; + return sprintf( "%.0f", $value ); +} + +sub reset_Acolor($) { + my $number = shift; + printf STDERR "%s104;%d%s", $OSC, $number, $ST; + printf "\t%2d ->reset Acolor\n", $number if ($opt_v); +} + +sub set_Acolor($) { + my $number = shift; + my $result = 0; + if ( defined $Acolors[$number] ) { + my $value = $Acolors[$number]; + my $r = ( ( $value / ( 256 * 256 ) ) % 256 ); + my $g = ( ( $value / (256) ) % 256 ); + my $b = ( ( $value / (1) ) % 256 ); + if ($opt_x) { + system( + sprintf( + "$opt_x $opt_T initc %d %d %d %d", + $number, &for_tput($r), &for_tput($g), &for_tput($b) + ) + ); + } + else { + printf STDERR "%s4;%d;rgb:%02X/%02X/%02X%s", $OSC, $number, $r, $g, + $b, + $ST; + } + printf "\t%2d ->%06X ( %3d %3d %3d )\n", $number, $value, $r, $g, $b + if ($opt_v); + $result = 1; + } + return $result; +} + +sub reset_Tcolor($) { + my $number = shift; + my $actual = $Tcolor_names{$number}; + printf STDERR "%s%d%s", $OSC, 110 + $number, $ST; + printf "\t%2d ->reset Tcolor{%s}\n", $number, $actual + if ($opt_v); +} + +sub set_Tcolor($) { + my $number = shift; + my $actual = $Tcolor_names{$number}; + my $result = 0; + if (%Tcolors) { + if ( defined $Tcolors{$actual} ) { + my $value = $Tcolors{$actual}; + my $r = ( ( $value / ( 256 * 256 ) ) % 256 ); + my $g = ( ( $value / (256) ) % 256 ); + my $b = ( ( $value / (1) ) % 256 ); + printf STDERR "%s%d;rgb:%02X/%02X/%02X%s", $OSC, 10 + $number, $r, + $g, $b, $ST; + printf "\t%2d ->set Tcolor{%s}\n", $number, $actual + if ($opt_v); + $result = 1; + } + } + return $result; +} + +sub set_colors() { + for my $n ( 0 .. 2 ) { + &reset_Tcolor($n) unless &set_Tcolor($n); + } + for my $n ( 0 .. 15 ) { + &reset_Acolor($n) unless &set_Acolor($n); + } + printf STDERR "\007" if (&isatty); + STDERR->flush; +} + +sub reset_colors() { + for my $n ( 0 .. 2 ) { + &reset_Tcolor($n); + } + printf STDERR "%s104%s", $OSC, $ST; + printf "\tall ->reset Acolor\n" if ($opt_v); +} + +sub dump_colors($) { + my $theme = shift; + if ( open( DUMP, ">>", $opt_d ) ) { + my $state = &get_reply( sprintf( "%s#R", $CSI ), "Q" ); + $state = substr( $state, length($CSI) ) + if ( index( $state, $CSI ) == 0 ); + printf DUMP "State \"%s\"\n", $state; + printf DUMP "Palette after \"%s\"\n", $theme; + if (&isatty) { + printf DUMP "Tcolors:\n"; + for my $n ( 0 .. 2 ) { + printf DUMP "\t%s = %s\n", $Tcolor_names{$n}, + &get_color_string( 0, $n ); + } + printf DUMP "Acolors:\n"; + for my $n ( 0 .. 15 ) { + printf DUMP "\t%2d -> %s\n", $n, &get_color_string( 1, $n ); + } + } + close DUMP; + } +} + +sub show_colors($) { + my $theme = shift; + if ( substr( $theme, 0, 1 ) eq "+" ) { + + # push (or set slot, if number follows) + if ( $theme =~ /^\+[0-9]$/ ) { + my $slot = substr( $theme, 1 ); + printf STDERR "%s#%dP", $CSI, $slot + 1; + printf "\tpush %s\n", $slot if ($opt_v); + } + else { + printf STDERR "%s#P", $CSI; + printf "\tpush\n" if ($opt_v); + } + } + elsif ( substr( $theme, 0, 1 ) eq "-" ) { + + # pop (or restore from slot, if number follows) + if ( $theme =~ /^-[0-9]$/ ) { + my $slot = substr( $theme, 1 ); + printf STDERR "%s#%dQ", $CSI, $slot + 1; + printf "\tpop %s\n", $slot if ($opt_v); + } + else { + printf STDERR "%s#Q", $CSI; + printf "\tpop\n" if ($opt_v); + } + } + elsif ( $theme eq "?" ) { + + # query TODO + printf STDERR "%s#R", $CSI; + printf "\tquery\n" if ($opt_v); + } + else { + &init_theme($theme); + &set_colors if ( $#Acolors >= 0 ); + &reset_colors unless ( $#Acolors >= 0 ); + } + &dump_colors($theme) if ($opt_d); +} + +sub show_themes($) { + my @themes = @{ $_[0] }; + for my $n ( 0 .. $#themes ) { + &show_colors( $themes[$n] ); + sleep $opt_s if ( ( $n != $#themes ) and &isatty ); + } +} + +sub main::HELP_MESSAGE() { + printf STDERR <= 0 ) ); + +if ($opt_8) { + $CSI = "\x9b"; + $OSC = "\x9d"; + $ST = "\x9c"; +} +else { + $CSI = "\x1b["; + $OSC = "\x1b]"; + $ST = "\x1b\\"; +} + +$ST = "\007" if ($opt_b); + +$opt_s = 1 unless ($opt_s); +$opt_T = "-T $opt_T" if ($opt_T); +$opt_T = "-T xterm-256color" unless ($opt_T); + +$DARK = 0; +$DARK = 1 if ($opt_i); +$DARK = &guess_dark if ($opt_g); + +if ($opt_a) { + &show_themes(&all_themes); +} +elsif ( $#ARGV >= 0 ) { + &show_themes( \@ARGV ); +} +else { + &show_colors("solarized"); +} + +1; diff --git a/app/xterm/vttests/pointer-shapes.sh b/app/xterm/vttests/pointer-shapes.sh new file mode 100644 index 000000000..f2fe59079 --- /dev/null +++ b/app/xterm/vttests/pointer-shapes.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# $XTermId: pointer-shapes.sh,v 1.2 2021/11/11 17:47:07 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2021 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# exercise xterm's pointer-shape control + +map() { + printf '\033]22;%s\033\\' "$1" + printf "** %s\n" "$1" + sleep 2 +} + +map X_cursor +map arrow +map based_arrow_down +map based_arrow_up +map boat +map bogosity +map bottom_left_corner +map bottom_right_corner +map bottom_side +map bottom_tee +map box_spiral +map center_ptr +map circle +map clock +map coffee_mug +map cross +map cross_reverse +map crosshair +map diamond_cross +map dot +map dotbox +map double_arrow +map draft_large +map draft_small +map draped_box +map exchange +map fleur +map gobbler +map gumby +map hand1 +map hand2 +map heart +map icon +map iron_cross +map left_ptr +map left_side +map left_tee +map leftbutton +map ll_angle +map lr_angle +map man +map middlebutton +map mouse +map pencil +map pirate +map plus +map question_arrow +map right_ptr +map right_side +map right_tee +map rightbutton +map rtl_logo +map sailboat +map sb_down_arrow +map sb_h_double_arrow +map sb_left_arrow +map sb_right_arrow +map sb_up_arrow +map sb_v_double_arrow +map shuttle +map sizing +map spider +map spraycan +map star +map target +map tcross +map top_left_arrow +map top_left_corner +map top_right_corner +map top_side +map top_tee +map trek +map ul_angle +map umbrella +map ur_angle +map watch +map xterm diff --git a/app/xterm/vttests/print-vt-chars.pl b/app/xterm/vttests/print-vt-chars.pl index e7ab8db3e..528434b2b 100644 --- a/app/xterm/vttests/print-vt-chars.pl +++ b/app/xterm/vttests/print-vt-chars.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# XTerm$Id: print-vt-chars.pl,v 1.2 2021/01/10 09:23:58 matthieu Exp $ +# $XTermId: print-vt-chars.pl,v 1.23 2020/12/13 15:05:06 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # diff --git a/app/xterm/vttests/query-status.pl b/app/xterm/vttests/query-status.pl index e3fbcab98..4e1afe29e 100644 --- a/app/xterm/vttests/query-status.pl +++ b/app/xterm/vttests/query-status.pl @@ -1,9 +1,9 @@ #!/usr/bin/env perl -# $XTermId: query-status.pl,v 1.7 2019/05/19 08:57:41 tom Exp $ +# $XTermId: query-status.pl,v 1.10 2021/11/11 21:31:48 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2017-2018,2019 by Thomas E. Dickey +# Copyright 2017-2019,2021 by Thomas E. Dickey # # All Rights Reserved # @@ -41,19 +41,23 @@ use warnings; use Getopt::Std; use IO::Handle; -our ($opt_8); +our ( $opt_a, $opt_c, $opt_d, $opt_8 ); $Getopt::Std::STANDARD_HELP_VERSION = 1; -&getopts('8') || die( - "Usage: $0 [options]\n +&getopts('acd8') || die( + "Usage: $0 [options] [suffixes]\n Options:\n + -a test ANSI colors with SGR controls + -c test cursor appearance with DECSCUSR controls + -d test direct colors with SGR controls -8 use 8-bit controls Options which use C1 controls may not work with UTF-8. " ); -our $ST = $opt_8 ? "\x9c" : "\x1b\\"; +our $ST = $opt_8 ? "\x9c" : "\x1b\\"; +our $CSI = $opt_8 ? "\x9a" : "\x1b["; our %suffixes; $suffixes{DECSCA} = '"q'; @@ -116,16 +120,16 @@ sub visible($) { } sub query_one($) { - my $name = shift; + my $name = shift; + + return unless $suffixes{$name}; + my $suffix = $suffixes{$name}; my $prefix = $opt_8 ? "\x90" : "\x1bP"; - my $reply; - my $n; - my $st = $opt_8 ? "\x9c" : qr/\x1b\\/; - my $DCS = qr/${prefix}/; - my $match = qr/${DCS}.*${st}/; - - $reply = get_reply( $prefix . '$q' . $suffix . $ST ); + my $st = $opt_8 ? "\x9c" : qr/\x1b\\/; + my $DCS = qr/${prefix}/; + my $match = qr/${DCS}.*${st}/; + my $reply = get_reply( $prefix . '$q' . $suffix . $ST ); printf "%-10s query{%s}%*s", $name, # &visible($suffix), # @@ -148,6 +152,24 @@ sub query_one($) { printf "\n"; } +sub ansi_color($) { + my $color = shift; + return $color; +} + +sub direct_color($) { + my $color = shift; + my $result = "8:2:"; + $result .= ( $color & 4 ) ? ":255" : ":0"; + $result .= ( $color & 2 ) ? ":255" : ":0"; + $result .= ( $color & 1 ) ? ":255" : ":0"; + return $result; +} + +sub default_colors() { + return "39;49"; +} + printf "\x1b G" if ($opt_8); if ( $#ARGV >= 0 ) { @@ -155,6 +177,33 @@ if ( $#ARGV >= 0 ) { &query_one( shift @ARGV ); } } +elsif ($opt_a) { + for my $fg ( 0 .. 7 ) { + printf "%s3%sm", $CSI, &ansi_color($fg); + for my $bg ( 0 .. 7 ) { + printf "%s4%sm", $CSI, &ansi_color($bg); + &query_one("SGR"); + } + } + printf "%s%sm", $CSI, &default_colors; +} +elsif ($opt_c) { + for my $c ( 0 .. 6 ) { + printf "%s%d q", $CSI, $c; + &query_one("DECSCUSR"); + } + printf "%s q", $CSI; +} +elsif ($opt_d) { + for my $fg ( 0 .. 7 ) { + printf "%s3%sm", $CSI, &direct_color($fg); + for my $bg ( 0 .. 7 ) { + printf "%s4%sm", $CSI, &direct_color($bg); + &query_one("SGR"); + } + } + printf "%s39;49m", $CSI; +} else { for my $key ( sort keys %suffixes ) { &query_one($key); diff --git a/app/xterm/vttests/resize.sh b/app/xterm/vttests/resize.sh index fed2f10b7..b62645206 100644 --- a/app/xterm/vttests/resize.sh +++ b/app/xterm/vttests/resize.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: resize.sh,v 1.21 2021/03/03 01:16:53 tom Exp $ +# $XTermId: resize.sh,v 1.22 2022/02/13 14:36:28 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2011,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -75,12 +75,8 @@ original=${CSI}8\;${high}\;${wide}t${SUF} test "$maxwide" = 0 && maxwide=`expr "$wide" \* 2` test "$maxhigh" = 0 && maxhigh=`expr "$high" \* 2` -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 w=$wide h=$high diff --git a/app/xterm/vttests/scroll.pl b/app/xterm/vttests/scroll.pl new file mode 100644 index 000000000..f95e1deb1 --- /dev/null +++ b/app/xterm/vttests/scroll.pl @@ -0,0 +1,259 @@ +#!/usr/bin/env perl +# $XTermId: scroll.pl,v 1.2 2009/07/02 23:54:51 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2009 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Tests insert/delete-line feature in xterm. This applies only to the +# visible screen (saved-lines are unaffected). +# +# TODO: +# add option to wrap the test-pattern +# use scrolling-margins to help fill-in a chunk +use strict; + +use Getopt::Std; + +# do this so outout from successive calls to this script won't get in the +# wrong order: +use IO::Handle; +STDERR->autoflush(1); +STDOUT->autoflush(1); + +our ($opt_c, $opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_height, $term_width, $max_scroll); + +# returns the number of rows in the screen +sub screen_height() { + my $data = `resize -u |fgrep LINES=`; + $data =~ s/LINES=//; + $data =~ s/;//; + return $data +} + +# returns the number of columns in the screen +sub screen_width() { + my $data = `resize -u |fgrep COLUMNS=`; + $data =~ s/COLUMNS=//; + $data =~ s/;//; + return $data +} + +sub set_color($) { + my $code = $_[0]; + if (defined($opt_c)) { + if ($code == 3) { + printf "\x1b[1;33;42m"; # yellow-on-green + } elsif ($code == 2) { + printf "\x1b[0;31;45m"; # red-on-magenta + } elsif ($code == 1) { + printf "\x1b[0;36;44m"; # cyan-on-blue + } else { + printf "\x1b[0;39;49m"; + } + } +} + +# returns a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +sub clear_screen() { + upper_left(); + printf "\x1b[J"; +} + +sub clr_to_eol() { + printf "\x1b[K"; +} + +sub lower_left() { + printf "\x1b[%dH", $term_height; +} + +sub upper_left() { + printf "\x1b[H"; +} + +sub move_to($) { + printf "\x1b[%dG", $_[0] + 1; +} + +sub bak_scroll($) { + #lower_left; + if ($_[0]) { + printf "\x1b[%dS", $_[0]; + } else { + printf "\x1b[S"; + } +} + +sub fwd_scroll($) { + if ($_[0]) { + printf "\x1b[%dT", $_[0]; + } else { + printf "\x1b[T"; + } +} + +sub delete_char() { + set_color(2); + printf "\x1b[%dP", 1; + set_color(1); +} + +sub insert_once($) { + set_color(2); + printf "\x1b[%d@%s", length($_[0]); + write_chars($_[0]); +} + +sub insert_mode($) { + set_color(2); + printf "\x1b[%dP", length($_[0]); + printf "\x1b[4h"; + write_chars($_[0]); + printf "\x1b[4l"; +} + +sub write_chars($) { + set_color(3); + printf "%s", $_[0]; + set_color(1); +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = $_[0]; + if (defined($opt_w)) { + # 0,1,1,2,2,3,3,... + $value = (($value + 1) / 2) % length($test_string); + } else { + $value %= length($test_string); + } + return $value; +} + +# write the text for the given line-number +sub testit($) { + my $number = $_[0]; + my $length = $term_width; + # use delete-lines to "pull" the screen up, like scrolling. + select(undef, undef, undef, 0.1); + if ((($number / $max_scroll) % 2) != 0) { + lower_left; + fwd_scroll(1); + } else { + lower_left; + bak_scroll(1); + } + if ( defined($opt_n) ) { + printf "%5d ", $number % 99999; + $length -= 6; + } + # if we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + if (defined($opt_c)) { + set_color(1); + clr_to_eol(); + } + my $starts = starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ($number % 2 ) != 0); + $length = ($length - (($number) % 2)) / 2; + } + my $string = substr($test_string, $starts); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s", $string; + # now - within the line - modify it + move_to((4 * $term_width) / 5); + insert_mode("XX"); + move_to((3 * $term_width) / 5); + delete_char(); + move_to((2 * $term_width) / 5); + insert_once('~'); + move_to((1 * $term_width) / 5); + write_chars('~'); + move_to(0); + set_color(0); +} + +sub main::HELP_MESSAGE() { + printf STDERR <; + close TTY; + system "stty $old"; + if ( defined $reply ) { + die("^C received\n") if ( "$reply" eq "\003" ); + } + return $reply; +} + +sub read_cmd($) { + my $cmd = shift; + my @result; + if ( open my $fh, "$cmd |" ) { + @result = <$fh>; + close $fh; + chomp @result; + } + return @result; +} + +sub get_xprop($$) { + my $id = shift; + my $name = shift; + my @data = &read_cmd("xprop -id $id"); + my $prop = ""; + for my $n ( 0 .. $#data ) { + if ( $data[$n] =~ /$name\([^)]+\) =/ ) { + $prop = $data[$n]; + $prop =~ s/^[^=]*=\s*//; + $prop =~ s/"//g; + last; + } + } + return $prop; +} + +sub visible($) { + my $reply = $_[0]; + my $n; + my $result = ""; + for ( $n = 0 ; $n < length($reply) ; ) { + my $c = substr( $reply, $n, 1 ); + if ( $c =~ /[[:print:]]/ ) { + $result .= $c; + } + else { + my $k = ord substr( $reply, $n, 1 ); + if ( ord $k == 0x1b ) { + $result .= "\\E"; + } + elsif ( $k == 0x7f ) { + $result .= "^?"; + } + elsif ( $k == 32 ) { + $result .= "\\s"; + } + elsif ( $k < 32 ) { + $result .= sprintf( "^%c", $k + 64 ); + } + elsif ( $k > 128 ) { + $result .= sprintf( "\\%03o", $k ); + } + else { + $result .= chr($k); + } + } + $n += 1; + } + + return $result; +} + +sub limited($) { + my $value = shift; + if ( $value >= 65536 ) { + $value %= 65536; + } + if ( $value >= 32768 ) { + $value -= 65536; + } + return $value; +} + +sub check_position($$$) { + my $name = shift; + my $expect = shift; + my $actual = shift; + printf " ?%s:%d", $name, $expect if ( $expect != $actual ); +} + +sub report_position() { + my $reply = &get_reply( sprintf "%s13t", $CSI ); + my $status = 0; + my @result; + if ( index( $reply, $CSI ) == 0 ) { + $reply = substr( $reply, length($CSI) ); + $status = 1; + } + if ( $reply =~ /^3;\d+;\d+t$/ ) { + my $y = $reply; + $y =~ s/^3;(\d+);.*/$1/; + my $x = $reply; + $x =~ s/^3;\d+;(\d+).*/$1/; + $result[0] = &limited($y); + $result[1] = &limited($x); + printf "OK ->%s ->%d,%d", &visible($reply), $result[0], $result[1]; + } + else { + printf "ERR ->%s", &visible($reply); + } + if ( $opt_x and $ENV{WINDOWID} ) { + my @actual = `xwininfo -id $ENV{WINDOWID} | grep " upper-left [XY]:"`; + for my $n ( 0 .. $#actual ) { + $actual[$n] =~ s/^.*:\s+//; + } + if ( $#actual == 3 ) { + printf " abs(%d,%d) rel(%d,%d)", $actual[0], $actual[1], + $actual[2], $actual[3] + if ($opt_v); + my $expect_y; + my $expect_x; + if ( $wm_name =~ /^gnome/i ) { + $expect_x = $actual[0] - ( $extents[0] + $extents[1] ); + $expect_y = $actual[1] - ( $extents[2] + $extents[3] ); + } + elsif ( $#extents == 3 + and ( $wm_name !~ /^fvwm/i ) + and ( $wm_name !~ /^enlightenment/i ) ) + { + $expect_x = $actual[0] - ( $extents[0] ); + $expect_y = $actual[1] - ( $extents[2] ); + } + else { + $expect_x = $actual[0] - $actual[2]; + $expect_y = $actual[1] - $actual[3]; + } + if ( $#result > 0 ) { + &check_position( "X", $expect_x, $result[0] ); + &check_position( "Y", $expect_y, $result[1] ); + } + } + } + printf "\n"; + return @result; +} + +sub update_position() { + my @pos = @{ $_[0] }; + printf "** update %d,%d\n", $pos[0], $pos[1]; + $pos[0] += 65536 if ( $pos[0] < 0 ); + $pos[1] += 65536 if ( $pos[1] < 0 ); + &no_reply( sprintf "%s3;%d;%dt", $CSI, $pos[0], $pos[1] ); +} + +sub update_and_report($) { + my @pos = @{ $_[0] }; + &update_position( \@pos ); + sleep 1 if ($opt_a); + return &report_position; +} + +sub get_screensize() { + my $reply = &get_reply( sprintf "%s15t", $CSI ); + my @result; + if ( index( $reply, $CSI ) == 0 ) { + $reply = substr( $reply, length($CSI) ); + if ( $reply =~ /^5;\d+;\d+t$/ ) { + my $y = $reply; + $y =~ s/^5;(\d+);.*/$1/; + my $x = $reply; + $x =~ s/^5;\d+;(\d+).*/$1/; + $result[0] = $x; + $result[1] = $y; + } + } + return @result; +} + +sub doit() { + my @old = &report_position; + if ($opt_a) { + my @size = &get_screensize; + if (@size) { + printf "Screen %dx%d\n", $size[0], $size[1]; + my $ulx = -$default_x; + my $uly = -$default_y; + my $lrx = $size[0] - $default_x; + my $lry = $size[1] - $default_y; + &update_and_report( [ $ulx, $uly ] ); + &update_and_report( [ $ulx, $lry ] ); + &update_and_report( [ $lrx, $lry ] ); + &update_and_report( [ $lrx, $uly ] ); + &update_position( \@old ); + } + } + else { + my @pos = ( $default_y, $default_x ); + for my $n ( 1 .. $repeat ) { + @pos = &update_and_report( \@pos ); + } + } +} + +printf "\x1b G" if ($opt_8); + +if ( $opt_x and $ENV{WINDOWID} ) { + my $extents = &get_xprop( $ENV{WINDOWID}, "_NET_FRAME_EXTENTS" ); + if ( $extents ne "" ) { + @extents = split /,\s*/, $extents; + printf "** has EWMH extents: $extents\n"; + my $supwin = `xprop -root '_NET_SUPPORTING_WM_CHECK'`; + if ( $supwin ne "" ) { + $supwin =~ s/^.*(0x[[:xdigit:]]+).*/$1/; + $wm_name = &get_xprop( $supwin, "_NET_WM_NAME" ); + $wm_name = "unknown" unless ( $wm_name ne "" ); + printf "** using \"$wm_name\"\n"; + } + } +} + +&doit; + +printf "\x1b F" if ($opt_8); + +1; diff --git a/app/xterm/vttests/tab0.sh b/app/xterm/vttests/tab0.sh new file mode 100644 index 000000000..4e025dd39 --- /dev/null +++ b/app/xterm/vttests/tab0.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# $XTermId: tab0.sh,v 1.2 2019/06/01 16:03:03 tom Exp $ +# ----------------------------------------------------------------------------- +# Copyright 2019 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Demonstrate hard-tabs. + +: ${TABS:=tabs} +: ${TPUT:=tput} + +show() { + printf "Tabs $1:" + read ignore + p=0 + while [ $p -lt $wide ] + do + printf "%s+----%d" "----" `expr 1 + \( $p / 10 \)` + p=`expr $p + 10` + done + printf "\n" + p=1 + printf " " + while [ $p -lt $wide ] + do + printf "%*s" $1 "*" + p=`expr $p + $1` + done + printf "\n" + p=0 + while [ $p -lt $wide ] + do + printf "\t+" + p=`expr $p + $1` + done + printf "\n" + printf "...done" + read ignore +} + +# enable hard tabs, disable autowrap. +initialize() { + $TPUT $1 + clear + stty tabs + printf "\033[?7l" +} + +setup() { + initialize reset +} + +# Turn hard tabs off, reenable autowrap. +restore() { + stty -tabs + printf "\033[?7h" +} + +wide=`$TPUT cols` + +# If the terminal honors VT100 RIS, try that as a "hard reset" to get the +# power-on behavior. +for name in rs1 rs2 +do + value=`$TPUT $name | sed -e 's//ESC:/g'` + case "$value" in + *ESC:c*) + ;; + *) + value= + ;; + esac + if [ -n "$value" ] + then + initialize $name + printf "Testing after tput $name\r\n" + show 8 + break + fi +done + +# The following tests use the normal "reset" behavior. +setup +$TABS -8 +show 8 +$TABS -4 +show 4 + +# Some terminal emulators are known to be buggy, and "reset" does not get them +# to reset the tab-stops. +setup +show 8 +restore diff --git a/app/xterm/vttests/title.sh b/app/xterm/vttests/title.sh index b5599db82..7b7f4d6d7 100644 --- a/app/xterm/vttests/title.sh +++ b/app/xterm/vttests/title.sh @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: title.sh,v 1.22 2021/03/03 01:16:53 tom Exp $ +# $XTermId: title.sh,v 1.23 2022/02/13 14:36:47 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1999-2021,2021 by Thomas E. Dickey +# Copyright 1999-2021,2022 by Thomas E. Dickey # # All Rights Reserved # @@ -71,12 +71,8 @@ stty $old original=`echo "$original" |sed -e 's/^...//' -e 's/.$//'` original=${ESC}]2\;"${original}"${SUF} -if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null -then - trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT QUIT TERM -else - trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 3 15 -fi +trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 +trap '$CMD $OPT "$original" >/dev/tty' 0 while true do diff --git a/app/xterm/vttests/titlestack.pl b/app/xterm/vttests/titlestack.pl new file mode 100644 index 000000000..78ba0e74e --- /dev/null +++ b/app/xterm/vttests/titlestack.pl @@ -0,0 +1,614 @@ +#!/usr/bin/env perl +# $XTermId: titlestack.pl,v 1.29 2019/09/20 00:50:10 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2019 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Test the title-stack and title-mode options of xterm. + +# TODO: add test for arbitrary x property +# TODO: allow -g and -v options to toggle interactively + +use strict; +use warnings; + +use Getopt::Std; +use Encode qw(decode encode); +use Term::ReadKey; +use I18N::Langinfo qw(langinfo CODESET); + +our $target = ""; + +our $encoding = lc( langinfo( CODESET() ) ); +our $wm_name; +our ( $opt_b, $opt_g, $opt_v, $opt_8 ); + +our @titlestack; # stack of title-strings, using current encoding +our @item_stack; # selector used when doing a push +our @mode_stack; # titleModes in effect when titlestack was loaded +our $SP; # stack-pointer +our $TM; # current titleModes, in various combinations + +our $utf8_sample = 0; + +our $CSI = "\x1b["; +our $OSC = "\x1b]"; +our $ST = "\x1b\\"; + +sub SendHEX() { return ( $TM & 1 ) ? 1 : 0; } +sub ReadHEX() { return ( $TM & 2 ) ? 1 : 0; } +sub SendUTF8() { return ( $TM & 4 ) ? 1 : 0; } +sub ReadUTF8() { return ( $TM & 8 ) ? 1 : 0; } + +sub to_hex($) { + my $value = shift; + my $result = ""; + my $n; + + for ( $n = 0 ; $n < length($value) ; ++$n ) { + $result .= sprintf( "%02X", ord substr( $value, $n, 1 ) ); + } + return $result; +} + +sub from_hex($) { + my $value = shift; + my $result = ""; + if ( $value =~ /^[[:xdigit:]]+$/ and ( length($value) % 2 ) == 0 ) { + my $octets = ""; + for ( my $n = 0 ; $n < length($value) ; $n += 2 ) { + my $pair = substr( $value, $n, 2 ); + my $data = hex $pair; + $octets .= chr($data); + } + $result = decode( &ReadUTF8 ? "utf-8" : "iso-8859-1", $octets ); + } + else { + $result = $value; + } + return $result; +} + +sub show_string($) { + my $value = shift; + my $n; + my $octets = + encode( ( ( $encoding eq "utf-8" ) ? "utf-8" : "iso-8859-1" ), $value ); + + my $result = ""; + for ( $n = 0 ; $n < length($octets) ; $n += 1 ) { + my $c = ord substr( $octets, $n, 1 ); + if ( $c == ord '\\' ) { + $result .= "\\\\"; + } + elsif ( $c == 0x1b ) { + $result .= "\\E"; + } + elsif ( $c == 0x7f ) { + $result .= "^?"; + } + elsif ( $c == 32 ) { + $result .= "\\s"; + } + elsif ( $c < 32 ) { + $result .= sprintf( "^%c", $c + 64 ); + } + elsif ( $c > 128 ) { + $result .= sprintf( "\\%03o", $c ); + } + else { + $result .= chr($c); + } + } + + printf "%s\r\n", $result; +} + +sub send_command($) { + my $command = shift; + if ($opt_v) { + printf "send: "; + &show_string($command); + } + print STDERR encode( &SendUTF8 ? "utf-8" : "iso-8859-1", $command ); +} + +sub get_reply($) { + my $command = shift; + my $reply = ""; + + &send_command($command); + my $start = time; + while (1) { + my $test = ReadKey 1; + last if not defined $test; + last if ( time > ( $start + 1 ) ); + + $reply .= $test; + } + if ($opt_v) { + printf "read: "; + &show_string($reply); + } + return $reply; +} + +sub get_title($) { + my $icon = shift; + my $reply = &get_reply( sprintf( "%s%dt", $CSI, $icon ? 20 : 21 ) ); + my $prefix = $icon ? "L" : "l"; + + if ( $opt_8 and ( $reply =~ /^$CSI/ ) ) { + $reply =~ s/^${CSI}//; + $reply =~ s/${ST}$//; + } + else { + $reply =~ s/^\x1b//; + $reply =~ s/^[\[\]]//; + if ( index( $reply, $ST ) >= 0 ) { + $reply =~ s/\x1b\\$//; + } + else { + $reply =~ s/\007$//; + } + } + if ( $reply =~ /^$prefix/ ) { + $reply =~ s/^$prefix//; + if (&ReadHEX) { + $reply = &from_hex($reply); + } + } + else { + $reply = "?" . $reply; + } + return $reply; +} + +sub raw() { + ReadMode 'ultra-raw', 'STDIN'; # allow single-character inputs +} + +sub cooked() { + ReadMode 'normal'; +} + +sub read_cmd($) { + my $command = shift; + my @result; + if ( open( my $fp, "$command |" ) ) { + binmode( $fp, ":utf8" ) if ( $encoding eq "utf-8" ); + @result = <$fp>; + close($fp); + chomp @result; + } + return @result; +} + +sub which_modes($) { + my $modes = shift; + my $result = ""; + if ( $modes & 3 ) { + $result .= "put" if ( ( $modes & 3 ) == 1 ); + $result .= "get" if ( ( $modes & 3 ) == 2 ); + $result .= "p/q" if ( ( $modes & 3 ) == 3 ); + $result .= " hex"; + } + if ( $modes & 12 ) { + $modes /= 4; + $result .= "," unless ( $result eq "" ); + $result .= "put" if ( ( $modes & 3 ) == 1 ); + $result .= "get" if ( ( $modes & 3 ) == 2 ); + $result .= "p/q" if ( ( $modes & 3 ) == 3 ); + $result .= " utf"; + } + $result = "default" if ( $result eq "" ); + return $result; +} + +sub which_tmode($$) { + my $set = shift; + my $mode = shift; + my $result = ""; + $result = "set window/icon labels using hexadecimal" if ( $mode == 0 ); + $result = "query window/icon labels using hexadecimal" if ( $mode == 1 ); + $result = "set window/icon labels using UTF-8" if ( $mode == 2 ); + $result = "query window/icon labels using UTF-8" if ( $mode == 3 ); + $result = "do not " . $result if ( $set == 0 and $result ne "" ); + return $result; +} + +sub get_tmode($) { + my $set = shift; + my $help = 0; + my $result = "?"; + while ( $result !~ /^[0123]$/ ) { + $result = ReadKey 0; + if ( $result eq "q" ) { + $result = -1; + last; + } + elsif ( $result eq "?" and not $help ) { + for my $n ( 0 .. 3 ) { + printf "\r\n\t%s = %s", $n, &which_tmode( $set, $n ); + } + printf "\r\n\t:"; + $help = 1; + } + } + if ( $result >= 0 ) { + printf "[%s]\r\n\t:", &which_tmode( $set, $result ); + } + return $result; +} + +sub which_item($) { + my $code = shift; + my $result = ""; + $result = "both" if ( $code == 0 ); + $result = "icon" if ( $code == 1 ); + $result = "name" if ( $code == 2 ); + return $result; +} + +sub which_selector($) { + my $code = shift; + my $result = ""; + $result = "both titles" if ( $code == 0 ); + $result = "icon title" if ( $code == 1 ); + $result = "window title" if ( $code == 2 ); + return $result; +} + +sub get_selector() { + my $result = "?"; + my $help = 0; + printf "\t:"; + while ( $result !~ /^[012]$/ ) { + $result = ReadKey 0; + if ( $result eq "q" ) { + $result = -1; + last; + } + elsif ( $result eq "l" ) { + $result = 2; + } + elsif ( $result eq "L" ) { + $result = 1; + } + elsif ( $result eq "?" and not $help ) { + for my $n ( 0 .. 2 ) { + printf "\r\n\t%d = %s", $n, &which_selector($n); + } + printf "\r\n\t:"; + $help = 1; + } + } + if ( $result >= 0 ) { + printf "[%s]\r\n\t:", &which_selector($result); + } + return $result; +} + +sub display_info() { + + # use xprop to get properties + my $command = "xprop"; + if ( $ENV{WINDOWID} ) { + my $windowid = $ENV{WINDOWID}; + $command .= " -id " . $windowid if ( $windowid ne "" ); + } + else { + printf "...xprop\r\n"; + } + my @props = &read_cmd($command); + for my $n ( 0 .. $#props ) { + printf "\t%s\r\n", $props[$n] + if ( index( $props[$n], "WM_NAME(" ) >= 0 + or index( $props[$n], "WM_ICON_NAME(" ) >= 0 ); + } + + # use escape sequences to get corresponding information + printf "... Icon title:%s\r\n", &get_title(1); + printf "... Window title:%s\r\n", &get_title(0); + + # show title-stack (and modes used for each level) + printf "... Modes[%s]\r\n", &which_modes($TM); + printf "... Stack(%d):\r\n", $SP; + for my $n ( 0 .. $SP ) { + printf "\t%d [%s:%s]%s\r\n", $n, &which_item( $item_stack[$n] ), + &which_modes( $mode_stack[$n] ), $titlestack[$n]; + } +} + +sub set_titlemode($) { + my $set = shift; + my $opts = ""; + my $opt; + printf "\t:"; + while ( ( $opt = &get_tmode($set) ) >= 0 ) { + $TM |= ( 1 << $opt ) if ($set); + $TM &= ~( 1 << $opt ) unless ($set); + $opts .= ";" unless ( $opts eq "" ); + $opts .= $opt; + } + if ( $opts ne "" ) { + &send_command( sprintf( "%s>%s%s", $CSI, $opts, $set ? "t" : "T" ) ); + } +} + +sub utf8_sample($) { + my $item = shift; + my $last = 4; + my $text; + if ( ( $item % $last ) == 0 ) { + my $chars = "THE QUICK BROWN FOX\nJUMPED OVER THE LAZY DOG"; + $text = ""; + for my $n ( 0 .. length($chars) ) { + my $chr = substr( $chars, $n, 1 ); + if ( $chr eq " " ) { + $chr = " "; + } + elsif ( ord($chr) < 32 ) { + + # leave control characters as-is + } + else { + $chr = chr( 0xff00 + ord($chr) - 32 ); + } + $text .= $chr; + } + } + elsif ( ( $item % $last ) == 1 ) { + $text = chr(0x442) . chr(0x435) . chr(0x441) . chr(0x442); + } + elsif ( ( $item % $last ) == 2 ) { + for my $chr ( 0x391 .. 0x3a9 ) { + $text .= chr($chr); + } + } + elsif ( ( $item % $last ) == 3 ) { + for my $chr ( 0x3b1 .. 0x3c9 ) { + $text .= chr($chr); + } + } + return $text; +} + +sub set_titletext() { + my $opt = &get_selector; + if ( $opt >= 0 ) { + my $text; + if ($opt_g) { + + if (&SendUTF8) { + $text = &utf8_sample( $utf8_sample++ ); + } + else { + # ugly code, but mapping the a/e/i/o/u uppercase accented + # characters that repeat. + my $a_chars = chr(192) . chr(193) . chr(194) . chr(196); + my $e_chars = ""; + my $i_chars = " "; + my $o_chars = chr(210) . chr(211) . chr(212) . chr(214); + my $u_chars = ""; + my $gap = " " . chr(215) . " "; + for my $chr ( 0 .. 3 ) { + $e_chars .= chr( $chr + 200 ); + $i_chars .= chr( $chr + 204 ) . " "; + $u_chars .= chr( $chr + 217 ); + } + $text = + $a_chars + . $gap + . $e_chars + . $gap + . $i_chars + . $gap + . $o_chars + . $gap + . $u_chars; + } + printf "%s\r\n", $text; + } + else { + &cooked; + $text = ReadLine 0; + chomp $text; + &raw; + } + $titlestack[$SP] = $text; + $item_stack[$SP] = $opt; + $mode_stack[$SP] = $TM; + if (&SendHEX) { + my $octets = + encode( ( &SendUTF8 ? "utf-8" : "iso-8859-1" ), $text ); + $text = &to_hex($octets); + } + &send_command( sprintf( "%s%s;%s%s", $OSC, $opt, $text, $ST ) ); + } +} + +sub save_title() { + my $opt = &get_selector; + if ( $opt >= 0 ) { + &send_command( sprintf( "%s22;%st", $CSI, $opt ) ); + ++$SP; + $titlestack[$SP] = $titlestack[ $SP - 1 ]; + $item_stack[$SP] = $opt; + $mode_stack[$SP] = $mode_stack[ $SP - 1 ]; + } +} + +sub restore_title($) { + my $set = shift; + my $opt = &get_selector unless ($set); + if ( $opt >= 0 and $SP > 0 ) { + $opt = $item_stack[$SP] if ($set); + &send_command( sprintf( "%s23;%st", $CSI, $opt ) ); + $SP--; + } +} + +sub get_xprop($$) { + my $id = shift; + my $name = shift; + my @data = &read_cmd("xprop -id $id"); + my $prop = ""; + for my $n ( 0 .. $#data ) { + if ( $data[$n] =~ /$name\([^)]+\) =/ ) { + $prop = $data[$n]; + $prop =~ s/^[^=]*=\s*//; + $prop =~ s/"//g; + last; + } + } + return $prop; +} + +sub get_WM_NAME() { + $wm_name = "missing WM_NAME"; + my $supwin = `xprop -root '_NET_SUPPORTING_WM_CHECK'`; + if ( $supwin ne "" ) { + $supwin =~ s/^.*(0x[[:xdigit:]]+).*/$1/; + $wm_name = &get_xprop( $supwin, "_NET_WM_NAME" ); + $wm_name = "unknown" if ( $wm_name eq "" ); + printf "** using \"$wm_name\" window manager\n"; + } +} + +sub main::HELP_MESSAGE() { + printf STDERR < 0 ) { + &restore_title(1); +} + +&send_command( sprintf( "%s>T", $CSI ) ); # reset title-modes to default + +&cooked; + +printf "\x1b F" if ($opt_8); diff --git a/app/xterm/vttests/unascii.sh b/app/xterm/vttests/unascii.sh new file mode 100644 index 000000000..dcd4d0b96 --- /dev/null +++ b/app/xterm/vttests/unascii.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# $XTermId: unascii.sh,v 1.2 2013/09/02 21:54:06 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2013 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# display the characters recognized by xterm in AsciiEquivs +export PATH=$(dirname $(readlink -f $0)):$PATH +vxt-utf8 0x2010 +vxt-utf8 0x2011 +vxt-utf8 0x2012 +vxt-utf8 0x2013 +vxt-utf8 0x2014 +vxt-utf8 0x2015 +vxt-utf8 0x2212 +vxt-utf8 0x2018 +vxt-utf8 0x2019 +vxt-utf8 0x201C +vxt-utf8 0x201D +vxt-utf8 0x2329 +vxt-utf8 0x232a diff --git a/app/xterm/vttests/under-latin.pl b/app/xterm/vttests/under-latin.pl new file mode 100644 index 000000000..1332b39a8 --- /dev/null +++ b/app/xterm/vttests/under-latin.pl @@ -0,0 +1,127 @@ +#!/usr/bin/env perl +# $XTermId: under-latin.pl,v 1.6 2020/01/31 00:16:52 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2020 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Print a text-test pattern using Latin-1 characters that have these features: +# a) accents +# b) descenders +# c) underlining + +use strict; +use warnings; + +use Getopt::Std; +use Term::ReadKey; + +$| = 1; + +our ( $opt_b, $opt_i, $opt_u ); + +our $ROWS = 24; +our $COLS = 4; + +our @sample; + +sub underlined($$) { + my $text = shift; + my $code = shift; + $text = sprintf "\033[4m%s\033[24m", $text if ($code); + return $text; +} + +sub print_row($) { + my $y = shift; + my $cells = $y * 5; + for my $x ( 0 .. $COLS ) { + printf "%s", + &underlined( $sample[ $cells % 2 ], ( $cells % 4 ) > 1 ? 1 : 0 ); + ++$cells; + } +} + +sub main::HELP_MESSAGE() { + printf STDERR <= $ROWS ); +} + +if ( -t 1 ) { + printf "\033[m"; + ReadMode 'cbreak'; + my $key = ReadKey(30); + ReadMode 'normal'; +} +printf "\n"; + +1; diff --git a/app/xterm/vttests/utf8.pl b/app/xterm/vttests/utf8.pl new file mode 100644 index 000000000..3b162361e --- /dev/null +++ b/app/xterm/vttests/utf8.pl @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# $XTermId: utf8.pl,v 1.5 2018/12/14 09:25:47 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2012,2018 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# display the given Unicode characters, given their hex or decimal values. + +use strict; +use Encode 'encode_utf8'; + +sub vxt_utf8($) { + my $arg = $_[0]; + my $hex = $arg; + my $dec = $arg; + if ( $arg =~ /^u\+[[:xdigit:]]+/i ) { + $hex =~ s/^../0x/; + $dec = hex($hex); + } elsif ( $arg !~ /^0x[[:xdigit:]]+$/i ) { + $hex = sprintf "%04X", $arg; + } elsif ( $arg !~ /^u\+[[:xdigit:]]+$/i ) { + $hex =~ s/^u\+//i; + $hex = sprintf "%04X", $arg; + } else { + $dec = hex($hex); + } + my $chr = chr($dec); + my $type = ( $chr =~ /\p{isPrint}/ + ? ( $chr =~ /\p{isAlpha}/ + ? "alpha" + : ( $chr =~ /\p{isPunct}/ + ? "punct" + : ( $chr =~ /\p{isDigit}/ + ? "digit" + : "printing" ) ) ) + : ( $chr =~ /\p{isCntrl}/ + ? "cntrl" + : "nonprinting" ) ); + printf "%d ->%#x ->{%s} (%d bytes, %s)\n", $dec, $dec, $chr, length(Encode::encode_utf8($dec)), $type; +} + +binmode(STDOUT, ":utf8"); +while ( $#ARGV >= 0 ) { + vxt_utf8 ( shift @ARGV ); +} +exit; diff --git a/app/xterm/vttests/version.sh b/app/xterm/vttests/version.sh new file mode 100644 index 000000000..7e680fe38 --- /dev/null +++ b/app/xterm/vttests/version.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# $XTermId: version.sh,v 1.1 2020/04/25 20:47:48 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2020 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Demonstrate version-string from xterm #354 + +ESC="" +CMD='/bin/echo' +OPT='-n' +SUF='' +TMP=/tmp/xterm$$ +eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null +( test ! -f $TMP || test -s $TMP ) && +for verb in printf print ; do + rm -f $TMP + eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null + if test -f $TMP ; then + if test ! -s $TMP ; then + CMD="$verb" + OPT= + SUF='\c' + break + fi + fi +done +rm -f $TMP + +exec 0q${SUF}" > /dev/tty +read version + +stty $old +echo "$version" |cat -v diff --git a/app/xterm/vttests/vt52chars.pl b/app/xterm/vttests/vt52chars.pl new file mode 100644 index 000000000..f102d23e9 --- /dev/null +++ b/app/xterm/vttests/vt52chars.pl @@ -0,0 +1,109 @@ +#!/usr/bin/env perl +# $XTermId: vt52chars.pl,v 1.1 2019/07/08 20:27:21 tom Exp $ +# ----------------------------------------------------------------------------- +# Copyright 2019 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# show the vt52 graphic characters, annotatated in a table. + +sub clear() { + printf "\033H"; # home + printf "\033J"; # erase +} + +sub move($$) { + my $y = shift; + my $x = shift; + printf "\033Y%c%c", $y + 32, $x + 32; +} + +sub start_vt52() { + printf "\033[?2l"; +} + +sub stop_vt52() { + printf "\033<"; +} + +sub show_char() { + my $value = shift; + my $string = shift; + my $chr = $value - 0140; + return if ( $chr < 0 ); # not supported by xterm + $value &= 0xff; + my $y = 2 + int( $chr % 16 ); + my $x = 6 + int( $chr / 16 ) * 40; + &move( $y, $x ); + printf "%03o \033F%s\033G %s", $value, chr($value), $string; +} + +sub show_table() { + &clear; + &move( 0, 28 ); + printf "VT52 graphic characters"; + &show_char( 0140, "reserved" ); + &show_char( 0141, "solid rectangle" ); + &show_char( 0142, "1/" ); + &show_char( 0143, "3/" ); + &show_char( 0144, "5/" ); + &show_char( 0145, "7/" ); + &show_char( 0146, "degrees" ); + &show_char( 0147, "plus or minus" ); + &show_char( 0150, "right arrow" ); + &show_char( 0151, "ellipsis" ); + &show_char( 0152, "divide by" ); + &show_char( 0153, "down arrow" ); + &show_char( 0154, "bar at scan 0" ); + &show_char( 0155, "bar at scan 1" ); + &show_char( 0156, "bar at scan 2" ); + &show_char( 0157, "bar at scan 3" ); + &show_char( 0160, "bar at scan 4" ); + &show_char( 0161, "bar at scan 5" ); + &show_char( 0162, "bar at scan 6" ); + &show_char( 0163, "bar at scan 7" ); + &show_char( 0164, "subscript 0" ); + &show_char( 0165, "subscript 1" ); + &show_char( 0166, "subscript 2" ); + &show_char( 0167, "subscript 3" ); + &show_char( 0170, "subscript 4" ); + &show_char( 0171, "subscript 5" ); + &show_char( 0172, "subscript 6" ); + &show_char( 0173, "subscript 7" ); + &show_char( 0174, "subscript 8" ); + &show_char( 0175, "subscript 9" ); + &show_char( 0176, "paragraph" ); + &move( 19, 6 ); + printf "BAR[\033F\154\155\156\157\160\161\162\163\033G]"; + &move( 23, 0 ); +} + +&start_vt52; +&show_table; +&stop_vt52; + +1; diff --git a/app/xterm/vttests/wrap.pl b/app/xterm/vttests/wrap.pl new file mode 100644 index 000000000..d454d7242 --- /dev/null +++ b/app/xterm/vttests/wrap.pl @@ -0,0 +1,165 @@ +#!/usr/bin/env perl +# $XTermId: wrap.pl,v 1.12 2007/07/13 00:15:28 tom Exp $ +# ----------------------------------------------------------------------------- +# Copyright 2007 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Generates a series of wrapping lines, according to the terminal width. +# The wrapping text optionally includes double-width or other characters +# encoded in UTF-8. +use strict; + +use Getopt::Std; + +our ($opt_i, $opt_n, $opt_r, $opt_w); +our ($lineno, $test_string, $term_width); + +# Return a string of two-column characters given an ASCII alpha/numeric string +sub double_cells($) { + my $value = $_[0]; + $value =~ s/ / /g; + pack("U*", + map { ($_ <= 32 || $_ > 127) # if non-ASCII character... + ? 32 # ...just show a blank + : (0xff00 + ($_ - 32)) # map to "Fullwidth Form" + } unpack("C*", $value)); # unpack unsigned-char characters +} + +# Insert a character using escape sequences to push the existing text to the +# right, write the actual character and then move left one column so succeeding +# calls will do the same. This will not cause the pushed-text to wrap, but +# will exercise the right-margin logic in other ways. +# +# Since this script does not modify the autowrap mode, you can reset that +# outside the script and compare the default (unwrapped) versus the "-i" +# option. +sub insert_char($$) { + my $value = $_[0]; + my $final = $_[1]; + my $cells = defined($opt_w) ? 2 : 1; + printf "\x1b[%d@", $cells; + printf "%s", defined($opt_w) ? double_cells($value) : $value; + if ( ! $final ) { + printf "\x1b[%dD", $cells; + } +} + +# vary the starting point of each line, to make a more interesting pattern +sub starts_of($) { + my $value = $_[0]; + if (defined($opt_w)) { + # 0,1,1,2,2,3,3,... + $value = (($value + 1) / 2) % length($test_string); + } else { + $value %= length($test_string); + } + return $value; +} + +# Vary the length of each line from $term_width - 5 to $term_width + 5, then +# double it, and then repeat. That's 22/cycle. +sub length_of($) { + my $value = $_[0]; + my $cycle = $value % 22; + if ( $cycle < 11 ) { + $value = $term_width; + } else { + $value = $term_width * 2; + $cycle /= 2; + } + return $value + $cycle - 5; +} + +# Write the text for the given line-number. +sub testit($) { + my $number = $_[0]; + my $length = length_of($number); + if ( defined($opt_n) ) { + printf "%5d ", $number % 99999; + $length -= 6; + } + # If we're printing double-column characters, we have half as much + # space effectively - but don't forget the remainder, so we can push + # the characters by single-columns. + my $starts = starts_of($number); + if ( defined($opt_w) ) { + printf " ", if ( ($number % 2 ) != 0); + $length = ($length + (($number + 1) % 2)) / 2; + } + my $string = substr($test_string, $starts); + while ( length($string) < $length ) { + $string = $string . $test_string; + } + $string = substr($string, 0, $length); + if ( defined($opt_i) ) { + my ($n, $c); + for ($n = length($string) - 1; $n >= 0; $n--) { + insert_char(substr($string, $n, 1), $n == 0); + } + printf "\n"; + } else { + if ( defined($opt_w) ) { + $string = double_cells($string); + } + printf "%s\n", $string; + } +} + +sub main::HELP_MESSAGE() { + printf STDERR < Start Blinking Cursor (att610). +# +# CSI ? Pm l +# DEC Private Mode Reset (DECRST). +# Ps = 1 2 -> Stop Blinking Cursor (att610). +# +# CSI Ps SP q +# Set cursor style (DECSCUSR, VT520). +# Ps = 0 -> blinking block. +# Ps = 1 -> blinking block (default). +# Ps = 2 -> steady block. +# Ps = 3 -> blinking underline. +# Ps = 4 -> steady underline. +# Ps = 5 -> blinking bar (xterm). +# Ps = 6 -> steady bar (xterm). +# +use strict; + +use Term::ReadKey; + +use IO::Handle; +STDERR->autoflush(1); +STDOUT->autoflush(1); + +our %DECSET = ( + "\e[?12h", "Start Blinking Cursor (AT&T 610)", + "\e[?12l", "Stop Blinking Cursor (AT&T 610)" +); + +our %DECSCUSR = ( + "\e[0 q", + "blinking block", + "\e[1 q", + "blinking block (default)", + "\e[2 q", + "steady block", + "\e[3 q", + "blinking underline", + "\e[4 q", + "steady underline", + "\e[5 q", + "blinking bar (xterm)", + "\e[6 q", + "steady bar (xterm)" +); + +sub show($$) { + my $seq = shift; + my $txt = shift; + printf "%s -> %s\n", &visible($seq), $txt; +} + +sub get_reply($$) { + my $seq = shift; + my $end = shift; + printf STDERR "%s", $seq; + my $key; + my $result = ""; + $key = ReadKey(0); + $result .= $key; + if ( $key eq "\e" ) { + + while (1) { + $key = ReadKey(100); + $result .= $key; + next if ( length($result) < length($end) ); + last if ( substr( $result, -length($end) ) eq $end ); + } + } + return $result; +} + +sub mode_value($) { + my $value = shift; + if ( $value eq 1 ) { + $value = "set"; + } + elsif ( $value eq 2 ) { + $value = "reset"; + } + elsif ( $value eq 3 ) { + $value = "*set"; + } + elsif ( $value eq 4 ) { + $value = "*reset"; + } + else { + $value = &visible( "?" . $value ); + } + return $value; +} + +sub DECRQM($) { + my $mode = shift; + my $sequence = sprintf( "\e[?%d\$p", $mode ); + my $reply = &get_reply( $sequence, "y" ); + if ( $reply =~ /^\e\[\?$mode;\d+\$y$/ ) { + $reply =~ s/^\e\[\?$mode;(\d+)\$y$/$1/; + } + return &mode_value($reply); +} + +sub DECRQSS($) { + my $request = shift; + my $ending = "\e\\"; + my $sequence = sprintf( "\eP\$q%s$ending", $request ); + my $reply = &get_reply( $sequence, $ending ); + + # xterm responds with + # DCS 1 $ r Pt ST for valid requests, + # DCS 0 $ r Pt ST for invalid requests. + #if ( $reply =~ /^\eP1\$r.*$ending$/ ) { + if ( $reply =~ /^\eP1\$r\d+ q\e\\$/ ) { + $reply =~ s/^\eP1\$r(\d+) q\e\\$/$1/; + } + return &visible($reply); +} + +sub get_key() { + my $key; + do { + $key = ReadKey(0); + if ( $key eq "\e" ) { + while ( ReadKey(10) !~ /[@-~]/ ) { + # + } + } + } while ( $key eq "\e" ); + return $key; +} + +sub visible($) { + my $txt = shift; + $txt =~ s/\e/\\e/g; + $txt =~ s/\a/\\a/g; + return $txt; +} + +sub test($$) { + my $set = shift; + my $msg = shift; + + ReadMode 'raw'; + + printf STDERR "%s\t[", &visible($set); + + # save the cursor position + printf STDERR "\e7"; + + # send the escape sequence + printf STDERR "%s", $set; + + # print the description + printf STDERR "X] "; + + printf STDERR " [C=%s,", &DECRQSS(" q"); + printf STDERR "B=%s,", &DECRQM(12); + printf STDERR "M=%s,%s]", &DECRQM(13), &DECRQM(14); + printf STDERR " %s", $msg; + printf STDERR "\e[0J"; + + # restore the cursor position + printf STDERR "\e8"; + + # wait for any key + my $key = &get_key; + ReadMode 'restore'; + + # print newline + printf STDERR "\n"; + + # A backspace response makes the current line reprint (to test menus) + return ( $key ne "\b" and $key ne "\177" ) ? 1 : 0; +} + +if ( -t STDOUT ) { + printf "Legend:\n"; + printf " C = cursor shape (1,2 block, 3,4 underline, 5,6 left-bar)\n"; + printf " B = escape-sequence blink\n"; + printf " M = menu blink and XOR mode\n"; + printf "\n"; + printf "An asterisk means the mode is always set or reset.\n"; + printf "Press any key to proceed; press backspace to reprint line.\n"; + printf "\n"; + my @DECSET = sort keys %DECSET; + my @DECSCUSR = sort keys %DECSCUSR; + + for ( my $h = 0 ; $h <= $#DECSET ; ++$h ) { + $h-- unless &test( $DECSET[$h], $DECSET{ $DECSET[$h] } ); + } + for my $l ( 0 .. $#DECSCUSR ) { + $l-- unless &test( $DECSCUSR[$l], $DECSCUSR{ $DECSCUSR[$l] } ); + } +} +else { + printf "DECSET (AT&T 610 blinking cursor):\n"; + for my $key ( sort keys %DECSET ) { + &show( $key, $DECSET{$key} ); + } + + printf "DECSCUSR:\n"; + for my $key ( sort keys %DECSCUSR ) { + &show( $key, $DECSCUSR{$key} ); + } +} +1; diff --git a/app/xterm/vttests/xtra-scroll.pl b/app/xterm/vttests/xtra-scroll.pl new file mode 100644 index 000000000..fcf5ae261 --- /dev/null +++ b/app/xterm/vttests/xtra-scroll.pl @@ -0,0 +1,539 @@ +#!/usr/bin/env perl +# $XTermId: xtra-scroll.pl,v 1.12 2021/09/03 18:34:50 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 2021 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. +# ----------------------------------------------------------------------------- +# Interactively test screen-updates which can exercise the cdXtraScroll and +# tiXtraScroll features. + +use strict; +use warnings; + +use Getopt::Std; +use Term::ReadKey; +use I18N::Langinfo qw(langinfo CODESET); + +$! = 1; + +our $target = ""; + +our $encoding = lc( langinfo( CODESET() ) ); +our ($opt_8); + +our $dirty = 1; # nonzero if the screen should be painted +our $mode_margin = 0; # nonzero if left/right margin mode enabled +our $mode_origin = 0; # nonzero if origin-mode in effect +our $mode_screen = 0; # nonzero if using alternate screen +our $pos_x = 0; # current cursor-Y, absolute +our $pos_y = 0; # current cursor-X, absolute +our $term_high; # terminal's height +our $term_wide; # terminal's width +our $CSI = "\x1b["; +our $crlf = "\r\n"; +our $text_sample = "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG "; +our $text_filler = ""; +our %margins; + +sub raw() { + ReadMode 'ultra-raw', 'STDIN'; # allow single-character inputs +} + +sub cooked() { + ReadMode 'normal'; +} + +sub utf8_sample() { + my $text = ""; + for my $n ( 0 .. length($text_sample) ) { + my $chr = substr( $text_sample, $n, 1 ); + if ( $chr eq " " ) { + $chr = " "; + } + elsif ( ord($chr) < 32 ) { + + # leave control characters as-is + } + else { + $chr = chr( 0xff00 + ord($chr) - 32 ); + } + $text .= $chr; + } + return $text; +} + +sub next_x($) { + my $value = shift; + if ($mode_margin) { + $value = $margins{R} if ( $value < $margins{R} ); + $value = $margins{L} if ( $value > $margins{L} ); + } + else { + $value = $value % $term_wide; + } + return $value; +} + +sub next_y($) { + my $value = shift; + if ($mode_origin) { + $value = $margins{B} if ( $value < $margins{T} ); + $value = $margins{T} if ( $value > $margins{B} ); + } + else { + $value = $value % $term_high; + } + return $value; +} + +sub move() { + my $y = $pos_y; + if ($mode_origin) { + my $min_y = ( $margins{T} >= 0 ) ? $margins{T} : 0; + my $two_y = $min_y + 1; # scrolling region is at least 2 lines + my $max_y = ( $margins{B} >= $two_y ) ? $margins{B} : $two_y; + $y = $max_y if ( $y > $max_y ); + $y -= $min_y; # convert to relative ordinate + } + $y = 0 if ( $y < 0 ); + printf STDERR "%s%d;%dH", $CSI, 1 + $y, 1 + $pos_x; +} + +sub home() { + printf STDERR "%sH", $CSI; + $pos_x = 0; + $pos_y = 0; + &move; +} + +sub erase_display($) { + my $mode = shift; + printf STDERR "%s%sJ", $CSI, $mode; +} + +sub erase_line($) { + my $mode = shift; + printf STDERR "%s%sK", $CSI, $mode; +} + +sub toggle($) { + my $value = shift; + return ( $value == 0 ) ? 1 : 0; +} + +################################################################################ + +sub set_margin_mode($) { + my $mode = shift; + printf STDERR "%s?69%s", $CSI, ( $mode == 0 ) ? "l" : "h"; + $mode_margin = $mode; +} + +################################################################################ + +sub set_origin_mode($) { + my $mode = shift; + printf STDERR "%s?6%s", $CSI, ( $mode == 0 ) ? "l" : "h"; + $mode_origin = $mode; +} + +################################################################################ + +sub set_screen_mode($) { + my $mode = shift; + printf STDERR "%s?1049%s", $CSI, ( $mode == 0 ) ? "l" : "h"; + $mode_screen = $mode; +} + +################################################################################ + +sub do_tb_margins($$) { + my $param_T = ""; + my $param_B = ""; + $param_T = sprintf( "%d", 1 + $margins{T} ) if ( $margins{T} >= 0 ); + $param_B = sprintf( "%d", 1 + $margins{B} ) + if ( $margins{B} > $margins{T} ); + printf STDERR "%s%s;%sr", $CSI, $param_T, $param_B; + &move; +} + +sub undo_tb_margins() { + &do_tb_margins( -1, -1 ); +} + +sub redo_tb_margins() { + &do_tb_margins( $margins{T}, $margins{B} ); +} + +sub set_tb_margins($$) { + my $reset = ( not defined $margins{T} or not defined $margins{B} ) ? 1 : 0; + my $old_T = 1; + my $old_B = $term_high; + $old_T = $margins{T} if ( defined $margins{T} ); + $old_B = $margins{B} if ( defined $margins{B} ); + $margins{T} = shift; + $margins{B} = shift; + if ( $reset == 0 ) { + $reset = 1 if ( $old_T != $margins{T} ); + $reset = 1 if ( $old_B != $margins{B} ); + } + &redo_tb_margins if ( $reset == 1 ); +} + +################################################################################ + +sub do_lr_margins($$) { + my $param_L = ""; + my $param_R = ""; + $param_L = sprintf( "%d", 1 + $margins{L} ) if ( $margins{L} >= 0 ); + $param_R = sprintf( "%d", 1 + $margins{R} ) + if ( $margins{R} > $margins{T} ); + printf STDERR "%s%s;%ss", $CSI, $param_L, $param_R; + &move; +} + +sub undo_lr_margins() { + &do_lr_margins( -1, -1 ); +} + +sub redo_lr_margins() { + &do_lr_margins( $margins{L}, $margins{R} ); +} + +sub set_lr_margins($$) { + my $reset = ( not defined $margins{L} or not defined $margins{R} ) ? 1 : 0; + my $old_L = 1; + my $old_R = $term_high; + $old_L = $margins{L} if ( defined $margins{L} ); + $old_R = $margins{R} if ( defined $margins{R} ); + $margins{L} = shift; + $margins{R} = shift; + if ( $reset == 0 ) { + $reset = 1 if ( $old_L != $margins{L} ); + $reset = 1 if ( $old_R != $margins{R} ); + } + &redo_lr_margins if ( $reset == 1 ); +} + +################################################################################ + +sub has_tb_margins() { + my $result = 0; + $result = 1 if ( $margins{T} != 1 ); + $result = 1 if ( $margins{B} != $term_high ); + return $result; +} + +sub repaint($) { + my $erase = shift; + my $save_x = $pos_x; + my $save_y = $pos_y; + $dirty = 0; + if ($erase) { + &home; + &erase_display(2); + } + if ( $text_filler ne "" ) { + if ( $mode_origin and &has_tb_margins ) { + my @rows = split /$crlf/, $text_filler; + for my $row ( 0 .. $#rows ) { + next unless ( $row >= $margins{T} ); + next unless ( $row <= $margins{B} ); + printf STDERR "%s$crlf", $rows[$row]; + } + } + else { + printf STDERR "%s$crlf", $text_filler; + } + } + else { + my $cells = 0; + my $limit = $term_high * $term_wide; + while ( $cells < $limit ) { + my $sample = ( $encoding eq "utf-8" ) ? &utf8_sample : $text_sample; + printf STDERR "%s", $sample; + $cells += length($sample); + } + } + $pos_x = $save_x; + $pos_y = $save_y; + &move; +} + +sub initialize() { + if ( $encoding eq "utf-8" ) { + binmode( STDOUT, ":utf8" ); + binmode( STDERR, ":utf8" ); + } + if ($opt_8) { + if ( $encoding eq "utf-8" ) { + undef $opt_8; + printf "...ignoring -8 option since locale uses %s\n", $encoding; + } + else { + printf STDERR "\x1b G"; + $CSI = "\x9b"; + } + } + + &raw; + + my @term_size = GetTerminalSize( \*STDERR ); + $term_wide = 80; + $term_wide = $term_size[0] if ( $#term_size >= 0 ); + $term_wide = 80 if ( $term_wide <= 0 ); + $term_high = 24; + $term_high = $term_size[1] if ( $#term_size >= 1 ); + $term_high = 24 if ( $term_high <= 0 ); + + &set_margin_mode(0); + &set_origin_mode(0); + &set_screen_mode(0); + + &set_tb_margins( -1, -1 ); + &set_lr_margins( 1, $term_wide ); + + &home; + &erase_display("2"); +} + +sub cleanup() { + &cooked; + + printf STDERR "\x1b F" if ($opt_8); + + &set_margin_mode(0); + &set_origin_mode(0); + &set_screen_mode(0); + + &undo_tb_margins; + + $pos_x = 1; + $pos_y = $term_high - 2; + &move; + &erase_display(""); +} + +sub beep() { + printf STDERR "\a"; +} + +sub main::HELP_MESSAGE() { + printf STDERR <; + chomp @lines; + close FP; + $text_filler = join( $crlf, @lines ); + } +} + +printf "encoding $encoding\n"; + +&initialize(); + +while (1) { + my $cmd; + + printf "\r\nCommand (? for help):" if ( $dirty != 0 ); + $cmd = ReadKey 0; + if ( not $cmd ) { + sleep 1; + } + elsif ( $cmd eq "?" ) { + $dirty = 1; + &home; + &erase_display(2); + printf $crlf + . "General:" + . $crlf + . " ? (help)," + . " q (quit)" + . $crlf + . "Clear:" + . $crlf + . " C (entire screen)," + . " c (screen-below)," + . " E (entire line)," + . " e (line-right)" + . $crlf . "Fill:" + . $crlf + . " @ (margin-box)," + . " # (prompt-char)" + . $crlf + . "Move cursor:\r\n" + . " h,j,k,l (vi-like)," + . " H (to home)." + . $crlf + . "Set margin using current position:" + . $crlf + . " T (top)," + . " B (bottom)," + . " L (left)," + . " R (right)" + . $crlf + . "Reset modes" + . $crlf + . " M (margins)" + . $crlf + . "Toggle modes" + . $crlf + . " A (alternate-screen)," + . " O (origin-mode)" + . " | (left/right-mode)" + . $crlf + . "Print sample:" + . " form-feed (repaint)"; + } + elsif ( $cmd eq "\033" ) { + + # try to ignore special-keys + my $count = 0; + while (1) { + $cmd = ReadKey 0; + $count++; + next if ( $count == 1 and $cmd eq "O" ); + next unless ( $cmd =~ /^[A-~]$/ ); + $cmd = ReadKey 0; + last; + } + } + elsif ( $cmd eq "q" ) { + last; + } + elsif ( index( "CcEe@#hjklHMTBLRAO|\f", $cmd ) >= 0 ) { + my $was_dirty = $dirty; + &repaint(1) if ( $dirty != 0 ); + if ( $cmd eq "C" ) { + &home; + &erase_display("2"); + } + elsif ( $cmd eq "c" ) { + &erase_display(""); + } + elsif ( $cmd eq "E" ) { + &erase_line("2"); + } + elsif ( $cmd eq "e" ) { + &erase_line(""); + } + elsif ( $cmd eq "@" ) { + + # FIXME + } + elsif ( $cmd eq "#" ) { + $text_sample = ReadKey 0; + if ( $text_filler ne "" ) { + my $save_filler = $text_filler; + $text_filler =~ s/[^\d\s]/$text_sample/g; + &repaint(0); + $text_filler = $save_filler; + } + else { + &repaint(0); + } + } + elsif ( $cmd eq "h" ) { + $pos_x = &next_x( $pos_x - 1 ); + &move; + } + elsif ( $cmd eq "j" ) { + $pos_y = &next_y( $pos_y + 1 ); + &move; + } + elsif ( $cmd eq "k" ) { + $pos_y = &next_y( $pos_y - 1 ); + &move; + } + elsif ( $cmd eq "l" ) { + $pos_x = &next_x( $pos_x + 1 ); + &move; + } + elsif ( $cmd eq "H" ) { + &home; + } + elsif ( $cmd eq "M" ) { + &set_tb_margins( -1, -1 ); + &set_lr_margins( -1, -1 ); + &repaint(0); + } + elsif ( $cmd eq "T" ) { + &set_tb_margins( $pos_y, $margins{B} ); + } + elsif ( $cmd eq "B" ) { + &set_tb_margins( $margins{T}, $pos_y ); + } + elsif ( $cmd eq "L" ) { + &set_lr_margins( $pos_x, $margins{R} ); + } + elsif ( $cmd eq "R" ) { + &set_lr_margins( $margins{L}, $pos_x ); + } + elsif ( $cmd eq "A" ) { + &set_screen_mode( &toggle($mode_screen) ); + &repaint(1); + } + elsif ( $cmd eq "O" ) { + &set_origin_mode( &toggle($mode_origin) ); + } + elsif ( $cmd eq "|" ) { + &set_margin_mode( &toggle($mode_margin) ); + } + elsif ( $cmd eq "\f" ) { + &repaint(1) unless ($was_dirty); + } + else { + &beep; + $dirty = 2; + } + } + else { + &beep; + } +} + +&cleanup; +printf " ...quit\r\n"; + +1; diff --git a/app/xterm/wcwidth.c b/app/xterm/wcwidth.c index a94c9db0d..023aa9004 100644 --- a/app/xterm/wcwidth.c +++ b/app/xterm/wcwidth.c @@ -1,9 +1,9 @@ -/* $XTermId: wcwidth.c,v 1.58 2021/06/12 13:08:53 tom Exp $ */ +/* $XTermId: wcwidth.c,v 1.59 2022/02/13 16:11:03 tom Exp $ */ /* $XFree86: xc/programs/xterm/wcwidth.c,v 1.9 2006/06/19 00:36:52 dickey Exp $ */ /* - * Copyright 2002-2020,2021 by Thomas E. Dickey + * Copyright 2002-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -188,6 +188,9 @@ void mk_wcwidth_init(int mode) * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) * have a column width of 0. * + * - Hangul Jamo Extended-B medial vowels and final consonants for old + * Korean (U+D7B0-U+D7FF) have a column width of 0. + * * - Spacing characters in the East Asian Wide (W) or East Asian * Full-width (F) category as defined in Unicode Technical * Report #11 have a column width of 2. In that report, some codes @@ -288,51 +291,52 @@ int mk_wcwidth(wchar_t ucs) { 0xAAB2, 0xAAB4 }, { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, { 0xAAEC, 0xAAED }, { 0xAAF6, 0xAAF6 }, { 0xABE5, 0xABE5 }, { 0xABE8, 0xABE8 }, { 0xABED, 0xABED }, - { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE2F }, - { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, { 0x101FD, 0x101FD }, - { 0x102E0, 0x102E0 }, { 0x10376, 0x1037A }, { 0x10A01, 0x10A03 }, - { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, - { 0x10A3F, 0x10A3F }, { 0x10AE5, 0x10AE6 }, { 0x10D24, 0x10D27 }, - { 0x10EAB, 0x10EAC }, { 0x10F46, 0x10F50 }, { 0x10F82, 0x10F85 }, - { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x11070, 0x11070 }, - { 0x11073, 0x11074 }, { 0x1107F, 0x11081 }, { 0x110B3, 0x110B6 }, - { 0x110B9, 0x110BA }, { 0x110BD, 0x110BD }, { 0x110C2, 0x110C2 }, - { 0x110CD, 0x110CD }, { 0x11100, 0x11102 }, { 0x11127, 0x1112B }, - { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, { 0x11180, 0x11181 }, - { 0x111B6, 0x111BE }, { 0x111C9, 0x111CC }, { 0x111CF, 0x111CF }, - { 0x1122F, 0x11231 }, { 0x11234, 0x11234 }, { 0x11236, 0x11237 }, - { 0x1123E, 0x1123E }, { 0x112DF, 0x112DF }, { 0x112E3, 0x112EA }, - { 0x11300, 0x11301 }, { 0x1133B, 0x1133C }, { 0x11340, 0x11340 }, - { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11438, 0x1143F }, - { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, { 0x1145E, 0x1145E }, - { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, { 0x114BF, 0x114C0 }, - { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, { 0x115BC, 0x115BD }, - { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, { 0x11633, 0x1163A }, - { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, { 0x116AB, 0x116AB }, - { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, { 0x116B7, 0x116B7 }, - { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, { 0x11727, 0x1172B }, - { 0x1182F, 0x11837 }, { 0x11839, 0x1183A }, { 0x1193B, 0x1193C }, - { 0x1193E, 0x1193E }, { 0x11943, 0x11943 }, { 0x119D4, 0x119D7 }, - { 0x119DA, 0x119DB }, { 0x119E0, 0x119E0 }, { 0x11A01, 0x11A0A }, - { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, - { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, - { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, - { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, - { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, - { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, - { 0x11D47, 0x11D47 }, { 0x11D90, 0x11D91 }, { 0x11D95, 0x11D95 }, - { 0x11D97, 0x11D97 }, { 0x11EF3, 0x11EF4 }, { 0x13430, 0x13438 }, - { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, { 0x16F4F, 0x16F4F }, - { 0x16F8F, 0x16F92 }, { 0x16FE4, 0x16FE4 }, { 0x1BC9D, 0x1BC9E }, - { 0x1BCA0, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, - { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, - { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 }, - { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 }, - { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, - { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, - { 0x1E026, 0x1E02A }, { 0x1E130, 0x1E136 }, { 0x1E2AE, 0x1E2AE }, - { 0x1E2EC, 0x1E2EF }, { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, - { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } + { 0xD7B0, 0xD7FF }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x101FD, 0x101FD }, { 0x102E0, 0x102E0 }, { 0x10376, 0x1037A }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x10AE5, 0x10AE6 }, + { 0x10D24, 0x10D27 }, { 0x10EAB, 0x10EAC }, { 0x10F46, 0x10F50 }, + { 0x10F82, 0x10F85 }, { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, + { 0x11070, 0x11070 }, { 0x11073, 0x11074 }, { 0x1107F, 0x11081 }, + { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x110BD, 0x110BD }, + { 0x110C2, 0x110C2 }, { 0x110CD, 0x110CD }, { 0x11100, 0x11102 }, + { 0x11127, 0x1112B }, { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, + { 0x11180, 0x11181 }, { 0x111B6, 0x111BE }, { 0x111C9, 0x111CC }, + { 0x111CF, 0x111CF }, { 0x1122F, 0x11231 }, { 0x11234, 0x11234 }, + { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, { 0x112DF, 0x112DF }, + { 0x112E3, 0x112EA }, { 0x11300, 0x11301 }, { 0x1133B, 0x1133C }, + { 0x11340, 0x11340 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, + { 0x11438, 0x1143F }, { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, + { 0x1145E, 0x1145E }, { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, + { 0x114BF, 0x114C0 }, { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, + { 0x115BC, 0x115BD }, { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, + { 0x11633, 0x1163A }, { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, + { 0x116AB, 0x116AB }, { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, + { 0x116B7, 0x116B7 }, { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, + { 0x11727, 0x1172B }, { 0x1182F, 0x11837 }, { 0x11839, 0x1183A }, + { 0x1193B, 0x1193C }, { 0x1193E, 0x1193E }, { 0x11943, 0x11943 }, + { 0x119D4, 0x119D7 }, { 0x119DA, 0x119DB }, { 0x119E0, 0x119E0 }, + { 0x11A01, 0x11A0A }, { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, + { 0x11A47, 0x11A47 }, { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, + { 0x11A8A, 0x11A96 }, { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, + { 0x11C38, 0x11C3D }, { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, + { 0x11CAA, 0x11CB0 }, { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, + { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, + { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 }, { 0x11D90, 0x11D91 }, + { 0x11D95, 0x11D95 }, { 0x11D97, 0x11D97 }, { 0x11EF3, 0x11EF4 }, + { 0x13430, 0x13438 }, { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, + { 0x16F4F, 0x16F4F }, { 0x16F8F, 0x16F92 }, { 0x16FE4, 0x16FE4 }, + { 0x1BC9D, 0x1BC9E }, { 0x1BCA0, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, + { 0x1CF30, 0x1CF46 }, { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, + { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, + { 0x1DA00, 0x1DA36 }, { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, + { 0x1DA84, 0x1DA84 }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, + { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, + { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E130, 0x1E136 }, + { 0x1E2AE, 0x1E2AE }, { 0x1E2EC, 0x1E2EF }, { 0x1E8D0, 0x1E8D6 }, + { 0x1E944, 0x1E94A }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF } }; /* *INDENT-ON* */ diff --git a/app/xterm/xterm.appdata.xml b/app/xterm/xterm.appdata.xml index 460df3422..92fa95b1c 100644 --- a/app/xterm/xterm.appdata.xml +++ b/app/xterm/xterm.appdata.xml @@ -1,5 +1,5 @@ - + xterm.desktop CC-BY-3.0 @@ -35,7 +35,7 @@ terminal - + https://invisible-island.net/xterm/ dickey@invisible-island.net diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h index 80a1b2ac4..468294a99 100644 --- a/app/xterm/xterm.h +++ b/app/xterm/xterm.h @@ -1,7 +1,7 @@ -/* $XTermId: xterm.h,v 1.902 2021/09/19 18:27:35 tom Exp $ */ +/* $XTermId: xterm.h,v 1.910 2022/03/09 00:39:01 tom Exp $ */ /* - * Copyright 1999-2020,2021 by Thomas E. Dickey + * Copyright 1999-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -540,6 +540,7 @@ extern char **environ; #define XtNhpLowerleftBugCompat "hpLowerleftBugCompat" #define XtNi18nSelections "i18nSelections" #define XtNiconHint "iconHint" +#define XtNindicatorFormat "indicatorFormat" #define XtNinitialFont "initialFont" #define XtNinternalBorder "internalBorder" #define XtNitalicULMode "italicULMode" @@ -747,6 +748,7 @@ extern char **environ; #define XtCHpLowerleftBugCompat "HpLowerleftBugCompat" #define XtCI18nSelections "I18nSelections" #define XtCIconHint "IconHint" +#define XtCIndicatorFormat "IndicatorFormat" #define XtCInitialFont "InitialFont" #define XtCJumpScroll "JumpScroll" #define XtCKeepClipboard "KeepClipboard" @@ -966,11 +968,11 @@ extern void report_char_class(XtermWidget); #define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2)) #define isWide(n) (((IChar)(n) >= first_widechar) && isWideFrg(n)) #define CharWidth(screen, n) ((!((screen)->utf8_mode) && ((n) < 256)) \ - ? (IsLatin1(n) ? 1 : 0) \ - : my_wcwidth((wchar_t) (n))) + ? (IsLatin1(n) ? 1 : 0) \ + : my_wcwidth((wchar_t) (n))) #else #define WideCells(n) 1 -#define CharWidth(n) (IsLatin1(n) ? 1 : 0) +#define CharWidth(screen, n) (IsLatin1(n) ? 1 : 0) #endif /* cachedCgs.c */ @@ -1066,7 +1068,9 @@ extern void CursorDown (TScreen * /* screen */, int /* n */); extern void CursorForward (XtermWidget /* xw */, int /* n */); extern void CursorNextLine (XtermWidget /* xw */, int /* count */); extern void CursorPrevLine (XtermWidget /* xw */, int /* count */); +extern void CursorRestore2 (XtermWidget /* xw */, SavedCursor * /* sc */); extern void CursorRestore (XtermWidget /* xw */); +extern void CursorSave2 (XtermWidget /* xw */, SavedCursor * /* sc */); extern void CursorSave (XtermWidget /* xw */); extern void CursorSet (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* flags */); extern void CursorUp (TScreen * /* screen */, int /* n */); @@ -1078,7 +1082,14 @@ extern int set_cur_col(TScreen * /* screen */, int /* value */); extern int set_cur_row(TScreen * /* screen */, int /* value */); #else #define set_cur_col(screen, value) screen->cur_col = value -#define set_cur_row(screen, value) screen->cur_row = value +#define set_cur_row(screen, value) \ + do { \ + int row_value = value; \ + if_STATUS_LINE(screen, { \ + row_value = LastRowNumber(screen); \ + }); \ + screen->cur_row = row_value; \ + } while (0) #endif /* cursorfont.c */ @@ -1182,7 +1193,7 @@ extern int creat_as (uid_t /* uid */, gid_t /* gid */, Bool /* append */, char * extern int getVisualDepth (XtermWidget /* xw */); extern int ignore_x11_error(Display * /* dpy */, XErrorEvent * /* event */); extern int open_userfile (uid_t /* uid */, gid_t /* gid */, char * /* path */, Bool /* append */); -extern int update_winsize(int /* fd */, int /* rows */, int /* cols */, int /* height */, int /* width */); +extern int update_winsize (TScreen * /* screen */, int /* rows */, int /* cols */, int /* height */, int /* width */); extern int xerror (Display * /* d */, XErrorEvent * /* ev */); extern int xioerror (Display * /* dpy */); extern int xtermClosestColor (XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */); @@ -1422,16 +1433,16 @@ extern void writePtyData (int /* f */, IChar * /* d */, unsigned /* len */); #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ extern Bool non_blank_line (TScreen */* screen */, int /* row */, int /* col */, int /* len */); -extern Char * allocScrnData (TScreen * /* screen */, unsigned /* nrow */, unsigned /* ncol */); +extern Char * allocScrnData (TScreen * /* screen */, unsigned /* nrow */, unsigned /* ncol */, Bool /* bottom */); extern ScrnBuf allocScrnBuf (XtermWidget /* xw */, unsigned /* nrow */, unsigned /* ncol */, ScrnPtr * /* addr */); extern ScrnBuf scrnHeadAddr (TScreen * /* screen */, ScrnBuf /* base */, unsigned /* offset */); -extern int ScreenResize (XtermWidget /* xw */, int /* width */, int /* height */, unsigned * /* flags */); extern size_t ScrnPointers (TScreen * /* screen */, size_t /* len */); extern void ClearBufRows (XtermWidget /* xw */, int /* first */, int /* last */); extern void ClearCells (XtermWidget /* xw */, int /* flags */, unsigned /* len */, int /* row */, int /* col */); extern void CopyCells (TScreen * /* screen */, LineData * /* src */, LineData * /* dst */, int /* col */, int /* len */, Bool /* down */); extern void FullScreen (XtermWidget /* xw */, int /* mode */); extern void FreeMarkGCs (XtermWidget /* xw */); +extern void ScreenResize (XtermWidget /* xw */, int /* width */, int /* height */, unsigned * /* flags */); extern void ScrnAllocBuf (XtermWidget /* xw */); extern void ScrnClearCells (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */); extern void ScrnDeleteChar (XtermWidget /* xw */, unsigned /* n */); @@ -1446,7 +1457,7 @@ extern void ScrnRefresh (XtermWidget /* xw */, int /* toprow */, int /* leftco extern void ScrnUpdate (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); extern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned /* flags */, CellColor /* cur_fg_bg */, unsigned /* length */); extern void ShowWrapMarks (XtermWidget /* xw */, int /* row */, CLineData * /* ld */); -extern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */); +extern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */, Bool /* bottom */); extern void xtermParseRect (XtermWidget /* xw */, int, int *, XTermRect *); #if OPT_TRACE && OPT_TRACE_FLAGS @@ -1571,6 +1582,7 @@ extern int dimRound (double /* value */); extern int drawXtermText (XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */); extern int extendedBoolean (const char * /* value */, const FlagList * /* table */, Cardinal /* limit */); extern void ChangeColors (XtermWidget /* xw */, ScrnColors * /* pNew */); +extern void ClearLine (XtermWidget /* xw */); extern void ClearRight (XtermWidget /* xw */, int /* n */); extern void ClearScreen (XtermWidget /* xw */); extern void DeleteChar (XtermWidget /* xw */, unsigned /* n */); diff --git a/app/xterm/xterm.log.html b/app/xterm/xterm.log.html index a87f84f83..03324b122 100644 --- a/app/xterm/xterm.log.html +++ b/app/xterm/xterm.log.html @@ -2,7 +2,7 @@ ***************************************************************************** * this file is part of xterm * * * - * Copyright 1997-2020,2021 by Thomas E. Dickey * + * Copyright 1997-2021,2022 by Thomas E. Dickey * * * * All Rights Reserved * * * @@ -30,7 +30,7 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.2358 2021/09/21 23:48:07 tom Exp $ + $XTermId: xterm.log.html,v 1.2406 2022/03/10 01:00:00 tom Exp $ --> @@ -50,7 +50,7 @@
-

Copyright © 1997-2020,2021 by Copyright © 1997-2021,2022 by Thomas E. Dickey


@@ -70,6 +70,12 @@ CHANGELOG).

+

Patch #372 - + 2022/03/09

+ +
    +
  • amend allocation/freeing of scrollback lines, eliminating + an adjustment for status-line added in patch #371 (report/testcase by Rajeev V. + Pillai).
  • +
+ +

Patch #371 - + 2022/02/24

+ +
    +
  • drop double-buffer default from test-packages, since that + interferes with status-line.
  • + +
  • add faceSize7 to table in + charproc.c, overlooked in patch #360 (patch by Vladimir A. Pavlov).
  • + +
  • use XDrawString rather than + XDrawString16 for text when the latter is not + needed.
  • + +
  • improve performance for initializing/reusing graphic + objects in the SIXEL feature.
  • + +
  • improve error-checking for resize.
  • + +
  • fix errata in manual page (Debian #988221).
  • + +
  • extended list of environment variables to purge on startup, + i.e., in case a user starts xterm from another terminal + emulator.
  • + +
  • add comment in cursor.c to explain why + autowrap (DECAWM) does not apply to data + saved/restored with save/restore cursor-operations (report by + Thomas Wolff).
  • + +
  • add special case in generating the combining-character + table in wcwidth.c, for Hangul Jamo Extended-B + (report by Luis Javier Merino).
  • + +
  • simplify/improve portability of trap commands + in shell-scripts.
  • + +
  • update configure options
    + --disable-rectangles,
    + --disable-tcap-fkeys and
    + --disable-tcap-query
    + to account for changed default settings.
  • + +
  • rather than ignore empty parameter for setting title, use + that to reset it to “xterm” for scripting.
  • + +
  • check for out-of-bounds condition while drawing sixels, and + quit that operation (report by Nick Black).
  • + +
  • add fallback definition for PROJECTROOT so + that a suitable default location for luit will be + compiled-in on build-servers.
  • + +
  • implement DEC status-line controls DECSASD/DECSSDT: +
      +
    • decode controls, set state
    • + +
    • implement DECRQSS responses
    • + +
    • implement indicator-style status-line
    • + +
    • add configure option + --enable-status-line
    • + +
    • add resource indicatorFormat
    • + +
    • implement host-writable status-line, able to handle + video-attributes and simple left/right cursor movement. + This disallows all of the DEC/xterm private modes such as + switching to/from the alternate screen.
    • + +
    • move the status-line if the window is resized.
    • + +
    • Note: the associated screen-resizing does not + work for the special case of TrueType fonts with + double-buffering (see note in patch #349).
    • +
    +
  • + +
  • modify configure-script fixup for -Werror + options to exclude fixup for -Werror=format, e.g., + -Werror=format-security.
  • + +
  • amend change from patch #370; DEC + 070's pseudo-code for DECCOLM incorrectly suggests that it + enables DECLRMM as a side-effect.
  • + +
  • fix some memory leaks seen using esctest and asan2 (patch + by Luis Javier Merino).
  • +
+ +

Patch #370 - + 2021/11/13

+ +
    +
  • add -a, -c and -d + options to query-status.pl to improve test for + DECRQSS.
  • + +
  • expanded discussion of maximum graphics geometry in + ctlseqs.ms (suggested by Bon Wong).
  • + +
  • corrected parameter symbol for DECCARA and + DECRARA in ctlseqs.ms to indicate + that multiple parameters may be used (report by Thomas + Wolff).
  • + +
  • add several test/demo scripts.
  • + +
  • improve DECCOLM, DECLRMM and + DECALN referring to pseudo-code in DEC 070.
  • + +
  • amend a change in patch #348 which caused left/right margin + mode to be reset when resizing the terminal window (report by + Valentine Barshak).
  • + +
  • fix a misnamed macro-parameter (patch by Rajeev V. + Pillai).
  • + +
  • fix spacing of wideFont when its width is not + exactly twice as wide as the normal font (report by Rajeev V. + Pillai).
  • + +
  • suppress loading of italic font in a few places when + colorITmode is enabled (report/analysis by Rajeev + V. Pillai).
  • + +
  • modify XTSMGRAPHICS to return failure status + if the terminal is not configured to support the corresponding + ReGIS or SIXEL feature (report by Nick Black, notcurses #2252, + notcurses #2257).
  • + +
  • modify DECERA and DECFRA to erase + corresponding area in SIXEL graphics (patch by Nick Black, + notcurses #1740, vt340test #16). Also modify + DECSERA.
  • + +
  • equate visuals for TrueColor and DirectColor (patch by + Denis Kaganovich).
  • + +
  • correct computation for pixel value of rgb when using depth + 16 (report by Denis Kaganovich).
  • + +
  • correct wrapping of VT100-style double-sized characters + when configured for Unicode wide-characters (report by Luis + Javier Merino).
  • + +
  • updated default value for sixelScrolling + resource to match expected behavior versus DECSDM + change in patch #369 (report by Grant + Taylor).
  • +
+

Patch #369 - 2021/09/21

@@ -1944,11 +2115,11 @@ -
  • reorganize text-drawing to make it possible to investigate - using Xft to implement VT100-style double-sized characters. - While doing this, made a workaround for apparent Xft bug which - loses its drawable state when switching from 132 to 80 - columns.
  • +
  • reorganize text-drawing to make it + possible to investigate using Xft to implement VT100-style + double-sized characters. While doing this, made a workaround + for apparent Xft bug which loses its drawable state when + switching from 132 to 80 columns.
  • improve font-warning messages by showing which are derived rather than directly from resource settings diff --git a/app/xterm/xterm.man b/app/xterm/xterm.man index 383e0b88b..2ff339c4f 100644 --- a/app/xterm/xterm.man +++ b/app/xterm/xterm.man @@ -1,7 +1,7 @@ '\" t -.\" $XTermId: xterm.man,v 1.851 2021/09/07 00:02:12 tom Exp $ +.\" $XTermId: xterm.man,v 1.856 2022/02/22 09:11:42 tom Exp $ .\" -.\" Copyright 1996-2020,2021 by Thomas E. Dickey +.\" Copyright 1996-2021,2022 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -316,8 +316,8 @@ one per line. The message is written to the standard output. After printing the message, \fI\*n\fP exits. \fI\*N\fP generates this message, sorting it and noting whether -a \*(``\fB\-\fR\fIoption\fP\*('' -or a \*(``\fB+\fR\fIoption\fP\*('' turns the feature on or off, +a \*(``\fB\-\fIoption\fR\*('' +or a \*(``\fB+\fIoption\fR\*('' turns the feature on or off, since some features historically have been one or the other. \fI\*N\fP generates a concise help message (multiple options per line) when an unknown option is used, e.g., @@ -1510,7 +1510,7 @@ Abbreviated options also are supported, e.g., It also uses the X Toolkit resource types (such as booleans, colors, -fonts, +fonts, integers, and strings) along with their respective converters. @@ -1529,7 +1529,7 @@ Again, the actual resource type is a string, parsed and used when needed. .PP Application specific resources -(e.g., \*(``\fB__default_class__.\fP\fINAME\fP\*('') follow: +(e.g., \*(``\fB__default_class__.\fINAME\fR\*('') follow: .SS Application Resources .TP 8 .B "backarrowKeyIsErase\fP (class\fB BackarrowKeyIsErase\fP)" @@ -2191,14 +2191,14 @@ than prepending the string to the icon title. The following resources are specified as part of the \fIvt100\fP widget (class \fIVT100\fP). They are specified by patterns such as -\*(``\fB__default_class__.vt100.\fP\fINAME\fP\*(''. +\*(``\fB__default_class__.vt100.\fINAME\fR\*(''. .PP If your \fI\*n\fP is configured to support the \*(``toolbar\*('', then those patterns need an extra level for the form-widget which holds the toolbar and vt100 widget. A wildcard between the top-level \*(``__default_class__\*('' and the \*(``vt100\*('' widget makes the resource settings work for either, -e.g., \*(``\fB__default_class__*vt100.\fP\fINAME\fP\*(''. +e.g., \*(``\fB__default_class__*vt100.\fINAME\fR\*(''. .TP 8 .B "activeIcon\fP (class\fB ActiveIcon\fP)" Specifies whether or not active icon windows are to be used when the @@ -2296,7 +2296,7 @@ the X protocol SendEvent request) should be interpreted or discarded. The default is \*(``false\*('' meaning they are discarded. Note that allowing such events would create a very large security hole, therefore enabling this resource forcefully disables -the \fBallow\fP\fIXXX\fP\fBOps\fR resources. +the \fBallow\fIXXX\fBOps\fR resources. The default is \*(``false\*(''. .TP .B "allowTcapOps\fP (class\fB AllowTcapOps\fP)" @@ -3560,6 +3560,9 @@ Specifies the pointsize of the fifth alternative font. .B "faceSize6\fP (class\fB FaceSize6\fP)" Specifies the pointsize of the sixth alternative font. .TP 8 +.B "faceSize7\fP (class\fB FaceSize7\fP)" +Specifies the pointsize of the seventh alternative font. +.TP 8 .B "fastScroll\fP (class\fB FastScroll\fP)" Modifies the effect of jump scroll (\fBjumpScroll\fP) by suppressing screen refreshes @@ -3896,6 +3899,21 @@ Specifies the font for the miniature active icon window, if this feature is compiled into \fI\*n\fR. The default is \*(``nil2\*(''. .TP 8 +.B "indicatorFormat\fP (class\fB IndicatorFormat\fP)" +When displaying the status line using the \fIindicator\fP mode +(i.e., selecting DECSSDT line type 1), +format the status using this resource. +.IP +The default value of the resource displays the version of \fI\*n\fR, +the cursor position and the time/date: +.NS +\*(``%{version%}\ \ %{position%}\ \ %{unixtime%}\*('' +.NE +.IP +If a \*(``%\*('' marker does not match any +of the three special tokens used in the default resource setting, +\fI\*n\fP uses \fBstrftime\fP to interpret it. +.TP 8 .B "initialFont\fP (class\fB InitialFont\fP)" Specifies which of the VT100 fonts to use initially. Values are the same as for the \fBset\-vt\-font\fP action. @@ -4463,7 +4481,7 @@ The default values for \fBon2Clicks\fP and \fBon3Clicks\fP are There is no default value for \fBon4Clicks\fP or \fBon5Clicks\fP, making those inactive. On startup, \fI\*n\fP determines the maximum number of clicks -by the \fBon\fP\fIX\fP\fBClicks\fP resource values which are set. +by the \fBon\fIX\fBClicks\fR resource values which are set. .TP 8 .B "openIm\fP (class\fB OpenIm\fP)" Tells \fI\*n\fP whether to open the input method at startup. @@ -5055,7 +5073,7 @@ Mouse protocol will never send special escapes when \fIshift\fP-key is used. .RE .IP \fI\*N\fP interprets a control sequence which can change this -setting between +setting between \*(``true\*('' and \*(``false\*(''. The default is \*(``false\*(''. @@ -5095,14 +5113,14 @@ If \fI\*n\fR is configured to support SIXEL graphics, this resource tells it whether to scroll up one line at a time when sixels would be written past the bottom line on the window. -The default is \*(``false\*(''. +The default is \*(``false\*('' which enables scrolling. .TP 8 .B "sixelScrollsRight\fP (class\fB SixelScrollsRight\fP)" If \fI\*n\fR is configured to support SIXEL graphics, this resource tells it whether to scroll to the right as needed to keep the current position visible rather than truncate the plot on the on the right. -The default is \*(``false\*(''. +The default is \*(``false\*('' which disables scrolling. .TP 8 .B "tekGeometry\fP (class\fB Geometry\fP)" Specifies the preferred size and position of the Tektronix window. @@ -5479,7 +5497,7 @@ The \fBximFont\fP resource is provided to override this default font setting. The following resources are specified as part of the \fItek4014\fP widget (class \fITek4014\fP). These are specified by patterns -such as \*(``\fB__default_class__.tek4014.\fP\fINAME\fP\*('': +such as \*(``\fB__default_class__.tek4014.\fINAME\fR\*('': .TP 8 .B "font2\fP (class\fB Font\fP)" Specifies font number 2 to use in the Tektronix window. @@ -5518,7 +5536,7 @@ Specifies the width of the Tektronix window in pixels. The resources that may be specified for the various menus are described in the documentation for the Athena \fBSimpleMenu\fP widget. The name and classes of the entries in each of the menus are listed below. -Resources named \*(``\fBline\fR\fIN\fR\*('' where \fIN\fR is a number +Resources named \*(``\fBline\fIN\fR\*('' where \fIN\fR is a number are separators with class \fBSmeLine\fR. .PP As with all X resource-based widgets, @@ -5529,19 +5547,19 @@ The \fBMain Options\fP menu (widget name \fImainMenu\fP) has the following entries: .TP 8 .B "toolbar\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-toolbar(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-toolbar(\fItoggle\fB)\fR action. .TP 8 .B "securekbd\fP (class\fB SmeBSB\fP)" This entry invokes the \fBsecure()\fP action. .TP 8 .B "allowsends\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-send\-events(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-send\-events(\fItoggle\fB)\fR action. .TP 8 .B "redraw\fP (class\fB SmeBSB\fP)" This entry invokes the \fBredraw()\fP action. .TP 8 .B "logging\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBlogging(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBlogging(\fItoggle\fB)\fR action. .TP 8 .B "print\-immediate\fP (class\fB SmeBSB\fP)" This entry invokes the \fBprint\-immediate()\fP action. @@ -5562,57 +5580,57 @@ This entry invokes the \fBdump\-html()\fP action. This entry invokes the \fBdump\-svg()\fP action. .TP 8 .B "8\-bit\-control\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-8\-bit\-control(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-8\-bit\-control(\fItoggle\fB)\fR action. .TP 8 .B "backarrow\ key\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-backarrow(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-backarrow(\fItoggle\fB)\fR action. .TP 8 .B "num\-lock\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-num\-lock(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-num\-lock(\fItoggle\fB)\fR action. .TP 8 .B "alt\-esc\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBalt\-sends\-escape(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBalt\-sends\-escape(\fItoggle\fB)\fR action. .TP 8 .B "meta\-esc\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBmeta\-sends\-escape(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBmeta\-sends\-escape(\fItoggle\fB)\fR action. .TP 8 .B "delete\-is\-del\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBdelete\-is\-del(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBdelete\-is\-del(\fItoggle\fB)\fR action. .TP 8 .B "oldFunctionKeys\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-old\-function\-keys(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-old\-function\-keys(\fItoggle\fB)\fR action. .TP 8 .B "hpFunctionKeys\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-hp\-function\-keys(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-hp\-function\-keys(\fItoggle\fB)\fR action. .TP 8 .B "scoFunctionKeys\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-sco\-function\-keys(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-sco\-function\-keys(\fItoggle\fB)\fR action. .TP 8 .B "sunFunctionKeys\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-sun\-function\-keys(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-sun\-function\-keys(\fItoggle\fB)\fR action. .TP 8 .B "sunKeyboard\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsunKeyboard(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBsunKeyboard(\fItoggle\fB)\fR action. .TP 8 .B "suspend\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fItstp\fP\fB)\fP action +This entry invokes the \fBsend\-signal(\fItstp\fB)\fR action on systems that support job control. .TP 8 .B "continue\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fIcont\fP\fB)\fP action +This entry invokes the \fBsend\-signal(\fIcont\fB)\fR action on systems that support job control. .TP 8 .B "interrupt\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fIint\fP\fB)\fP action. +This entry invokes the \fBsend\-signal(\fIint\fB)\fR action. .TP 8 .B "hangup\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fIhup\fP\fB)\fP action. +This entry invokes the \fBsend\-signal(\fIhup\fB)\fR action. .TP 8 .B "terminate\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fIterm\fP\fB)\fP action. +This entry invokes the \fBsend\-signal(\fIterm\fB)\fR action. .TP 8 .B "kill\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBsend\-signal(\fP\fIkill\fP\fB)\fP action. +This entry invokes the \fBsend\-signal(\fIkill\fB)\fR action. .TP 8 .B "quit\fP (class\fB SmeBSB\fP)" This entry invokes the \fBquit()\fP action. @@ -5622,62 +5640,62 @@ The \fBVT Options\fP menu (widget name \fIvtMenu\fP) has the following entries: .TP 8 .B "scrollbar\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-scrollbar(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-scrollbar(\fItoggle\fB)\fR action. .TP 8 .B "jumpscroll\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-jumpscroll(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-jumpscroll(\fItoggle\fB)\fR action. .TP 8 .B "reversevideo\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-reverse\-video(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-reverse\-video(\fItoggle\fB)\fR action. .TP 8 .B "autowrap\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-autowrap(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-autowrap(\fItoggle\fB)\fR action. .TP 8 .B "reversewrap\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-reversewrap(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-reversewrap(\fItoggle\fB)\fR action. .TP 8 .B "autolinefeed\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-autolinefeed(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-autolinefeed(\fItoggle\fB)\fR action. .TP 8 .B "appcursor\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-appcursor(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-appcursor(\fItoggle\fB)\fR action. .TP 8 .B "appkeypad\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-appkeypad(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-appkeypad(\fItoggle\fB)\fR action. .TP 8 .B "scrollkey\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-scroll\-on\-key(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-scroll\-on\-key(\fItoggle\fB)\fR action. .TP 8 .B "scrollttyoutput\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-scroll\-on\-tty\-output(\fP\fItoggle\fP\fB)\fP +This entry invokes the \fBset\-scroll\-on\-tty\-output(\fItoggle\fB)\fR action. .TP 8 .B "allow132\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-allow132(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-allow132(\fItoggle\fB)\fR action. .TP 8 .B "cursesemul\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-cursesemul(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-cursesemul(\fItoggle\fB)\fR action. .TP 8 .B "keepSelection\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-keep\-selection(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-keep\-selection(\fItoggle\fB)\fR action. .TP 8 .B "selectToClipboard\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-keep\-clipboard(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-keep\-clipboard(\fItoggle\fB)\fR action. .TP 8 .B "visualbell\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-visual\-bell(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-visual\-bell(\fItoggle\fB)\fR action. .TP 8 .B "bellIsUrgent\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-bellIsUrgent(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-bellIsUrgent(\fItoggle\fB)\fR action. .TP 8 .B "poponbell\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-pop\-on\-bell(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-pop\-on\-bell(\fItoggle\fB)\fR action. .TP 8 .B "cursorblink\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-cursorblink(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-cursorblink(\fItoggle\fB)\fR action. .TP 8 .B "titeInhibit\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-titeInhibit(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-titeInhibit(\fItoggle\fB)\fR action. .TP 8 .B "activeicon\fP (class\fB SmeBSB\fP)" This entry toggles active icons on and off if this feature was @@ -5696,127 +5714,127 @@ This entry invokes the \fBhard\-reset()\fP action. This entry invokes the \fBclear\-saved\-lines()\fP action. .TP 8 .B "tekshow\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-visibility(\fP\fItek,toggle\fP\fB)\fP action. +This entry invokes the \fBset\-visibility(\fItek,toggle\fB)\fR action. .TP 8 .B "tekmode\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-terminal\-type(\fP\fItek\fP\fB)\fP action. +This entry invokes the \fBset\-terminal\-type(\fItek\fB)\fR action. .TP 8 .B "vthide\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-visibility(\fP\fIvt,off\fP\fB)\fP action. +This entry invokes the \fBset\-visibility(\fIvt,off\fB)\fR action. .TP 8 .B "altscreen\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-altscreen(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-altscreen(\fItoggle\fB)\fR action. .TP 8 .B "sixelScrolling\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-sixel\-scrolling(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-sixel\-scrolling(\fItoggle\fB)\fR action. .TP 8 .B "privateColorRegisters\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-private\-colors(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBset\-private\-colors(\fItoggle\fB)\fR action. . .PP The \fBVT Fonts\fP menu (widget name \fIfontMenu\fP) has the following entries: .TP 8 .B "fontdefault\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fId\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fId\fB)\fR action, setting the font using the \fBfont\fP (default) resource, e.g., \*(``Default\*('' in the menu. .TP 8 .B "font1\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI1\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI1\fB)\fR action, setting the font using the \fBfont1\fP resource, e.g., \*(``Unreadable\*('' in the menu. .TP 8 .B "font2\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI2\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI2\fB)\fR action, setting the font using the \fBfont2\fP resource, e.g., \*(``Tiny\*('' in the menu. .TP 8 .B "font3\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI3\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI3\fB)\fR action, setting the font using the \fBfont3\fP resource, e.g., \*(``Small\*('' in the menu. .TP 8 .B "font4\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI4\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI4\fB)\fR action, letting the font using the \fBfont4\fP resource, e.g., \*(``Medium\*('' in the menu. .TP 8 .B "font5\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI5\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI5\fB)\fR action, letting the font using the \fBfont5\fP resource, e.g., \*(``Large\*('' in the menu. .TP 8 .B "font6\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI6\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI6\fB)\fR action, letting the font using the \fBfont6\fP resource, e.g., \*(``Huge\*('' in the menu. .TP 8 .B "font7\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fI7\fP\fB)\fP action, +This entry invokes the \fBset\-vt\-font(\fI7\fB)\fR action, letting the font using the \fBfont7\fP resource, e.g., \*(``Enormous\*('' in the menu. .TP 8 .B "fontescape\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fIe\fP\fB)\fP action. +This entry invokes the \fBset\-vt\-font(\fIe\fB)\fR action. .TP 8 .B "fontsel\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-vt\-font(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-vt\-font(\fIs\fB)\fR action. .TP 8 .B "allow\-bold\-fonts\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-bold\-fonts(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-bold\-fonts(\fItoggle\fB)\fR action. .TP 8 .B "font\-linedrawing\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-font\-linedrawing(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-font\-linedrawing(\fIs\fB)\fR action. .TP 8 .B "font\-packed\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-font\-packed(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-font\-packed(\fIs\fB)\fR action. .TP 8 .B "font\-doublesize\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-font\-doublesize(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-font\-doublesize(\fIs\fB)\fR action. .TP 8 .B "render\-font\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-render\-font(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-render\-font(\fIs\fB)\fR action. .TP 8 .B "utf8\-fonts\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-utf8\-fonts(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-utf8\-fonts(\fIs\fB)\fR action. .TP 8 .B "utf8\-mode\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-utf8\-mode(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-utf8\-mode(\fIs\fB)\fR action. .TP 8 .B "utf8\-title\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-utf8\-title(\fP\fIs\fP\fB)\fP action. +This entry invokes the \fBset\-utf8\-title(\fIs\fB)\fR action. .TP 8 .B "allow\-color\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-color\-ops(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-color\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-font\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-fonts\-ops(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-fonts\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-tcap\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-tcap\-ops(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-tcap\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-title\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-title\-ops(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-title\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-window\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-window\-ops(\fP\fItoggle\fP\fB)\fP action. +This entry invokes the \fBallow\-window\-ops(\fItoggle\fB)\fR action. . .PP The \fBTek Options\fP menu (widget name \fItekMenu\fP) has the following entries: .TP 8 .B "tektextlarge\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-tek\-text(\fP\fIlarge\fP\fB)\fP action. +This entry invokes the \fBset\-tek\-text(\fIlarge\fB)\fR action. .TP 8 .B "tektext2\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-tek\-text(\fP\fI2\fP\fB)\fP action. +This entry invokes the \fBset\-tek\-text(\fI2\fB)\fR action. .TP 8 .B "tektext3\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-tek\-text(\fP\fI3\fP\fB)\fP action. +This entry invokes the \fBset\-tek\-text(\fI3\fB)\fR action. .TP 8 .B "tektextsmall\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-tek\-text(\fP\fIsmall\fP\fB)\fP action. +This entry invokes the \fBset\-tek\-text(\fIsmall\fB)\fR action. .TP 8 .B "tekpage\fP (class\fB SmeBSB\fP)" This entry invokes the \fBtek\-page()\fP action. @@ -5828,13 +5846,13 @@ This entry invokes the \fBtek\-reset()\fP action. This entry invokes the \fBtek\-copy()\fP action. .TP 8 .B "vtshow\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-visibility(\fP\fIvt,toggle\fP\fB)\fP action. +This entry invokes the \fBset\-visibility(\fIvt,toggle\fB)\fR action. .TP 8 .B "vtmode\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-terminal\-type(\fP\fIvt\fP\fB)\fP action. +This entry invokes the \fBset\-terminal\-type(\fIvt\fB)\fR action. .TP 8 .B "tekhide\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBset\-visibility(\fP\fItek,toggle\fP\fB)\fP action. +This entry invokes the \fBset\-visibility(\fItek,toggle\fB)\fR action. .\" .SS Scrollbar Resources .PP @@ -7395,7 +7413,7 @@ Xt does not allow you to put a null character .B "keymap(\fIname\fP)" This action dynamically defines a new translation table whose resource name is \fIname\fP with the suffix \*(``\fIKeymap\fP\*('' -(i.e., \fIname\fP\fBKeymap\fP, where case is significant). +(i.e., \fIname\fBKeymap\fR, where case is significant). The name \fINone\fP restores the original translation table. .TP 8 .B "larger\-vt\-font()" @@ -8228,9 +8246,9 @@ Instead, use \fBprintf\fP (POSIX). For example, to set the \fIwindow title\fP to \*(``Hello world!\*('', you could use one of these commands in a script: .NS -printf \*(AQ\\033]2;Hello world!\\033\\\*(AQ +printf \*(AQ\\033]2;Hello world!\\033\\\\\*(AQ printf \*(AQ\\033]2;Hello world!\\007\*(AQ -printf \*(AQ\\033]2;%s\\033\\\*(AQ "Hello world!" +printf \*(AQ\\033]2;%s\\033\\\\\*(AQ "Hello world!" printf \*(AQ\\033]2;%s\\007\*(AQ "Hello world!" .NE .PP @@ -8241,9 +8259,9 @@ newline from the output. Some programs (such as \fBscreen\fP(1)) set both window- and icon-titles at the same time, using a slightly different control sequence: .NS -printf \*(AQ\\033]0;Hello world!\\033\\\*(AQ +printf \*(AQ\\033]0;Hello world!\\033\\\\\*(AQ printf \*(AQ\\033]0;Hello world!\\007\*(AQ -printf \*(AQ\\033]0;%s\\033\\\*(AQ "Hello world!" +printf \*(AQ\\033]0;%s\\033\\\\\*(AQ "Hello world!" printf \*(AQ\\033]0;%s\\007\*(AQ "Hello world!" .NE .PP @@ -8253,9 +8271,9 @@ Some will make a distinction and allow you to set just the icon title. You can tell \fI\*n\fP to ask for this with a different parameter in the control sequence: .NS -printf \*(AQ\\033]1;Hello world!\\033\\\*(AQ +printf \*(AQ\\033]1;Hello world!\\033\\\\\*(AQ printf \*(AQ\\033]1;Hello world!\\007\*(AQ -printf \*(AQ\\033]1;%s\\033\\\*(AQ "Hello world!" +printf \*(AQ\\033]1;%s\\033\\\\\*(AQ "Hello world!" printf \*(AQ\\033]1;%s\\007\*(AQ "Hello world!" .NE . diff --git a/app/xterm/xtermcfg.h b/app/xterm/xtermcfg.h index 1a51c9170..2235bef18 100644 --- a/app/xterm/xtermcfg.h +++ b/app/xterm/xtermcfg.h @@ -1,7 +1,7 @@ -/* $XTermId: xtermcfg.hin,v 1.223 2021/08/22 20:00:07 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.225 2022/02/13 13:50:45 tom Exp $ */ /* - * Copyright 1997-2019,2020 by Thomas E. Dickey + * Copyright 1997-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -153,7 +153,7 @@ /* #undef OPT_DABBREV */ /* CF_ARG_ENABLE(dabbrev) */ /* #undef OPT_DEC_CHRSET */ /* CF_ARG_DISABLE(doublechars) */ /* #undef OPT_DEC_LOCATOR */ /* CF_ARG_ENABLE(dec-locator) */ -#define OPT_DEC_RECTOPS 1 /* CF_ARG_ENABLE(rectangles) */ +/* #define OPT_DEC_RECTOPS */ /* CF_ARG_DISABLE(rectangles) */ #define OPT_DIRECT_COLOR 1 /* CF_ARG_ENABLE(direct-color) */ /* #undef OPT_DOUBLE_BUFFER */ /* CF_ARG_ENABLE(double-buffer) */ /* #undef OPT_EXEC_XTERM */ /* CF_ARG_ENABLE(exec-xterm) */ @@ -181,7 +181,8 @@ /* #undef OPT_SELECTION_OPS */ /* CF_ARG_DISABLE(selection-ops) */ #define OPT_SELECT_REGEX 1 /* CF_ARG_DISABLE(regex) */ /* #undef OPT_SESSION_MGT */ /* CF_ARG_DISABLE(session-mgt) */ -/* #undef OPT_SIXEL_GRAPHICS */ /* CF_ARG_ENABLE(sixel-graphics) */ +/* #undef OPT_SIXEL_GRAPHICS */ /* CF_ARG_ENABLE(sixel-graphics) */ +/* #undef OPT_STATUS_LINE */ /* CF_ARG_ENABLE(status-line) */ /* #undef OPT_SUN_FUNC_KEYS */ /* CF_ARG_ENABLE(sun-fkeys) */ #define OPT_TCAP_FKEYS 0 /* CF_ARG_ENABLE(tcap-fkeys) */ #define OPT_TCAP_QUERY 0 /* CF_ARG_ENABLE(tcap-query) */ diff --git a/app/xterm/xtermcfg.hin b/app/xterm/xtermcfg.hin index 9372f9a7a..65eaae357 100644 --- a/app/xterm/xtermcfg.hin +++ b/app/xterm/xtermcfg.hin @@ -1,7 +1,7 @@ -/* $XTermId: xtermcfg.hin,v 1.223 2021/08/22 20:00:07 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.225 2022/02/13 13:50:45 tom Exp $ */ /* - * Copyright 1997-2020,2021 by Thomas E. Dickey + * Copyright 1997-2021,2022 by Thomas E. Dickey * * All Rights Reserved * @@ -154,7 +154,7 @@ #undef OPT_DABBREV /* CF_ARG_ENABLE(dabbrev) */ #undef OPT_DEC_CHRSET /* CF_ARG_DISABLE(doublechars) */ #undef OPT_DEC_LOCATOR /* CF_ARG_ENABLE(dec-locator) */ -#undef OPT_DEC_RECTOPS /* CF_ARG_ENABLE(rectangles) */ +#undef OPT_DEC_RECTOPS /* CF_ARG_DISABLE(rectangles) */ #undef OPT_DIRECT_COLOR /* CF_ARG_ENABLE(direct-color) */ #undef OPT_DOUBLE_BUFFER /* CF_ARG_ENABLE(double-buffer) */ #undef OPT_EXEC_XTERM /* CF_ARG_ENABLE(exec-xterm) */ @@ -183,6 +183,7 @@ #undef OPT_SELECT_REGEX /* CF_ARG_DISABLE(regex) */ #undef OPT_SESSION_MGT /* CF_ARG_DISABLE(session-mgt) */ #undef OPT_SIXEL_GRAPHICS /* CF_ARG_ENABLE(sixel-graphics) */ +#undef OPT_STATUS_LINE /* CF_ARG_ENABLE(status-line) */ #undef OPT_SUN_FUNC_KEYS /* CF_ARG_ENABLE(sun-fkeys) */ #undef OPT_TCAP_FKEYS /* CF_ARG_ENABLE(tcap-fkeys) */ #undef OPT_TCAP_QUERY /* CF_ARG_ENABLE(tcap-query) */