http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.34.tar.gz
[xscreensaver] / configure.in
index 9fbdfe306982b546950a86c456d8b9b19eec1551..361fac21e5ca762100bb0daa8a3d18dfd11786e9 100644 (file)
@@ -344,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;
@@ -516,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
@@ -536,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"
@@ -765,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)
@@ -1136,6 +1144,7 @@ fi
 ###############################################################################
 
 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.],
@@ -1161,16 +1170,28 @@ if test "$with_xf86gamma" = yes; then
                    [true], -lXext -lX11)
   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"
+  # 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 that succeeded, then we've really got it.
+  # 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
@@ -1789,7 +1810,7 @@ if test "$with_gtk" = yes; then
   # Check for Gnome Capplet support.
   #
   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-    gnome_config_libs="capplet gnomeui"
+    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 | \
@@ -1850,6 +1871,15 @@ if test "$with_gtk" = yes; then
 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
+
+
 ###############################################################################
 #
 #       Checking whether Motif is really Lesstif.
@@ -2635,6 +2665,7 @@ 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
@@ -2650,6 +2681,17 @@ else
 fi
 
 
+# Another substitution in the XScreenSaver.ad.in file:
+#
+if test "$have_gnome_help" = yes; then
+  GNOMEHELP_Y=''
+  GNOMEHELP_N='!    '
+else
+  GNOMEHELP_Y='!    '
+  GNOMEHELP_N=''
+fi
+
+
 ###############################################################################
 #
 #       Perform substitutions and write Makefiles.
@@ -2686,11 +2728,14 @@ 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)
 
@@ -2877,17 +2922,22 @@ 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