diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 9355 |
1 files changed, 4953 insertions, 4402 deletions
@@ -30,7 +30,6 @@ else esac fi - as_nl=' ' export as_nl @@ -78,7 +77,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. @@ -234,7 +232,6 @@ $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a @@ -354,7 +351,6 @@ $as_echo X"$as_dir" | test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - } # as_fn_mkdir_p # as_fn_executable_p FILE @@ -399,7 +395,6 @@ else } fi # as_fn_arith - # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are @@ -461,7 +456,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && @@ -553,7 +547,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 @@ -627,7 +620,7 @@ DEPEND APPDEFAULTS ANIM_LIBS ANIM_OBJS -GTK_EXTRA_OBJS +FONT_DIR HACK_CONF_DIR PO_DATADIR GTK_DATADIR @@ -648,24 +641,16 @@ GL_EXES JPEG_EXES LOCK_OBJS LOCK_SRCS -SAVER_GL_LIBS -SAVER_GL_OBJS -SAVER_GL_SRCS XFT_LIBS XFT_OBJS XFT_SRCS -XMU_LIBS -XMU_OBJS -XMU_SRCS PASSWD_OBJS PASSWD_SRCS MEN_OSX SCRIPTS_OSX +SYSTEMD_LIBS EXES_SYSTEMD EXES_OSX -OBJCC -COMMENT_DEMO_GLADE2_GTK_2_22_TAIL -COMMENT_DEMO_GLADE2_GTK_2_22_HEAD WITH_BROWSER DEFAULT_TEXT_FILE DEFAULT_IMAGE_DIRECTORY @@ -675,11 +660,10 @@ NEW_LOGIN_COMMAND COMMENT_PAM_CHECK_ACCOUNT HAVE_PAM_FAIL_DELAY INSTALL_PAM -NEED_SETUID INSTALL_DIRS SETCAP_HACKS SETUID_HACKS -INSTALL_SETUID +SETUID_AUTH PROG_SETCAP LIBCAP_LIBS LIBCAP_CFLAGS @@ -699,11 +683,19 @@ SAVER_LIBS ALL_DEMO_PROGRAMS PREFERRED_DEMO_PROGRAM INCLUDES -setcap_program +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CXX +PTHREAD_CC +ax_pthread_config +SED +target_os +target_vendor +target_cpu +target +login_manager_tmp gnome_url_show_program gnome_open_program -pkg_config -login_manager_tmp MKINSTALLDIRS POSUB POFILES @@ -753,6 +745,7 @@ INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS +pkg_config X_EXTRA_LIBS X_LIBS X_PRE_LIBS @@ -766,10 +759,6 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM CPP -PTHREAD_CFLAGS -PTHREAD_LIBS -PTHREAD_CC -ax_pthread_config OBJEXT EXEEXT ac_ct_CC @@ -804,7 +793,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -827,22 +815,30 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -with_x_app_defaults -with_pthread enable_largefile with_x enable_nls +with_app_defaults with_hackdir enable_subdir with_configdir +with_fontdir with_dpms_ext +with_xf86vmode_ext with_xinerama_ext +with_randr_ext with_xinput_ext -with_xf86vmode_ext with_xf86gamma_ext -with_randr_ext +with_xidle_ext +with_sgi_ext +with_sgivc_ext +with_readdisplay +with_xshm_ext +with_xdbe_ext +with_xkb_ext with_proc_interrupts with_proc_oom +with_systemd enable_locking enable_root_passwd with_pam @@ -850,26 +846,22 @@ with_pam_service_name enable_pam_check_account_type with_kerberos with_shadow -with_passwd_helper -with_login_manager with_gtk with_motif +with_login_manager +with_image_directory +with_text_file +with_browser +with_pthread +with_gles with_gl +with_glx with_gle -with_gles +with_jpeg with_png with_pixbuf -with_jpeg with_xft -with_systemd -with_xshm_ext -with_xdbe_ext -with_readdisplay -with_image_directory -with_text_file -with_browser with_setuid_hacks -with_setcap_hacks with_record_animation ' ac_precious_vars='build_alias @@ -883,7 +875,6 @@ CPPFLAGS CPP XMKMF' - # Initialize some variables set by options. ac_init_help= ac_init_version=false @@ -920,7 +911,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1173,15 +1163,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1319,7 +1300,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1357,7 +1338,6 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null - ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || @@ -1365,7 +1345,6 @@ ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes @@ -1452,12 +1431,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', @@ -1467,25 +1440,14 @@ For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --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 modifiable per-process 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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1497,6 +1459,7 @@ X features: System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi @@ -1504,90 +1467,72 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-largefile omit support for large files - --disable-nls do not use Native Language Support - -Screen locking options: - --enable-locking Compile in support for locking the display. - --disable-locking Do not allow locking at all. +Installation Options: - --enable-root-passwd Allow root passwd to unlock screen. - --disable-root-passwd Do not allow that. - --enable-pam-check-account-type - Whether PAM should check the result of account - modules when authenticating. Only do this if you - have account configured properly on your system. - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - - --with-pthread Enables POSIX threads, for SMP support. - --with-x use the X Window System + --prefix=PREFIX Install root of architecture-independent files. + --exec-prefix=EPREFIX Install root of architecture-dependent files. + --with-app-defaults=DIR Where to install the default settings file. + --with-hackdir=DIR Where to install the hundreds of demo executables. + --with-configdir=DIR Where to install the GUI configuration files. + --with-fontdir=DIR Where to install the extra font files. +Server Extension Options: -Installation options: - --with-hackdir=DIR Where to install the hundreds of demo executables. - Default: `PREFIX/libexec/xscreensaver/' - --with-configdir=DIR Where to install the data files that describe each - of the display modes to the GUI. - Default: `PREFIX/share/xscreensaver/config/' - --with-x-app-defaults=DIR - Where to install xscreensaver configuration file. - - --with-dpms-ext Include support for the DPMS extension. - --with-xinerama-ext Include support for the XINERAMA extension. - --with-xinput-ext Include support for the XInput extension. - --with-xf86vmode-ext Include support for XFree86 virtual screens. + --with-dpms-ext Include support for power management. + --with-xf86vmode-ext Include support for virtual screens. + --with-xinerama-ext Include support for multiple monitors. + --with-randr-ext Include support for multiple monitors. + --with-xinput-ext Include support for the XInput2 extension. --with-xf86gamma-ext Include support for XFree86 gamma fading. - --with-randr-ext Include support for the X Resize+Rotate extension. - --with-proc-interrupts Include support for consulting the /proc/interrupts - file to notice keyboard activity. - --with-proc-oom Include support for disabling the OOM-killer. - --with-pam Include support for PAM (Pluggable Auth Modules.) - --with-pam-service-name NAME arg is the name of the PAM service that - xscreensaver will authenticate as. + --with-xidle-ext Include support for the X11R5 XIDLE extension. + --with-sgi-ext Include support for the SGI SCREEN_SAVER extension. + --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension. + --with-readdisplay Include support for the SGI XReadDisplay extension. + --with-xshm-ext Include support for the Shared Memory extension. + --with-xdbe-ext Include support for the DOUBLE-BUFFER extension. + --with-xkb-ext Include support for the X Keyboard extension. + --with-proc-interrupts Include support for consulting /proc/interrupts to + notice activity on PS/2 keyboards and mice. + --with-proc-oom Include support to duck the out-of-memory killer. + --with-systemd Support systemd requests to lock on suspend, and to + allow video players to inhibit the screen saver. + +Screen Locking Options: + + --disable-locking Do not allow locking of the display at all. + --with-pam Include support for PAM (Pluggable Auth Modules). + --with-pam-service-name Set the name of the xscreensaver PAM service. + --enable-pam-account Whether PAM should check the result of account + modules when authenticating. Only do this if you + have "account" modules configured on your system. + --enable-root-passwd Allow the root passwd to unlock, if not using PAM. --with-kerberos Include support for Kerberos authentication. --with-shadow Include support for shadow password authentication. - --with-passwd-helper Include support for an external password - verification helper program. - --with-login-manager Put a "New Login" button on the unlock dialog that - runs a login manager like gdmflexiserver or kdmctl. -User interface options: +User Interface Options: --with-gtk Use the Gtk toolkit for the user interface. - --with-motif Use the Motif toolkit for the user interface - (no longer supported.) + --with-motif Use the Motif toolkit for the user interface. + --with-login-manager Put a "New Login" button on the unlock dialog that + runs a login manager like gdmflexiserver or kdmctl. + --with-image-directory Some demos will display random images from here. + --with-text-file=FILE Some demos will use this as a source of text. + --with-browser=BROWSER The web browser used to open the "Help" URL. -Graphics options: +Graphics Options: --with-gl Build those demos which depend on OpenGL. - --with-gle Build those demos which depend on GLE - (the OpenGL "extrusion" library.) - --with-gles Target OpenGL ES 1.x API instead of OpenGL 1.3. - --with-png Include support for the PNG library. - --with-pixbuf Include support for the GDK-Pixbuf library in some - demos, which will make it possible for them to read - GIF, JPEG, and PNG files as well. + --with-gles Emulate OpenGL 1.3 in terms of OpenGL ES 1.x. + --with-glx Use GLX to interface OpenGL and X11 instead of EGL. + --with-gle Include support for the GL Extrusion library. --with-jpeg Include support for the JPEG library. + --with-png Include support for the PNG library. + --with-pixbuf Include support for the GDK-Pixbuf library, which + allows the display of JPEG, PNG, GIF and SVG images. --with-xft Include support for the X Freetype library. - --with-systemd Build xscreensaver-systemd to lock on suspend. - --with-xshm-ext Include support for the Shared Memory extension. - --with-xdbe-ext Include support for the DOUBLE-BUFFER extension. - --with-readdisplay Include support for the XReadDisplay extension. - --with-image-directory Arg is the default directory from which some demos - will choose random images to display. - --with-text-file=FILE By default, some demos may display this file. - --with-browser=BROWSER Specify the web browser used to show the help URL. - --with-setuid-hacks Allow some demos to be installed `setuid root' - (which is needed in order to ping other hosts.) - --with-setcap-hacks Allow some demos to be installed with setcap - (which is needed in order to ping other hosts.) + --with-pthread Enables POSIX threads, for SMP support. + --with-setuid-hacks Install the "sonar" demo as setuid root, which is + needed in order to ping other hosts. --with-record-animation Include code for generating MP4 videos. Some influential environment variables: @@ -1687,7 +1632,7 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -rf conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -1719,52 +1664,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1802,48 +1701,6 @@ fi } # ac_fn_c_try_cpp -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -1891,7 +1748,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1931,6 +1788,48 @@ fi } # ac_fn_c_check_header_mongrel +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -2016,6 +1915,52 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_type +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -rf conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2188,14 +2133,12 @@ IFS=$as_save_IFS cat >&5 <<_ACEOF - ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF - # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. @@ -2372,7 +2315,6 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF - # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE @@ -2490,10 +2432,8 @@ 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_config_headers="$ac_config_headers config.h" - echo "current directory: `pwd`" echo "command line was: $0 $@" @@ -2503,161 +2443,44 @@ echo "command line was: $0 $@" # ############################################################################### +# Defines in config.h are dumped out alphabetically rather than in any kind +# of sane order, sigh. +# +# OS stuff. +# - - - +# +# X11 server stuff. +# # This only ever existed in X11R4 and X11R5. -#AH_TEMPLATE([HAVE_XIDLE_EXTENSION], -# [Define this if you have the XIDLE extension installed. If you -# have the XIDLE extension, this is recommended. (You have this -# extension if the file /usr/include/X11/extensions/xidle.h -# exists.) Turning on this flag lets XScreenSaver work better with -# servers which support this extension; but it will still work -# with servers which do not suport it, so it's a good idea to -# compile in support for it if you can.]) - -# Using this extension will crash your X server and make fading not work. -#AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION], -# [Define this if you have the MIT-SCREEN-SAVER extension -# installed. See the caveats about this extension, above. -# (It's available if /usr/include/X11/extensions/scrnsaver.h -# exists.)]) # This only ever existed on SGI hardware. -#AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION], -# [Define this if you have the SGI SCREEN_SAVER extension. This is -# standard on Irix systems, and not available elsewhere.]) # This only ever existed on SGI hardware. -#AH_TEMPLATE([HAVE_SGI_VC_EXTENSION], -# [Define this if you have the SGI-VIDEO-CONTROL extension. This -# is standard on Irix systems, and not available elsewhere.]) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#AH_TEMPLATE([HAVE_XCOMPOSITE_EXTENSION], +# [Define this if you have the X Composite Extension.]) +# +# GUI stuff. +# +# +# Image loading. +# +# +# Graphics libraries. +# +# +# Locking. +# +#AH_TEMPLATE([PASSWD_HELPER_PROGRAM], +# [Define this to use a third-party password helper program.]) # After checking to see that --srcdir is correct (which AC_INIT does) # check for some random other files that come later in the tar file, @@ -2676,73 +2499,22 @@ done ############################################################################### # -# Query AX_PTHREAD, and figure out which compiler gets used. -# -############################################################################### - - - - -############################################################################### -# -# Function to figure out how to run the compiler. -# -############################################################################### - - - - -############################################################################### -# # Check for availability of various gcc command-line options. # ############################################################################### - - - - - - -# Need to disable Objective C extensions in ANSI C on MacOS X to work -# around an Apple-specific gcc bug. -# - - ############################################################################### # -# Function to figure out how to disable // comments in ANSI C code. -# -# (With recent gcc, this is done with "-std=c89". With older gcc, this -# is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to -# gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang. -# so much for compatibility!) -# -# UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that -# declarations preceed statements, without resorting to "-pedantic". -# This means that there is no way to get gcc3 to issue warnings that -# ensure that your code complies with the ANSI/ISO C89 standard, without -# also drowning in totally useless warnings. Thank you master may I -# have another. -# -# So, I give up, let's just use -pedantic. +# Function to figure out how to run the compiler. # ############################################################################### - - - - - ############################################################################### # # Function to figure out how to create directory trees. # ############################################################################### - - - ############################################################################### # # Function to check whether gettimeofday() exists, and how to call it. @@ -2750,9 +2522,6 @@ done # ############################################################################### - - - ############################################################################### # # Function to find perl5 (defines PERL and PERL_VERSION.) @@ -2763,29 +2532,12 @@ done perl_version_cmd='print $]' - - - - -############################################################################### -# -# Function to demand "bc". Losers. -# -############################################################################### - - - ############################################################################### # # Functions to check how to do ICMP PING requests. # ############################################################################### - - - - - ############################################################################### # # Functions to check for various X11 crap. @@ -2794,42 +2546,13 @@ perl_version_cmd='print $]' # Try and find the app-defaults directory. # It sucks that autoconf doesn't do this already... +# (AC_PATH_X_APP_DEFAULTS_XMKMF is no longer used.) # - -############################################################################### -# -# Handle the --with-x-app-defaults option HERE -# -############################################################################### - - -# Check whether --with-x-app-defaults was given. -if test "${with_x_app_defaults+set}" = set; then : - withval=$with_x_app_defaults; ac_cv_x_app_defaults="$withval" -else - eval ac_x_app_defaults="$withval" -fi - - - - - - - - - - - # Random special-cases for X on certain pathological OSes. # You know who you are. # - - - - - ############################################################################### # # Some utility functions to make checking for X things easier. @@ -2839,28 +2562,20 @@ fi # Like AC_CHECK_HEADER, but it uses the already-computed -I directories. # - # Like AC_EGREP_HEADER, but it uses the already-computed -I directories. # - -# Like AC_TRY_COMPILE, but it uses the already-computed -I directories. +# Like AC_COMPILE_IFELSE but it uses the already-computed -I directories. # - - # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories. # Use this sparingly; it probably doesn't work very well on X programs. # - -# Like AC_TRY_RUN, but it uses the already-computed -I directories. +# Like AC_RUN_IFELSE but it uses the already-computed -I directories. # (But not the -L directories!) # - - - # Usage: HANDLE_X_PATH_ARG([variable_name], # [--command-line-option], # [descriptive string]) @@ -2877,9 +2592,6 @@ fi # as appropriate. # - - - ############################################################################### ############################################################################### # @@ -2888,11 +2600,14 @@ fi ############################################################################### ############################################################################### +# Default $PATH might not contain /sbin and thus miss /sbin/setcap. +# +export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin" + # WTF! autoconf emits this *way* too late. Do it earlier. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - # random compiler setup ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2922,7 +2637,6 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -2960,7 +2674,6 @@ build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : @@ -2993,8 +2706,6 @@ host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - ac_original_cc=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3038,7 +2749,6 @@ else $as_echo "no" >&6; } fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC @@ -3131,7 +2841,6 @@ else $as_echo "no" >&6; } fi - fi fi if test -z "$CC"; then @@ -3188,7 +2897,6 @@ else $as_echo "no" >&6; } fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then @@ -3230,7 +2938,6 @@ else $as_echo "no" >&6; } fi - test -n "$CC" && break done fi @@ -3274,7 +2981,6 @@ else $as_echo "no" >&6; } fi - test -n "$ac_ct_CC" && break done @@ -3293,7 +2999,6 @@ fi fi - test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH @@ -3319,7 +3024,7 @@ $as_echo "$ac_try_echo"; } >&5 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi - rm -f conftest.er1 conftest.err + rm -rf conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3457,11 +3162,11 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi -rm -f conftest conftest$ac_cv_exeext +rm -rf conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } -rm -f conftest.$ac_ext +rm -rf conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3521,7 +3226,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -rf conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } @@ -3539,7 +3244,7 @@ main () return 0; } _ACEOF -rm -f conftest.o conftest.obj +rm -rf conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -3568,7 +3273,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -rf conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } @@ -3758,7 +3463,7 @@ fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext +rm -rf conftest.$ac_ext CC=$ac_save_CC fi @@ -3785,588 +3490,6 @@ 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 - -have_pthread=no - with_pthread_req=unspecified - - # AX_PTHREAD is from the GNU Autoconf Archive. - # https://savannah.gnu.org/projects/autoconf-archive/ - # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 21 - -# This is what autoupdate's m4 run will expand. It fires -# the warning (with _au_warn_XXX), outputs it into the -# updated configure.ac (with AC_DIAGNOSE), and then outputs -# the replacement expansion. - - -# This is an auxiliary macro that is also run when -# autoupdate runs m4. It simply calls m4_warning, but -# we need a wrapper so that each warning is emitted only -# once. We break the quoting in m4_warning's argument in -# order to expand this macro's arguments, not AU_DEFUN's. - - -# Finally, this is the expansion that is picked up by -# autoconf. It tells the user to run autoupdate, and -# then outputs the replacement expansion. We do not care -# about autoupdate's warning because that contains -# information on what to do *after* running autoupdate. - - - - # This affects CC, LIBS, and CFLAGS, instead of defining new variables. - - -# Check whether --with-pthread was given. -if test "${with_pthread+set}" = set; then : - withval=$with_pthread; with_pthread="$withval"; with_pthread_req="$withval" -else - with_pthread=yes -fi - - - if test "$with_pthread" = yes; then - # AX_PTHREAD might want a different compiler. - - -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_compiler_gnu=$ac_cv_c_compiler_gnu - -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 -$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_join (); -int -main () -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } - if test x"$ax_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case ${host_os} in - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" - ;; - - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" - ;; -esac - -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5 -$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; } -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo(void); -int -main () -{ -foo() - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - ax_pthread_extra_flags= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$save_CFLAGS" - -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do - - case $flag in - none) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -$as_echo_n "checking whether pthreads work without any flags... " >&6; } - ;; - - -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 -$as_echo_n "checking whether pthreads work with $flag... " >&6; } - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - # Extract the first word of "pthread-config", so it can be a program name with args. -set dummy pthread-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ax_pthread_config+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ax_pthread_config"; then - ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ax_pthread_config="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi -fi -ax_pthread_config=$ac_cv_prog_ax_pthread_config -if test -n "$ax_pthread_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -$as_echo "$ax_pthread_config" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test x"$ax_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 -$as_echo_n "checking for the pthreads library -l$flag... " >&6; } - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> - static void routine(void *a) { a = 0; } - static void *start_routine(void *a) { return a; } -int -main () -{ -pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -$as_echo_n "checking for joinable pthread attribute... " >&6; } - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> -int -main () -{ -int attr = $attr; return attr /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - attr_name=$attr; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 -$as_echo "$attr_name" >&6; } - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - -cat >>confdefs.h <<_ACEOF -#define PTHREAD_CREATE_JOINABLE $attr_name -_ACEOF - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 -$as_echo_n "checking if more special flags are required for pthreads... " >&6; } - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5 -$as_echo "$flag" >&6; } - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 -$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } -if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <pthread.h> -int -main () -{ -int i = PTHREAD_PRIO_INHERIT; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_cv_PTHREAD_PRIO_INHERIT=yes -else - ax_cv_PTHREAD_PRIO_INHERIT=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 -$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } - if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : - -$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h - -fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then - case $host_os in - aix*) - case "x/$CC" in #( - x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : - #handle absolute path differently from PATH based program lookup - case "x$CC" in #( - x/*) : - if as_fn_executable_p ${CC}_r; then : - PTHREAD_CC="${CC}_r" -fi ;; #( - *) : - for ac_prog in ${CC}_r -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PTHREAD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PTHREAD_CC"; then - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PTHREAD_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC -if test -n "$PTHREAD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -$as_echo "$PTHREAD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PTHREAD_CC" && break -done -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - ;; -esac ;; #( - *) : - ;; -esac - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - - - - - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then - if test "$CC" = "$PTHREAD_CC" -o -z "$ac_original_cc"; then - have_pthread=yes - else - ac_prog_cc_no_pthread=yes - fi - - : -else - ax_pthread_ok=no - -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_compiler_gnu=$ac_cv_c_compiler_gnu - - - - if test "$have_pthread" = yes; then - $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h - - CC=$PTHREAD_CC - fi - fi - # Needs ac_original_cc. - - - if test -z "$GCC"; then # not using GCC { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to request ANSI compilation" >&5 @@ -4401,165 +3524,233 @@ $as_echo "Solaris: adding -D__EXTENSIONS__" >&6; } CC="$CC -D__EXTENSIONS__" ;; esac + + # Prior to 1996, XScreenSaver was written in K&R C, because ANSI C + # compilers (function prototypes!) were not yet universally deployed. + # And even after the conversion to ANSI C, GNU C's various non-standard + # extensions (such as allowing C++ style "//" comments in C code, and + # declarations after statements) were not supported by non-gcc compilers + # for many years, so we continued to use "-std=c89" to prevent those + # GNU-isms from sneaking in to the code. Well, these days various + # vendors have sloppily allowed non-ANSI syntax to slip into their + # library header files. GTK and OpenGL have been major offenders in this + # way. So... as of 2021, I guess we are forced to use "-std=gnu89", to + # allow those extensions, and hope that the warnings generated by + # "-pedantic" are heeded. + # + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -std=gnu89" >&5 +$as_echo_n "checking whether gcc accepts -std=gnu89... " >&6; } +if ${ac_cv_gcc_accepts_gnu89+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -std=gnu89 conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_gnu89=no + else + ac_cv_gcc_accepts_gnu89=yes + CC="$CC -std=gnu89" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_gnu89" >&5 +$as_echo "$ac_cv_gcc_accepts_gnu89" >&6; } + ac_gcc_accepts_gnu89="$ac_cv_gcc_accepts_gnu89" fi - OBJCC="$CC" + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -pedantic" >&5 +$as_echo_n "checking whether gcc accepts -pedantic... " >&6; } +if ${ac_cv_gcc_accepts_pedantic+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -pedantic conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_pedantic=no + else + ac_cv_gcc_accepts_pedantic=yes + CC="$CC -pedantic" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_pedantic" >&5 +$as_echo "$ac_cv_gcc_accepts_pedantic" >&6; } + ac_gcc_accepts_pedantic="$ac_cv_gcc_accepts_pedantic" + fi - # This test makes cross-compiling fail, so let's just assume that nobody - # is using a K&R compiler any more... - # -# AC_MSG_CHECKING([whether the compiler works on ANSI C]) -# AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], -# AC_MSG_RESULT(yes), -# AC_MSG_RESULT(no) -# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.), -# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.)) - - if test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Turning on gcc compiler warnings." >&5 -$as_echo "Turning on gcc compiler warnings." >&6; } - CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes" - OBJCC="$OBJCC -Wall" - # As of gcc 3.4, we have "-Wdeclaration-after-statement" - # and so perhaps now we can do without -pedantic? - else - case "$host" in - *-irix5* |*-irix6.0-3* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Turning on SGI compiler warnings." >&5 -$as_echo "Turning on SGI compiler warnings." >&6; } - CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3" - ;; -# *-dec-osf* ) -# if test -z "$GCC"; then -# AC_MSG_RESULT(Turning on DEC C compiler warnings.) -# CC="$CC -migrate -w0 -verbose -warnprotos" -# fi -# ;; - esac + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wall" >&5 +$as_echo_n "checking whether gcc accepts -Wall... " >&6; } +if ${ac_cv_gcc_accepts_Wall+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -Wall conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_Wall=no + else + ac_cv_gcc_accepts_Wall=yes + CC="$CC -Wall" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_Wall" >&5 +$as_echo "$ac_cv_gcc_accepts_Wall" >&6; } + ac_gcc_accepts_Wall="$ac_cv_gcc_accepts_Wall" fi -if test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wno-overlength-strings" >&5 -$as_echo_n "checking whether gcc accepts -Wno-overlength-strings... " >&6; } -if ${ac_cv_gcc_accepts_no_overlength+:} false; then : + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wnested-externs" >&5 +$as_echo_n "checking whether gcc accepts -Wnested-externs... " >&6; } +if ${ac_cv_gcc_accepts_wnested_externs+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.$ac_ext touch conftest.$ac_ext - if ( ( gcc -c -Wno-overlength-strings conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + if ( ( gcc -c -Wnested-externs conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ grep unrecognized >/dev/null ); then - ac_cv_gcc_accepts_no_overlength=no + ac_cv_gcc_accepts_wnested_externs=no else - ac_cv_gcc_accepts_no_overlength=yes - CC="$CC -Wno-overlength-strings" + ac_cv_gcc_accepts_wnested_externs=yes + CC="$CC -Wnested-externs" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_overlength" >&5 -$as_echo "$ac_cv_gcc_accepts_no_overlength" >&6; } - ac_gcc_accepts_no_overlength="$ac_cv_gcc_accepts_no_overlength" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_wnested_externs" >&5 +$as_echo "$ac_cv_gcc_accepts_wnested_externs" >&6; } + ac_gcc_accepts_wnested_externs="$ac_cv_gcc_accepts_wnested_externs" fi -if test -n "$GCC"; then + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wstrict-prototypes" >&5 +$as_echo_n "checking whether gcc accepts -Wstrict-prototypes... " >&6; } +if ${ac_cv_gcc_accepts_wstrict_prototypes+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -Wstrict-prototypes conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_wstrict_prototypes=no + else + ac_cv_gcc_accepts_wstrict_prototypes=yes + CC="$CC -Wstrict-prototypes" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_wstrict_prototypes" >&5 +$as_echo "$ac_cv_gcc_accepts_wstrict_prototypes" >&6; } + ac_gcc_accepts_wstrict_prototypes="$ac_cv_gcc_accepts_wstrict_prototypes" + fi + + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wmissing-prototypes" >&5 +$as_echo_n "checking whether gcc accepts -Wmissing-prototypes... " >&6; } +if ${ac_cv_gcc_accepts_wmissing_prototypes+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -Wmissing-prototypes conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_wmissing_prototypes=no + else + ac_cv_gcc_accepts_wmissing_prototypes=yes + CC="$CC -Wmissing-prototypes" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_wmissing_prototypes" >&5 +$as_echo "$ac_cv_gcc_accepts_wmissing_prototypes" >&6; } + ac_gcc_accepts_wmissing_prototypes="$ac_cv_gcc_accepts_wmissing_prototypes" + fi + + if test -n "$GCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wdeclaration-after-statement" >&5 $as_echo_n "checking whether gcc accepts -Wdeclaration-after-statement... " >&6; } -if ${ac_cv_gcc_accepts_no_decl_after+:} false; then : +if ${ac_cv_gcc_accepts_declaration_after+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.$ac_ext touch conftest.$ac_ext if ( ( gcc -c -Wdeclaration-after-statement conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ grep unrecognized >/dev/null ); then - ac_cv_gcc_accepts_no_decl_after=no + ac_cv_gcc_accepts_declaration_after=no else - ac_cv_gcc_accepts_no_decl_after=yes + ac_cv_gcc_accepts_declaration_after=yes CC="$CC -Wdeclaration-after-statement" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_decl_after" >&5 -$as_echo "$ac_cv_gcc_accepts_no_decl_after" >&6; } - ac_gcc_accepts_no_decl_after="$ac_cv_gcc_accepts_no_decl_after" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_declaration_after" >&5 +$as_echo "$ac_cv_gcc_accepts_declaration_after" >&6; } + ac_gcc_accepts_declaration_after="$ac_cv_gcc_accepts_declaration_after" fi -if test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -no-cpp-precomp" >&5 -$as_echo_n "checking whether gcc accepts -no-cpp-precomp... " >&6; } -if ${ac_cv_gcc_accepts_no_cpp_precomp+:} false; then : + # "string length is greater than ISO C89 compilers required to support" + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wno-overlength-strings" >&5 +$as_echo_n "checking whether gcc accepts -Wno-overlength-strings... " >&6; } +if ${ac_cv_gcc_accepts_no_overlength_strings+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.$ac_ext touch conftest.$ac_ext - if ( ( gcc -c -no-cpp-precomp conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + if ( ( gcc -c -Wno-overlength-strings conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ grep unrecognized >/dev/null ); then - ac_cv_gcc_accepts_no_cpp_precomp=no + ac_cv_gcc_accepts_no_overlength_strings=no else - ac_cv_gcc_accepts_no_cpp_precomp=yes - CC="$CC -no-cpp-precomp" + ac_cv_gcc_accepts_no_overlength_strings=yes + CC="$CC -Wno-overlength-strings" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_cpp_precomp" >&5 -$as_echo "$ac_cv_gcc_accepts_no_cpp_precomp" >&6; } - ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_overlength_strings" >&5 +$as_echo "$ac_cv_gcc_accepts_no_overlength_strings" >&6; } + ac_gcc_accepts_no_overlength_strings="$ac_cv_gcc_accepts_no_overlength_strings" fi -if test -n "$GCC"; then - - case "$host" in - *-darwin* ) - # Fucking Apple let // comments sneak into OpenGL headers, so - # we *must* allow // comments when compiling on Mac OS 10.6! FUCK! - ;; - *) - if test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -std=c89" >&5 -$as_echo_n "checking whether gcc accepts -std=c89... " >&6; } -if ${ac_cv_gcc_accepts_std+:} false; then : + # Ignore warnings about using "inline" + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wno-language-extension-token" >&5 +$as_echo_n "checking whether gcc accepts -Wno-language-extension-token... " >&6; } +if ${ac_cv_gcc_accepts_no_language_ext_token+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.$ac_ext touch conftest.$ac_ext - if ( ( gcc -c -std=c89 conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + if ( ( gcc -c -Wno-language-extension-token conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ grep unrecognized >/dev/null ); then - ac_cv_gcc_accepts_std=no + ac_cv_gcc_accepts_no_language_ext_token=no else - ac_cv_gcc_accepts_std=yes - CC="$CC -std=c89" + ac_cv_gcc_accepts_no_language_ext_token=yes + CC="$CC -Wno-language-extension-token" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_std" >&5 -$as_echo "$ac_cv_gcc_accepts_std" >&6; } - ac_gcc_accepts_std="$ac_cv_gcc_accepts_std" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_language_ext_token" >&5 +$as_echo "$ac_cv_gcc_accepts_no_language_ext_token" >&6; } + ac_gcc_accepts_no_language_ext_token="$ac_cv_gcc_accepts_no_language_ext_token" fi - ;; - esac + # Xlib headers use named variadic macros. + if test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -Wno-variadic-macros" >&5 +$as_echo_n "checking whether gcc accepts -Wno-variadic-macros... " >&6; } +if ${ac_cv_gcc_accepts_no_variadic_macros+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftest.$ac_ext + touch conftest.$ac_ext + if ( ( gcc -c -Wno-variadic-macros conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_no_variadic_macros=no + else + ac_cv_gcc_accepts_no_variadic_macros=yes + CC="$CC -Wno-variadic-macros" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gcc_accepts_no_variadic_macros" >&5 +$as_echo "$ac_cv_gcc_accepts_no_variadic_macros" >&6; } + ac_gcc_accepts_no_variadic_macros="$ac_cv_gcc_accepts_no_variadic_macros" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling C++ comments in ANSI C code." >&5 -$as_echo "Disabling C++ comments in ANSI C code." >&6; } - # - # The reason that // comments are banned from xscreensaver is that gcc is - # basically the only compiler in the world that supports them in C code. - # All other vendors support them only in their C++ compilers, not in their - # ANSI C compilers. This means that it's a portability problem: every time - # these comments have snuck into the xscreensaver source code, I've gotten - # complaints about it the next day. So we turn off support for them in gcc - # as well to prevent them from accidentially slipping in. - # - if test "$ac_gcc_accepts_std" = yes ; then - # - # -std=c89 defines __STRICT_ANSI__, which we don't want. - # (That appears to be the only additional preprocessor symbol - # it defines, in addition to the syntax changes it makes.) - # - # -std=gnu89 is no good, because // comments were a GNU extension - # before they were in the ANSI C 99 spec... (gcc 2.96 permits // - # with -std=gnu89 but not with -std=c89.) - # - # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD - CC="$CC -U__STRICT_ANSI__" -# else -# # The old way: -# CC="$CC -Wp,-lang-c89" - fi fi ac_ext=c @@ -4604,7 +3795,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4620,11 +3811,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext +rm -rf conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4663,7 +3854,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4679,11 +3870,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext +rm -rf conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else @@ -4822,23 +4013,6 @@ _ACEOF ;; esac - -ac_bc_result=`echo 6+9 | bc 2>/dev/null` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bc" >&5 -$as_echo_n "checking for bc... " >&6; } - if test "$ac_bc_result" = "15" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - echo '' - as_fn_error $? "Your system doesn't have \"bc\", which has been a standard - part of Unix since the 1970s. Come back when your vendor - has grown a clue." "$LINENO" 5 - fi - - # stuff for Makefiles # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -5005,7 +4179,7 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -rf conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -5017,7 +4191,6 @@ $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'. # That's wrong: it should be set to '${INSTALL}', so that one can # implement the "install-strip" target properly (strip executables, @@ -5069,7 +4242,7 @@ case `"$ac_path_GREP" --version 2>&1` in # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + rm -rf conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 @@ -5089,7 +4262,6 @@ fi $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : @@ -5135,7 +4307,7 @@ case `"$ac_path_EGREP" --version 2>&1` in # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + rm -rf conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 @@ -5156,7 +4328,6 @@ fi $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -5197,7 +4368,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -5214,7 +4385,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -5285,7 +4456,6 @@ fi done - for ac_header in unistd.h inttypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -5332,74 +4502,10 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <signal.h> - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal +#define RETSIGTYPE void _ACEOF - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <sys/time.h> -#include <time.h> - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : @@ -5620,24 +4726,7 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_gettimeofday_args=2 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - #include <sys/time.h> -int -main () -{ -struct timeval tv; gettimeofday(&tv); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : ac_gettimeofday_args=1 -else - ac_gettimeofday_args=0 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_gettimeofday_args=$ac_gettimeofday_args @@ -5686,7 +4775,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5710,7 +4799,7 @@ rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC - rm -f conftest.$ac_ext + rm -rf conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 @@ -5732,7 +4821,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5756,7 +4845,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5801,7 +4890,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5825,7 +4914,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5858,7 +4947,6 @@ esac rm -rf conftest* fi - fi for ac_func in select fcntl uname nice setpriority getcwd getwd putenv sbrk @@ -5916,7 +5004,6 @@ cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_SA_LEN 1 _ACEOF - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct icmp" >&5 @@ -6081,14 +5168,12 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <sys/types.h> - #include <sys/socket.h> + #include <sys/types.h> + #include <sys/socket.h> int main () { - - socklen_t socklen; - +socklen_t socklen; ; return 0; } @@ -6161,7 +5246,6 @@ else $as_echo "no" >&6; } fi - test -n "$PERL" && break done @@ -6180,7 +5264,6 @@ $as_echo "$ac_cv_perl_version" >&6; } PERL_VERSION=$ac_cv_perl_version fi - if test -z "$PERL" ; then # don't let it be blank... PERL=/usr/bin/perl @@ -6189,7 +5272,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } - # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; @@ -6305,7 +5387,7 @@ else fi done fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -rf conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -6869,95 +5951,10 @@ fi fi - if test "$have_x" != yes; then as_fn_error $? "Couldn't find X11 headers/libs. Try \`$0 --help'." "$LINENO" 5 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X app-defaults directory" >&5 -$as_echo_n "checking for X app-defaults directory... " >&6; } -if ${ac_cv_x_app_defaults+:} false; then : - $as_echo_n "(cached) " >&6 -else - # skip this, it's always wrong these days. - # AC_PATH_X_APP_DEFAULTS_XMKMF - if test x"$ac_x_app_defaults" = x; then - true - # Look for the directory under a standard set of common directories. - # Check X11 before X11Rn because it's often a symlink to the current release. - for ac_dir in \ - \ - /usr/share/X11/app-defaults \ - \ - /usr/X11/lib/app-defaults \ - /usr/X11R6/lib/app-defaults \ - /usr/X11R6/lib/X11/app-defaults \ - /usr/X11R5/lib/app-defaults \ - /usr/X11R5/lib/X11/app-defaults \ - /usr/X11R4/lib/app-defaults \ - /usr/X11R4/lib/X11/app-defaults \ - \ - /usr/lib/X11/app-defaults \ - /usr/lib/X11R6/app-defaults \ - /usr/lib/X11R5/app-defaults \ - /usr/lib/X11R4/app-defaults \ - \ - /etc/X11/app-defaults \ - \ - /usr/local/X11/lib/app-defaults \ - /usr/local/X11R6/lib/app-defaults \ - /usr/local/X11R5/lib/app-defaults \ - /usr/local/X11R4/lib/app-defaults \ - \ - /usr/local/lib/X11/app-defaults \ - /usr/local/lib/X11R6/app-defaults \ - /usr/local/lib/X11R6/X11/app-defaults \ - /usr/local/lib/X11R5/app-defaults \ - /usr/local/lib/X11R5/X11/app-defaults \ - /usr/local/lib/X11R4/app-defaults \ - /usr/local/lib/X11R4/X11/app-defaults \ - \ - /usr/X386/lib/X11/app-defaults \ - /usr/x386/lib/X11/app-defaults \ - /usr/XFree86/lib/X11/app-defaults \ - \ - /usr/lib/X11/app-defaults \ - /usr/local/lib/X11/app-defaults \ - /usr/unsupported/lib/X11/app-defaults \ - /usr/athena/lib/X11/app-defaults \ - /usr/local/x11r5/lib/X11/app-defaults \ - /usr/lpp/Xamples/lib/X11/app-defaults \ - /lib/usr/lib/X11/app-defaults \ - \ - /usr/openwin/lib/app-defaults \ - /usr/openwin/lib/X11/app-defaults \ - /usr/openwin/share/lib/app-defaults \ - /usr/openwin/share/lib/X11/app-defaults \ - \ - /X11R6/lib/app-defaults \ - /X11R5/lib/app-defaults \ - /X11R4/lib/app-defaults \ - ; \ - do - if test -d "$ac_dir"; then - ac_x_app_defaults=$ac_dir - break - fi - done - - fi - if test x"$ac_x_app_defaults" = x; then - /bin/echo -n 'fallback: ' - ac_cv_x_app_defaults="/usr/lib/X11/app-defaults" - else - # Record where we found app-defaults for the cache. - ac_cv_x_app_defaults="$ac_x_app_defaults" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x_app_defaults" >&5 -$as_echo "$ac_cv_x_app_defaults" >&6; } - eval ac_x_app_defaults="$ac_cv_x_app_defaults" case "$host" in *-hpux*) @@ -7044,7 +6041,6 @@ case "$host" in X_LIBS="-L/opt/Mesa/lib $X_LIBS" fi - # On HPUX, default to installing in /opt/xscreensaver/ instead of # in /usr/local/, unless there is already an xscreensaver in # /usr/local/bin/. This can be overridden with the --prefix arg @@ -7114,11 +6110,28 @@ fi ;; *-darwin*) - # On MacOS X (10.x with "fink"), many things are under /sw/. - # + # MacPorts on macOS + if test -d /opt/local/include ; then + X_CFLAGS="-I/opt/local/include $X_CFLAGS" + X_LIBS="-L/opt/local/lib $X_LIBS" + fi + + # Fink on macOS if test -d /sw/include ; then X_CFLAGS="-I/sw/include $X_CFLAGS" - X_LIBS="-L/sw/lib $X_LIBS" + X_LIBS="-L/sw/lib $X_LIBS" + fi + + # Homebrew on macOS Intel + if test -d /usr/local/include ; then + X_CFLAGS="-I/usr/local/include $X_CFLAGS" + X_LIBS="-L/usr/local/lib $X_LIBS" + fi + + # Homebrew on macOS ARM + if test -d /opt/homebrew/include ; then + X_CFLAGS="-I/opt/homebrew/include $X_CFLAGS" + X_LIBS="-L/opt/homebrew/lib $X_LIBS" fi ;; esac @@ -7159,18 +6172,195 @@ $as_echo "$ac_cv_xpointer" >&6; } $as_echo "#define XPointer char*" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xt" >&5 +$as_echo_n "checking for Xt... " >&6; } +if ${ac_cv_libxt+:} false; then : + $as_echo_n "(cached) " >&6 +else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is MacOS X" >&5 -$as_echo_n "checking whether this is MacOS X... " >&6; } + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <X11/Xlib.h> + #include <X11/Intrinsic.h> +int +main () +{ +Widget foo = (Widget) 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_libxt=yes +else + ac_cv_libxt=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$ac_save_CPPFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libxt" >&5 +$as_echo "$ac_cv_libxt" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is macOS" >&5 +$as_echo_n "checking whether this is macOS... " >&6; } ac_macosx=no + ac_irix=no case "$host" in *-apple-darwin* ) ac_macosx=yes ;; + *-irix* ) + ac_irix=yes + ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_macosx" >&5 $as_echo "$ac_macosx" >&6; } +############################################################################### +# +# pkg-config +# +############################################################################### + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_pkg_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $pkg_config in + [\\/]* | ?:[\\/]*) + ac_cv_path_pkg_config="$pkg_config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_pkg_config="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +pkg_config=$ac_cv_path_pkg_config +if test -n "$pkg_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pkg_config" >&5 +$as_echo "$pkg_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_pkg_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_pkg_config in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_pkg_config="$ac_pt_pkg_config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_pkg_config="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_pkg_config=$ac_cv_path_ac_pt_pkg_config +if test -n "$ac_pt_pkg_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_pkg_config" >&5 +$as_echo "$ac_pt_pkg_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_pkg_config" = x; then + pkg_config="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + pkg_config=$ac_pt_pkg_config + fi +else + pkg_config="$ac_cv_path_pkg_config" +fi + +if test -z "$pkg_config" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config not found!" >&5 +$as_echo "$as_me: WARNING: pkg-config not found!" >&2;} + pkg_config="false" +fi + +# Utility function for running pkg-config-based tests... +# +pkgs='' +pkg_check_version() { + if test "$ok" = yes ; then + req="$1" + min="$2" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $req" >&5 +$as_echo_n "checking for $req... " >&6; } + if $pkg_config --exists "$req" ; then + vers=`$pkg_config --modversion "$req"` + if $pkg_config --exists "$req >= $min" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers" >&5 +$as_echo "$vers" >&6; } + pkgs="$pkgs $req" + return 1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers (wanted >= $min)" >&5 +$as_echo "$vers (wanted >= $min)" >&6; } + ok=no + return 0 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ok=no + return 0 + fi + fi +} ############################################################################### # @@ -7178,6 +6368,13 @@ $as_echo "$ac_macosx" >&6; } # ############################################################################### +# Wow, this is complete madness. Why does po/Makefile.in.in exist?? Why does +# aclocal.m4 exist?? Why can't I upgrade it without everything breaking?? +# This IT_PROG_INTLTOOL nonsense has so many self-modifying levels of insanity +# that it *must* have been written by RMS. Or an equally demented protégé. +# Won't someone please have mercy on us all and write a normal po/Makefile.in +# that uses wildcards, and write a sane set of rules to detect gettext(3) and +# msgfmt(1) and just do the obviously straightforward thing? { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } @@ -7191,9 +6388,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } - - - case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 @@ -7253,7 +6447,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7293,7 +6486,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7333,7 +6525,6 @@ else $as_echo "no" >&6; } fi - if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi @@ -7342,21 +6533,14 @@ if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi - INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' - - - INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' - - - INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' @@ -7381,102 +6565,6 @@ fi INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 @@ -7517,7 +6605,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7557,7 +6644,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7597,7 +6683,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7638,7 +6723,6 @@ else $as_echo "no" >&6; } fi - if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi @@ -7651,23 +6735,12 @@ fi # Substitute ALL_LINGUAS so we can use it in po/Makefile - - - - GETTEXT_PACKAGE=xscreensaver cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$GETTEXT_PACKAGE" -_ACEOF - - - ALL_LINGUAS="da de es et fi fr hu it ja ko nb nl pl pt pt_BR ru sk sv vi wa zh_CN zh_TW" for ac_header in locale.h @@ -7717,14 +6790,12 @@ $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi USE_NLS=yes - gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : @@ -7798,8 +6869,6 @@ $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi - - ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" @@ -8009,7 +7078,6 @@ fi fi - if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } @@ -8265,7 +7333,6 @@ else $as_echo "no" >&6; } fi - # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -8351,8 +7418,6 @@ rm -f core conftest.err conftest.$ac_objext \ fi - - if test "$gt_cv_have_gettext" = "yes" ; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h @@ -8374,24 +7439,11 @@ $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } ac_config_commands="$ac_config_commands default-1" - for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done - - - - - - - - - - - - if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= @@ -8438,7 +7490,6 @@ $as_echo "$LINGUAS" >&6; } MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi - test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -8455,130 +7506,104 @@ $as_echo "$LINGUAS" >&6; } MKINSTALLDIRS="$INSTALL_DIRS" - ############################################################################### # -# Check for -lXmu (some fucked up vendors don't ship it...) +# The --with-x-app-defaults option # ############################################################################### -have_xmu=no +#### H1 - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/Xmu/Error.h" "ac_cv_header_X11_Xmu_Error_h" "#include <stdlib.h> - #include <stdio.h> - #include <X11/Intrinsic.h> -" -if test "x$ac_cv_header_X11_Xmu_Error_h" = xyes; then : - have_xmu=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" -if test "$have_xmu" = no ; then - XMU_SRCS='$(UTILS_SRC)/xmu.c' - XMU_OBJS='$(UTILS_BIN)/xmu.o' - XMU_LIBS='' +# Check whether --with-app-defaults was given. +if test "${with_app_defaults+set}" = set; then : + withval=$with_app_defaults; ac_cv_x_app_defaults="$withval" else - XMU_SRCS='' - XMU_OBJS='' - XMU_LIBS='-lXmu' - $as_echo "#define HAVE_XMU 1" >>confdefs.h - + eval ac_x_app_defaults="$withval" fi - -############################################################################### -# -# Check for the SunOS 4.1.x _get_wmShellWidgetClass bug. -# See comp.windows.x FAQ question 124. The right fix is to -# get OpenWindows 3.0 patches 100512-02 and 100573-03. -# -############################################################################### - -if test "$have_xmu" = yes ; then - case "$host" in - *-sunos4*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5 -$as_echo_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug... " >&6; } -if ${ac_cv_sunos_xmu_bug+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_LDFLAGS="$LDFLAGS" - if test \! -z "$x_libraries" ; then - LDFLAGS="$LDFLAGS -L$x_libraries" - fi - # Note: this trick never works! (Generally.) - # We're only getting away with using AC_TRY_LINK - # with X libraries because we know it's SunOS. - LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_sunos_xmu_bug=no -else - ac_cv_sunos_xmu_bug=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$ac_save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sunos_xmu_bug" >&5 -$as_echo "$ac_cv_sunos_xmu_bug" >&6; } - if test "$ac_cv_sunos_xmu_bug" = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -static" >&5 -$as_echo_n "checking whether the compiler understands -static... " >&6; } -if ${ac_cv_ld_static+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X app-defaults directory" >&5 +$as_echo_n "checking for X app-defaults directory... " >&6; } +if ${ac_cv_x_app_defaults+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -static" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ + # skip this, it's always wrong these days. + # AC_PATH_X_APP_DEFAULTS_XMKMF + if test x"$ac_x_app_defaults" = x; then + true + # Look for the directory under a standard set of common directories. + # Check X11 before X11Rn because it's often a symlink to the current release. + for ac_dir in \ + \ + /usr/share/X11/app-defaults \ + \ + /usr/X11/lib/app-defaults \ + /usr/X11R6/lib/app-defaults \ + /usr/X11R6/lib/X11/app-defaults \ + /usr/X11R5/lib/app-defaults \ + /usr/X11R5/lib/X11/app-defaults \ + /usr/X11R4/lib/app-defaults \ + /usr/X11R4/lib/X11/app-defaults \ + \ + /usr/lib/X11/app-defaults \ + /usr/lib/X11R6/app-defaults \ + /usr/lib/X11R5/app-defaults \ + /usr/lib/X11R4/app-defaults \ + \ + /etc/X11/app-defaults \ + \ + /usr/local/X11/lib/app-defaults \ + /usr/local/X11R6/lib/app-defaults \ + /usr/local/X11R5/lib/app-defaults \ + /usr/local/X11R4/lib/app-defaults \ + \ + /usr/local/lib/X11/app-defaults \ + /usr/local/lib/X11R6/app-defaults \ + /usr/local/lib/X11R6/X11/app-defaults \ + /usr/local/lib/X11R5/app-defaults \ + /usr/local/lib/X11R5/X11/app-defaults \ + /usr/local/lib/X11R4/app-defaults \ + /usr/local/lib/X11R4/X11/app-defaults \ + \ + /usr/X386/lib/X11/app-defaults \ + /usr/x386/lib/X11/app-defaults \ + /usr/XFree86/lib/X11/app-defaults \ + \ + /usr/lib/X11/app-defaults \ + /usr/local/lib/X11/app-defaults \ + /usr/unsupported/lib/X11/app-defaults \ + /usr/athena/lib/X11/app-defaults \ + /usr/local/x11r5/lib/X11/app-defaults \ + /usr/lpp/Xamples/lib/X11/app-defaults \ + /lib/usr/lib/X11/app-defaults \ + \ + /usr/openwin/lib/app-defaults \ + /usr/openwin/lib/X11/app-defaults \ + /usr/openwin/share/lib/app-defaults \ + /usr/openwin/share/lib/X11/app-defaults \ + \ + /X11R6/lib/app-defaults \ + /X11R5/lib/app-defaults \ + /X11R4/lib/app-defaults \ + ; \ + do + if test -d "$ac_dir"; then + ac_x_app_defaults=$ac_dir + break + fi + done - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_ld_static=yes -else - ac_cv_ld_static=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$ac_save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ld_static" >&5 -$as_echo "$ac_cv_ld_static" >&6; } - if test "$ac_cv_ld_static" = yes ; then - LDFLAGS="$LDFLAGS -static" + fi + if test x"$ac_x_app_defaults" = x; then + /bin/echo -n 'fallback: ' + ac_cv_x_app_defaults="/usr/lib/X11/app-defaults" else - LDFLAGS="$LDFLAGS -Bstatic" + # Record where we found app-defaults for the cache. + ac_cv_x_app_defaults="$ac_x_app_defaults" fi - fi - ;; - esac fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x_app_defaults" >&5 +$as_echo "$ac_cv_x_app_defaults" >&6; } + eval ac_x_app_defaults="$ac_cv_x_app_defaults" ############################################################################### # @@ -8596,7 +7621,6 @@ else with_hackdir=yes fi - if test x"$with_hackdir" = xyes; then HACKDIR='${libexecdir}/xscreensaver' elif test x"$with_hackdir" = xno; then @@ -8627,11 +7651,9 @@ if test -n "$obsolete_enable"; then exit 1 fi - ############################################################################### # # Handle the --with-configdir option -# Help for --with-x-app-defaults option added. # ############################################################################### @@ -8645,7 +7667,6 @@ else with_configdir=yes fi - if test x"$with_configdir" = xyes; then HACK_CONF_DIR='${datadir}/xscreensaver/config' elif test x"$with_configdir" = xno; then @@ -8662,111 +7683,39 @@ else fi fi - - - ############################################################################### # -# Check for the SGI SCREEN_SAVER server extension. +# Handle the --with-fontdir option # ############################################################################### -#have_sgi=no -#with_sgi_req=unspecified -#AC_ARG_WITH(sgi-ext, -#[Except where noted, all of the --with options below can also take a -#directory argument: for example, `--with-motif=/opt/Motif'. That would -#cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ -#to be added to the -L list, assuming those directories exist. -# -#By default, support for each of these options will be built in, if the -#relevant library routines exist. At run time, they will then be used -#only if the X server being used supports them. Each --with option has -#a corresponding --without option, to override building support for them -#at all. -# -#Screen blanking and idle-detection options: -# -# --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.], -# [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes]) -# -#HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER) -# -#if test "$with_sgi" = yes; then -# AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h, -# [have_sgi=yes -# AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],, -# [#include <X11/Xlib.h>]) -# -#elif test "$with_sgi" != no; then -# echo "error: must be yes or no: --with-sgi-ext=$with_sgi" -# exit 1 -#fi - - -############################################################################### -# -# Check for the XIDLE server extension. -# -############################################################################### - -#have_xidle=no -#with_xidle_req=unspecified -#AC_ARG_WITH(xidle-ext, -#[ --with-xidle-ext Include support for the XIDLE extension.], -# [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes]) -# -#HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE) -# -#if test "$with_xidle" = yes; then -# AC_CHECK_X_HEADER(X11/extensions/xidle.h, -# [have_xidle=yes -# AC_DEFINE(HAVE_XIDLE_EXTENSION)],, -# [#include <X11/Xlib.h>]) -#elif test "$with_xidle" != no; then -# echo "error: must be yes or no: --with-xidle-ext=$with_xidle" -# exit 1 -#fi - - -############################################################################### -# -# Check for the SGI-VIDEO-CONTROL server extension. -# -############################################################################### +have_fontdir=yes +with_fontdir_req=unspecified -#have_sgivc=no -#with_sgivc_req=unspecified -#AC_ARG_WITH(sgivc-ext, -#[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.], -# [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes]) -# -#HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL) -# -#if test "$with_sgivc" = yes; then -# -# # first check for XSGIvc.h -# AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],, -# [#include <X11/Xlib.h>]) -# -# # if that succeeded, then check for the -lXsgivc -# if test "$have_sgivc" = yes; then -# have_sgivc=no -# AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap, -# [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true], -# -lXext -lX11) -# fi -# -# # if that succeeded, then we've really got it. -# if test "$have_sgivc" = yes; then -# AC_DEFINE(HAVE_SGI_VC_EXTENSION) -# fi -# -#elif test "$with_sgivc" != no; then -# echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" -# exit 1 -#fi +# Check whether --with-fontdir was given. +if test "${with_fontdir+set}" = set; then : + withval=$with_fontdir; with_fontdir="$withval"; with_fontdir_req="$withval" +else + with_fontdir=yes +fi +if test x"$with_fontdir" = xyes; then + FONT_DIR='${datarootdir}/fonts/xscreensaver' + if test "$ac_macosx" = yes; then + FONT_DIR='/Library/Fonts' + fi +elif test x"$with_fontdir" = xno; then + FONT_DIR='' +else + # there must be a better way than this... + if test -z "`echo $with_fontdir | sed 's@^/.*@@'`" ; then + # absolute path + FONT_DIR="$with_fontdir" + else + # relative path + FONT_DIR='${datarootdir}/fonts/'"$with_fontdir" + fi +fi ############################################################################### # @@ -8774,6 +7723,8 @@ fi # ############################################################################### +#### H1 + have_dpms=no with_dpms_req=unspecified @@ -8784,8 +7735,6 @@ else with_dpms=yes fi - - case "$with_dpms" in yes) ;; no) ;; @@ -8829,7 +7778,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_dpms" = yes; then # first check for dpms.h @@ -8847,7 +7795,6 @@ if test "x$ac_cv_header_X11_extensions_dpms_h" = xyes; then : have_dpms=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" # if that succeeded, then check for the DPMS code in the libraries @@ -8920,7 +7867,6 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - # if that failed, look in -lXdpms (this is where it was in XFree86 3.x) if test "$have_dpms" = no; then @@ -8991,7 +7937,6 @@ fi fi fi - # if that succeeded, then we've really got it. if test "$have_dpms" = yes; then $as_echo "#define HAVE_DPMS_EXTENSION 1" >>confdefs.h @@ -9003,33 +7948,30 @@ elif test "$with_dpms" != no; then exit 1 fi - ############################################################################### # -# Check for the XINERAMA server extension. +# Check for the XF86VMODE server extension (for virtual screens.) # ############################################################################### -have_xinerama=no -with_xinerama_req=unspecified +have_xf86vmode=no +with_xf86vmode_req=unspecified -# Check whether --with-xinerama-ext was given. -if test "${with_xinerama_ext+set}" = set; then : - withval=$with_xinerama_ext; with_xinerama="$withval"; with_xinerama_req="$withval" +# Check whether --with-xf86vmode-ext was given. +if test "${with_xf86vmode_ext+set}" = set; then : + withval=$with_xf86vmode_ext; with_xf86vmode="$withval"; with_xf86vmode_req="$withval" else - with_xinerama=yes + with_xf86vmode=yes fi - - - case "$with_xinerama" in + case "$with_xf86vmode" in yes) ;; no) ;; /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINERAMA headers" >&5 -$as_echo_n "checking for XINERAMA headers... " >&6; } - d=$with_xinerama/include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode headers" >&5 +$as_echo_n "checking for xf86vmode headers... " >&6; } + d=$with_xf86vmode/include if test -d $d; then X_CFLAGS="-I$d $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9039,9 +7981,9 @@ $as_echo "$d" >&6; } $as_echo "not found ($d: no such directory)" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINERAMA libs" >&5 -$as_echo_n "checking for XINERAMA libs... " >&6; } - d=$with_xinerama/lib + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode libs" >&5 +$as_echo_n "checking for xf86vmode libs... " >&6; } + d=$with_xf86vmode/lib if test -d $d; then X_LIBS="-L$d $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9052,20 +7994,42 @@ $as_echo "not found ($d: no such directory)" >&6; } fi # replace the directory string with "yes". - with_xinerama_req="yes" - with_xinerama=$with_xinerama_req + with_xf86vmode_req="yes" + with_xf86vmode=$with_xf86vmode_req ;; *) echo "" - echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory." + echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory." echo " If it is a directory, then \`DIR/include' will be added to" echo " the -I list, and \`DIR/lib' will be added to the -L list." exit 1 ;; esac +VIDMODE_LIBS="" + +if test "$with_xf86vmode" = yes; then + + # first check for xf86vmode.h + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then : + have_xf86vmode=yes +fi + CPPFLAGS="$ac_save_CPPFLAGS" + + # if that succeeded, then check for the -lXxf86vm + if test "$have_xf86vmode" = yes; then + have_xf86vmode=no ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -9085,13 +8049,13 @@ $as_echo "not found ($d: no such directory)" >&6; } CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXss" >&5 -$as_echo_n "checking for XScreenSaverQueryInfo in -lXss... " >&6; } -if ${ac_cv_lib_Xss_XScreenSaverQueryInfo+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5 +$as_echo_n "checking for XF86VidModeGetViewPort in -lXxf86vm... " >&6; } +if ${ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXss -lXss -lX11 $LIBS" +LIBS="-lXxf86vm -lXext -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9101,28 +8065,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XScreenSaverQueryInfo (); +char XF86VidModeGetViewPort (); int main () { -return XScreenSaverQueryInfo (); +return XF86VidModeGetViewPort (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xss_XScreenSaverQueryInfo=yes + ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=yes else - ac_cv_lib_Xss_XScreenSaverQueryInfo=no + ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 -$as_echo "$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6; } -if test "x$ac_cv_lib_Xss_XScreenSaverQueryInfo" = xyes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lXss" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&5 +$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&6; } +if test "x$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" = xyes; then : + have_xf86vmode=yes; + VIDMODE_LIBS="-lXxf86vm"; + SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS" else true fi @@ -9131,7 +8097,77 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" + fi + + # if that succeeded, then we've really got it. + if test "$have_xf86vmode" = yes; then + $as_echo "#define HAVE_XF86VMODE 1" >>confdefs.h + + fi + +elif test "$with_xf86vmode" != no; then + echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode" + exit 1 +fi + +############################################################################### +# +# Check for the XINERAMA server extension. +# +############################################################################### + +have_xinerama=no +with_xinerama_req=unspecified + +# Check whether --with-xinerama-ext was given. +if test "${with_xinerama_ext+set}" = set; then : + withval=$with_xinerama_ext; with_xinerama="$withval"; with_xinerama_req="$withval" +else + with_xinerama=yes +fi + + case "$with_xinerama" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINERAMA headers" >&5 +$as_echo_n "checking for XINERAMA headers... " >&6; } + d=$with_xinerama/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINERAMA libs" >&5 +$as_echo_n "checking for XINERAMA libs... " >&6; } + d=$with_xinerama/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_xinerama_req="yes" + with_xinerama=$with_xinerama_req + ;; + *) + echo "" + echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac if test "$with_xinerama" = yes; then @@ -9149,7 +8185,6 @@ if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes; then : have_xinerama=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" # if that succeeded, then check for the XINERAMA code in the libraries @@ -9222,7 +8257,6 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.) if test "$have_xinerama" = no; then @@ -9304,33 +8338,34 @@ elif test "$with_xinerama" != no; then exit 1 fi - ############################################################################### # -# Check for the XINPUT server extension. +# Check for the RANDR (Resize and Rotate) server extension. +# +# We need this to detect when the resolution of the desktop +# has changed out from under us (this is a newer, different +# mechanism than the XF86VMODE virtual viewports.) # ############################################################################### -have_xinput=no -with_xinput_req=unspecified +have_randr=no +with_randr_req=unspecified -# Check whether --with-xinput-ext was given. -if test "${with_xinput_ext+set}" = set; then : - withval=$with_xinput_ext; with_xinput="$withval"; with_xinput_req="$withval" +# Check whether --with-randr-ext was given. +if test "${with_randr_ext+set}" = set; then : + withval=$with_randr_ext; with_randr="$withval"; with_randr_req="$withval" else - with_xinput=yes + with_randr=yes fi - - - case "$with_xinput" in + case "$with_randr" in yes) ;; no) ;; /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT headers" >&5 -$as_echo_n "checking for XINPUT headers... " >&6; } - d=$with_xinput/include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR headers" >&5 +$as_echo_n "checking for RANDR headers... " >&6; } + d=$with_randr/include if test -d $d; then X_CFLAGS="-I$d $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9340,9 +8375,9 @@ $as_echo "$d" >&6; } $as_echo "not found ($d: no such directory)" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT libs" >&5 -$as_echo_n "checking for XINPUT libs... " >&6; } - d=$with_xinput/lib + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR libs" >&5 +$as_echo_n "checking for RANDR libs... " >&6; } + d=$with_randr/lib if test -d $d; then X_LIBS="-L$d $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9353,23 +8388,22 @@ $as_echo "not found ($d: no such directory)" >&6; } fi # replace the directory string with "yes". - with_xinput_req="yes" - with_xinput=$with_xinput_req + with_randr_req="yes" + with_randr=$with_randr_req ;; *) echo "" - echo "error: argument to --with-xinput-ext must be \"yes\", \"no\", or a directory." + echo "error: argument to --with-randr-ext must be \"yes\", \"no\", or a directory." echo " If it is a directory, then \`DIR/include' will be added to" echo " the -I list, and \`DIR/lib' will be added to the -L list." exit 1 ;; esac +if test "$with_randr" = yes; then -if test "$with_xinput" = yes; then - - # first check for Xinput.h + # first check for Xrandr.h ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -9377,18 +8411,86 @@ if test "$with_xinput" = yes; then fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput.h" "ac_cv_header_X11_extensions_XInput_h" "#include <X11/Xlib.h> + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include <X11/Xlib.h> " -if test "x$ac_cv_header_X11_extensions_XInput_h" = xyes; then : - have_xinput=yes +if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then : + have_randr=yes fi + CPPFLAGS="$ac_save_CPPFLAGS" + + # if that succeeded, then check for the XRR code in the libraries + if test "$have_randr" = yes; then + + # RANDR probably needs -lXrender + xrender_libs= + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderSetSubpixelOrder in -lXrender" >&5 +$as_echo_n "checking for XRenderSetSubpixelOrder in -lXrender... " >&6; } +if ${ac_cv_lib_Xrender_XRenderSetSubpixelOrder+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrender -lXext -lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XRenderSetSubpixelOrder (); +int +main () +{ +return XRenderSetSubpixelOrder (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xrender_XRenderSetSubpixelOrder=yes +else + ac_cv_lib_Xrender_XRenderSetSubpixelOrder=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&5 +$as_echo "$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&6; } +if test "x$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" = xyes; then : + xrender_libs="-lXrender" +else + true +fi CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" - # if that succeeded, then check for libXi - if test "$have_xinput" = yes; then - have_xinput=no + # first look for RANDR in -lXext + have_randr=no ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -9408,13 +8510,80 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XListInputDevices in -lXi" >&5 -$as_echo_n "checking for XListInputDevices in -lXi... " >&6; } -if ${ac_cv_lib_Xi_XListInputDevices+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXext" >&5 +$as_echo_n "checking for XRRGetScreenInfo in -lXext... " >&6; } +if ${ac_cv_lib_Xext_XRRGetScreenInfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXi -lXext -lX11 $LIBS" +LIBS="-lXext $xrender_libs -lXext -lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XRRGetScreenInfo (); +int +main () +{ +return XRRGetScreenInfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xext_XRRGetScreenInfo=yes +else + ac_cv_lib_Xext_XRRGetScreenInfo=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XRRGetScreenInfo" >&5 +$as_echo "$ac_cv_lib_Xext_XRRGetScreenInfo" >&6; } +if test "x$ac_cv_lib_Xext_XRRGetScreenInfo" = xyes; then : + have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs" +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + # if that failed, look in -lXrandr + if test "$have_randr" = no; then + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXrandr" >&5 +$as_echo_n "checking for XRRGetScreenInfo in -lXrandr... " >&6; } +if ${ac_cv_lib_Xrandr_XRRGetScreenInfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrandr $xrender_libs -lXext -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9424,28 +8593,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XListInputDevices (); +char XRRGetScreenInfo (); int main () { -return XListInputDevices (); +return XRRGetScreenInfo (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xi_XListInputDevices=yes + ac_cv_lib_Xrandr_XRRGetScreenInfo=yes else - ac_cv_lib_Xi_XListInputDevices=no + ac_cv_lib_Xrandr_XRRGetScreenInfo=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XListInputDevices" >&5 -$as_echo "$ac_cv_lib_Xi_XListInputDevices" >&6; } -if test "x$ac_cv_lib_Xi_XListInputDevices" = xyes; then : - have_xinput=yes; SAVER_LIBS="$SAVER_LIBS -lXi" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5 +$as_echo "$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; } +if test "x$ac_cv_lib_Xrandr_XRRGetScreenInfo" = xyes; then : + have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs" else true fi @@ -9454,46 +8623,90 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" + fi fi # if that succeeded, then we've really got it. - if test "$have_xinput" = yes; then - $as_echo "#define HAVE_XINPUT 1" >>confdefs.h + if test "$have_randr" = yes; then + $as_echo "#define HAVE_RANDR 1" >>confdefs.h + # Now check for version 1.2 in the same libs. + # Try to compile, since on macOS 10.5.7, headers are older than libs! + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenResources" >&5 +$as_echo_n "checking for XRRGetScreenResources... " >&6; } +if ${ac_cv_randr_12+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_randr_12=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #include <X11/Xlib.h> + #include <X11/extensions/Xrandr.h> +int +main () +{ +XRRScreenResources *res = + XRRGetScreenResources (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_randr_12=yes +else + ac_cv_randr_12=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$ac_save_CPPFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_randr_12" >&5 +$as_echo "$ac_cv_randr_12" >&6; } + if test "$ac_cv_randr_12" = yes ; then + $as_echo "#define HAVE_RANDR_12 1" >>confdefs.h -elif test "$with_xinput" != no; then - echo "error: must be yes or no: --with-xinput-ext=$with_xinput" + fi +# AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)], +# [true], $SAVER_LIBS) + fi + +elif test "$with_randr" != no; then + echo "error: must be yes or no: --with-randr-ext=$with_randr" exit 1 fi - ############################################################################### # -# Check for the XF86VMODE server extension (for virtual screens.) +# Check for the XINPUT server extension. # ############################################################################### -have_xf86vmode=no -with_xf86vmode_req=unspecified +have_xinput=no +with_xinput_req=unspecified +xinput_halfassed=no -# Check whether --with-xf86vmode-ext was given. -if test "${with_xf86vmode_ext+set}" = set; then : - withval=$with_xf86vmode_ext; with_xf86vmode="$withval"; with_xf86vmode_req="$withval" +# Check whether --with-xinput-ext was given. +if test "${with_xinput_ext+set}" = set; then : + withval=$with_xinput_ext; with_xinput="$withval"; with_xinput_req="$withval" else - with_xf86vmode=yes + with_xinput=yes fi - - - case "$with_xf86vmode" in + case "$with_xinput" in yes) ;; no) ;; /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode headers" >&5 -$as_echo_n "checking for xf86vmode headers... " >&6; } - d=$with_xf86vmode/include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT headers" >&5 +$as_echo_n "checking for XINPUT headers... " >&6; } + d=$with_xinput/include if test -d $d; then X_CFLAGS="-I$d $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9503,9 +8716,9 @@ $as_echo "$d" >&6; } $as_echo "not found ($d: no such directory)" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xf86vmode libs" >&5 -$as_echo_n "checking for xf86vmode libs... " >&6; } - d=$with_xf86vmode/lib + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT libs" >&5 +$as_echo_n "checking for XINPUT libs... " >&6; } + d=$with_xinput/lib if test -d $d; then X_LIBS="-L$d $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9516,25 +8729,22 @@ $as_echo "not found ($d: no such directory)" >&6; } fi # replace the directory string with "yes". - with_xf86vmode_req="yes" - with_xf86vmode=$with_xf86vmode_req + with_xinput_req="yes" + with_xinput=$with_xinput_req ;; *) echo "" - echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory." + echo "error: argument to --with-xinput-ext must be \"yes\", \"no\", or a directory." echo " If it is a directory, then \`DIR/include' will be added to" echo " the -I list, and \`DIR/lib' will be added to the -L list." exit 1 ;; esac +if test "$with_xinput" = yes; then -VIDMODE_LIBS="" - -if test "$with_xf86vmode" = yes; then - - # first check for xf86vmode.h + # first check for Xinput2.h ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -9542,18 +8752,18 @@ if test "$with_xf86vmode" = yes; then fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include <X11/Xlib.h> + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput2.h" "ac_cv_header_X11_extensions_XInput2_h" "#include <X11/Xlib.h> " -if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then : - have_xf86vmode=yes +if test "x$ac_cv_header_X11_extensions_XInput2_h" = xyes; then : + have_xinput=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" - # if that succeeded, then check for the -lXxf86vm - if test "$have_xf86vmode" = yes; then - have_xf86vmode=no + # if that succeeded, then check for libXi + if test "$have_xinput" = yes; then + have_xinput=no + xinput_halfassed=yes ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -9573,13 +8783,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5 -$as_echo_n "checking for XF86VidModeGetViewPort in -lXxf86vm... " >&6; } -if ${ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XISelectEvents in -lXi" >&5 +$as_echo_n "checking for XISelectEvents in -lXi... " >&6; } +if ${ac_cv_lib_Xi_XISelectEvents+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXxf86vm -lXext -lX11 $LIBS" +LIBS="-lXi -lXext -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9589,30 +8799,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XF86VidModeGetViewPort (); +char XISelectEvents (); int main () { -return XF86VidModeGetViewPort (); +return XISelectEvents (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=yes + ac_cv_lib_Xi_XISelectEvents=yes else - ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort=no + ac_cv_lib_Xi_XISelectEvents=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&5 -$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" >&6; } -if test "x$ac_cv_lib_Xxf86vm_XF86VidModeGetViewPort" = xyes; then : - have_xf86vmode=yes; - VIDMODE_LIBS="-lXxf86vm"; - SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XISelectEvents" >&5 +$as_echo "$ac_cv_lib_Xi_XISelectEvents" >&6; } +if test "x$ac_cv_lib_Xi_XISelectEvents" = xyes; then : + have_xinput=yes; xinput_halfassed=no; + SAVER_LIBS="$SAVER_LIBS -lXi" else true fi @@ -9624,17 +8833,16 @@ fi fi # if that succeeded, then we've really got it. - if test "$have_xf86vmode" = yes; then - $as_echo "#define HAVE_XF86VMODE 1" >>confdefs.h + if test "$have_xinput" = yes; then + $as_echo "#define HAVE_XINPUT 1" >>confdefs.h fi -elif test "$with_xf86vmode" != no; then - echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode" +elif test "$with_xinput" != no; then + echo "error: must be yes or no: --with-xinput-ext=$with_xinput" exit 1 fi - ############################################################################### # # Check for the XF86VMODE server extension (for gamma fading.) @@ -9652,8 +8860,6 @@ else with_xf86gamma=yes fi - - case "$with_xf86gamma" in yes) ;; no) ;; @@ -9697,7 +8903,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_xf86gamma" = yes; then # first check for xf86vmode.h, if we haven't already @@ -9717,7 +8922,6 @@ if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then : have_xf86gamma=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" fi @@ -9882,37 +9086,30 @@ elif test "$with_xf86gamma" != no; then exit 1 fi - ############################################################################### # -# Check for the RANDR (Resize and Rotate) server extension. -# -# We need this to detect when the resolution of the desktop -# has changed out from under us (this is a newer, different -# mechanism than the XF86VMODE virtual viewports.) +# Check for the XIDLE server extension. # ############################################################################### -have_randr=no -with_randr_req=unspecified +have_xidle=no +with_xidle_req=unspecified -# Check whether --with-randr-ext was given. -if test "${with_randr_ext+set}" = set; then : - withval=$with_randr_ext; with_randr="$withval"; with_randr_req="$withval" +# Check whether --with-xidle-ext was given. +if test "${with_xidle_ext+set}" = set; then : + withval=$with_xidle_ext; with_xidle="$withval"; with_xidle_req="$withval" else - with_randr=yes + with_xidle=yes fi - - - case "$with_randr" in + case "$with_xidle" in yes) ;; no) ;; /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR headers" >&5 -$as_echo_n "checking for RANDR headers... " >&6; } - d=$with_randr/include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XIDLE headers" >&5 +$as_echo_n "checking for XIDLE headers... " >&6; } + d=$with_xidle/include if test -d $d; then X_CFLAGS="-I$d $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9922,9 +9119,9 @@ $as_echo "$d" >&6; } $as_echo "not found ($d: no such directory)" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RANDR libs" >&5 -$as_echo_n "checking for RANDR libs... " >&6; } - d=$with_randr/lib + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XIDLE libs" >&5 +$as_echo_n "checking for XIDLE libs... " >&6; } + d=$with_xidle/lib if test -d $d; then X_LIBS="-L$d $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -9935,23 +9132,56 @@ $as_echo "not found ($d: no such directory)" >&6; } fi # replace the directory string with "yes". - with_randr_req="yes" - with_randr=$with_randr_req + with_xidle_req="yes" + with_xidle=$with_xidle_req ;; *) echo "" - echo "error: argument to --with-randr-ext must be \"yes\", \"no\", or a directory." + echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory." echo " If it is a directory, then \`DIR/include' will be added to" echo " the -I list, and \`DIR/lib' will be added to the -L list." exit 1 ;; esac +if test "$with_xidle" = yes; then -if test "$with_randr" = yes; then + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xidle.h" "ac_cv_header_X11_extensions_xidle_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_xidle_h" = xyes; then : + have_xidle=yes + $as_echo "#define HAVE_XIDLE_EXTENSION 1" >>confdefs.h - # first check for Xrandr.h +fi + + CPPFLAGS="$ac_save_CPPFLAGS" +elif test "$with_xidle" != no; then + echo "error: must be yes or no: --with-xidle-ext=$with_xidle" + exit 1 +fi + +############################################################################### +# +# Check for the MIT-SCREEN-SAVER server extension. +# +############################################################################### + +have_mit=no +with_mit=no +with_mit_req=unspecified +#AC_ARG_WITH(mit-ext, +#[ --with-mit-ext Include support for the MIT-SCREEN-SAVER extension.], +# [with_mit="$withval"; with_mit_req="$withval"],[with_mit=no]) +#HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER) + +if test "$with_mit" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -9959,20 +9189,18 @@ if test "$with_randr" = yes; then fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include <X11/Xlib.h> + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include <X11/Xlib.h> " -if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then : - have_randr=yes +if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then : + have_mit=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" - # if that succeeded, then check for the XRR code in the libraries - if test "$have_randr" = yes; then - - # RANDR probably needs -lXrender - xrender_libs= + # Now check to see if it's really in the library; XF86Free-3.3 ships + # scrnsaver.h, but doesn't include the code in libXext.a, the idiots! + # + if test "$have_mit" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -9992,13 +9220,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderSetSubpixelOrder in -lXrender" >&5 -$as_echo_n "checking for XRenderSetSubpixelOrder in -lXrender... " >&6; } -if ${ac_cv_lib_Xrender_XRenderSetSubpixelOrder+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverRegister in -lXext" >&5 +$as_echo_n "checking for XScreenSaverRegister in -lXext... " >&6; } +if ${ac_cv_lib_Xext_XScreenSaverRegister+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender -lXext -lX11 $LIBS" +LIBS="-lXext -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10008,39 +9236,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XRenderSetSubpixelOrder (); +char XScreenSaverRegister (); int main () { -return XRenderSetSubpixelOrder (); +return XScreenSaverRegister (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xrender_XRenderSetSubpixelOrder=yes + ac_cv_lib_Xext_XScreenSaverRegister=yes else - ac_cv_lib_Xrender_XRenderSetSubpixelOrder=no + ac_cv_lib_Xext_XScreenSaverRegister=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&5 -$as_echo "$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" = xyes; then : - xrender_libs="-lXrender" -else +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XScreenSaverRegister" >&5 +$as_echo "$ac_cv_lib_Xext_XScreenSaverRegister" >&6; } +if test "x$ac_cv_lib_Xext_XScreenSaverRegister" = xyes; then : true +else + have_mit=no fi CPPFLAGS="$ac_save_CPPFLAGS" LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - - # first look for RANDR in -lXext - have_randr=no + if test "$have_mit" = no; then + # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead + # of in Xext. Thank you master, may I have another. ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -10060,13 +9288,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXext" >&5 -$as_echo_n "checking for XRRGetScreenInfo in -lXext... " >&6; } -if ${ac_cv_lib_Xext_XRRGetScreenInfo+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverRegister in -lXExExt" >&5 +$as_echo_n "checking for XScreenSaverRegister in -lXExExt... " >&6; } +if ${ac_cv_lib_XExExt_XScreenSaverRegister+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $xrender_libs -lXext -lX11 $LIBS" +LIBS="-lXExExt -lX11 -lXext -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10076,28 +9304,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XRRGetScreenInfo (); +char XScreenSaverRegister (); int main () { -return XRRGetScreenInfo (); +return XScreenSaverRegister (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xext_XRRGetScreenInfo=yes + ac_cv_lib_XExExt_XScreenSaverRegister=yes else - ac_cv_lib_Xext_XRRGetScreenInfo=no + ac_cv_lib_XExExt_XScreenSaverRegister=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XRRGetScreenInfo" >&5 -$as_echo "$ac_cv_lib_Xext_XRRGetScreenInfo" >&6; } -if test "x$ac_cv_lib_Xext_XRRGetScreenInfo" = xyes; then : - have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XExExt_XScreenSaverRegister" >&5 +$as_echo "$ac_cv_lib_XExExt_XScreenSaverRegister" >&6; } +if test "x$ac_cv_lib_XExExt_XScreenSaverRegister" = xyes; then : + have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt" else true fi @@ -10106,9 +9334,13 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" + fi - # if that failed, look in -lXrandr - if test "$have_randr" = no; then + if test "$have_mit" = no; then + # Double fuck! Looks like some versions of XFree86 (whichever version + # it is that comes with RedHat Linux 2.0 -- I can't find a version + # number) put this garbage in Xss instead of Xext. Thank you master, + # may I have another. ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -10128,13 +9360,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenInfo in -lXrandr" >&5 -$as_echo_n "checking for XRRGetScreenInfo in -lXrandr... " >&6; } -if ${ac_cv_lib_Xrandr_XRRGetScreenInfo+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverRegister in -lXss" >&5 +$as_echo_n "checking for XScreenSaverRegister in -lXss... " >&6; } +if ${ac_cv_lib_Xss_XScreenSaverRegister+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrandr $xrender_libs -lXext -lX11 $LIBS" +LIBS="-lXss -lX11 -lXext -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10144,28 +9376,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XRRGetScreenInfo (); +char XScreenSaverRegister (); int main () { -return XRRGetScreenInfo (); +return XScreenSaverRegister (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xrandr_XRRGetScreenInfo=yes + ac_cv_lib_Xss_XScreenSaverRegister=yes else - ac_cv_lib_Xrandr_XRRGetScreenInfo=no + ac_cv_lib_Xss_XScreenSaverRegister=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5 -$as_echo "$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; } -if test "x$ac_cv_lib_Xrandr_XRRGetScreenInfo" = xyes; then : - have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverRegister" >&5 +$as_echo "$ac_cv_lib_Xss_XScreenSaverRegister" >&6; } +if test "x$ac_cv_lib_Xss_XScreenSaverRegister" = xyes; then : + have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss" else true fi @@ -10175,21 +9407,80 @@ fi # LIBS="$ac_save_LIBS" fi + + if test "$have_mit" = yes; then +# AC_DEFINE(HAVE_MIT_SAVER_EXTENSION) + echo "Using the MIT-SCREEN-SAVER extension will crash your server. Don't." + exit 1 + fi + fi - # if that succeeded, then we've really got it. - if test "$have_randr" = yes; then - $as_echo "#define HAVE_RANDR 1" >>confdefs.h +elif test "$with_mit" != no; then + echo "error: must be yes or no: --with-mit-ext=$with_mit" + exit 1 +fi +############################################################################### +# +# Check for the SGI SCREEN_SAVER server extension. +# +############################################################################### - # Now check for version 1.2 in the same libs. - # Try to compile, since on MacOS 10.5.7, headers are older than libs! - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRGetScreenResources" >&5 -$as_echo_n "checking for XRRGetScreenResources... " >&6; } -if ${ac_cv_randr_12+:} false; then : - $as_echo_n "(cached) " >&6 +have_sgi=no +with_sgi_req=unspecified + +# Check whether --with-sgi-ext was given. +if test "${with_sgi_ext+set}" = set; then : + withval=$with_sgi_ext; with_sgi="$withval"; with_sgi_req="$withval" else - ac_cv_randr_12=no + with_sgi=$ac_irix +fi + + case "$with_sgi" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SGI SCREEN_SAVER headers" >&5 +$as_echo_n "checking for SGI SCREEN_SAVER headers... " >&6; } + d=$with_sgi/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SGI SCREEN_SAVER libs" >&5 +$as_echo_n "checking for SGI SCREEN_SAVER libs... " >&6; } + d=$with_sgi/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_sgi_req="yes" + with_sgi=$with_sgi_req + ;; + + *) + echo "" + echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_sgi" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -10197,54 +9488,382 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XScreenSaver.h" "ac_cv_header_X11_extensions_XScreenSaver_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_XScreenSaver_h" = xyes; then : + have_sgi=yes + $as_echo "#define HAVE_SGI_SAVER_EXTENSION 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + +elif test "$with_sgi" != no; then + echo "error: must be yes or no: --with-sgi-ext=$with_sgi" + exit 1 +fi + +############################################################################### +# +# Check for the SGI-VIDEO-CONTROL server extension. +# +############################################################################### + +have_sgivc=no +with_sgivc_req=unspecified + +# Check whether --with-sgivc-ext was given. +if test "${with_sgivc_ext+set}" = set; then : + withval=$with_sgivc_ext; with_sgivc="$withval"; with_sgivc_req="$withval" +else + with_sgivc=$ac_irix +fi + + case "$with_sgivc" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SGI-VIDEO-CONTROL headers" >&5 +$as_echo_n "checking for SGI-VIDEO-CONTROL headers... " >&6; } + d=$with_sgivc/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SGI-VIDEO-CONTROL libs" >&5 +$as_echo_n "checking for SGI-VIDEO-CONTROL libs... " >&6; } + d=$with_sgivc/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_sgivc_req="yes" + with_sgivc=$with_sgivc_req + ;; + + *) + echo "" + echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_sgivc" = yes; then + + # first check for XSGIvc.h + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XSGIvc.h" "ac_cv_header_X11_extensions_XSGIvc_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_XSGIvc_h" = xyes; then : + have_sgivc=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + + # if that succeeded, then check for the -lXsgivc + if test "$have_sgivc" = yes; then + have_sgivc=no + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5 +$as_echo_n "checking for XSGIvcQueryGammaMap in -lXsgivc... " >&6; } +if ${ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXsgivc -lXext -lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdlib.h> - #include <X11/Xlib.h> - #include <X11/extensions/Xrandr.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XSGIvcQueryGammaMap (); int main () { -XRRScreenResources *res = - XRRGetScreenResources (0, 0); +return XSGIvcQueryGammaMap (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_randr_12=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=yes else - ac_cv_randr_12=no + ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$ac_save_CPPFLAGS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&5 +$as_echo "$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&6; } +if test "x$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" = xyes; then : + have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc" +else + true fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_randr_12" >&5 -$as_echo "$ac_cv_randr_12" >&6; } - if test "$ac_cv_randr_12" = yes ; then - $as_echo "#define HAVE_RANDR_12 1" >>confdefs.h - fi -# AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)], -# [true], $SAVER_LIBS) + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + fi + # if that succeeded, then we've really got it. + if test "$have_sgivc" = yes; then + $as_echo "#define HAVE_SGI_VC_EXTENSION 1" >>confdefs.h -elif test "$with_randr" != no; then - echo "error: must be yes or no: --with-randr-ext=$with_randr" + fi + +elif test "$with_sgivc" != no; then + echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" exit 1 fi +############################################################################### +# +# Check for the SGI XReadDisplay server extension. +# +############################################################################### + +have_readdisplay=no +with_readdisplay_req=unspecified + +# Check whether --with-readdisplay was given. +if test "${with_readdisplay+set}" = set; then : + withval=$with_readdisplay; with_readdisplay="$withval"; with_readdisplay_req="$withval" +else + with_readdisplay=$ac_irix +fi + + case "$with_readdisplay" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay headers" >&5 +$as_echo_n "checking for XReadDisplay headers... " >&6; } + d=$with_readdisplay/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay libs" >&5 +$as_echo_n "checking for XReadDisplay libs... " >&6; } + d=$with_readdisplay/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_readdisplay_req="yes" + with_readdisplay=$with_readdisplay_req + ;; + + *) + echo "" + echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_readdisplay" = yes; then + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/readdisplay.h" "ac_cv_header_X11_extensions_readdisplay_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_readdisplay_h" = xyes; then : + $as_echo "#define HAVE_READ_DISPLAY_EXTENSION 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" +elif test "$with_readdisplay" != no; then + echo "error: must be yes or no: --with-readdisplay=$with_readdisplay" + exit 1 +fi ############################################################################### # -# Check for XF86MiscSetGrabKeysState (but only bother if we are already -# using other XF86 stuff.) +# Check for the XSHM server extension. # ############################################################################### -have_xf86miscsetgrabkeysstate=no -if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then +have_xshm=no +with_xshm_req=unspecified + +# Check whether --with-xshm-ext was given. +if test "${with_xshm_ext+set}" = set; then : + withval=$with_xshm_ext; with_xshm="$withval"; with_xshm_req="$withval" +else + with_xshm=yes +fi + + case "$with_xshm" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM headers" >&5 +$as_echo_n "checking for XSHM headers... " >&6; } + d=$with_xshm/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM libs" >&5 +$as_echo_n "checking for XSHM libs... " >&6; } + d=$with_xshm/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_xshm_req="yes" + with_xshm=$with_xshm_req + ;; + + *) + echo "" + echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_xshm" = yes; then + + # first check for Xshm.h. + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes; then : + have_xshm=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + + # if that succeeded, then check for sys/ipc.h. + if test "$have_xshm" = yes; then + have_xshm=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ipc_h" = xyes; then : + have_xshm=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + fi + + # if that succeeded, then check for sys/shm.h. + if test "$have_xshm" = yes; then + have_xshm=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_shm_h" = xyes; then : + have_xshm=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + fi + + # AIX is pathological, as usual: apparently it's normal for the Xshm headers + # to exist, but the library code to not exist. And even better, the library + # code is in its own library: libXextSam.a. So, if we're on AIX, and that + # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and + # that's not quite right, but close enough.) + # + case "$host" in + *-aix*) + if `uname -v` -eq 3 ; then + have_xshm=no ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -10264,13 +9883,13 @@ if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86MiscSetGrabKeysState in -lXxf86misc" >&5 -$as_echo_n "checking for XF86MiscSetGrabKeysState in -lXxf86misc... " >&6; } -if ${ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXextSam" >&5 +$as_echo_n "checking for XShmQueryExtension in -lXextSam... " >&6; } +if ${ac_cv_lib_XextSam_XShmQueryExtension+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXxf86misc -lXext -lX11 $LIBS" +LIBS="-lXextSam -lX11 -lXext -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10280,28 +9899,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char XF86MiscSetGrabKeysState (); +char XShmQueryExtension (); int main () { -return XF86MiscSetGrabKeysState (); +return XShmQueryExtension (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState=yes + ac_cv_lib_XextSam_XShmQueryExtension=yes else - ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState=no + ac_cv_lib_XextSam_XShmQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" >&5 -$as_echo "$ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" >&6; } -if test "x$ac_cv_lib_Xxf86misc_XF86MiscSetGrabKeysState" = xyes; then : - have_xf86miscsetgrabkeysstate=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XextSam_XShmQueryExtension" >&5 +$as_echo "$ac_cv_lib_XextSam_XShmQueryExtension" >&6; } +if test "x$ac_cv_lib_XextSam_XShmQueryExtension" = xyes; then : + have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam" else true fi @@ -10310,13 +9929,217 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - if test "$have_xf86miscsetgrabkeysstate" = yes ; then - SAVER_LIBS="$SAVER_LIBS -lXxf86misc" - $as_echo "#define HAVE_XF86MISCSETGRABKEYSSTATE 1" >>confdefs.h + fi + ;; + esac + + # if that succeeded, then we've really got it. + if test "$have_xshm" = yes; then + $as_echo "#define HAVE_XSHM_EXTENSION 1" >>confdefs.h + + fi + +elif test "$with_xshm" != no; then + echo "error: must be yes or no: --with-xshm-ext=$with_xshm" + exit 1 +fi + +############################################################################### +# +# Check for the DOUBLE-BUFFER server extension. +# +############################################################################### + +have_xdbe=no +with_xdbe_req=unspecified + +# Check whether --with-xdbe-ext was given. +if test "${with_xdbe_ext+set}" = set; then : + withval=$with_xdbe_ext; with_xdbe="$withval"; with_xdbe_req="$withval" +else + with_xdbe=yes +fi + + case "$with_xdbe" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER headers" >&5 +$as_echo_n "checking for DOUBLE-BUFFER headers... " >&6; } + d=$with_xdbe/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER libs" >&5 +$as_echo_n "checking for DOUBLE-BUFFER libs... " >&6; } + d=$with_xdbe/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_xdbe_req="yes" + with_xdbe=$with_xdbe_req + ;; + + *) + echo "" + echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_xdbe" = yes; then + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xdbe.h" "ac_cv_header_X11_extensions_Xdbe_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_extensions_Xdbe_h" = xyes; then : + have_xdbe=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + if test "$have_xdbe" = yes; then + $as_echo "#define HAVE_DOUBLE_BUFFER_EXTENSION 1" >>confdefs.h + + fi + +elif test "$with_xdbe" != no; then + echo "error: must be yes or no: --with-xdbe-ext=$with_xshm" + exit 1 +fi + +############################################################################### +# +# Check for the COMPOSITE server extension. +# +############################################################################### + +#have_xcomposite=no +#with_xcomposite_req=unspecified +#AC_ARG_WITH(xcomposite-ext, +#[ --with-xcomposite-ext Include support for the XCOMPOSITE extension.], +# [with_xcomposite="$withval"; with_xcomposite_req="$withval"], +# [with_xcomposite=yes]) +# +#HANDLE_X_PATH_ARG(with_xcomposite, --with-xcomposite-ext, XCOMPOSITE) +# +#if test "$with_xcomposite" = yes; then +# +# AC_CHECK_X_HEADER(X11/extensions/Xcomposite.h, [have_xcomposite=yes],, +# [#include <X11/Xlib.h>]) +# if test "$have_xcomposite" = yes; then +# AC_DEFINE(HAVE_XCOMPOSITE_EXTENSION) +# SAVER_LIBS="-lXcomposite $SAVER_LIBS" +# fi +# +#elif test "$with_xcomposite" != no; then +# echo "error: must be yes or no: --with-xcomposite-ext=$with_xshm" +# exit 1 +#fi + +############################################################################### +# +# Check for the XKB server extension. +# +############################################################################### + +have_xkb=no +with_xkb_req=unspecified + +# Check whether --with-xkb-ext was given. +if test "${with_xkb_ext+set}" = set; then : + withval=$with_xkb_ext; with_xkb="$withval"; with_xkb_req="$withval" +else + with_xkb=yes +fi + + case "$with_xkb" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XKB headers" >&5 +$as_echo_n "checking for XKB headers... " >&6; } + d=$with_xkb/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XKB libs" >&5 +$as_echo_n "checking for XKB libs... " >&6; } + d=$with_xkb/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_xkb_req="yes" + with_xkb=$with_xkb_req + ;; + + *) + echo "" + echo "error: argument to --with-xkb-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_xkb" = yes; then + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include <X11/Xlib.h> +" +if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then : + have_xkb=yes fi + CPPFLAGS="$ac_save_CPPFLAGS" + if test "$have_xkb" = yes; then + $as_echo "#define HAVE_XKB 1" >>confdefs.h + + fi + +elif test "$with_xkb" != no; then + echo "error: must be yes or no: --with-xkb-ext=$with_xshm" + exit 1 +fi ############################################################################### # @@ -10349,11 +10172,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -rm -f conftest* +rm -rf conftest* CPPFLAGS="$ac_save_CPPFLAGS" - ############################################################################### # # Check for /proc/interrupts. @@ -10367,10 +10189,9 @@ with_proc_interrupts_req=unspecified if test "${with_proc_interrupts+set}" = set; then : withval=$with_proc_interrupts; with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval" else - with_proc_interrupts=yes + with_proc_interrupts=no fi - if test "$with_proc_interrupts" = yes; then # Note that we may be building in an environment (e.g. Debian buildd chroot) @@ -10406,13 +10227,13 @@ elif test "$with_proc_interrupts" != no; then exit 1 fi - ############################################################################### # # Check for /proc/*/oom_score_adj. # ############################################################################### +setuid_auth=no have_proc_oom=no with_proc_oom_req=unspecified @@ -10423,7 +10244,6 @@ else with_proc_oom=yes fi - if test "$with_proc_oom_req" = yes; then # Note that we may be building in an environment (e.g. Debian buildd chroot) @@ -10432,7 +10252,6 @@ if test "$with_proc_oom_req" = yes; then have_proc_oom=yes $as_echo "#define HAVE_PROC_OOM 1" >>confdefs.h - elif test "$with_proc_oom_req" = unspecified; then have_proc_oom=no @@ -10454,6 +10273,10 @@ $as_echo "$ac_cv_have_proc_oom" >&6; } if test "$have_proc_oom" = yes; then $as_echo "#define HAVE_PROC_OOM 1" >>confdefs.h + # Only root can write to /proc/$$/oom_score_adj, even though it's us. + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling setuid to opt out of OOM-killer." >&5 +$as_echo "enabling setuid to opt out of OOM-killer." >&6; } + setuid_auth=yes fi elif test "$with_proc_oom" != no; then @@ -10461,21 +10284,242 @@ elif test "$with_proc_oom" != no; then exit 1 fi +############################################################################### +# +# Check for -lsystemd +# +############################################################################### + +have_systemd=no +with_systemd_req=unspecified +systemd_halfassed=no +systemd_too_old=no + +# Check whether --with-systemd was given. +if test "${with_systemd+set}" = set; then : + withval=$with_systemd; with_systemd="$withval"; with_systemd_req="$withval" +else + with_systemd=yes +fi + + case "$with_systemd" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd headers" >&5 +$as_echo_n "checking for systemd headers... " >&6; } + d=$with_systemd/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd libs" >&5 +$as_echo_n "checking for systemd libs... " >&6; } + d=$with_systemd/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_systemd_req="yes" + with_systemd=$with_systemd_req + ;; + + *) + echo "" + echo "error: argument to --with-systemd must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_systemd" != yes -a "$with_systemd" != no ; then + echo "error: must be yes or no: --with-systemd=$with_systemd" + exit 1 +fi + +if test "$with_systemd" = yes; then + + pkgs='' + ok="yes" + pkg_check_version libsystemd 221 + have_systemd="$ok" + + if test "$have_systemd" = no; then + if $pkg_config --exists libsystemd ; then + systemd_too_old=yes + fi + fi + + if test "$have_systemd" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd includes" >&5 +$as_echo_n "checking for libsystemd includes... " >&6; } +if ${ac_cv_systemd_config_cflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_systemd_config_cflags=`$pkg_config --cflags $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_cflags" >&5 +$as_echo "$ac_cv_systemd_config_cflags" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd libs" >&5 +$as_echo_n "checking for libsystemd libs... " >&6; } +if ${ac_cv_systemd_config_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_systemd_config_libs=`$pkg_config --libs $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_libs" >&5 +$as_echo "$ac_cv_systemd_config_libs" >&6; } + fi + + ac_systemd_config_cflags=$ac_cv_systemd_config_cflags + ac_systemd_config_libs=$ac_cv_systemd_config_libs + + if test "$have_systemd" = yes; then + # + # we appear to have libsystemd; check for headers/libs to be sure. + # + ac_save_systemd_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_systemd_config_cflags" + + have_systemd=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-bus.h" "ac_cv_header_systemd_sd_bus_h" "$ac_includes_default" +if test "x$ac_cv_header_systemd_sd_bus_h" = xyes; then : + have_systemd=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + + CPPFLAGS="$ac_save_systemd_CPPFLAGS" + fi + + if test "$have_systemd" = yes; then + # we have the headers, now check for the libraries + have_systemd=no + systemd_halfassed=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability..." >&5 +$as_echo "checking for libsystemd usability..." >&6; } + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_bus_open_system in -lc" >&5 +$as_echo_n "checking for sd_bus_open_system in -lc... " >&6; } +if ${ac_cv_lib_c_sd_bus_open_system+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $ac_systemd_config_libs -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sd_bus_open_system (); +int +main () +{ +return sd_bus_open_system (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_sd_bus_open_system=yes +else + ac_cv_lib_c_sd_bus_open_system=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sd_bus_open_system" >&5 +$as_echo "$ac_cv_lib_c_sd_bus_open_system" >&6; } +if test "x$ac_cv_lib_c_sd_bus_open_system" = xyes; then : + have_systemd=yes; systemd_halfassed=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + + if test "$have_systemd" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability... no" >&5 +$as_echo "checking for libsystemd usability... no" >&6; } + fi +fi + +if test "$have_systemd" = yes; then + INCLUDES="$INCLUDES $ac_systemd_config_cflags" + EXES_SYSTEMD='$(EXES_SYSTEMD)' + SYSTEMD_LIBS="$ac_systemd_config_libs" + $as_echo "#define HAVE_LIBSYSTEMD 1" >>confdefs.h + +else + EXES_SYSTEMD='' + SYSTEMD_LIBS='' +fi ############################################################################### # # The --enable-locking option # +# Note: "configure --help" list all "--enable" options before any +# "--with" options, so we document the --enable options inline with +# the --with options where it looks better, instead of in AC_ARG_ENABLE +# where it would make sense, sigh... +# ############################################################################### # Check whether --enable-locking was given. if test "${enable_locking+set}" = set; then : - enableval=$enable_locking; enable_locking="$enableval" + enableval=$enable_locking; # This is documented elsewhere because of --enable/--with option sorting. + enable_locking="$enableval" else if test "$ac_macosx" = yes; then - # We can't lock on MacOS X, so default to not compiling in support for it. + # We can't lock on macOS, so default to not compiling in support for it. # But allow --enable-locking to override that, so I can debug Linux locking - # under MacOS X11. + # under macOS X11. enable_locking=no else enable_locking=yes @@ -10492,17 +10536,18 @@ else exit 1 fi - -############################################################################### +############################################################################## # # Whether to allow root password to unblank. # ############################################################################### + # Check whether --enable-root-passwd was given. if test "${enable_root_passwd+set}" = set; then : - enableval=$enable_root_passwd; enable_root_passwd="$enableval" + enableval=$enable_root_passwd; # This is documented elsewhere because of --enable/--with option sorting. + enable_root_passwd="$enableval" else - enable_root_passwd=yes + enable_root_passwd=no fi if test "$enable_root_passwd" = yes; then @@ -10522,8 +10567,12 @@ fi case "$host" in *-solaris*) - # Solaris systems tend to come with PAM misconfigured. - # Don't build it by default, even if the headers exist. + # Solaris systems tend to have the PAM runtime misconfigured and unusable. + with_pam_default=no + ;; + *-freebsd* ) + # FreeBSD's PAM implementation requires the calling process to be setuid + # the whole time, which is unacceptable. with_pam_default=no ;; *) @@ -10532,10 +10581,11 @@ case "$host" in ;; esac +#### H1 + have_pam=no with_pam_req=unspecified - # Check whether --with-pam was given. if test "${with_pam+set}" = set; then : withval=$with_pam; with_pam="$withval"; with_pam_req="$withval" @@ -10543,8 +10593,6 @@ else with_pam=$with_pam_default fi - - # Check whether --with-pam_service_name was given. if test "${with_pam_service_name+set}" = set; then : withval=$with_pam_service_name; pam_service_name="$withval" @@ -10552,10 +10600,10 @@ else pam_service_name="xscreensaver" fi - # Check whether --enable-pam-check-account-type was given. if test "${enable_pam_check_account_type+set}" = set; then : - enableval=$enable_pam_check_account_type; enable_pam_check_account_type="$enableval" + enableval=$enable_pam_check_account_type; # This is documented elsewhere because of --enable/--with option sorting. + enable_pam_check_account_type="$enableval" else enable_pam_check_account_type=no fi @@ -10569,7 +10617,6 @@ elif test "$enable_pam_check_account_type" != no ; then exit 1 fi - case "$with_pam" in yes) ;; no) ;; @@ -10613,7 +10660,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$enable_locking" = yes -a "$with_pam" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAM" >&5 $as_echo_n "checking for PAM... " >&6; } @@ -10656,7 +10702,6 @@ $as_echo "$ac_cv_pam" >&6; } #define PAM_SERVICE_NAME "$pam_service_name" _ACEOF - PASSWD_LIBS="${PASSWD_LIBS} -lpam" # libpam typically requires dlopen and dlsym. On FreeBSD, @@ -10701,7 +10746,6 @@ if test "x$ac_cv_lib_dl_dlopen" = xyes; then : PASSWD_LIBS="${PASSWD_LIBS} -ldl" fi - # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt. have_timedwait=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigtimedwait in -lc" >&5 @@ -10901,7 +10945,6 @@ rm -f core conftest.err conftest.$ac_objext \ LDFLAGS=$ac_save_LDFLAGS fi - if test "$ac_pam_fail_delay" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -10915,7 +10958,6 @@ $as_echo "no" >&6; } fi fi - ############################################################################### # # Check for Kerberos. @@ -10926,7 +10968,6 @@ have_kerberos=no have_kerberos5=no with_kerberos_req=unspecified - # Check whether --with-kerberos was given. if test "${with_kerberos+set}" = set; then : withval=$with_kerberos; with_kerberos="$withval"; with_kerberos_req="$withval" @@ -10934,8 +10975,6 @@ else with_kerberos=yes fi - - case "$with_kerberos" in yes) ;; no) ;; @@ -10979,7 +11018,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$enable_locking" = yes -a "$with_kerberos" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos 4" >&5 $as_echo_n "checking for Kerberos 4... " >&6; } @@ -11151,7 +11189,7 @@ $as_echo "$as_me: WARNING: Cannot find compat lib (libkrb4) needed to use Kerber PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err" - # jwz: MacOS X uses -lkrb5, but not -lcrypt + # jwz: macOS uses -lkrb5, but not -lcrypt ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -11215,7 +11253,6 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - elif test "$have_kerberos" = yes ; then # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err" @@ -11275,19 +11312,15 @@ fi fi fi - ############################################################################### # # Check for the nine billion variants of shadow passwords... # ############################################################################### -need_setuid=no - have_shadow=no with_shadow_req=unspecified - # Check whether --with-shadow was given. if test "${with_shadow+set}" = set; then : withval=$with_shadow; with_shadow="$withval"; with_shadow_req="$withval" @@ -11295,8 +11328,6 @@ else with_shadow=yes fi - - case "$with_shadow" in yes) ;; no) ;; @@ -11340,13 +11371,11 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$enable_locking" = no ; then with_shadow_req=no with_shadow=no fi - ############################################################################### # # Check for Sun "adjunct" passwords. @@ -11396,11 +11425,10 @@ $as_echo "$ac_cv_sun_adjunct" >&6; } if test "$ac_cv_sun_adjunct" = yes; then have_shadow_adjunct=yes have_shadow=yes - need_setuid=yes + setuid_auth=yes fi fi - ############################################################################### # # Check for DEC and SCO so-called "enhanced" security. @@ -11454,7 +11482,7 @@ $as_echo "$ac_cv_enhanced_passwd" >&6; } if test $ac_cv_enhanced_passwd = yes; then have_shadow_enhanced=yes have_shadow=yes - need_setuid=yes + setuid_auth=yes # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx) # (I'm told it needs -lcurses too, but I don't understand why.) @@ -11593,7 +11621,7 @@ $as_echo "$ac_cv_hpux_passwd" >&6; } if test "$ac_cv_hpux_passwd" = yes; then have_shadow_hpux=yes have_shadow=yes - need_setuid=yes + setuid_auth=yes # on HPUX, bigcrypt is in -lsec { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bigcrypt in -lsec" >&5 @@ -11639,7 +11667,6 @@ fi fi fi - ############################################################################### # # Check for FreeBSD-style shadow passwords. @@ -11667,10 +11694,64 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_master_passwd" >&5 $as_echo "$ac_cv_master_passwd" >&6; } if test "$ac_cv_master_passwd" = yes; then - need_setuid=yes + setuid_auth=yes fi fi +############################################################################### +# +# Check for OpenBSD-style shadow passwords. +# It's getpwnam_shadow instead of getpwnam, and it only works as root. +# +############################################################################### + +if test "$with_shadow" = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenBSD-style shadow passwords" >&5 +$as_echo_n "checking for OpenBSD-style shadow passwords... " >&6; } +if ${ac_cv_pwnam_shadow+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #include <unistd.h> + #include <sys/types.h> + #include <pwd.h> +int +main () +{ +struct spwd *p = getspnam_shadow("nobody"); + const char *pw = p->pw_passwd; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_pwnam_shadow=yes +else + ac_cv_pwnam_shadow=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$ac_save_CPPFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pwnam_shadow" >&5 +$as_echo "$ac_cv_pwnam_shadow" >&6; } + if test "$ac_cv_pwnam_shadow" = yes; then + have_pwnam_shadow=yes + + # If we also have PAM, assume that we don't need to be setuid. + if test $have_pam != yes; then + setuid_auth=yes + fi + fi +fi ############################################################################### # @@ -11719,7 +11800,11 @@ fi $as_echo "$ac_cv_shadow" >&6; } if test "$ac_cv_shadow" = yes; then have_shadow=yes - need_setuid=yes + + # If we also have PAM, assume that we don't need to be setuid. + if test $have_pam != yes; then + setuid_auth=yes + fi # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc. have_getspnam=no @@ -11808,7 +11893,6 @@ fi fi fi - ############################################################################### # # Check for other libraries needed for non-shadow passwords. @@ -11903,20 +11987,57 @@ fi fi fi +############################################################################### +# +# Strongly suspect that this hasn't been used in years. Also, the same +# goal is achieved by xscreensaver-auth in XScreenSaver 6. -- jwz, 2021 +# +# Check for external password helper +# On SuSE in 1993, instead of having xscreensaver be a setuid program, +# they fork an external program that takes the password on stdin, and +# returns true if that password is a valid one. Then only that smaller +# program needs to be setuid. +# +# (Note that this external program is not a GUI: the GUI is still +# all in xscreensaver itself; the external program just does auth.) +# +############################################################################### -# Most of the above shadow mechanisms will have set need_setuid to yes, +#have_passwd_helper=no +#with_passwd_helper_req=unspecified +# +#AC_ARG_WITH(passwd-helper, +#[ --with-passwd-helper Include support for external password verification.], +# [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no]) +## no HANDLE_X_PATH_ARG for this one +# +#if test "$enable_locking" = no ; then +# with_passwd_helper_req=no +# with_passwd_helper=no +#fi +# +#case "$with_passwd_helper" in +# ""|no) : ;; +# /*) +# AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper") +# have_passwd_helper=yes;; +# *) +# echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2 +# exit 1 +#esac + +# Most of the above shadow mechanisms will have set setuid_auth to yes, # if they were found. But, on some systems, we need setuid even when # using plain old vanilla passwords. # -if test "$enable_locking" = yes ; then +if test "$enable_locking" = yes -a "$have_pam" = no ; then case "$host" in - *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* ) - need_setuid=yes + *-hpux* | *-aix* | *-netbsd* | *-freebsd* ) + setuid_auth=yes ;; esac fi - if test "$have_shadow_adjunct" = yes ; then $as_echo "#define HAVE_ADJUNCT_PASSWD 1" >>confdefs.h @@ -11929,376 +12050,19 @@ elif test "$have_shadow_hpux" = yes ; then elif test "$have_shadow" = yes ; then $as_echo "#define HAVE_SHADOW_PASSWD 1" >>confdefs.h -fi - - -############################################################################### -# -# Check for external password helper -# On SuSE, instead of having xscreensaver be a setuid program, they -# fork an external program that takes the password on stdin, and -# returns true if that password is a valid one. Then only that -# smaller program needs to be setuid. -# -# (Note that this external program is not a GUI: the GUI is still -# all in xscreensaver itself; the external program just does auth.) -# -############################################################################### - -have_passwd_helper=no -with_passwd_helper_req=unspecified - - -# Check whether --with-passwd-helper was given. -if test "${with_passwd_helper+set}" = set; then : - withval=$with_passwd_helper; with_passwd_helper="$withval"; with_passwd_helper_req="$withval" -else - with_passwd_helper=no -fi - -# no HANDLE_X_PATH_ARG for this one - -if test "$enable_locking" = no ; then - with_passwd_helper_req=no - with_passwd_helper=no -fi - -case "$with_passwd_helper" in - ""|no) : ;; - /*) - cat >>confdefs.h <<_ACEOF -#define PASSWD_HELPER_PROGRAM "$with_passwd_helper" -_ACEOF - - have_passwd_helper=yes;; - *) - echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2 - exit 1 -esac - - -############################################################################### -# -# Check for a login manager for a "New Login" button on the lock dialog. -# Usually this will be "/usr/bin/gdmflexiserver". -# -############################################################################### - -with_login_manager_req=unspecified -default_login_manager_1='gdmflexiserver -ls' -default_login_manager_2='kdmctl reserve' -default_login_manager_3='lxdm -c USER_SWITCH' -default_login_manager_4='dm-tool switch-to-greeter' - - -# Check whether --with-login-manager was given. -if test "${with_login_manager+set}" = set; then : - withval=$with_login_manager; with_login_manager="$withval"; with_login_manager_req="$withval" -else - with_login_manager=yes -fi - -# no HANDLE_X_PATH_ARG for this one - -if test "$enable_locking" = no ; then - with_login_manager_req=no - with_login_manager=no -fi - -case "$with_login_manager_req" in - no) - with_login_manager="" - ;; - - yes|unspecified) - # Try various defaults, use the first one that exists. - - with_login_manager="" - - if test -z "$with_login_manager" ; then - set dummy $default_login_manager_1 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. -set dummy $login_manager_tmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_login_manager_tmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $login_manager_tmp in - [\\/]* | ?:[\\/]*) - ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -login_manager_tmp=$ac_cv_path_login_manager_tmp -if test -n "$login_manager_tmp"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 -$as_echo "$login_manager_tmp" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_1" - fi - fi - - if test -z "$with_login_manager" ; then - set dummy $default_login_manager_2 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. -set dummy $login_manager_tmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_login_manager_tmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $login_manager_tmp in - [\\/]* | ?:[\\/]*) - ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -login_manager_tmp=$ac_cv_path_login_manager_tmp -if test -n "$login_manager_tmp"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 -$as_echo "$login_manager_tmp" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_2" - fi - fi - - if test -z "$with_login_manager" ; then - set dummy $default_login_manager_3 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. -set dummy $login_manager_tmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_login_manager_tmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $login_manager_tmp in - [\\/]* | ?:[\\/]*) - ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -login_manager_tmp=$ac_cv_path_login_manager_tmp -if test -n "$login_manager_tmp"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 -$as_echo "$login_manager_tmp" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_3" - fi - fi - - if test -z "$with_login_manager" ; then - set dummy $default_login_manager_4 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. -set dummy $login_manager_tmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_login_manager_tmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $login_manager_tmp in - [\\/]* | ?:[\\/]*) - ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -login_manager_tmp=$ac_cv_path_login_manager_tmp -if test -n "$login_manager_tmp"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 -$as_echo "$login_manager_tmp" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_4" - fi - fi - - ;; - - /*) - # absolute path specified on cmd line - set dummy $with_login_manager_req ; login_manager_tmp=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $login_manager_tmp" >&5 -$as_echo_n "checking for $login_manager_tmp... " >&6; } - if test -x "$login_manager_tmp" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_login_manager="" - fi - ;; - - *) - # relative path specified on cmd line - set dummy $with_login_manager_req ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. -set dummy $login_manager_tmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_login_manager_tmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $login_manager_tmp in - [\\/]* | ?:[\\/]*) - ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -login_manager_tmp=$ac_cv_path_login_manager_tmp -if test -n "$login_manager_tmp"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 -$as_echo "$login_manager_tmp" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test -z "$login_manager_tmp" ; then - with_login_manager="" - else - with_login_manager="$login_manager_tmp" - fi - ;; -esac -ac_cv_login_manager_program="$with_login_manager" - -NEW_LOGIN_COMMAND_P='' -NEW_LOGIN_COMMAND="$ac_cv_login_manager_program" +elif test "$have_pwnam_shadow" = yes ; then + $as_echo "#define HAVE_PWNAM_SHADOW_PASSWD 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for login manager" >&5 -$as_echo_n "checking for login manager... " >&6; } -if test -z "$NEW_LOGIN_COMMAND" ; then - NEW_LOGIN_COMMAND="$default_login_manager_1" - NEW_LOGIN_COMMAND_P='! ' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND (disabled)" >&5 -$as_echo "$NEW_LOGIN_COMMAND (disabled)" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND" >&5 -$as_echo "$NEW_LOGIN_COMMAND" >&6; } fi - ############################################################################### # # Check for -lgtk (and Gnome stuff) # ############################################################################### +#### H1 + have_gtk=no with_gtk_req=unspecified @@ -12309,7 +12073,6 @@ else with_gtk=yes fi - # if --with-gtk=/directory/ was specified, remember that directory so that # we can also look for the `gtk-config' program in that directory. case "$with_gtk" in @@ -12321,7 +12084,6 @@ case "$with_gtk" in ;; esac - case "$with_gtk" in yes) ;; no) ;; @@ -12365,152 +12127,32 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_gtk" != yes -a "$with_gtk" != no ; then echo "error: must be yes or no: --with-gtk=$with_gtk" exit 1 fi - -parse_gtk_version_string() { - # M4 sucks!! - - maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'` - min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'` - - ac_gtk_version=`echo "$maj * 1000 + $min" | bc` - if test -z "$ac_gtk_version"; then - ac_gtk_version=unknown - ac_gtk_version_string=unknown - fi -} - -# Find pkg-config... (need this for both gtk and gdk_pixbuf.) -# if the user specified --with-gtk=/foo/ then look there. -# -gtk_path="$PATH" -if test ! -z "$gtk_dir"; then - # canonicalize slashes. - foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'` - gtk_path="$foo:$gtk_path" -fi - -for ac_prog in pkg-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_pkg_config+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $pkg_config in - [\\/]* | ?:[\\/]*) - ac_cv_path_pkg_config="$pkg_config" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $gtk_path -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_pkg_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -pkg_config=$ac_cv_path_pkg_config -if test -n "$pkg_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pkg_config" >&5 -$as_echo "$pkg_config" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$pkg_config" && break -done - - -if test -z "$pkg_config" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config not found!" >&5 -$as_echo "$as_me: WARNING: pkg-config not found!" >&2;} - pkg_config="false" -fi - - -# Utility function for running pkg-config-based tests... -# -pkgs='' -pkg_check_version() { - if test "$ok" = yes ; then - req="$1" - min="$2" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $req" >&5 -$as_echo_n "checking for $req... " >&6; } - if $pkg_config --exists "$req" ; then - vers=`$pkg_config --modversion "$req"` - if $pkg_config --exists "$req >= $min" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers" >&5 -$as_echo "$vers" >&6; } - pkgs="$pkgs $req" - return 1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vers (wanted >= $min)" >&5 -$as_echo "$vers (wanted >= $min)" >&6; } - ok=no - return 0 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ok=no - return 0 - fi - fi -} - - -jurassic_gtk=no gtk_halfassed=no -have_gtk_2_22_or_higher=no -COMMENT_DEMO_GLADE2_GTK_2_22_HEAD="" -COMMENT_DEMO_GLADE2_GTK_2_22_TAIL="" if test "$with_gtk" = yes; then have_gtk=no ok="yes" - pkg_check_version gtk+-2.0 2.0.1 ; ac_gtk_version_string="$vers" + pkg_check_version gtk+-2.0 2.22.0 ; ac_gtk_version_string="$vers" pkg_check_version gmodule-2.0 2.0.0 pkg_check_version libxml-2.0 2.4.6 - pkg_check_version libglade-2.0 1.99.0 pkg_check_version gdk-pixbuf-2.0 2.0.0 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0 have_gtk="$ok" if test "$have_gtk" = no; then if test -n "$ac_gtk_version_string" ; then - gtk_halfassed="$ac_gtk_version_string" + gtk_halfassed=yes gtk_halfassed_lib="$req" fi fi if test "$have_gtk" = yes; then - parse_gtk_version_string - jurassic_gtk=no - fi - - if test "$have_gtk" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gtk includes" >&5 $as_echo_n "checking for Gtk includes... " >&6; } if ${ac_cv_gtk_config_cflags+:} false; then : @@ -12534,7 +12176,6 @@ $as_echo "$ac_cv_gtk_config_libs" >&6; } ac_gtk_config_cflags=$ac_cv_gtk_config_cflags ac_gtk_config_libs=$ac_cv_gtk_config_libs - GTK_EXTRA_OBJS="" GTK_DATADIR="" if test "$have_gtk" = yes; then GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0` @@ -12551,19 +12192,8 @@ $as_echo "$ac_cv_gtk_config_libs" >&6; } $as_echo "#define HAVE_XML 1" >>confdefs.h fi - - if test "$have_gtk" = yes; then - ok="yes" - pkg_check_version gtk+-2.0 2.22 - have_gtk_2_22_or_higher="$ok" - if test "$have_gtk_2_22_or_higher" = yes; then - COMMENT_DEMO_GLADE2_GTK_2_22_HEAD="<!-- comment>" - COMMENT_DEMO_GLADE2_GTK_2_22_TAIL="</comment -->" - fi - fi fi - # Check for the various Gnome help and URL loading programs. # WITH_BROWSER=gnome-open @@ -12606,7 +12236,6 @@ else $as_echo "no" >&6; } fi - test -n "$gnome_open_program" && break done @@ -12648,13 +12277,11 @@ else $as_echo "no" >&6; } fi - test -n "$gnome_url_show_program" && break done fi - ############################################################################### # # Check for -lXm. @@ -12671,8 +12298,6 @@ else with_motif=no fi - - case "$with_motif" in yes) ;; no) ;; @@ -12716,7 +12341,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_motif" != yes -a "$with_motif" != no ; then echo "error: must be yes or no: --with-motif=$with_motif" exit 1 @@ -12742,11 +12366,9 @@ if test "x$ac_cv_header_Xm_Xm_h" = xyes; then : MOTIF_LIBS="$MOTIF_LIBS -lXm" fi - CPPFLAGS="$ac_save_CPPFLAGS" fi - if test "$have_motif" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -12764,11 +12386,9 @@ if test "x$ac_cv_header_Xm_ComboBox_h" = xyes; then : fi - CPPFLAGS="$ac_save_CPPFLAGS" fi - ############################################################################### # # Checking whether Motif is really Lesstif. @@ -12813,7 +12433,6 @@ $as_echo "$ac_cv_have_lesstif" >&6; } have_lesstif=$ac_cv_have_lesstif fi - lesstif_version=unknown lesstif_version_string=unknown @@ -12865,13 +12484,12 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lesstif_version_string" >&5 $as_echo "$ac_cv_lesstif_version_string" >&6; } - rm -f conftest-lt + rm -rf conftest-lt lesstif_version=$ac_cv_lesstif_version lesstif_version_string=$ac_cv_lesstif_version_string fi - if test "$have_motif" = yes ; then mtv=unknown echo unknown > conftest-mt @@ -12920,13 +12538,12 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_motif_version_string" >&5 $as_echo "$ac_cv_motif_version_string" >&6; } - rm -f conftest-mt + rm -rf conftest-mt motif_version=$ac_cv_motif_version motif_version_string=$ac_cv_motif_version_string fi - ############################################################################### # # Checking whether Motif requires -lXp. @@ -13007,7 +12624,6 @@ fi fi - ############################################################################### # # Checking whether Motif requires -lXintl (for _Xsetlocale.) @@ -13086,6 +12702,1487 @@ fi fi fi +############################################################################### +# +# Check for a login manager for a "New Login" button on the lock dialog. +# Usually this will be "/usr/bin/gdmflexiserver". +# +############################################################################### + +with_login_manager_req=unspecified +default_login_manager_1='gdmflexiserver -ls' +default_login_manager_2='kdmctl reserve' +default_login_manager_3='lxdm -c USER_SWITCH' +default_login_manager_4='dm-tool switch-to-greeter' + +# Check whether --with-login-manager was given. +if test "${with_login_manager+set}" = set; then : + withval=$with_login_manager; with_login_manager="$withval"; with_login_manager_req="$withval" +else + with_login_manager=yes +fi + +# no HANDLE_X_PATH_ARG for this one + +if test "$enable_locking" = no ; then + with_login_manager_req=no + with_login_manager=no +fi + +case "$with_login_manager_req" in + no) + with_login_manager="" + ;; + + yes|unspecified) + # Try various defaults, use the first one that exists. + + with_login_manager="" + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_1 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_1" + fi + fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_2 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_2" + fi + fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_3 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_3" + fi + fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_4 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_4" + fi + fi + + ;; + + *) + # Just believe whatever command was specified. + with_login_manager="$with_login_manager_req" + ;; +esac +ac_cv_login_manager_program="$with_login_manager" + +NEW_LOGIN_COMMAND_P='' +NEW_LOGIN_COMMAND="$ac_cv_login_manager_program" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for login manager" >&5 +$as_echo_n "checking for login manager... " >&6; } +if test -z "$NEW_LOGIN_COMMAND" ; then + NEW_LOGIN_COMMAND="$default_login_manager_1" + NEW_LOGIN_COMMAND_P='! ' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND (disabled)" >&5 +$as_echo "$NEW_LOGIN_COMMAND (disabled)" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEW_LOGIN_COMMAND" >&5 +$as_echo "$NEW_LOGIN_COMMAND" >&6; } +fi + +############################################################################### +# +# Check for a directory full of images to use as the default value +# of the "imageDirectory" preference. +# +############################################################################### + +have_imagedir=no +with_imagedir_req=unspecified + +# Check whether --with-image-directory was given. +if test "${with_image_directory+set}" = set; then : + withval=$with_image_directory; with_imagedir="$withval"; with_imagedir_req="$withval" +else + with_imagedir=yes +fi + +# no HANDLE_X_PATH_ARG for this one + +case "$with_imagedir" in + /*) + # absolute path + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $with_imagedir" >&5 +$as_echo_n "checking for image directory $with_imagedir... " >&6; } + if test -d "$with_imagedir" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_imagedir="" + fi + ;; + yes) + with_imagedir="" + + fallback_imgdir="" + for dd in \ + "/usr/share/rpd-wallpaper/" \ + "/usr/share/backgrounds/images/" \ + "/usr/share/wallpapers/" \ + "/usr/share/backgrounds/" \ + "/usr/share/pixmaps/backgrounds/" \ + "/usr/share/lxde/wallpapers/" \ + "/Library/Desktop Pictures/" \ + ; do + if test -z "$with_imagedir"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $dd" >&5 +$as_echo_n "checking for image directory $dd... " >&6; } + if test -d "$dd"; then + if ( ls "$dd" | grep -q ... ) >&- 2>&- ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_imagedir="$dd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: empty" >&5 +$as_echo "empty" >&6; } + if test -z "$fallback_imgdir"; then + fallback_imgdir="$dd" + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + done + if test -z "$with_imagedir"; then + with_imagedir="$fallback_imgdir" + fi +;; + no) + with_imagedir="" + ;; + + *) + echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req" + exit 1 + ;; +esac +ac_cv_imagedir="$with_imagedir" + +DEFAULT_IMAGES_P='True' +DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir" + +if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then + DEFAULT_IMAGES_P='False' +fi + +############################################################################### +# +# Pick a text file to use as the default of the "textFile" preference. +# Any old file will do, but preferably one that will make interesting +# shapes when displayed by "starwars" and "fontglide". +# +############################################################################### + +have_textfile=no +with_textfile_req=unspecified + +# Check whether --with-text-file was given. +if test "${with_text_file+set}" = set; then : + withval=$with_text_file; with_textfile="$withval"; with_textfile_req="$withval" +else + with_textfile=yes +fi + +# no HANDLE_X_PATH_ARG for this one + +case "$with_textfile" in + /*) + # absolute path + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for text file $with_textfile" >&5 +$as_echo_n "checking for text file $with_textfile... " >&6; } + if test -f "$with_textfile" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_textfile="" + fi + ;; + yes) + with_textfile="" + + #### Could use some more defaults here... + for f in \ + "/usr/X11R6/lib/X11/doc/README" \ + "/usr/share/doc/xserver-common/copyright" \ + "/usr/share/doc/xserver-xorg-core/copyright" \ + "/usr/X11R6/README" \ + "/usr/share/doc/libX11*/COPYING" \ + "/usr/X11/share/X11/doc/README*" \ + "/usr/share/doc/debian/debian-manifesto" \ + ; do + if test -z "$with_textfile"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for text file $f" >&5 +$as_echo_n "checking for text file $f... " >&6; } + f=`/bin/ls $f 2>&- | head -1` + if test -f "$f" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_textfile="$f" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + done + + ;; + no) + with_textfile="" + ;; + + *) + echo "error: must be an absolute path: --with-text-file=$with_textfile_req" + exit 1 + ;; +esac +ac_cv_textfile="$with_textfile" + +DEFAULT_TEXT_FILE="$ac_cv_textfile" + +############################################################################### +# +# Check the browser to see help URL +# +############################################################################### + +have_browser=no +with_browser_req=unspecified + +# Check whether --with-browser was given. +if test "${with_browser+set}" = set; then : + withval=$with_browser; with_browser="$withval"; with_browser_req="$withval" +else + with_browser=no +fi + +# no HANDLE_X_PATH_ARG for this one + +case "$with_browser" in + no ) + ;; + * ) + WITH_BROWSER=$with_browser + gnome_open_program=$with_browser + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for browser $with_browser" >&5 +$as_echo_n "checking for browser $with_browser... " >&6; } + with_browser_fullpath=`which $with_browser 2>/dev/null` + case $with_browser_fullpath in + /* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_browser=yes + ;; + * ) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +# Only warning: we don't want to install all packages for the +# dependency of the browser in building stage... + echo "WARNING: browser not found: --with-browser=$with_browser" + ;; + esac + ;; +esac +ac_cv_browser="$with_browser" + +############################################################################### +# +# Check for pthreads. Must come before checking for OpenGL, +# since some versions of OpenGL require it. +# +############################################################################### + +have_pthread=no +with_pthread_req=unspecified + +# AX_PTHREAD is from the GNU Autoconf Archive. +# https://savannah.gnu.org/projects/autoconf-archive/ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 <https://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 30 + +# This is what autoupdate's m4 run will expand. It fires +# the warning (with _au_warn_XXX), outputs it into the +# updated configure.ac (with AC_DIAGNOSE), and then outputs +# the replacement expansion. + +# This is an auxiliary macro that is also run when +# autoupdate runs m4. It simply calls m4_warning, but +# we need a wrapper so that each warning is emitted only +# once. We break the quoting in m4_warning's argument in +# order to expand this macro's arguments, not AU_DEFUN's. + +# Finally, this is the expansion that is picked up by +# autoconf. It tells the user to run autoupdate, and +# then outputs the replacement expansion. We do not care +# about autoupdate's warning because that contains +# information on what to do *after* running autoupdate. + +# Check whether --with-pthread was given. +if test "${with_pthread+set}" = set; then : + withval=$with_pthread; # This is documented after --with-gl in --with-xft. + with_pthread="$withval"; with_pthread_req="$withval" +else + with_pthread=yes +fi + +if test "$with_pthread" = yes; then + # AX_PTHREAD might want a different compiler. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -rf conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -rf conftest.sed + +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_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + if test "x$PTHREAD_CC" != "x"; then : + CC="$PTHREAD_CC" +fi + if test "x$PTHREAD_CXX" != "x"; then : + CXX="$PTHREAD_CXX" +fi + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $target_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} +fi +rm -rf conftest* + + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +$as_echo_n "checking whether $CC is Clang... " >&6; } +if ${ax_cv_PTHREAD_CLANG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : + ax_cv_PTHREAD_CLANG=yes +fi +rm -rf conftest* + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG" >&6; } +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +if test "x$GCC" = "xyes"; then : + ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" +fi + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +if test "x$ax_pthread_clang" = "xyes"; then : + ax_pthread_flags="-pthread,-lpthread -pthread" +fi + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $target_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--"; then : + ax_pthread_check_cond=0 +else + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +fi + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 +$as_echo_n "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ax_pthread_config" = "xno"; then : + continue +fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes"; then : + break +fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown"; then : + break +fi + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x"; then : + ax_pthread_try=no +fi + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } +if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +int +main () +{ +int attr = $ax_pthread_attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } + if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR +_ACEOF + + ax_pthread_joinable_attr_defined=yes + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +$as_echo_n "checking whether more special flags are required for pthreads... " >&6; } +if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $target_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } + if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"; then : + PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + return i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + + ax_pthread_prio_inherit_defined=yes + +fi + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $target_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + + if as_fn_executable_p ${CC}_r; then : + PTHREAD_CC="${CC}_r" +fi + if test "x${CXX}" != "x"; then : + if as_fn_executable_p ${CXX}_r; then : + PTHREAD_CXX="${CXX}_r" +fi +fi + ;; #( + *) : + + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + if test "x${CXX}" != "x"; then : + for ac_prog in ${CXX}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CXX"; then + ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX +if test -n "$PTHREAD_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 +$as_echo "$PTHREAD_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + test -n "$PTHREAD_CXX" && break +done +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + +fi + + ;; +esac + ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + if test "$CC" = "$PTHREAD_CC" -o -z "$ac_original_cc"; then + have_pthread=yes + else + ac_prog_cc_no_pthread=yes + fi + + : +else + ax_pthread_ok=no + +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_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "$have_pthread" = yes; then + $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + CC="$PTHREAD_CC" + fi +fi + +############################################################################### +# +# Handle --with-gles +# Must come before --with-gl +# +############################################################################### + +with_jwzgles_req=unspecified +have_jwzgles=no + +# Check whether --with-gles was given. +if test "${with_gles+set}" = set; then : + withval=$with_gles; # This is documented after --with-gl + with_jwzgles="$withval"; with_jwzgles_req="$withval" +else + with_jwzgles=no +fi + + case "$with_jwzgles" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JWZGLES headers" >&5 +$as_echo_n "checking for JWZGLES headers... " >&6; } + d=$with_jwzgles/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JWZGLES libs" >&5 +$as_echo_n "checking for JWZGLES libs... " >&6; } + d=$with_jwzgles/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_jwzgles_req="yes" + with_jwzgles=$with_jwzgles_req + ;; + + *) + echo "" + echo "error: argument to --with-gles must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_jwzgles" = yes; then + have_jwzgles=yes + JWZGLES_OBJS='$(JWXYZ_BIN)/jwzgles.o' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: emulating OpenGL 1.3 in terms of OpenGLES 1.x." >&5 +$as_echo "emulating OpenGL 1.3 in terms of OpenGLES 1.x." >&6; } +elif test "$with_jwzgles" != no; then + echo "error: must be yes or no: --with-gles=$with_jwzgles" + exit 1 +fi ############################################################################### # @@ -13093,10 +14190,13 @@ fi # ############################################################################### +#### H1 + have_gl=no ac_have_mesa_gl=no with_gl_req=unspecified gl_halfassed=no +have_glext=no # Check whether --with-gl was given. if test "${with_gl+set}" = set; then : @@ -13105,8 +14205,6 @@ else with_gl=yes fi - - case "$with_gl" in yes) ;; no) ;; @@ -13150,9 +14248,13 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - -ac_mesagl_version=unknown -ac_mesagl_version_string=unknown +# Some GL libraries require pthreads, so use the pthreads flags when +# testing them, then set them back after. +# +ac_save_pthreads_CFLAGS="$CFLAGS" +ac_save_pthreads_LIBS="$LIBS" +CFLAGS="$PTHREAD_CFLAGS $CFLAGS" +LIBS="$PTHREAD_LIBS $LIBS" if test "$with_gl" = yes; then @@ -13169,9 +14271,8 @@ else have_gl=no fi - - CPPFLAGS="$ac_save_CPPFLAGS" - if test "$have_gl" = yes ; then + CPPFLAGS="$ac_save_CPPFLAGS"; + if test "$have_gl" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -13179,114 +14280,149 @@ fi fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "#include <GL/gl.h> -" -if test "x$ac_cv_header_GL_glx_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "GL/glu.h" "ac_cv_header_GL_glu_h" "$ac_includes_default" +if test "x$ac_cv_header_GL_glu_h" = xyes; then : have_gl=yes else have_gl=no fi - - CPPFLAGS="$ac_save_CPPFLAGS" + CPPFLAGS="$ac_save_CPPFLAGS"; fi +fi - # If we have the headers, try and figure out which vendor it's from. +if test "$with_gl" = yes; then + # + # Since the OpenGL and GLES specifications are a complete dumpster fire, + # it's not easy to figure out how what libraries to use. + # + # OpenGLES library names: + # + # 1.x: libGLESv1_CM + # 2.x: libGLESv2 + # 3.x: libGLESv2 on Windows, libGLESv3 on Android # - if test "$have_gl" = yes ; then + # On modern Linux systems, these libraries exist: + # + # libGL - a superset of everything up to and including OpenGL 4.6 + # libGLESv1_CM - OpenGLES 1.1, meaning it omits much of OpenGL 1.3 + # libGLESv2 - OpenGLES 2 and 3, meaning it omits even more of OpenGL 1.3 + # + # Since Linux systems support OpenGL 1.3, those link against only libGL. + # + # Unless we are using --with-gles on Linux, in which case we are attempting + # to simulate a system that does not natively support OpenGL 1.3. In that + # case, we use the v1 and/or v2 libraries instead. + # + # Common practice on Android seems to be to link against the v1, v2 and v3 + # libraries in order, and then do runtime checks to see which set of + # functions is actually supported by the runtime. Just because you linked + # against a GLES3 library doesn't mean that the hardware supports it: most + # of these functions are just syscall-like stubs. + # + # See the commentary atop jwxyz/jwzgles.c for discussion of OpenGL versions. + # + if test "$have_gl" = yes; then + have_gl=no - # We need to know whether it's MesaGL so that we know which libraries - # to link against. - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GL is really MesaGL" >&5 -$as_echo_n "checking whether GL is really MesaGL... " >&6; } -if ${ac_cv_have_mesa_gl+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_have_mesa_gl=no - if test "$ac_macosx" = no; then - # WTF! MacOS 10.5.0 ships the Mesa GL headers! - # It's not really Mesa, is it? + if test "$have_jwzgles" = yes; then + + # Only check for the v1/2/3 libraries on Linux when using --with-gles + # to emulate a system that does not natively support OpenGL 1.3. + + # Check for GLES 3.x ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + if test \! -z "$includedir" ; then CPPFLAGS="$CPPFLAGS -I$includedir" fi + # note: $X_CFLAGS includes $x_includes CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glDrawElements in -lGLESv3" >&5 +$as_echo_n "checking for glDrawElements in -lGLESv3... " >&6; } +if ${ac_cv_lib_GLESv3_glDrawElements+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lGLESv3 $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <GL/glx.h> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glDrawElements (); +int +main () +{ +return glDrawElements (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Mesa|MESA" >/dev/null 2>&1; then : - ac_cv_have_mesa_gl=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_GLESv3_glDrawElements=yes +else + ac_cv_lib_GLESv3_glDrawElements=no fi -rm -f conftest* - - CPPFLAGS="$ac_save_CPPFLAGS" - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLESv3_glDrawElements" >&5 +$as_echo "$ac_cv_lib_GLESv3_glDrawElements" >&6; } +if test "x$ac_cv_lib_GLESv3_glDrawElements" = xyes; then : + have_gl=yes + gl_lib_1="GLESv3" + GL_LIBS="-lGLESv3 $GL_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_mesa_gl" >&5 -$as_echo "$ac_cv_have_mesa_gl" >&6; } - ac_have_mesa_gl=$ac_cv_have_mesa_gl - - gl_lib_1="" - GL_LIBS="" - if test "$ac_macosx" = yes; then + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" - # Without these, every link against libGL gets a bunch of useless - # warnings. - # - osx_crud="-bind_at_load -multiply_defined suppress" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding \"$osx_crud\" to GL_LIBS" >&5 -$as_echo "adding \"$osx_crud\" to GL_LIBS" >&6; } - GL_LIBS="$GL_LIBS $osx_crud" - unset osx_crud - - # New lossage in 10.5.0: without this, we get: - # ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib - # - osx_crud="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" - osx_crud="-Wl,-dylib_file,${osx_crud}:${osx_crud}" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding \"$osx_crud\" to GL_LIBS" >&5 -$as_echo "adding \"$osx_crud\" to GL_LIBS" >&6; } - GL_LIBS="$GL_LIBS $osx_crud" - unset osx_crud - - # New lossage in 10.6.8: we can't allow -L/opt/local/lib to be in the - # link line, or at runtime XQueryExtension gets a segv due to some kind - # of library version skew. Libs must come from /usr/X11/lib even if - # $prefix and/or $exec_prefix are set to /opt/local/. - # - { $as_echo "$as_me:${as_lineno-$LINENO}: result: omitting \"$libdir\" from LDFLAGS" >&5 -$as_echo "omitting \"$libdir\" from LDFLAGS" >&6; } - libdir='' + # Check for GLES 2.x - # Looks like as of OSX 10.12, gcc can't do ObjC. - OBJCC="clang -Wall" + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" - fi + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - # Some versions of MesaGL are compiled to require -lpthread. - # So if the Mesa headers exist, and -lpthread exists, then always - # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.) - # - # Oftentimes, AX_PTHREAD will bring in -lpthread as well; but that ends - # up before -l(Mesa)GL, instead of after where it would belong. - # - if test "$ac_have_mesa_gl" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glDrawElements in -lGLESv2" >&5 +$as_echo_n "checking for glDrawElements in -lGLESv2... " >&6; } +if ${ac_cv_lib_GLESv2_glDrawElements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" +LIBS="-lGLESv2 $GL_LIBS -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13296,39 +14432,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char glDrawElements (); int main () { -return pthread_create (); +return glDrawElements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes + ac_cv_lib_GLESv2_glDrawElements=yes else - ac_cv_lib_pthread_pthread_create=no + ac_cv_lib_GLESv2_glDrawElements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - GL_LIBS="-lpthread" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLESv2_glDrawElements" >&5 +$as_echo "$ac_cv_lib_GLESv2_glDrawElements" >&6; } +if test "x$ac_cv_lib_GLESv2_glDrawElements" = xyes; then : + have_gl=yes + gl_lib_1="GLESv2" + GL_LIBS="-lGLESv2 $GL_LIBS" fi - fi - - - # If we have Mesa headers, check to see if we can link against -lMesaGL. - # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL. - # Else, warn that GL is busted. (We have the headers, but no libs.) - # + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" - if test "$ac_have_mesa_gl" = yes ; then + # Check for GLES 1.x ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -13348,13 +14482,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lMesaGL" >&5 -$as_echo_n "checking for glXCreateContext in -lMesaGL... " >&6; } -if ${ac_cv_lib_MesaGL_glXCreateContext+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glDrawElements in -lGLESv1_CM" >&5 +$as_echo_n "checking for glDrawElements in -lGLESv1_CM... " >&6; } +if ${ac_cv_lib_GLESv1_CM_glDrawElements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm $LIBS" +LIBS="-lGLESv1_CM $GL_LIBS -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13364,38 +14498,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char glXCreateContext (); +char glDrawElements (); int main () { -return glXCreateContext (); +return glDrawElements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_MesaGL_glXCreateContext=yes + ac_cv_lib_GLESv1_CM_glDrawElements=yes else - ac_cv_lib_MesaGL_glXCreateContext=no + ac_cv_lib_GLESv1_CM_glDrawElements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_MesaGL_glXCreateContext" >&5 -$as_echo "$ac_cv_lib_MesaGL_glXCreateContext" >&6; } -if test "x$ac_cv_lib_MesaGL_glXCreateContext" = xyes; then : - gl_lib_1="MesaGL" - GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLESv1_CM_glDrawElements" >&5 +$as_echo "$ac_cv_lib_GLESv1_CM_glDrawElements" >&6; } +if test "x$ac_cv_lib_GLESv1_CM_glDrawElements" = xyes; then : + have_gl=yes + gl_lib_1="GLESv1_CM" + GL_LIBS="-lGLESv1_CM $GL_LIBS" fi CPPFLAGS="$ac_save_CPPFLAGS" LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - fi + else # $have_jwzgles = no - if test "$gl_lib_1" = "" ; then + # Check for OpenGL 1.x and/or OpenGL 4.x ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -13415,13 +14550,13 @@ fi CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5 -$as_echo_n "checking for glXCreateContext in -lGL... " >&6; } -if ${ac_cv_lib_GL_glXCreateContext+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glEnable in -lGL" >&5 +$as_echo_n "checking for glEnable in -lGL... " >&6; } +if ${ac_cv_lib_GL_glEnable+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm $LIBS" +LIBS="-lGL $GL_LIBS -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13431,148 +14566,260 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char glXCreateContext (); +char glEnable (); int main () { -return glXCreateContext (); +return glEnable (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GL_glXCreateContext=yes + ac_cv_lib_GL_glEnable=yes else - ac_cv_lib_GL_glXCreateContext=no + ac_cv_lib_GL_glEnable=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateContext" >&5 -$as_echo "$ac_cv_lib_GL_glXCreateContext" >&6; } -if test "x$ac_cv_lib_GL_glXCreateContext" = xyes; then : - gl_lib_1="GL" - GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glEnable" >&5 +$as_echo "$ac_cv_lib_GL_glEnable" >&6; } +if test "x$ac_cv_lib_GL_glEnable" = xyes; then : + have_gl=yes + gl_lib_1="GL" + GL_LIBS="-lGL $GL_LIBS" fi CPPFLAGS="$ac_save_CPPFLAGS" LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - fi + # Check for MesaGL 1.x, but only if libGL doesn't exist. + if test "$have_gl" = no; then - if test "$gl_lib_1" = "" ; then - # we have headers, but no libs -- bail. - have_gl=no - ac_have_mesa_gl=no - gl_halfassed=yes - else - # linking works -- we can build the GL hacks. - $as_echo "#define HAVE_GL 1" >>confdefs.h + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glEnable in -lMesaGL" >&5 +$as_echo_n "checking for glEnable in -lMesaGL... " >&6; } +if ${ac_cv_lib_MesaGL_glEnable+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lMesaGL $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glEnable (); +int +main () +{ +return glEnable (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_MesaGL_glEnable=yes +else + ac_cv_lib_MesaGL_glEnable=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_MesaGL_glEnable" >&5 +$as_echo "$ac_cv_lib_MesaGL_glEnable" >&6; } +if test "x$ac_cv_lib_MesaGL_glEnable" = xyes; then : + have_gl=yes + gl_lib_1="MesaGL" + GL_LIBS="-lMesaGL $GL_LIBS" +fi - if test "$ac_have_mesa_gl" = yes ; then - $as_echo "#define HAVE_MESA_GL 1" >>confdefs.h + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" fi fi fi - - # Now that we know we have GL headers and libs, do some more GL testing. + # Figure out whether the GLU functions are in the main GL libraries or + # in -lGLU. Since Android does not have GLU, we don't link against libGLU + # when using --with-gles on Linux. # + if test "$have_gl" = yes -a "$have_jwzgles" = no; then - if test "$have_gl" = yes ; then - # If it's MesaGL, we'd like to issue a warning if the version number - # is less than or equal to 2.6, because that version had a security bug. - # - if test "$ac_have_mesa_gl" = yes; then + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MesaGL version number" >&5 -$as_echo_n "checking MesaGL version number... " >&6; } -if ${ac_cv_mesagl_version_string+:} false; then : + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_gluBuild2DMipmaps" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluBuild2DMipmaps in -l$gl_lib_1" >&5 +$as_echo_n "checking for gluBuild2DMipmaps in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.$ac_ext <<EOF -#line 13497 "configure" -#include "confdefs.h" -#include <GL/gl.h> -#ifndef MESA_MAJOR_VERSION -# include <GL/xmesa.h> -# ifdef XMESA_MAJOR_VERSION - /* Around Mesa 3.2, they took out the Mesa version number, so instead, - we have to check the XMesa version number (the number of the X protocol - support, which seems to be the same as the Mesa version number.) - */ -# define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION -# define MESA_MINOR_VERSION XMESA_MINOR_VERSION -# else - /* Oh great. Some time after 3.4, they took out the xmesa.h header file, - so we have no way of telling what version of Mesa this is at all. - So, we'll guess that the osmesa version (the "offscreen protocol") - is less than or equal to the real mesa version number. Except that - if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in - Mesa 3.4. And Mesa 3.3 had xmesa.h. What a complete load of shit! - */ -# include <GL/osmesa.h> -# define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION -# define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably? -# if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3 -# undef MESA_MINOR_VERSION -# define MESA_MINOR_VERSION 4 or newer, probably? -# endif -# endif + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif -configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION -EOF +char gluBuild2DMipmaps (); +int +main () +{ +return gluBuild2DMipmaps (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_LIB$gl_lib_1" | $as_tr_cpp` 1 +_ACEOF - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" + LIBS="-l$gl_lib_1 $LIBS" - mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | grep configure:` +else + have_gl=no +fi - # M4 sucks!! + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" - mglv=`echo "$mglv" | sed -n \ - 's/^configure: *\([0-9][0-9]*\) *\([0-9].*\)$/\1.\2/p'` + if test "$have_gl" = no; then + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" - rm -f conftest.$ac_ext + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS" + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - if test "$mglv" = ""; then - ac_mesagl_version=unknown - ac_mesagl_version_string=unknown - else - ac_mesagl_version_string="$mglv" - # M4 sucks!! + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluBuild2DMipmaps in -lGLU" >&5 +$as_echo_n "checking for gluBuild2DMipmaps in -lGLU... " >&6; } +if ${ac_cv_lib_GLU_gluBuild2DMipmaps+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lGLU $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'` - min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'` +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gluBuild2DMipmaps (); +int +main () +{ +return gluBuild2DMipmaps (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_GLU_gluBuild2DMipmaps=yes +else + ac_cv_lib_GLU_gluBuild2DMipmaps=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluBuild2DMipmaps" >&5 +$as_echo "$ac_cv_lib_GLU_gluBuild2DMipmaps" >&6; } +if test "x$ac_cv_lib_GLU_gluBuild2DMipmaps" = xyes; then : + have_gl=yes + GL_LIBS="-lGLU $GL_LIBS" +else + have_gl=no + gl_halfassed=yes +fi - ac_mesagl_version=`echo "$maj * 1000 + $min" | bc` - if test -z "$ac_mesagl_version"; then - ac_mesagl_version=unknown - ac_mesagl_version_string=unknown - fi - fi - ac_cv_mesagl_version=$ac_mesagl_version - ac_cv_mesagl_version_string=$ac_mesagl_version_string + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mesagl_version_string" >&5 -$as_echo "$ac_cv_mesagl_version_string" >&6; } - ac_mesagl_version=$ac_cv_mesagl_version - ac_mesagl_version_string=$ac_cv_mesagl_version_string fi + fi + if test "$have_gl" = yes; then - # Check for OpenGL 1.1 features. - # + $as_echo "#define HAVE_GL 1" >>confdefs.h + + # OpenGL 1.0 didn't have multiple textures. ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -13641,6 +14888,237 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" + # Check for native GLES1 + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_glBindBuffer" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBindBuffer in -l$gl_lib_1" >&5 +$as_echo_n "checking for glBindBuffer in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glBindBuffer (); +int +main () +{ +return glBindBuffer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + $as_echo "#define HAVE_GLES 1" >>confdefs.h + +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + # Check for GLSL and GLES2 + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_compile "$LINENO" "GL/glext.h" "ac_cv_header_GL_glext_h" "#include <GL/gl.h> +" +if test "x$ac_cv_header_GL_glext_h" = xyes; then : + have_glext=yes +else + have_glext=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + if test "$have_glext" = yes ; then + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_glUseProgram" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glUseProgram in -l$gl_lib_1" >&5 +$as_echo_n "checking for glUseProgram in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glUseProgram (); +int +main () +{ +return glUseProgram (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + $as_echo "#define HAVE_GLSL 1" >>confdefs.h + + $as_echo "#define HAVE_GLES2 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + + # Check for GLES3 + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_glBlitFramebuffer" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBlitFramebuffer in -l$gl_lib_1" >&5 +$as_echo_n "checking for glBlitFramebuffer in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glBlitFramebuffer (); +int +main () +{ +return glBlitFramebuffer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + $as_echo "#define HAVE_GLES3 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + if test "$have_jwzgles" = yes; then + $as_echo "#define HAVE_JWZGLES 1" >>confdefs.h + + $as_echo "#define HAVE_GLES 1" >>confdefs.h + + fi + fi elif test "$with_gl" != no; then @@ -13648,6 +15126,331 @@ elif test "$with_gl" != no; then exit 1 fi +############################################################################### +# +# Handle --with-glx +# +############################################################################### + +have_glx=no +have_egl=no +with_egl_req=unspecified + +# Check whether --with-glx was given. +if test "${with_glx+set}" = set; then : + withval=$with_glx; with_egl="$withval"; with_egl_req="$withval" +else + with_glx=no +fi + + case "$with_glx" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLX headers" >&5 +$as_echo_n "checking for GLX headers... " >&6; } + d=$with_glx/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLX libs" >&5 +$as_echo_n "checking for GLX libs... " >&6; } + d=$with_glx/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_glx_req="yes" + with_glx=$with_glx_req + ;; + + *) + echo "" + echo "error: argument to --with-glx must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + +if test "$with_glx" = yes; then + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "GLX/glx.h" "ac_cv_header_GLX_glx_h" "$ac_includes_default" +if test "x$ac_cv_header_GLX_glx_h" = xyes; then : + have_glx=yes +else + have_glx=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" +elif test "$with_glx" != no; then + echo "error: must be yes or no: --with-glx=$with_glx" + exit 1 +fi + +if test "$have_gl" = yes; then + + # See if GLX functions are in -LGL. + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_glXCreateContext" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -l$gl_lib_1" >&5 +$as_echo_n "checking for glXCreateContext in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char glXCreateContext (); +int +main () +{ +return glXCreateContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + have_glx=yes +else + have_glx=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + # See if EGL functions are in -LGL. + egl_lib="" + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + as_ac_Lib=`$as_echo "ac_cv_lib_$gl_lib_1''_eglCreatePlatformWindowSurface" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for eglCreatePlatformWindowSurface in -l$gl_lib_1" >&5 +$as_echo_n "checking for eglCreatePlatformWindowSurface in -l$gl_lib_1... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$gl_lib_1 $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char eglCreatePlatformWindowSurface (); +int +main () +{ +return eglCreatePlatformWindowSurface (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + have_egl=yes +else + have_egl=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + if test "$have_egl" = no; then + # See if EGL functions are in -lEGL. + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for eglCreatePlatformWindowSurface in -lEGL" >&5 +$as_echo_n "checking for eglCreatePlatformWindowSurface in -lEGL... " >&6; } +if ${ac_cv_lib_EGL_eglCreatePlatformWindowSurface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lEGL $GL_LIBS -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char eglCreatePlatformWindowSurface (); +int +main () +{ +return eglCreatePlatformWindowSurface (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_EGL_eglCreatePlatformWindowSurface=yes +else + ac_cv_lib_EGL_eglCreatePlatformWindowSurface=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_EGL_eglCreatePlatformWindowSurface" >&5 +$as_echo "$ac_cv_lib_EGL_eglCreatePlatformWindowSurface" >&6; } +if test "x$ac_cv_lib_EGL_eglCreatePlatformWindowSurface" = xyes; then : + have_egl=yes + egl_lib="EGL" +else + have_egl=no +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + + # If both GLX and EGL exist, use GLX only if requested. + if test "$with_glx" = yes -a "$have_glx" = yes; then + have_egl=no + fi + + if test "$have_egl" = yes; then + $as_echo "#define HAVE_EGL 1" >>confdefs.h + + if test \! -z "$egl_lib"; then + GL_LIBS="-l$egl_lib $GL_LIBS" + fi + fi + + # One of them is required + if test "$have_egl" = no -a "$have_glx" = no; then + have_gl=no + gl_halfassed=yes + fi + + # --with-gles means that we are emulating a system that supports GLES but + # does not support OpenGL 1.3 (e.g., using Linux to simulate an Android-like + # environment). On such a system, GLE is required and GLX wouldn't exist. + # There is no way to request a GLES 3.0 runtime context using GLX. + # + if test "$have_jwzgles" = yes -a "$have_egl" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using --with-glx and --with-gles together is a bad idea." >&5 +$as_echo "$as_me: WARNING: Using --with-glx and --with-gles together is a bad idea." >&2;} + fi + +fi + +# Restore flags after testing OpenGL libraries. +# +CFLAGS="$ac_save_pthreads_CFLAGS" +LIBS="$ac_save_pthreads_LIBS" ############################################################################### # @@ -13666,8 +15469,6 @@ else with_gle=yes fi - - case "$with_gle" in yes) ;; no) ;; @@ -13711,14 +15512,12 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - GLE_LIBS="" if test "$have_gl" = no ; then true elif test "$with_gle" = yes; then - ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then CPPFLAGS="$CPPFLAGS -I$includedir" @@ -13733,7 +15532,6 @@ else have_gle3=no fi - CPPFLAGS="$ac_save_CPPFLAGS" if test "$have_gle3" = yes ; then have_gle=yes; @@ -13753,7 +15551,6 @@ else have_gle=no fi - CPPFLAGS="$ac_save_CPPFLAGS" if test "$have_gle" = yes ; then @@ -13771,7 +15568,6 @@ else have_gle=no fi - CPPFLAGS="$ac_save_CPPFLAGS" fi fi @@ -14008,32 +15804,31 @@ elif test "$with_gle" != no; then fi - ############################################################################### # -# Handle --with-gles +# Check for -ljpeg # ############################################################################### -with_gles_req=unspecified +have_jpeg=no +with_jpeg_req=unspecified +jpeg_halfassed=no -# Check whether --with-gles was given. -if test "${with_gles+set}" = set; then : - withval=$with_gles; with_gles="$withval"; with_gles_req="$withval" +# Check whether --with-jpeg was given. +if test "${with_jpeg+set}" = set; then : + withval=$with_jpeg; with_jpeg="$withval"; with_jpeg_req="$withval" else - with_gles=no + with_jpeg=yes fi - - - case "$with_gles" in + case "$with_jpeg" in yes) ;; no) ;; /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JWZGLES headers" >&5 -$as_echo_n "checking for JWZGLES headers... " >&6; } - d=$with_gles/include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG headers" >&5 +$as_echo_n "checking for JPEG headers... " >&6; } + d=$with_jpeg/include if test -d $d; then X_CFLAGS="-I$d $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -14043,9 +15838,9 @@ $as_echo "$d" >&6; } $as_echo "not found ($d: no such directory)" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JWZGLES libs" >&5 -$as_echo_n "checking for JWZGLES libs... " >&6; } - d=$with_gles/lib + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG libs" >&5 +$as_echo_n "checking for JPEG libs... " >&6; } + d=$with_jpeg/lib if test -d $d; then X_LIBS="-L$d $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 @@ -14056,30 +15851,113 @@ $as_echo "not found ($d: no such directory)" >&6; } fi # replace the directory string with "yes". - with_gles_req="yes" - with_gles=$with_gles_req + with_jpeg_req="yes" + with_jpeg=$with_jpeg_req ;; *) echo "" - echo "error: argument to --with-gles must be \"yes\", \"no\", or a directory." + echo "error: argument to --with-jpeg must be \"yes\", \"no\", or a directory." echo " If it is a directory, then \`DIR/include' will be added to" echo " the -I list, and \`DIR/lib' will be added to the -L list." exit 1 ;; esac +if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then + echo "error: must be yes or no: --with-jpeg=$with_jpeg" + exit 1 +fi + +if test "$with_jpeg" = yes; then -if test "$with_gles" = yes; then - have_gles=yes - $as_echo "#define HAVE_JWZGLES 1" >>confdefs.h + have_jpeg=no - JWZGLES_OBJS='$(JWXYZ_BIN)/jwzgles.o' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OpenGL ES compatiblity shim" >&5 -$as_echo "using OpenGL ES compatiblity shim" >&6; } -elif test "$with_gles" != no; then - echo "error: must be yes or no: --with-gles=$with_gles" - exit 1 + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes; then : + have_jpeg=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + + if test "$have_jpeg" = yes; then + # we have the header, now check for the library + have_jpeg=no + jpeg_halfassed=yes + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5 +$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_start_compress (); +int +main () +{ +return jpeg_start_compress (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_start_compress=yes +else + ac_cv_lib_jpeg_jpeg_start_compress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then : + have_jpeg=yes + jpeg_halfassed=no + JPEG_LIBS="-ljpeg" + $as_echo "#define HAVE_JPEGLIB 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi fi ############################################################################### @@ -14099,8 +15977,6 @@ else with_png=yes fi - - case "$with_png" in yes) ;; no) ;; @@ -14144,7 +16020,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_png" != yes -a "$with_png" != no ; then echo "error: must be yes or no: --with-png=$with_png" exit 1 @@ -14165,7 +16040,6 @@ if test "x$ac_cv_header_png_h" = xyes; then : have_png=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" if test "$have_png" = yes; then @@ -14242,12 +16116,11 @@ fi fi fi - ############################################################################### # # Check for -lgdk_pixbuf. # These tests are for gdk_pixbuf usage of the hacks, -# not xscreensaver-demo (thus we have to test again to get +# not xscreensaver-settings (thus we have to test again to get # the libraries right: don't want to pull in all of GTK # for the hacks.) # @@ -14263,7 +16136,6 @@ else with_gdk_pixbuf=yes fi - # if --with-pixbuf=/directory/ was specified, remember that directory so that # we can also look for the `gdk-pixbuf-config' program in that directory. case "$with_gdk_pixbuf" in @@ -14275,7 +16147,6 @@ case "$with_gdk_pixbuf" in ;; esac - case "$with_gdk_pixbuf" in yes) ;; no) ;; @@ -14319,7 +16190,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf" exit 1 @@ -14360,7 +16230,6 @@ $as_echo "$ac_cv_gdk_pixbuf_config_libs" >&6; } ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs - if test "$have_gdk_pixbuf" = yes; then # # we appear to have pixbuf; check for headers/libs to be sure. @@ -14383,7 +16252,6 @@ if test "x$ac_cv_header_gdk_pixbuf_gdk_pixbuf_h" = xyes; then : have_gdk_pixbuf=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" # if that worked, check for header B... @@ -14403,7 +16271,6 @@ if test "x$ac_cv_header_gdk_pixbuf_gdk_pixbuf_xlib_h" = xyes; then : gdk_pixbuf_halfassed=no fi - CPPFLAGS="$ac_save_CPPFLAGS" # yay, it has a new name in Gtk 2.x... @@ -14423,7 +16290,6 @@ if test "x$ac_cv_header_gdk_pixbuf_xlib_gdk_pixbuf_xlib_h" = xyes; then : gdk_pixbuf_halfassed=no fi - CPPFLAGS="$ac_save_CPPFLAGS" fi fi @@ -14650,168 +16516,6 @@ fi fi fi - -############################################################################### -# -# Check for -ljpeg -# -############################################################################### - -have_jpeg=no -with_jpeg_req=unspecified -jpeg_halfassed=no - -# Check whether --with-jpeg was given. -if test "${with_jpeg+set}" = set; then : - withval=$with_jpeg; with_jpeg="$withval"; with_jpeg_req="$withval" -else - with_jpeg=yes -fi - - - - case "$with_jpeg" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG headers" >&5 -$as_echo_n "checking for JPEG headers... " >&6; } - d=$with_jpeg/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG libs" >&5 -$as_echo_n "checking for JPEG libs... " >&6; } - d=$with_jpeg/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_jpeg_req="yes" - with_jpeg=$with_jpeg_req - ;; - - *) - echo "" - echo "error: argument to --with-jpeg must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then - echo "error: must be yes or no: --with-jpeg=$with_jpeg" - exit 1 -fi - -if test "$with_jpeg" = yes; then - - have_jpeg=no - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : - have_jpeg=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - - if test "$have_jpeg" = yes; then - # we have the header, now check for the library - have_jpeg=no - jpeg_halfassed=yes - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" -# ac_save_LIBS="$LIBS" - - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - # note: $X_CFLAGS includes $x_includes - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - if test \! -z "$libdir" ; then - LDFLAGS="$LDFLAGS -L$libdir" - fi - # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5 -$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ljpeg $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char jpeg_start_compress (); -int -main () -{ -return jpeg_start_compress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_jpeg_jpeg_start_compress=yes -else - ac_cv_lib_jpeg_jpeg_start_compress=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then : - have_jpeg=yes - jpeg_halfassed=no - JPEG_LIBS="-ljpeg" - $as_echo "#define HAVE_JPEGLIB 1" >>confdefs.h - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -# LIBS="$ac_save_LIBS" - - fi -fi - - ############################################################################### # # Check for -lXft @@ -14889,7 +16593,6 @@ if test "$have_xutf8drawstring" = yes ; then fi - have_xft=no with_xft_req=unspecified xft_halfassed=no @@ -14901,8 +16604,6 @@ else with_xft=yes fi - - case "$with_xft" in yes) ;; no) ;; @@ -14946,7 +16647,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$with_xft" != yes -a "$with_xft" != no ; then echo "error: must be yes or no: --with-xft=$with_xft" exit 1 @@ -15003,7 +16703,6 @@ if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : have_xft=yes fi - CPPFLAGS="$ac_save_CPPFLAGS" CPPFLAGS="$ac_save_xft_CPPFLAGS" @@ -15100,220 +16799,6 @@ else XFT_OBJS='$(UTILS_BIN)/xft.o' fi - -############################################################################### -# -# Check for -lsystemd -# -############################################################################### - -have_systemd=no -with_systemd_req=unspecified -systemd_halfassed=no - -# Check whether --with-systemd was given. -if test "${with_systemd+set}" = set; then : - withval=$with_systemd; with_systemd="$withval"; with_systemd_req="$withval" -else - with_systemd=yes -fi - - - - case "$with_systemd" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd headers" >&5 -$as_echo_n "checking for systemd headers... " >&6; } - d=$with_systemd/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd libs" >&5 -$as_echo_n "checking for systemd libs... " >&6; } - d=$with_systemd/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_systemd_req="yes" - with_systemd=$with_systemd_req - ;; - - *) - echo "" - echo "error: argument to --with-systemd must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_systemd" != yes -a "$with_systemd" != no ; then - echo "error: must be yes or no: --with-systemd=$with_systemd" - exit 1 -fi - -if test "$with_systemd" = yes; then - - pkgs='' - ok="yes" - pkg_check_version libsystemd 221 - have_systemd="$ok" - - if test "$have_systemd" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd includes" >&5 -$as_echo_n "checking for libsystemd includes... " >&6; } -if ${ac_cv_systemd_config_cflags+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_systemd_config_cflags=`$pkg_config --cflags $pkgs` -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_cflags" >&5 -$as_echo "$ac_cv_systemd_config_cflags" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd libs" >&5 -$as_echo_n "checking for libsystemd libs... " >&6; } -if ${ac_cv_systemd_config_libs+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_systemd_config_libs=`$pkg_config --libs $pkgs` -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_libs" >&5 -$as_echo "$ac_cv_systemd_config_libs" >&6; } - fi - - ac_systemd_config_cflags=$ac_cv_systemd_config_cflags - ac_systemd_config_libs=$ac_cv_systemd_config_libs - - if test "$have_systemd" = yes; then - # - # we appear to have libsystemd; check for headers/libs to be sure. - # - ac_save_systemd_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_systemd_config_cflags" - - have_systemd=no - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-bus.h" "ac_cv_header_systemd_sd_bus_h" "$ac_includes_default" -if test "x$ac_cv_header_systemd_sd_bus_h" = xyes; then : - have_systemd=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - - CPPFLAGS="$ac_save_systemd_CPPFLAGS" - fi - - if test "$have_systemd" = yes; then - # we have the headers, now check for the libraries - have_systemd=no - systemd_halfassed=yes - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability..." >&5 -$as_echo "checking for libsystemd usability..." >&6; } - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" -# ac_save_LIBS="$LIBS" - - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - # note: $X_CFLAGS includes $x_includes - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - if test \! -z "$libdir" ; then - LDFLAGS="$LDFLAGS -L$libdir" - fi - # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_bus_open_system in -lc" >&5 -$as_echo_n "checking for sd_bus_open_system in -lc... " >&6; } -if ${ac_cv_lib_c_sd_bus_open_system+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $ac_systemd_config_libs -lX11 -lXext -lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sd_bus_open_system (); -int -main () -{ -return sd_bus_open_system (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_sd_bus_open_system=yes -else - ac_cv_lib_c_sd_bus_open_system=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sd_bus_open_system" >&5 -$as_echo "$ac_cv_lib_c_sd_bus_open_system" >&6; } -if test "x$ac_cv_lib_c_sd_bus_open_system" = xyes; then : - have_systemd=yes -fi - - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -# LIBS="$ac_save_LIBS" - - fi - - if test "$have_systemd" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability... no" >&5 -$as_echo "checking for libsystemd usability... no" >&6; } - fi -fi - -if test "$have_systemd" = yes; then - INCLUDES="$INCLUDES $ac_systemd_config_cflags" - EXES_SYSTEMD='$(EXES_SYSTEMD)' - $as_echo "#define HAVE_LIBSYSTEMD 1" >>confdefs.h - -else - EXES_SYSTEMD='' -fi - - ############################################################################### # # Check for pty support: this allows 'phosphor' and 'apple2' @@ -15335,7 +16820,6 @@ fi done - ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" # ac_save_LIBS="$LIBS" @@ -15401,9 +16885,8 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" - if test "$ac_have_forkpty" != yes ; then - # we don't need (or have) -lutil on MacOS 10.4.2... + # we don't need (or have) -lutil on macOS 10.4.2... ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -15473,602 +16956,56 @@ fi ############################################################################### # -# Check for the XSHM server extension. +# Check for libcap, which allows "sonar" to work without setuid. +# Except, nevermind, that's bad. See comments in sonar-icmp.c. # ############################################################################### -have_xshm=no -with_xshm_req=unspecified - -# Check whether --with-xshm-ext was given. -if test "${with_xshm_ext+set}" = set; then : - withval=$with_xshm_ext; with_xshm="$withval"; with_xshm_req="$withval" -else - with_xshm=yes -fi - - - - case "$with_xshm" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM headers" >&5 -$as_echo_n "checking for XSHM headers... " >&6; } - d=$with_xshm/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHM libs" >&5 -$as_echo_n "checking for XSHM libs... " >&6; } - d=$with_xshm/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_xshm_req="yes" - with_xshm=$with_xshm_req - ;; - - *) - echo "" - echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_xshm" = yes; then - - # first check for Xshm.h. - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "#include <X11/Xlib.h> -" -if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes; then : - have_xshm=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - - # if that succeeded, then check for sys/ipc.h. - if test "$have_xshm" = yes; then - have_xshm=no - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ipc_h" = xyes; then : - have_xshm=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - fi - - # if that succeeded, then check for sys/shm.h. - if test "$have_xshm" = yes; then - have_xshm=no - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_shm_h" = xyes; then : - have_xshm=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - fi - - # AIX is pathological, as usual: apparently it's normal for the Xshm headers - # to exist, but the library code to not exist. And even better, the library - # code is in its own library: libXextSam.a. So, if we're on AIX, and that - # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and - # that's not quite right, but close enough.) - # - case "$host" in - *-aix*) - if `uname -v` -eq 3 ; then - have_xshm=no - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" -# ac_save_LIBS="$LIBS" - - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - # note: $X_CFLAGS includes $x_includes - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - if test \! -z "$libdir" ; then - LDFLAGS="$LDFLAGS -L$libdir" - fi - # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXextSam" >&5 -$as_echo_n "checking for XShmQueryExtension in -lXextSam... " >&6; } -if ${ac_cv_lib_XextSam_XShmQueryExtension+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXextSam -lX11 -lXext -lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XShmQueryExtension (); -int -main () -{ -return XShmQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_XextSam_XShmQueryExtension=yes -else - ac_cv_lib_XextSam_XShmQueryExtension=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XextSam_XShmQueryExtension" >&5 -$as_echo "$ac_cv_lib_XextSam_XShmQueryExtension" >&6; } -if test "x$ac_cv_lib_XextSam_XShmQueryExtension" = xyes; then : - have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam" -else - true -fi - - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -# LIBS="$ac_save_LIBS" - - fi - ;; - esac - - # if that succeeded, then we've really got it. - if test "$have_xshm" = yes; then - $as_echo "#define HAVE_XSHM_EXTENSION 1" >>confdefs.h - - fi - -elif test "$with_xshm" != no; then - echo "error: must be yes or no: --with-xshm-ext=$with_xshm" - exit 1 -fi - - -############################################################################### -# -# Check for the DOUBLE-BUFFER server extension. -# -############################################################################### - -have_xdbe=no -with_xdbe_req=unspecified - -# Check whether --with-xdbe-ext was given. -if test "${with_xdbe_ext+set}" = set; then : - withval=$with_xdbe_ext; with_xdbe="$withval"; with_xdbe_req="$withval" -else - with_xdbe=yes -fi - - - - case "$with_xdbe" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER headers" >&5 -$as_echo_n "checking for DOUBLE-BUFFER headers... " >&6; } - d=$with_xdbe/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOUBLE-BUFFER libs" >&5 -$as_echo_n "checking for DOUBLE-BUFFER libs... " >&6; } - d=$with_xdbe/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_xdbe_req="yes" - with_xdbe=$with_xdbe_req - ;; - - *) - echo "" - echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_xdbe" = yes; then - - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xdbe.h" "ac_cv_header_X11_extensions_Xdbe_h" "#include <X11/Xlib.h> -" -if test "x$ac_cv_header_X11_extensions_Xdbe_h" = xyes; then : - have_xdbe=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - if test "$have_xdbe" = yes; then - $as_echo "#define HAVE_DOUBLE_BUFFER_EXTENSION 1" >>confdefs.h - - fi - -elif test "$with_xdbe" != no; then - echo "error: must be yes or no: --with-xdbe-ext=$with_xshm" - exit 1 -fi - - -############################################################################### -# -# Check for the SGI XReadDisplay server extension. -# -# Note: this has to be down here, rather than up with the other server -# extension tests, so that the output of `configure --help' is in the -# right order. Arrgh! -# -############################################################################### - -have_readdisplay=no -with_readdisplay_req=unspecified - -# Check whether --with-readdisplay was given. -if test "${with_readdisplay+set}" = set; then : - withval=$with_readdisplay; with_readdisplay="$withval"; with_readdisplay_req="$withval" -else - with_readdisplay=yes -fi - - - - case "$with_readdisplay" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay headers" >&5 -$as_echo_n "checking for XReadDisplay headers... " >&6; } - d=$with_readdisplay/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadDisplay libs" >&5 -$as_echo_n "checking for XReadDisplay libs... " >&6; } - d=$with_readdisplay/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_readdisplay_req="yes" - with_readdisplay=$with_readdisplay_req - ;; - - *) - echo "" - echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_readdisplay" = yes; then - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/readdisplay.h" "ac_cv_header_X11_extensions_readdisplay_h" "#include <X11/Xlib.h> -" -if test "x$ac_cv_header_X11_extensions_readdisplay_h" = xyes; then : - $as_echo "#define HAVE_READ_DISPLAY_EXTENSION 1" >>confdefs.h - -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" -elif test "$with_readdisplay" != no; then - echo "error: must be yes or no: --with-readdisplay=$with_readdisplay" - exit 1 -fi - +have_libcap=no +setcap_hacks_default=no +setcap_hacks="$setcap_hacks_default" +setcap_hacks_req=unspecified -############################################################################### +#AC_ARG_WITH(setcap-hacks, +#[ --with-setcap-hacks Build the "sonar" demo with libcap, which allows +# it to ping other hosts without being setuid.], +# [setcap_hacks="$withval"; setcap_hacks_req="$withval"], +# [setcap_hacks=yes]) # -# Check for a directory full of images to use as the default value -# of the "imageDirectory" preference. +#HANDLE_X_PATH_ARG(setcap_hacks, --with-setcap-hacks, setcap hacks) # -############################################################################### - -have_imagedir=no -with_imagedir_req=unspecified - - -# Check whether --with-image-directory was given. -if test "${with_image_directory+set}" = set; then : - withval=$with_image_directory; with_imagedir="$withval"; with_imagedir_req="$withval" -else - with_imagedir=yes -fi - -# no HANDLE_X_PATH_ARG for this one - -case "$with_imagedir" in - /*) - # absolute path - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $with_imagedir" >&5 -$as_echo_n "checking for image directory $with_imagedir... " >&6; } - if test -d "$with_imagedir" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_imagedir="" - fi - ;; - yes) - with_imagedir="" - - #### Could use some more defaults here... - for dd in \ - "/usr/share/backgrounds/images/" \ - "/usr/share/wallpapers/" \ - "/Library/Desktop Pictures/" \ - ; do - if test -z "$with_imagedir"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for image directory $dd" >&5 -$as_echo_n "checking for image directory $dd... " >&6; } - if test -d "$dd" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_imagedir="$dd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - done - - ;; - no) - with_imagedir="" - ;; - - *) - echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req" - exit 1 - ;; -esac -ac_cv_imagedir="$with_imagedir" - -DEFAULT_IMAGES_P='True' -DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir" - -if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then - DEFAULT_IMAGES_P='False' -fi - - -############################################################################### +#if test "$setcap_hacks" != yes -a "$setcap_hacks" != no ; then +# echo "error: must be yes or no: --with-setcap-hacks=$setcap_hacks" +# exit 1 +#fi # -# Pick a text file to use as the default of the "textFile" preference. -# Any old file will do, but preferably one that will make interesting -# shapes when displayed by "starwars" and "fontglide". +#if test "$setcap_hacks" = yes; then # -############################################################################### - -have_textfile=no -with_textfile_req=unspecified - - -# Check whether --with-text-file was given. -if test "${with_text_file+set}" = set; then : - withval=$with_text_file; with_textfile="$withval"; with_textfile_req="$withval" -else - with_textfile=yes -fi - -# no HANDLE_X_PATH_ARG for this one - -case "$with_textfile" in - /*) - # absolute path - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for text file $with_textfile" >&5 -$as_echo_n "checking for text file $with_textfile... " >&6; } - if test -f "$with_textfile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_textfile="" - fi - ;; - yes) - with_textfile="" - - #### Could use some more defaults here... - for f in \ - "/usr/X11R6/lib/X11/doc/README" \ - "/usr/share/doc/xserver-common/copyright" \ - "/usr/share/doc/xserver-xorg-core/copyright" \ - "/usr/X11R6/README" \ - "/usr/share/doc/libX11*/COPYING" \ - "/usr/X11/share/X11/doc/README*" \ - "/usr/share/doc/debian/debian-manifesto" \ - ; do - if test -z "$with_textfile"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for text file $f" >&5 -$as_echo_n "checking for text file $f... " >&6; } - f=`/bin/ls $f 2>&- | head -1` - if test -f "$f" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_textfile="$f" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - done - - ;; - no) - with_textfile="" - ;; - - *) - echo "error: must be an absolute path: --with-text-file=$with_textfile_req" - exit 1 - ;; -esac -ac_cv_textfile="$with_textfile" - -DEFAULT_TEXT_FILE="$ac_cv_textfile" - +# AC_CHECK_PROGS(setcap_program, setcap) +# if test "$setcap_program" != ''; then +# AC_CHECK_X_HEADER(sys/capability.h, [have_setcap=yes]) +# fi +# if test "$have_setcap" = yes; then +# AC_CHECK_X_LIB(cap, cap_set_flag, +# [have_libcap=yes +# PROG_SETCAP="$setcap_program" +# LIBCAP_LIBS="-lcap" +# AC_DEFINE(HAVE_LIBCAP)]) +# fi +#fi ############################################################################### # -# Check the browser to see help URL +# Sonar must be setuid to be able to ping other hosts. # ############################################################################### -have_browser=no -with_browser_req=unspecified - - -# Check whether --with-browser was given. -if test "${with_browser+set}" = set; then : - withval=$with_browser; with_browser="$withval"; with_browser_req="$withval" +if test "$have_libcap" = yes; then + setuid_hacks_default=no else - with_browser=no + setuid_hacks_default=yes fi -# no HANDLE_X_PATH_ARG for this one - -case "$with_browser" in - no ) - ;; - * ) - WITH_BROWSER=$with_browser - gnome_open_program=$with_browser - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for browser $with_browser" >&5 -$as_echo_n "checking for browser $with_browser... " >&6; } - with_browser_fullpath=`which $with_browser 2>/dev/null` - case $with_browser_fullpath in - /* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_browser=yes - ;; - * ) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -# Only warning: we don't want to install all packages for the -# dependency of the browser in building stage... - echo "WARNING: browser not found: --with-browser=$with_browser" - ;; - esac - ;; -esac -ac_cv_browser="$with_browser" - -############################################################################### -# -# Check whether it's ok to install some hacks as setuid (e.g., "sonar") -# This should be safe, but let's give people the option. -# -############################################################################### - -setuid_hacks_default=no setuid_hacks="$setuid_hacks_default" # Check whether --with-setuid-hacks was given. @@ -16078,8 +17015,6 @@ else setuid_hacks="$setuid_hacks_default" fi - - case "$setuid_hacks" in yes) ;; no) ;; @@ -16123,7 +17058,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$setuid_hacks" = yes; then true elif test "$setuid_hacks" != no; then @@ -16131,208 +17065,6 @@ elif test "$setuid_hacks" != no; then exit 1 fi - -############################################################################### -# -# Check for setcap, which is less worrying than setuid. -# -############################################################################### - -have_libcap=no -setcap_hacks_default=yes -setcap_hacks="$setcap_hacks_default" -setcap_hacks_req=unspecified - -# Check whether --with-setcap-hacks was given. -if test "${with_setcap_hacks+set}" = set; then : - withval=$with_setcap_hacks; setcap_hacks="$withval"; setcap_hacks_req="$withval" -else - setcap_hacks=yes -fi - - - - case "$setcap_hacks" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setcap hacks headers" >&5 -$as_echo_n "checking for setcap hacks headers... " >&6; } - d=$setcap_hacks/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setcap hacks libs" >&5 -$as_echo_n "checking for setcap hacks libs... " >&6; } - d=$setcap_hacks/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - setcap_hacks_req="yes" - setcap_hacks=$setcap_hacks_req - ;; - - *) - echo "" - echo "error: argument to --with-setcap-hacks must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$setcap_hacks" != yes -a "$setcap_hacks" != no ; then - echo "error: must be yes or no: --with-setcap-hacks=$setcap_hacks" - exit 1 -fi - -if test "$setcap_hacks" = yes; then - - for ac_prog in setcap -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_setcap_program+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$setcap_program"; then - ac_cv_prog_setcap_program="$setcap_program" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_setcap_program="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -setcap_program=$ac_cv_prog_setcap_program -if test -n "$setcap_program"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $setcap_program" >&5 -$as_echo "$setcap_program" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$setcap_program" && break -done - - if test "$setcap_program" != ''; then - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_capability_h" = xyes; then : - have_setcap=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - fi - if test "$have_setcap" = yes; then - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" -# ac_save_LIBS="$LIBS" - - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - # note: $X_CFLAGS includes $x_includes - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - if test \! -z "$libdir" ; then - LDFLAGS="$LDFLAGS -L$libdir" - fi - # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_set_flag in -lcap" >&5 -$as_echo_n "checking for cap_set_flag in -lcap... " >&6; } -if ${ac_cv_lib_cap_cap_set_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cap_set_flag (); -int -main () -{ -return cap_set_flag (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cap_cap_set_flag=yes -else - ac_cv_lib_cap_cap_set_flag=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_set_flag" >&5 -$as_echo "$ac_cv_lib_cap_cap_set_flag" >&6; } -if test "x$ac_cv_lib_cap_cap_set_flag" = xyes; then : - have_libcap=yes - PROG_SETCAP="$setcap_program" - LIBCAP_LIBS="-lcap" - $as_echo "#define HAVE_LIBCAP 1" >>confdefs.h - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -# LIBS="$ac_save_LIBS" - - fi -fi - - ############################################################################### # # Check for --with-record-animation @@ -16349,8 +17081,6 @@ else record_anim="$record_anim_default" fi - - case "$record_anim" in yes) ;; no) ;; @@ -16394,7 +17124,6 @@ $as_echo "not found ($d: no such directory)" >&6; } ;; esac - if test "$record_anim" = yes; then true elif test "$record_anim" != no; then @@ -16426,7 +17155,6 @@ DEPEND=makedepend DEPEND_FLAGS= DEPEND_DEFINES= - if test \! -z "$includedir" ; then INCLUDES="$INCLUDES -I$includedir" fi @@ -16435,19 +17163,17 @@ if test \! -z "$libdir" ; then LDFLAGS="$LDFLAGS -L$libdir" fi - PREFERRED_DEMO_PROGRAM='' ALL_DEMO_PROGRAMS= if test "$have_motif" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm + PREFERRED_DEMO_PROGRAM=xscreensaver-settings-Xm ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi if test "$have_gtk" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk + PREFERRED_DEMO_PROGRAM=xscreensaver-settings-Gtk ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi - if test "$have_kerberos" = yes; then PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)" PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)" @@ -16462,14 +17188,13 @@ if test "$enable_pam_check_account_type" = yes; then else COMMENT_PAM_CHECK_ACCOUNT="#" fi -if test "$have_passwd_helper" = yes; then - PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)" - PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)" -fi +#if test "$have_passwd_helper" = yes; then +# PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)" +# PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)" +#fi PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)" PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)" - if test "$enable_locking" = yes; then LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)' LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)' @@ -16488,13 +17213,10 @@ else MEN_OSX= fi - -INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)' - -if test "$need_setuid" = yes; then - NEED_SETUID=yes +if test "$setuid_auth" = yes; then + SETUID_AUTH=yes else - NEED_SETUID=no + SETUID_AUTH=no fi if test "$setuid_hacks" = yes; then @@ -16532,7 +17254,6 @@ if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then JPEG_EXES='$(JPEG_EXES)' fi - # Another substitution in the XScreenSaver.ad.in file: # if test "$gnome_open_program" != ''; then @@ -16549,7 +17270,6 @@ else NOGNOME='' fi - # Set PO_DATADIR to something sensible. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale directory" >&5 @@ -16574,9 +17294,9 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PO_DATADIR/locale" >&5 $as_echo "$PO_DATADIR/locale" >&6; } - # canonicalize slashes. HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` +FONT_DIR=`echo "${FONT_DIR}" | sed 's@/$@@;s@//*@/@g'` # gcc 3.0 likes to issue this warning for every file: # @@ -16588,101 +17308,15 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` # INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'` - ############################################################################### # # Perform substitutions and write Makefiles. # ############################################################################### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPDEFAULTS=$ac_x_app_defaults - - - - - - -ac_config_files="$ac_config_files Makefile utils/Makefile jwxyz/Makefile hacks/Makefile hacks/images/Makefile hacks/glx/Makefile po/Makefile.in driver/Makefile driver/xscreensaver.pam driver/xscreensaver-demo.glade2 driver/XScreenSaver.ad" +ac_config_files="$ac_config_files Makefile utils/Makefile jwxyz/Makefile hacks/Makefile hacks/fonts/Makefile hacks/images/Makefile hacks/glx/Makefile po/Makefile.in driver/Makefile driver/xscreensaver.pam driver/XScreenSaver.ad" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16792,12 +17426,8 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs - - ac_config_commands="$ac_config_commands po/stamp-it" - - : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files @@ -16842,7 +17472,6 @@ else esac fi - as_nl=' ' export as_nl @@ -16890,7 +17519,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. @@ -16944,7 +17572,6 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH - # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are @@ -16961,7 +17588,6 @@ as_fn_error () as_fn_exit $as_status } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -17023,7 +17649,6 @@ else } fi # as_fn_arith - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -17109,7 +17734,6 @@ fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null - # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. @@ -17155,7 +17779,6 @@ $as_echo X"$as_dir" | test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' @@ -17164,7 +17787,6 @@ else as_mkdir_p=false fi - # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. @@ -17181,7 +17803,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## @@ -17216,7 +17837,6 @@ case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" @@ -17378,7 +17998,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # - _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -17393,12 +18012,12 @@ do "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "jwxyz/Makefile") CONFIG_FILES="$CONFIG_FILES jwxyz/Makefile" ;; "hacks/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/Makefile" ;; + "hacks/fonts/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/fonts/Makefile" ;; "hacks/images/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/images/Makefile" ;; "hacks/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hacks/glx/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "driver/Makefile") CONFIG_FILES="$CONFIG_FILES driver/Makefile" ;; "driver/xscreensaver.pam") CONFIG_FILES="$CONFIG_FILES driver/xscreensaver.pam" ;; - "driver/xscreensaver-demo.glade2") CONFIG_FILES="$CONFIG_FILES driver/xscreensaver-demo.glade2" ;; "driver/XScreenSaver.ad") CONFIG_FILES="$CONFIG_FILES driver/XScreenSaver.ad" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; @@ -17406,7 +18025,6 @@ do esac done - # If the user did not use the arguments to specify the items to instantiate, # 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 @@ -17449,7 +18067,6 @@ ac_tmp=$tmp # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then - ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this @@ -17467,7 +18084,6 @@ fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF - { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && @@ -17710,7 +18326,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" - eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag @@ -17838,7 +18453,6 @@ case $srcdir in esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - case $ac_mode in :F) # @@ -17954,7 +18568,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac - case $ac_file$ac_mode in "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile @@ -17983,7 +18596,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} esac done # for ac_tag - as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save @@ -17991,7 +18603,6 @@ ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open @@ -18017,7 +18628,6 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi - ############################################################################### # # Print some warnings at the end. @@ -18073,7 +18683,6 @@ noteL() { warn_prefix="$warn_prefix_1" } - # ac_prog_cc_no_pthread normally only happens on AIX, because according # to AX_PTHREAD, AIX needs CC=xlc_r or CC=cc_r to do threads. # If CC is specified, it takes precedence over --with-pthread. @@ -18094,6 +18703,10 @@ if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then warn 'The XIdle extension was requested, but was not found.' fi +if test "$with_mit_req" = yes -a "$have_mit" = no ; then + warn 'The MIT-SCREEN-SAVER extension was requested, but was not found.' +fi + if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then warn 'The XSHM extension was requested, but was not found.' fi @@ -18102,6 +18715,14 @@ if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then warn 'The DOUBLE-BUFFER extension was requested, but was not found.' fi +#if test "$with_xcomposite_req" = yes -a "$have_xcomposite" = no ; then +# warn 'The XCOMPOSITE extension was requested, but was not found.' +#fi + +if test "$with_xkb_req" = yes -a "$have_xkb" = no ; then + warn 'The X Keyboard extension was requested, but was not found.' +fi + if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.' fi @@ -18141,21 +18762,13 @@ else fi if test "$gtk_halfassed" != no ; then - warnL "GTK version $gtk_halfassed was found, but at least one supporting" - warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used." - warn2 "Perhaps some of the development packages are not installed?" - if test "$have_gtk" = yes ; then - v="$ac_gtk_version_string" - warn2 "GTK $v is also installed, so it will be used instead." - warn2 "Please read the above output and the \`config.log' file" - warn2 "for more details." - fi + warnL "GTK was found, but $gtk_halfassed_lib was not, so GTK can't be used." fi motif_warn2() { warn2 'Though the Motif front-end to xscreensaver is still' warn2 'maintained, it is no longer being updated with new' - warn2 'features: all new development on the xscreensaver-demo' + warn2 'features: all new development on the xscreensaver-settings' warn2 'program is happening in the GTK version, and not in the' warn2 'Motif version. It is recommended that you build against' warn2 'GTK instead of Motif. See <http://www.gtk.org/>.' @@ -18165,12 +18778,12 @@ if test "$have_motif" = no -a "$have_gtk" = no; then if test "$with_motif" = yes; then warnL "Neither the GTK nor Motif libraries were found; the" - warn2 "\`xscreensaver-demo' program requires one of these." + warn2 "\`xscreensaver-settings' program requires one of these." echo '' motif_warn2 else warnL "The GTK libraries do not seem to be available; the" - warn2 "\`xscreensaver-demo' program requires them." + warn2 "\`xscreensaver-settings' program requires them." # echo '' # warn2 'You can use Motif or Lesstif instead of GTK (use the' # warn2 "\`--with-motif' option) but that is NOT recommended." @@ -18181,25 +18794,13 @@ elif test "$with_motif_req" = yes -a "$have_motif" = no ; then warnL "Use of Motif was requested, but it wasn't found;" warn2 "Gtk will be used instead." -elif test "$jurassic_gtk" = yes ; then - - pref_gtk=2.0 - - v="$ac_gtk_version_string" - if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then - warnL "Use of Gtk was requested, but its version number is unknown;" - elif test "$with_gtk_req" = yes ; then - warnL "Use of Gtk was requested, but it is version $v;" - else - warnL "Gtk was found on this system, but it is version $v;" - fi - - warn2 "Gtk $pref_gtk or newer is required." - elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then warnL "Use of Gtk was requested, but it wasn't found." fi +if test "$ac_cv_libxt" != yes ; then + warnL 'The Xt library was not found. It is required.' +fi if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then warn "GTK is being used, but the GDK-Pixbuf library and/or" @@ -18225,13 +18826,17 @@ if test "$have_motif" = yes -a "$have_lesstif" = yes ; then fi fi - if test "$have_motif" = yes -a "$have_gtk" = no ; then warn 'Motif is being used, and GTK is not.' echo '' motif_warn2 fi +halfassery() { + echo '' + warn2 "More specifically, we found the headers but not the" + warn2 "libraries. Possibly a 'devel' package is needed." +} if test "$with_gdk_pixbuf_req" = yes -a "$have_gdk_pixbuf" = no; then warnL 'Use of GDK-Pixbuf was requested, but it was not found.' @@ -18248,14 +18853,7 @@ if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \ warnL 'The GDK-Pixbuf library was not found.' fi - if test "$gdk_pixbuf_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'libraries; so either GDK-Pixbuf is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - fi - + if test "$gdk_pixbuf_halfassed" = yes ; then halfassery ; fi if test "$have_png" = yes ; then echo '' warn2 'The PNG library is being used instead.' @@ -18267,26 +18865,18 @@ if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \ warn2 'configure.' fi - if test "$have_jpeg" = no ; then if test "$with_jpeg_req" = yes ; then warnL 'Use of libjpeg was requested, but it was not found.' elif test "$with_jpeg_req" = no ; then - noteL 'The JPEG library is not being used.' + warnL 'The JPEG library is not being used.' else - noteL 'The JPEG library was not found.' - fi - - if test "$jpeg_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'library; so either JPEG is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - echo '' + warnL 'The JPEG library was not found.' fi + if test "$jpeg_halfassed" = yes ; then halfassery ; fi if test "$have_gdk_pixbuf" = no ; then + echo '' warn2 "This means that it won't be possible for the image-manipulating" warn2 "display modes to load files from disk; and it also means that" warn2 "the \`webcollage' program will be much slower." @@ -18295,101 +18885,58 @@ if test "$have_jpeg" = no ; then fi fi - if test "$have_png" = no ; then if test "$with_png_req" = yes ; then warnL 'Use of libpng was requested, but it was not found.' elif test "$with_png_req" = no ; then - noteL 'The PNG library is not being used.' + warnL 'The PNG library is not being used.' else - noteL 'The PNG library was not found.' - fi - - if test "$png_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'library; so either PNG is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - echo '' + warnL 'The PNG library was not found.' fi + if test "$png_halfassed" = yes ; then halfassery ; fi warn2 "Many things aren't going to work right." fi +if test "$have_xinput" = no ; then + warnL 'The XInput2 library was not found. It is required.' + if test "$xinput_halfassed" = yes ; then halfassery ; else echo '' ; fi +fi if test "$have_xft" = no ; then - if test "$with_xft_req" = yes ; then - warnL "Use of libXft was requested, but it was not found." - elif test "$with_xft_req" = no ; then - noteL 'The Xft library is not being used.' - else - noteL "The Xft library was not found." - fi - - if test "$xft_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'libraries; so either Xft is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - echo '' - fi - - warn2 "This means that fonts won't be anti-aliased." + warnL 'The XFreeType library was not found. It is required.' + if test "$xft_halfassed" = yes ; then halfassery ; else echo '' ; fi fi - if test "$have_systemd" = no ; then systemd_warned=no - if test "$with_systemd_req" = yes ; then + if test "$systemd_too_old" = yes ; then + warnL "The systemd library is too old." + systemd_warned=yes + elif test "$with_systemd_req" = yes ; then warnL "Use of systemd was requested, but it was not found." systemd_warned=yes - elif test "$with_systemd_req" = no ; then + elif test "$ac_macosx" = yes; then true - # noteL 'The systemd library is not being used.' - # systemd_warned=yes + elif test "$with_systemd_req" = no ; then + noteL 'The systemd library is not being used.' + systemd_warned=yes else - true - # noteL "The systemd library was not found." - # systemd_warned=yes + warnL "The systemd library was not found." + systemd_warned=yes fi if test "$systemd_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'libraries; so either systemd is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - echo '' + halfassery systemd_warned=yes fi if test "$systemd_warned" = yes; then + echo '' warn2 "This means that xscreensaver-systemd won't be built." - fi -fi - - -if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then - preferred_mesagl=3.4 - mgv="$ac_mesagl_version_string" - pgl="$preferred_mesagl" - - if test "$ac_mesagl_version" = unknown; then - true - # warnL "Unable to determine the MesaGL version number!" - # warn2 "Make sure you are using version $preferred_mesagl or newer." - - elif test \! "$ac_mesagl_version" -gt 2006; then - warnL "MesaGL version number is $mgv --" - warn2 "MesaGL 2.6 and earlier have a security bug. It is strongly" - warn2 "recommended that you upgrade to at least version $preferred_mesagl." - - elif test \! "$ac_mesagl_version" -gt 3003; then - warnL "MesaGL version number is $mgv --" - warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended" - warn2 "that you upgrade to $pgl or newer." + warn2 "Without that, xscreensaver will not be able to auto-lock" + warn2 "before the system is suspended (e.g., closing laptop lid)" + warn2 "and might activate while video playback is in progress." fi fi @@ -18403,11 +18950,11 @@ if test "$have_gl" = no ; then fi if test "$gl_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'libraries; so either GL is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' + halfassery + if test "$have_glx" = no -a "$have_egl" = no; then + echo '' + warn2 'Neither EGL nor GLX were found.' + fi fi echo '' @@ -18417,7 +18964,6 @@ if test "$have_gl" = no ; then fi - if test "$have_gl" = yes -a "$have_gle" = no ; then # nobody cares about this; don't print the warning unless it was @@ -18436,13 +18982,7 @@ if test "$have_gl" = yes -a "$have_gle" = no ; then warn2 'library was not.' fi - if test "$gle_halfassed" = yes ; then - echo '' - warn2 'More specifically, we found the headers, but not the' - warn2 'libraries; so either GLE is half-installed on this' - warn2 "system, or something else went wrong. The \`config.log'" - warn2 'file might contain some clues.' - fi + if test "$gle_halfassed" = yes ; then halfassery ; fi echo '' warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)' @@ -18453,7 +18993,6 @@ if test "$have_gl" = yes -a "$have_gle" = no ; then fi fi - if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then warn 'Use of XReadDisplay was requested, but it was not found.' fi @@ -18464,6 +19003,12 @@ fi if test "$with_pam_req" = yes -a "$have_pam" = no ; then warn 'Use of PAM was requested, but it was not found.' +elif test "$have_pam" = no ; then + if test -d /etc/pam.d -o -f /etc/pam.conf ; then + warn "Your system seems to have PAM, but PAM is not being used." + warn2 "That is probably not going to work out well." + + fi fi if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then @@ -18474,29 +19019,34 @@ if test "$setcap_hacks_req" = yes -a "$have_libcap" = no ; then warn 'Use of libcap was requested, but it was not found.' fi -if test "$ac_macosx" = yes ; then - if test "$enable_locking" = yes ; then - warn "You have specified --enable-locking on MacOS X." - warn2 "THIS DOES NOT WORK! Don't do this!" - fi +if test "$ac_macosx" = yes -a "$enable_locking" = yes ; then + warn "You have specified --enable-locking on macOS." + warn2 "THIS DOES NOT WORK! Don't do this!" fi - # You are in a twisty maze of namespaces and syntaxes, all alike. +# Expand all of these as the Makefile will probably expand them. # Fuck the skull of Unix. # bindir=`eval eval eval eval eval eval eval echo $bindir` HACKDIR=`eval eval eval eval eval eval eval echo $HACKDIR` HACK_CONF_DIR=`eval eval eval eval eval eval eval echo $HACK_CONF_DIR` +FONT_DIR=`eval eval eval eval eval eval eval echo $FONT_DIR` # canonicalize slashes. bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'` HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'` HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` +FONT_DIR=`echo "${FONT_DIR}" | sed 's@/$@@;s@//*@/@g'` +if test -z "$FONT_DIR" ; then + FONT_DIR='not installed'; +else + FONT_DIR="${FONT_DIR}/" +fi # Sanity check the hackdir -for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do +for bad_choice in xscreensaver xscreensaver-settings xscreensaver-command ; do if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then echo "" as_fn_error $? "\"--with-hackdir=${bindir}/${bad_choice}\" won't work. @@ -18506,107 +19056,108 @@ for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do fi done +# Warn if there's a previous RPM package installed. -do_dir_warning=no +rpm_vers= +if test -z "$RPM_PACKAGE_VERSION" ; then + # Don't bother with this test if we are currently *building* an RPM. + rpmnames="xscreensaver xscreensaver-base xscreensaver-extras + xscreensaver-data xscreensaver-data-extra" -# Now let's warn if there's a previous RPM version already installed. -# But don't bother with this test if we are currently *building* an RPM. + # M4 sucks!! -if test -z "$RPM_PACKAGE_VERSION" ; then + pkg_vers=`(rpm -qv $rpmnames) 2>&- | \ + sed -n 's/^[-a-z]*-\([0-9][0-9]*[.].*\)/\1/p' | head -1` + rpm_vers="$pkg_vers" - rpmnames="xscreensaver xscreensaver-base xscreensaver-extras" +fi - # M4 sucks!! +if test \! -z "$rpm_vers" ; then - rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \ - sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \ - head -1` + # M4 sucks!! + pkg_bindir=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)xscreensaver-settings$@\1@p'` + pkg_bindir2=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)xscreensaver-demo$@\1@p'` + pkg_hackdir=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)popsquares$@\1@p'` + pkg_confdir=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)popsquares\.xml$@\1@p'` + pkg_fontdir=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)\.ttf$@\1@p'` + pkg_addir=`rpm -ql $rpmnames | sed -n 's@^\(.*/\)XScreenSaver$@\1@p'` - if test \! -z "$rpmv" ; then - rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'` - rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'` + if test -z "$pkg_bindir" ; then pkg_bindir="$pkg_bindir2" ; fi - warning=no - warnL "There is already an installed RPM of xscreensaver $rpmv" - warn2 'on this system. You might want to remove it ("rpm -ve")' - warn2 'before running "make install" in this directory.' - echo "" - warn2 "Alternately, you could build this version of xscreensaver" - warn2 'as an RPM, and then install that. An "xscreensaver.spec"' - warn2 'file is included. Try "rpmbuild -v -ba xscreensaver.spec".' - warn2 "See the RPM documentation for more info." - echo "" +fi - if test "$rpmbdir" = "$rpmhdir" ; then - warn2 "The RPM version was installed in $rpmbdir/." - do_dir_warning=yes - else - warn2 "The RPM version was installed in $rpmbdir/," - warn2 "with demos in $rpmhdir/." +# Warn if there's a previous Debian package installed. +# +deb_vers= +if test -z "$pkg_vers" ; then + debnames="xscreensaver xscreensaver-data xscreensaver-data-extra" + pkg_vers='' + for dpkg in $debnames ; do + if test -z "$pkg_vers"; then + pkg_vers=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'` + deb_vers="$pkg_vers" fi - fi + done fi -# Also warn if there's a Debian package installed. -# -debnames="xscreensaver xscreensaver-data xscreensaver-data-extra" -debv='' -for dpkg in $debnames ; do - if test -z "$debv"; then - debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'` - fi -done +if test \! -z "$deb_vers" ; then -if test \! -z "$debv" ; then - debbdir=`dpkg -L $debnames 2>/dev/null | \ - sed -n 's@^\(.*/bin/\)xscreensaver$@\1@p'` - debhdir=`dpkg -L $debnames 2>/dev/null | \ - sed -n 's@^\(.*/\)popsquares$@\1@p'` - if test -z "$debbdir" ; then debbdir='???'; fi - if test -z "$debhdir" ; then debhdir='???'; fi + # M4 sucks!! - warning=no - warnL "There is already an installed dpkg of xscreensaver" - warn2 "version \"$debv\" on this system." - echo "" - warn2 "The dpkg was installed in $debbdir," - warn2 "with demos in $debhdir." + pkg_bindir=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)xscreensaver-settings$@\1@p'` + pkg_bindir2=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)xscreensaver-demo$@\1@p'` + pkg_hackdir=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)popsquares$@\1@p'` + pkg_confdir=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)popsquares\.xml$@\1@p'` + pkg_fontdir=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)\.ttf$@\1@p'` + pkg_addir=`dpkg -L $debnames 2>&- | sed -n 's@^\(.*/\)XScreenSaver[^/]*$@\1@p'` + + if test -z "$pkg_bindir" ; then pkg_bindir="$pkg_bindir2" ; fi fi +bindir_err= +hackdir_err= +confdir_err= +fontdir_err= +addir_err= +if ! test -z "$pkg_vers" ; then -if test "${bindir}" = "${HACKDIR}" ; then - do_dir_warning=yes -fi + err=" (DIFFERS)" -if test "$do_dir_warning" = yes; then - echo "" - echo "$warnsep" - echo "" - echo ' When you run "make install", the "xscreensaver",' - echo ' "xscreensaver-demo", and "xscreensaver-command" executables' - echo " will be installed in ${bindir}/." - echo "" - echo " The various graphics demos (200+ different executables) will" - echo " be installed in ${HACKDIR}/." - echo "" - echo " If you would prefer the demos to be installed elsewhere," - echo " you should re-run configure with the --with-hackdir=DIR" - echo " option. For more information, run \`./configure --help'." - warning=yes -fi + if test -z "$pkg_bindir" ; then pkg_bindir='???' + elif test "$pkg_bindir" != "${bindir}/" ; then bindir_err="$err" ; fi -if test "$warning" != no; then - echo '' ; echo "$warnsep" ; echo '' -fi + if test -z "$pkg_hackdir" ; then pkg_hackdir='???' + elif test "$pkg_hackdir" != "${HACKDIR}/" ; then hackdir_err="$err"; fi -if test "$do_dir_warning" = no; then - if test "$warning" = no; then - echo '' - fi - echo "User programs will be installed in ${bindir}/" - echo "Screen savers will be installed in ${HACKDIR}/" - echo "Configuration dialogs will be installed in ${HACK_CONF_DIR}/" - echo "System-wide default settings will be installed in ${APPDEFAULTS}/" - echo '' -fi + if test -z "$pkg_confdir" ; then pkg_confdir='???' + elif test "$pkg_confdir" != "${HACK_CONF_DIR}/" ; then confdir_err="$err"; fi + + if test -z "$pkg_fontdir" ; then pkg_fontdir='none' + elif test "$pkg_fontdir/" != "${FONT_DIR}" ; then fontdir_err="$err"; fi + + if test -z "$pkg_addir" ; then pkg_addir='???' + elif test "$pkg_addir" != "${APPDEFAULTS}/" ; then addir_err="$err" ; fi + + warning=no + warnL "There is already an installed package of xscreensaver" + warn2 "version \"$pkg_vers\", in these directories:" + echo "" + warn2 "User programs: $pkg_bindir$bindir_err" + warn2 "Screen savers: $pkg_hackdir$hackdir_err" + warn2 "Configuration: $pkg_confdir$confdir_err" + warn2 "Extra fonts: $pkg_fontdir$fontdir_err" + warn2 "App Defaults: $pkg_addir$addir_err" +fi + +echo "" +echo "$warnsep" +echo "" +echo " XScreenSaver will be installed in these directories:" +echo "" +echo " User programs: ${bindir}/$bindir_err" +echo " Screen savers: ${HACKDIR}/$hackdir_err" +echo " Configuration: ${HACK_CONF_DIR}/$confdir_err" +echo " Extra Fonts: ${FONT_DIR}$fontdir_err" +echo " App Defaults: ${APPDEFAULTS}/$addir_err" +echo "" |