http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.34.tar.gz
[xscreensaver] / configure.in
index 342988f7f9cd447006979626f285af9922729cda..361fac21e5ca762100bb0daa8a3d18dfd11786e9 100644 (file)
@@ -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"
       ;;
 
@@ -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"
@@ -745,6 +753,13 @@ 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)
@@ -758,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)
@@ -792,13 +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"
+  XMU_LIBS='-lXmu'
   AC_DEFINE(HAVE_XMU)
 fi
 
@@ -1087,7 +1100,7 @@ fi
 
 ###############################################################################
 #
-#       Check for the XF86VMODE server extension.
+#       Check for the XF86VMODE server extension (for virtual screens.)
 #
 ###############################################################################
 
@@ -1124,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.
@@ -1736,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 | \
@@ -1797,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.
@@ -2328,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.
@@ -2597,7 +2648,7 @@ else
   LOCK_OBJS='$(NOLOCK_OBJS_1)'
 fi
 
-INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
+INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
 
 if test "$need_setuid" = yes; then
   NEED_SETUID=yes
@@ -2614,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
@@ -2629,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.
@@ -2653,24 +2716,26 @@ 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)
 
@@ -2857,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
 
@@ -2936,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,"
@@ -3000,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]*\)-.*$/\1/'`
+      sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
 changequote([,])
 
 if test \! -z "$rpmv" ; then