X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=configure.in;h=361fac21e5ca762100bb0daa8a3d18dfd11786e9;hb=a1d41b2aa6e18bf9a49b914a99dda8232c5d7762;hp=ed3a8193ef71517050cad4eaa218a3f7ed1c5705;hpb=c596d1306f5f92f7eab76224d3b049980a14adcb;p=xscreensaver diff --git a/configure.in b/configure.in index ed3a8193..361fac21 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski. +# configure.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski. # AC_INIT(driver/subprocs.c) @@ -46,7 +46,7 @@ AC_DEFUN(AC_PROG_CC_ANSI, ;; *-dec-* ) - AC_MSG_RESULT(DEC: adding -std1) + AC_MSG_RESULT(DEC: adding -std1 -ieee) CC="$CC -std1" ;; @@ -83,6 +83,63 @@ AC_DEFUN(AC_PROG_CC_ANSI, ]) +############################################################################### +# +# Functions 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!) +# +############################################################################### + +AC_DEFUN(AC_GCC_ACCEPTS_STD, + [if test -n "$GCC"; then + AC_CACHE_CHECK([whether gcc accepts -std], + ac_cv_gcc_accepts_std, + [if ( gcc -E -std=c89 - &1 >/dev/null | \ + grep unrecognized >/dev/null ); then + ac_cv_gcc_accepts_std=no + else + ac_cv_gcc_accepts_std=yes + fi]) + ac_gcc_accepts_std="$ac_cv_gcc_accepts_std" + fi +]) + +AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE, + [if test -n "$GCC"; then + AC_GCC_ACCEPTS_STD + AC_MSG_RESULT(Disabling C++ comments in ANSI C code.) + # + # 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="$CC -std=c89 -U__STRICT_ANSI__" + else + # The old way: + CC="$CC -Wp,-lang-c89" + fi + fi +]) + + ############################################################################### # # Function to figure out how to create directory trees. @@ -191,6 +248,26 @@ AC_DEFUN(AC_PROG_PERL, ]) +############################################################################### +# +# Function to demand "bc". Losers. +# +############################################################################### + +AC_DEFUN(AC_DEMAND_BC, + [ac_bc_result=`echo 6+9 | bc 2>/dev/null` + AC_MSG_CHECKING([for bc]) + if test "$ac_bc_result" = "15" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + echo '' + AC_MSG_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.]) + fi + ]) + ############################################################################### # # Functions to check how to do ICMP PING requests. @@ -228,7 +305,12 @@ AC_DEFUN(AC_CHECK_ICMP, i.icmp_id = 0; i.icmp_seq = 0; si.sin_family = AF_INET; - ip.ip_hl = 0;], + #if defined(__DECC) || defined(_IP_VHL) + ip.ip_vhl = 0; + #else + ip.ip_hl = 0; + #endif + ], [ac_cv_have_icmp=yes], [ac_cv_have_icmp=no])]) if test "$ac_cv_have_icmp" = yes ; then @@ -262,7 +344,7 @@ AC_DEFUN(AC_CHECK_ICMPHDR, struct ip ip; i.type = ICMP_ECHO; i.code = 0; - i.cksum = 0; + i.checksum = 0; i.un.echo.id = 0; i.un.echo.sequence = 0; si.sin_family = AF_INET; @@ -434,15 +516,15 @@ AC_DEFUN(AC_X_RANDOM_PATHS, # for version in X11R6 X11R5 X11R4 ; do # if either pair of directories exists... - if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib + if test -d /usr/include/$version || test -d /usr/contrib/$version/include then # if contrib exists, use it... - if test -d /usr/contrib/$version/lib ; then + if test -d /usr/contrib/$version/include ; then X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include" X_LIBS="$X_LIBS -L/usr/contrib/$version/lib" fi # if the "standard" one exists, use it. - if test -d /usr/lib/$version ; then + if test -d /usr/include/$version ; then X_CFLAGS="$X_CFLAGS -I/usr/include/$version" X_LIBS="$X_LIBS -L/usr/lib/$version" fi @@ -454,21 +536,29 @@ AC_DEFUN(AC_X_RANDOM_PATHS, # Now find Motif. Thanks for not making xmkmf find this by # default, you losers. # - if test -d /usr/lib/Motif1.2 ; then + if test -d /usr/include/Motif2.1 ; then + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1" + X_LIBS="$X_LIBS -L/usr/lib/Motif2.1" + elif test -d /usr/include/Motif1.2 ; then X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2" X_LIBS="$X_LIBS -L/usr/lib/Motif1.2" - elif test -d /usr/lib/Motif1.1 ; then + elif test -d /usr/include/Motif1.1 ; then X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1" X_LIBS="$X_LIBS -L/usr/lib/Motif1.1" fi # Now let's check for the pseudo-standard locations for OpenGL and XPM. # - if test -d /opt/Mesa/lib ; then + if test -d /opt/graphics/OpenGL/include ; then + # HP-UX 10.20 puts it here + X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS" + X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS" + elif test -d /opt/Mesa/lib ; then X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS" X_LIBS="-L/opt/Mesa/lib $X_LIBS" fi + if test -d /opt/xpm/lib/X11 ; then X_CFLAGS="-I/opt/xpm/include $X_CFLAGS" X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS" @@ -563,7 +653,7 @@ AC_DEFUN(AC_CHECK_X_LIB, [ LDFLAGS="$LDFLAGS -L$libdir" fi # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS" + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5]) CPPFLAGS="$ac_save_CPPFLAGS" @@ -652,15 +742,24 @@ AC_DEFUN(HANDLE_X_PATH_ARG, [ # random compiler setup AC_CANONICAL_HOST AC_PROG_CC_ANSI +AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE AC_PROG_CPP AC_C_CONST AC_C_INLINE +AC_DEMAND_BC # stuff for Makefiles AC_PROG_INSTALL AC_PROG_INSTALL_DIRS AC_PROG_MAKE_SET +# 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, +# but do not try to strip scripts.) +# +INSTALL_SCRIPT='${INSTALL}' + # random libc stuff AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h) @@ -674,7 +773,7 @@ AC_HEADER_DIRENT AC_GETTIMEOFDAY_ARGS AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv) -AC_CHECK_FUNCS(sigaction syslog realpath) +AC_CHECK_FUNCS(sigaction syslog realpath setrlimit) AC_CHECK_ICMP AC_CHECK_ICMPHDR AC_CHECK_HEADERS(crypt.h sys/select.h) @@ -682,7 +781,7 @@ AC_PROG_PERL if test -z "$PERL" ; then # don't let it be blank... - PERL=/usr/local/bin/perl5 + PERL=/usr/bin/perl fi AC_PATH_XTRA @@ -708,15 +807,11 @@ AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes]) if test "$have_xmu" = no ; then XMU_SRCS='$(UTILS_SRC)/xmu.c' XMU_OBJS='$(UTILS_BIN)/xmu.o' + XMU_LIBS='' else XMU_SRCS='' XMU_OBJS='' - SAVER_LIBS="-lXmu $SAVER_LIBS" - HACK_LIBS="-lXmu $HACK_LIBS" - MOTIF_LIBS="-lXmu $MOTIF_LIBS" - GTK_LIBS="-lXmu $GTK_LIBS" - ATHENA_LIBS="-lXmu $ATHENA_LIBS" - ATHENA3D_LIBS="-lXmu $ATHENA3D_LIBS" + XMU_LIBS='-lXmu' AC_DEFINE(HAVE_XMU) fi @@ -976,14 +1071,22 @@ if test "$with_dpms" = yes; then # first check for dpms.h AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes]) - # if that succeeded, then check for the -lXdpms + # if that succeeded, then check for the DPMS code in the libraries if test "$have_dpms" = yes; then + + # first look in -lXext (this is where it is with XFree86 4.0) have_dpms=no - AC_CHECK_X_LIB(Xdpms, DPMSInfo, - [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [true], - -lXext -lX11) + AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11) + + # if that failed, look in -lXdpms (this is where it was in XFree86 3.x) + if test "$have_dpms" = no; then + AC_CHECK_X_LIB(Xdpms, DPMSInfo, + [have_dpms=yes; XDPMS_LIBS="-lXdpms"], [true], + -lXext -lX11) + fi fi + # if that succeeded, then we've really got it. if test "$have_dpms" = yes; then AC_DEFINE(HAVE_DPMS_EXTENSION) @@ -997,7 +1100,7 @@ fi ############################################################################### # -# Check for the XF86VMODE server extension. +# Check for the XF86VMODE server extension (for virtual screens.) # ############################################################################### @@ -1034,6 +1137,67 @@ elif test "$with_xf86vmode" != no; then fi +############################################################################### +# +# Check for the XF86VMODE server extension (for gamma fading.) +# +############################################################################### + +have_xf86gamma=no +have_xf86gamma_ramp=no +with_xf86gamma_req=unspecified +AC_ARG_WITH(xf86gamma-ext, +[ --with-xf86gamma-ext Include support for XFree86 gamma fading.], + [with_xf86gamma="$withval"; with_xf86gamma_req="$withval"], + [with_xf86gamma=yes]) + +HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma) + +if test "$with_xf86gamma" = yes; then + + # first check for xf86vmode.h, if we haven't already + if test "$have_xf86vmode" = yes; then + have_xf86gamma=yes + else + AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes]) + fi + + # if that succeeded, then check for the -lXxf86vm + if test "$have_xf86gamma" = yes; then + have_xf86gamma=no + AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma, + [have_xf86gamma=yes], + [true], -lXext -lX11) + fi + + # check for the Ramp versions of the functions too. + if test "$have_xf86gamma" = yes; then + have_xf86gamma_ramp=no + AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp, + [have_xf86gamma_ramp=yes], + [true], -lXext -lX11) + fi + + # if those tests succeeded, then we've really got the functions. + if test "$have_xf86gamma" = yes; then + AC_DEFINE(HAVE_XF86VMODE_GAMMA) + fi + + if test "$have_xf86gamma_ramp" = yes; then + AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP) + fi + + # pull in the lib, if we haven't already + if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then + SAVER_LIBS="$SAVER_LIBS -lXxf86vm" + fi + +elif test "$with_xf86gamma" != no; then + echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode" + exit 1 +fi + + ############################################################################### # # Check for HP XHPDisableReset and XHPEnableReset. @@ -1222,6 +1386,7 @@ fi ############################################################################### have_kerberos=no +have_kerberos5=no with_kerberos_req=unspecified AC_ARG_WITH(kerberos, @@ -1231,21 +1396,41 @@ AC_ARG_WITH(kerberos, HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos) if test "$enable_locking" = yes -a "$with_kerberos" = yes; then - AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos, + AC_CACHE_CHECK([for Kerberos 4], ac_cv_kerberos, [AC_TRY_X_COMPILE([#include ],, [ac_cv_kerberos=yes], [ac_cv_kerberos=no])]) + AC_CACHE_CHECK([for Kerberos 5], ac_cv_kerberos5, + [AC_TRY_X_COMPILE([#include ],, + [ac_cv_kerberos5=yes], + [ac_cv_kerberos5=no])]) + if test "$ac_cv_kerberos" = yes ; then have_kerberos=yes AC_DEFINE(HAVE_KERBEROS) + fi + if test "$ac_cv_kerberos5" = yes ; then + have_kerberos=yes + have_kerberos5=yes + AC_DEFINE(HAVE_KERBEROS) + AC_DEFINE(HAVE_KERBEROS5) + fi + + if test "$have_kerberos5" = yes ; then + # from Matt Knopp + # (who got it from amu@mit.edu) + PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err" + elif test "$have_kerberos" = yes ; then # from Tim Showalter PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes" + fi + + if test "$have_kerberos" = yes ; then AC_CHECK_FUNC(res_search,, AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv", AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos]) )) - fi fi @@ -1496,9 +1681,14 @@ if test "$with_motif" = yes; then fi +if test "$have_motif" = yes; then + AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)]) +fi + + ############################################################################### # -# Check for -lgtk. +# Check for -lgtk (and Gnome stuff) # ############################################################################### @@ -1526,6 +1716,31 @@ if test "$with_gtk" != yes -a "$with_gtk" != no ; then exit 1 fi +have_gnome=no +with_gnome_req=unspecified +AC_ARG_WITH(gnome, +[ --with-gnome Include support for the Gnome Control Center.], + [with_gnome="$withval"; with_gnome_req="$withval"],[with_gnome=yes]) + +# if --with-gnome=/directory/ was specified, remember that directory so that +# we can also look for the `gnome-config' program in that directory. +case "$with_gnome" in + /*) + gnome_dir="$with_gnome" + ;; + *) + gnome_dir="" + ;; +esac + +HANDLE_X_PATH_ARG(with_gnome, --with-gnome, Gnome) + +if test "$with_gnome" != yes -a "$with_gnome" != no ; then + echo "error: must be yes or no: --with-gnome=$with_gnome" + exit 1 +fi + + jurassic_gtk=no if test "$with_gtk" = yes; then have_gtk=no @@ -1538,18 +1753,32 @@ if test "$with_gtk" = yes; then if test ! -z "$gtk_dir"; then # canonicalize slashes. gtk_dir=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'` - gtk_path="$gtk_dir:$gtk_dir:$gtk_path" + gtk_path="$gtk_dir:$gtk_path" fi - AC_PATH_PROGS(glib_config, glib-config,, $gtk_path) - AC_PATH_PROGS(gtk_config, gtk-config,, $gtk_path) + if test ! -z "gnome_dir"; then + # canonicalize slashes. + gnome_dir=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'` + gtk_path="$gnome_dir:$gtk_path" + fi + + AC_PATH_PROGS(glib_config, glib12-config glib-config,, $gtk_path) + AC_PATH_PROGS(gtk_config, gtk12-config gtk-config,, $gtk_path) + + if test "$with_gnome" = yes; then + AC_PATH_PROGS(gnome_config, gnome-config,, $gtk_path) + fi if test -n "$glib_config" -a -n "gtk_config" ; then have_gtk=yes + if test "$with_gnome" = yes -a -n "$gnome_config" ; then + have_gnome=yes + fi fi + if test "$have_gtk" = yes; then AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string, - [ac_cv_gtk_version_string=`$glib_config --version`]) + [ac_cv_gtk_version_string=`$gtk_config --version`]) ac_gtk_version_string=$ac_cv_gtk_version_string # M4 sucks!! changequote(X,Y) @@ -1564,75 +1793,90 @@ if test "$with_gtk" = yes; then if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002 then have_gtk=no + have_gnome=no jurassic_gtk=yes fi fi + if test "$have_gtk" = yes; then AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags, [ac_cv_gtk_config_cflags=`$gtk_config --cflags`]) AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs, [ac_cv_gtk_config_libs=`$gtk_config --libs`]) - INCLUDES="$INCLUDES $ac_cv_gtk_config_cflags" - GTK_LIBS="$GTK_LIBS $ac_cv_gtk_config_libs" - AC_DEFINE(HAVE_GTK) fi -fi - + ac_gtk_config_cflags=$ac_cv_gtk_config_cflags + ac_gtk_config_libs=$ac_cv_gtk_config_libs -############################################################################### -# -# Check for -lXaw and -lXaw3d. -# -############################################################################### + # Check for Gnome Capplet support. + # + if test "$have_gnome" = yes -a "$have_gtk" = yes; then + gnome_config_libs="gtk capplet gnomeui" + AC_MSG_CHECKING(for Gnome capplet includes) + AC_CACHE_VAL(ac_cv_gnome_config_cflags, + [if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \ + grep Unknown >/dev/null ) ; then + ac_cv_gnome_config_cflags='' + else + ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs` + fi]) + ac_gnome_config_cflags=$ac_cv_gnome_config_cflags + if test "$ac_gnome_config_cflags" = "" ; then + have_gnome=no + AC_MSG_RESULT(no) + else + AC_MSG_RESULT($ac_gnome_config_cflags) + fi + fi -have_athena=no -have_athena3d=no -with_athena_req=unspecified -AC_ARG_WITH(athena, -[ --with-athena Use the Athena toolkit for the user interface.], - [with_athena="$withval"; with_athena_req="$withval"],[with_athena=yes]) + if test "$have_gnome" = yes -a "$have_gtk" = yes; then + AC_MSG_CHECKING(for Gnome capplet libs) + AC_CACHE_VAL(ac_cv_gnome_config_libs, + [if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null | + grep Unknown >/dev/null ) ; then + ac_cv_gnome_config_libs='' + else + ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs` + fi]) + ac_gnome_config_libs=$ac_cv_gnome_config_libs + if test "$ac_gnome_config_libs" = "" ; then + have_gnome=no + AC_MSG_RESULT(no) + else + AC_MSG_RESULT($ac_gnome_config_libs) + fi + fi -HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena) + GNOME_DATADIR="" + if test "$have_gnome" = yes -a "$have_gtk" = yes; then + GNOME_DATADIR=`$gnome_config --datadir` + fi -if test "$with_athena" != yes -a "$with_athena" != no ; then - echo "error: must be yes or no: --with-athena=$with_athena" - exit 1 -fi + # If we have Gnome, then override the gtk-config values with + # the gnome-config values. + # + if test "$have_gnome" = yes -a "$have_gtk" = yes; then + ac_gtk_config_cflags=$ac_gnome_config_cflags + ac_gtk_config_libs=$ac_gnome_config_libs + AC_DEFINE(HAVE_CRAPPLET) + fi -if test "$with_athena" = yes; then - have_athena=no - AC_CHECK_X_HEADER(X11/Xaw/Dialog.h, [have_athena=yes]) - if test "$have_athena" = yes; then - AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB, - [have_athena=yes; have_athena3d=yes], [true], - -lXt -lXmu -lXext -lX11) + if test "$have_gtk" = yes; then + INCLUDES="$INCLUDES $ac_gtk_config_cflags" + GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs" + AC_DEFINE(HAVE_GTK) fi -fi -if test "$have_athena" = yes; then - AC_DEFINE(HAVE_ATHENA) - ATHENA_LIBS="-lXaw $ATHENA_LIBS" -fi - -if test "$have_athena3d" = yes; then - ATHENA3D_LIBS="-lXaw3d $ATHENA3D_LIBS" fi -# If we have Athena, check whether it's a version that includes -# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.) -if test "$have_athena" = yes ; then - AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h], - ac_cv_have_XawViewportSetCoordinates, - [ac_cv_have_XawViewportSetCoordinates=no - AC_EGREP_X_HEADER(XawViewportSetCoordinates, - X11/Xaw/Viewport.h, - ac_cv_have_XawViewportSetCoordinates=yes)]) - if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then - AC_DEFINE(HAVE_XawViewportSetCoordinates) - fi +# Check for the Gnome Help Browser. +# +if test "$have_gnome" = yes; then + AC_CHECK_PROG(have_gnome_help, gnome-help-browser, yes, no) +else + have_gnome_help=no fi @@ -1787,6 +2031,7 @@ fi have_gl=no ac_have_mesa_gl=no with_gl_req=unspecified +gl_halfassed=no AC_ARG_WITH(gl,[ Graphics options: @@ -1813,36 +2058,48 @@ if test "$with_gl" = yes; then # AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl, [ac_cv_have_mesa_gl=no - AC_EGREP_X_HEADER(Mesa, GL/glx.h, [ac_cv_have_mesa_gl=yes]) + AC_EGREP_X_HEADER(Mesa|MESA, GL/glx.h, [ac_cv_have_mesa_gl=yes]) ]) ac_have_mesa_gl=$ac_cv_have_mesa_gl + gl_lib_1="" + GL_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.) + # + if test "$ac_have_mesa_gl" = yes; then + AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],) + 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.) # - gl_lib_1="" - GL_LIBS="" if test "$ac_have_mesa_gl" = yes ; then AC_CHECK_X_LIB(MesaGL, glXCreateContext, [gl_lib_1="MesaGL" - GL_LIBS="-lMesaGL -lMesaGLU"], - [], -lMesaGLU -lX11 -lXext -lm) + GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"], + [], -lMesaGLU $GL_LIBS -lX11 -lXext -lm) fi if test "$gl_lib_1" = "" ; then AC_CHECK_X_LIB(GL, glXCreateContext, [gl_lib_1="GL" - GL_LIBS="-lGL -lGLU"], - [], -lGLU -lX11 -lXext -lm) + GL_LIBS="-lGL -lGLU $GL_LIBS"], + [], -lGLU $GL_LIBS -lX11 -lXext -lm) fi 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. AC_DEFINE(HAVE_GL) @@ -1867,6 +2124,11 @@ if test "$with_gl" = yes; then #line __oline__ "configure" #include "confdefs.h" #include +#ifndef MESA_MAJOR_VERSION +# include +# define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION +# define MESA_MINOR_VERSION XMESA_MINOR_VERSION +#endif configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION EOF @@ -1907,50 +2169,10 @@ EOF fi - # If it's MesaGL, check to see if it requires -lpthread. - # - have_pthread=no - mesa_requires_pthread=no - if test "$ac_have_mesa_gl" = yes; then - - AC_CHECK_LIB(pthread, pthread_create, [have_pthread=yes], [],) - if test "$have_pthread" = yes; then - AC_CHECK_X_LIB($gl_lib_1, gl_get_thread_context, - [mesa_requires_pthread=yes], [true], - $GL_LIBS -lpthread -lX11 -lXext -lm) - fi - - if test "$mesa_requires_pthread" = yes; then - GL_LIBS="$GL_LIBS -lpthread" - fi - fi - # Check for OpenGL 1.1 features. # AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)], [true], $GL_LIBS -lX11 -lXext -lm) - - - # Check whether the `xscreensaver' executable should link against GL. - # See comments in utils/visual-gl.c for why this is sometimes necessary. - # - AC_MSG_CHECKING(whether drastic GL measures must be taken) - case "$host" in - *-sgi*) - AC_MSG_RESULT([yes -- hello, SGI.]) - AC_DEFINE(DAEMON_USE_GL) - SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c' - SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o' - SAVER_GL_LIBS="$GL_LIBS" - ;; - *) - AC_MSG_RESULT([no -- non-SGI.]) - SAVER_GL_SRCS='' - SAVER_GL_OBJS='' - SAVER_GL_LIBS='' - ;; - esac - fi elif test "$with_gl" != no; then @@ -1967,6 +2189,7 @@ fi have_gle=no with_gle_req=unspecified +gle_halfassed=no AC_ARG_WITH(gle, [ --with-gle Build those demos which depend on GLE (the OpenGL "extrusion" library.)], @@ -1978,29 +2201,58 @@ GLE_LIBS="" if test "$with_gle" = yes; then - AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no) - if test "$have_gle" = yes ; then - AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no) + AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no) + if test "$have_gle3" = yes ; then + have_gle=yes; + else + AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no) + if test "$have_gle" = yes ; then + AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no) + fi fi -# /usr/local/lib/GL/libgle.a -# /usr/local/lib/GL/libmatrix.a - if test "$have_gle" = yes ; then have_gle=no + gle_halfassed=yes AC_CHECK_X_LIB(gle, gleCreateGC, - [have_gle=yes; GLE_LIBS="-lgle"], + [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"], [], $GL_LIBS -lX11 -lXext -lm) fi if test "$have_gle" = yes ; then have_gle=no - AC_CHECK_X_LIB(matrix, uview_direction_d, - [have_gle=yes; GLE_LIBS="$GLE_LIBS -lmatrix"], - [], $GL_LIBS -lX11 -lXext -lm) + gle_halfassed=yes + + # sometimes the libmatrix stuff is included in libgle. look there first. +# +# I don't get it. For some reason, this test passes on SGI, as if +# uview_direction_d() was in libgle -- but it's not, it's in libmatrix. +# Yet the link is succeeding. Why??? +# +# AC_CHECK_X_LIB(gle, uview_direction_d, +# [have_gle=yes; gle_halfassed=no], +# [], $GL_LIBS -lX11 -lXext -lm) + + # As of GLE 3 this is in libgle, and has changed name to uview_direction! + # *sigh* + if test "$have_gle3" = yes ; then + AC_CHECK_X_LIB(gle, uview_direction, + [have_gle=yes; gle_halfassed=no], + [], $GL_LIBS -lX11 -lXext -lm) + fi + # if it wasn't in libgle, then look in libmatrix. + if test "$have_gle" = no ; then + AC_CHECK_X_LIB(matrix, uview_direction_d, + [have_gle=yes; gle_halfassed=no; + GLE_LIBS="$GLE_LIBS -lmatrix"], + [], $GL_LIBS -lX11 -lXext -lm) + fi fi if test "$have_gle" = yes ; then AC_DEFINE(HAVE_GLE) + if test "$have_gle3" = yes ; then + AC_DEFINE(HAVE_GLE3) + fi fi elif test "$with_gle" != no; then @@ -2084,10 +2336,12 @@ if test "$with_xshm" = yes; then # case "$host" in *-aix*) - have_xshm=no - AC_CHECK_X_LIB(XextSam, XShmQueryExtension, - [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"], - [true], -lX11 -lXext -lm) + if [ `uname -v` -eq 3 ]; then + have_xshm=no + AC_CHECK_X_LIB(XextSam, XShmQueryExtension, + [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"], + [true], -lX11 -lXext -lm) + fi ;; esac @@ -2157,38 +2411,6 @@ elif test "$with_readdisplay" != no; then fi -############################################################################### -# -# Check for the SGI Iris Video Library. -# -############################################################################### - -have_sgivideo=no -with_sgivideo_req=unspecified -AC_ARG_WITH(sgivideo, -[ --with-sgivideo Include support for SGI's Iris Video Library.], - [with_sgivideo="$withval"; with_sgivideo_req="$withval"], - [with_sgivideo=yes]) - -HANDLE_X_PATH_ARG(with_sgivideo, --with-sgivideo, Iris Video) - -if test "$with_sgivideo" = yes; then - AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes) - if test "$have_sgivideo" = yes; then - have_sgivideo=no - AC_CHECK_LIB(vl, vlOpenVideo, [have_sgivideo=yes]) - if test "$have_sgivideo" = yes; then - SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o" - SGI_VIDEO_LIBS="-lvl" - AC_DEFINE(HAVE_SGI_VIDEO) - fi - fi -elif test "$with_sgivideo" != no; then - echo "error: must be yes or no: --with-sgivideo=$with_sgivideo" - exit 1 -fi - - ############################################################################### # # Check for a program to generate random text. @@ -2212,8 +2434,7 @@ AC_ARG_WITH(zippy,[ default (though it can be overridden with X resources.) If you don't specify this, the default is to use \"yow\" from the Emacs distribution (if you - have it) or else to use \"fortune\". -], + have it) or else to use \"fortune\".], [with_zippy_req="$withval"; with_zippy="$withval"],[with_zippy=yes]) if test "$with_zippy" = no || test "$with_zippy" = yes ; then @@ -2348,6 +2569,31 @@ fi AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program") +############################################################################### +# +# 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" +AC_ARG_WITH(setuid-hacks, +[ --with-setuid-hacks Allow some demos to be installed \`setuid root' + (which is needed in order to ping other hosts.) +], + [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"]) + +HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks) + +if test "$setuid_hacks" = yes; then + true +elif test "$setuid_hacks" != no; then + echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks" + exit 1 +fi + + ############################################################################### # # Done testing. Now, set up the various -I and -L variables, @@ -2369,23 +2615,16 @@ if test \! -z "$libdir" ; then fi +PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm ALL_DEMO_PROGRAMS= -if test "$have_athena3d" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw3d - ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" -fi -if test "$have_athena" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw +if test "$have_motif" = yes; then + PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi if test "$have_gtk" = yes; then PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi -if test "$have_motif" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm - ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" -fi if test "$have_kerberos" = yes; then @@ -2406,32 +2645,50 @@ if test "$enable_locking" = yes; then LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)' else LOCK_SRCS='$(NOLOCK_SRCS_1)' - LOCK_OBJS='$(NOLOCK_SRCS_1)' + LOCK_OBJS='$(NOLOCK_OBJS_1)' fi +INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)' + if test "$need_setuid" = yes; then NEED_SETUID=yes - INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)' else NEED_SETUID=no - INSTALL_SETUID='$(INSTALL_PROGRAM)' +fi + +if test "$setuid_hacks" = yes; then + SETUID_HACKS=yes +else + SETUID_HACKS=no fi tab=' ' if test "$have_gl" = yes; then GL_EXES='$(GL_EXES)' + GL_UTIL_EXES='$(GL_UTIL_EXES)' GL_MEN='$(GL_MEN)' GL_KLUDGE="${tab} " else - GL_KLUDGE=" -${tab} " + GL_KLUDGE="-${tab} " fi if test "$have_gle" = yes; then GLE_EXES='$(GLE_EXES)' GLE_MEN='$(GLE_MEN)' - GLE_KLUDGE="${tab} " + GLE_KLUDGE="${tab} " +else + GLE_KLUDGE="-${tab} " +fi + + +# Another substitution in the XScreenSaver.ad.in file: +# +if test "$have_gnome_help" = yes; then + GNOMEHELP_Y='' + GNOMEHELP_N='! ' else - GLE_KLUDGE=" -${tab} " + GNOMEHELP_Y='! ' + GNOMEHELP_N='' fi @@ -2448,36 +2705,39 @@ AC_SUBST(ALL_DEMO_PROGRAMS) AC_SUBST(SAVER_LIBS) AC_SUBST(MOTIF_LIBS) AC_SUBST(GTK_LIBS) -AC_SUBST(ATHENA_LIBS) -AC_SUBST(ATHENA3D_LIBS) AC_SUBST(HACK_LIBS) AC_SUBST(XPM_LIBS) AC_SUBST(GL_LIBS) AC_SUBST(GLE_LIBS) +AC_SUBST(XDPMS_LIBS) AC_SUBST(PASSWD_LIBS) AC_SUBST(INSTALL_SETUID) +AC_SUBST(SETUID_HACKS) AC_SUBST(INSTALL_DIRS) AC_SUBST(NEED_SETUID) AC_SUBST(INSTALL_PAM) -AC_SUBST(SGI_VIDEO_OBJS) -AC_SUBST(SGI_VIDEO_LIBS) AC_SUBST(PASSWD_SRCS) AC_SUBST(PASSWD_OBJS) AC_SUBST(XMU_SRCS) AC_SUBST(XMU_OBJS) +AC_SUBST(XMU_LIBS) AC_SUBST(SAVER_GL_SRCS) AC_SUBST(SAVER_GL_OBJS) AC_SUBST(SAVER_GL_LIBS) AC_SUBST(LOCK_SRCS) AC_SUBST(LOCK_OBJS) AC_SUBST(GL_EXES) +AC_SUBST(GL_UTIL_EXES) AC_SUBST(GL_MEN) AC_SUBST(GL_KLUDGE) AC_SUBST(GLE_EXES) AC_SUBST(GLE_MEN) AC_SUBST(GLE_KLUDGE) +AC_SUBST(GNOMEHELP_Y) +AC_SUBST(GNOMEHELP_N) AC_SUBST(HACKDIR) +AC_SUBST(GNOME_DATADIR) APPDEFAULTS=$ac_x_app_defaults AC_SUBST(APPDEFAULTS) @@ -2518,7 +2778,8 @@ warn() { warnpre if test "$warning" = long ; then echo '' ; fi warning=yes - echo "$warn_prefix $@" + rest="$@" + echo "$warn_prefix $rest" } warnL() { @@ -2526,11 +2787,13 @@ warnL() { warnpre warning=yes if test "$was" != no ; then echo '' ; fi - echo "$warn_prefix $@" + rest="$@" + echo "$warn_prefix $rest" } warn2() { - echo " $@" + rest="$@" + echo " $rest" warning=long } @@ -2584,17 +2847,13 @@ if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then fi -if test "$have_motif" = no -a "$have_gtk" = no -a "$have_athena" = no ; then - warnL "None of Motif, Gtk, or Athena widgets seem to be available;" +if test "$have_motif" = no -a "$have_gtk" = no; then + warnL "Neither Motif nor Gtk seem to be available;" warn2 "the \`xscreensaver-demo' program requires one of these." elif test "$with_motif_req" = yes -a "$have_motif" = no ; then warnL "Use of Motif was requested, but it wasn't found;" - if test "$have_gtk" = yes; then - warn2 "Gtk will be used instead." - else - warn2 "Athena will be used instead." - fi + warn2 "Gtk will be used instead." elif test "$jurassic_gtk" = yes ; then @@ -2609,29 +2868,18 @@ elif test "$jurassic_gtk" = yes ; then warnL "Gtk was found on this system, but it is version $v;" fi - if test "$have_motif" = yes; then - which="Motif" - else - which="Athena" - fi - - warn2 "Gtk $pref_gtk or newer is required. $which will be used instead." + warn2 "Gtk $pref_gtk or newer is required. Motif will be used instead." elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then warnL "Use of Gtk was requested, but it wasn't found;" - if test "$have_motif" = yes; then - warn2 "Motif will be used instead." - else - warn2 "Athena will be used instead." - fi + warn2 "Motif will be used instead." -elif test "$with_athena_req" = yes -a "$have_athena" = no ; then - warnL "Use of Athena was requested, but it wasn't found;" - if test "$have_gtk" = yes; then - warn2 "Gtk will be used instead." - else - warn2 "Motif will be used instead." - fi +fi + + +if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then + warn 'Use of the Gnome Control Panel was requested, but the necessary' + warn2 'headers and/or libraries were not found.' fi @@ -2653,15 +2901,6 @@ if test "$have_motif" = yes -a "$have_lesstif" = yes ; then fi fi -if test "$have_athena" = yes -a "$have_motif" = no -a "$have_gtk" = no; then - warnL "Athena widgets are being used instead of Motif or Gtk." - warn2 "The \`xscreensaver-demo' program looks much better" - warn2 "with Motif or Gtk. Wouldn't you rather be using Motif?" - warn2 "Motif is shipped by every commercial Unix vendor," - warn2 "and there is a free implementation available as" - warn2 "well: see . Gtk is shipped" - warn2 "with most Linux and BSD distributions." -fi if test "$have_xpm" = no ; then @@ -2683,21 +2922,25 @@ fi if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then - preferred_mesagl=3.0 + preferred_mesagl=3.4 + mgv="$ac_mesagl_version_string" + pgl="$preferred_mesagl" if test "$ac_mesagl_version" = unknown; then 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 $ac_mesagl_version_string is being used." - warn2 "MesaGL versions 2.6 and earlier have a security bug." - warn2 "It is strongly recommended that you upgrade to at" - warn2 "least version $preferred_mesagl." + warnL "MesaGL version $mgv is being used. MesaGL 2.6 and earlier" + warn2 "have a security bug. It is strongly recommended that you" + warn2 "upgrade to at least version $preferred_mesagl." + + elif test \! "$ac_mesagl_version" -gt 3003; then + warnL "MesaGL version $mgv is being used. That version has some" + warn2 "bugs; it is recommended that you upgrade to $pgl or newer." fi fi - if test "$have_gl" = no ; then if test "$with_gl_req" = yes ; then warnL 'Use of GL was requested, but it was not found.' @@ -2707,6 +2950,14 @@ if test "$have_gl" = no ; then noteL 'The OpenGL 3D library was not found.' 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.' + fi + echo '' warn2 'Those demos which use 3D will not be built or installed.' warn2 'You might want to consider installing OpenGL and' @@ -2721,19 +2972,32 @@ fi if test "$have_gl" = yes -a "$have_gle" = no ; then if test "$with_gle_req" = yes ; then - warnL 'Use of GLE was requested, but it was not found.' + noteL 'Use of the GLE (GL Extrusion) library was requested, but' + warn2 'it was not found (though the OpenGL library was found, and' + warn2 'is being used.)' elif test "$with_gle_req" = no ; then - noteL 'The GLE (GL Extrusion) library is not being used.' + noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)' + warn2 'library is not.' else - noteL 'The GLE (GL Extrusion) library was not found.' + noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)' + warn2 '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 echo '' - warn2 'Some of the OpenGL (3D) demos will not be built or installed.' - warn2 'You might want to consider installing GLE and re-running' - warn2 'configure. (Remember to delete the config.cache file first.)' - warn2 'You can find the GLE library at .' - warn2 'For general OpenGL info, see .' + warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)' + warn2 'will not be built or installed. You might want to consider' + warn2 'installing GLE and re-running configure. (Remember to delete' + warn2 'the config.cache file first.) You can find the GLE library' + warn2 'at . For general OpenGL info,' + warn2 'see .' fi @@ -2742,10 +3006,6 @@ if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then warn 'Use of XReadDisplay was requested, but it was not found.' fi -if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then - warn 'Use of the Iris Video Library was requested, but it was not found.' -fi - if test -n "$with_zippy_req"; then if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then warnL "$with_zippy_req was requested as the Zippy program," @@ -2806,7 +3066,7 @@ do_dir_warning=no # M4 sucks!! changequote(X,Y) rpmv=`(rpm -qv xscreensaver) 2>&- | \ - sed 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-[0-9][0-9]*$/\1/'` + sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'` changequote([,]) if test \! -z "$rpmv" ; then @@ -2837,15 +3097,15 @@ fi # Warn about egregious GNOME bogosity. # -if (rpm -qv control-center) >&- 2>&- ; then - warning=no - warnL "The Gnome Control Center seems to be installed." - echo "" - warn2 "Note that simply installing this version of xscreensaver" - warn2 "will not cause GNOME to know about the newly-added display" - warn2 "modes -- GNOME is just lame that way. Instead of using the" - warn2 "Control Center, try using the \`xscreensaver-demo' command." -fi +#if (rpm -qv control-center) >&- 2>&- ; then +# warning=no +# warnL "The Gnome Control Center seems to be installed." +# echo "" +# warn2 "Note that simply installing this version of xscreensaver" +# warn2 "will not cause GNOME to know about the newly-added display" +# warn2 "modes -- GNOME is just lame that way. Instead of using the" +# warn2 "Control Center, try using the \`xscreensaver-demo' command." +#fi if test "${bindir}" = "${HACKDIR}" ; then @@ -2860,7 +3120,7 @@ if test "$do_dir_warning" = yes; then echo ' "xscreensaver-demo", and "xscreensaver-command" executables' echo " will be installed in ${bindir}." echo "" - echo " The various graphics demos (100+ different executables) will" + echo " The various graphics demos (120+ different executables) will" echo " also be installed in ${HACKDIR}." echo "" echo " If you would prefer the demos to be installed elsewhere"