http://packetstorm.tacticalflex.com/UNIX/admin/xscreensaver-3.27.tar.gz
[xscreensaver] / configure.in
index 57529eb7cb1da1af5bf15217308be81a962e70bb..164e6d8e739ff73cc043ea779894e1a0aeb4b9ff 100644 (file)
@@ -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)
@@ -85,6 +85,37 @@ AC_DEFUN(AC_PROG_CC_ANSI,
 ])
 
 
+###############################################################################
+#
+#       Function to work around the fucked up gcc 2.96 included in Red Hat 7.0
+#
+###############################################################################
+
+AC_DEFUN(AC_ESCHEW_REDHAT_GCC_LOSSAGE,
+ [if test -n "$GCC"; then
+   AC_MSG_CHECKING(for Red Hat GCC lossage)
+   AC_CACHE_VAL(ac_cv_red_hat_gcc_lossage,
+    [ac_cv_red_hat_gcc_lossage=no
+      AC_EGREP_CPP(lossage,
+     [#include <stdlib.h>
+      #if !defined(__USE_POSIX) || !defined(__USE_SVID) || !defined(__USE_BSD)
+        lossage
+      #endif
+     ], ac_cv_red_hat_gcc_lossage=yes)
+    ])
+
+    ac_red_hat_gcc_lossage=$ac_cv_red_hat_gcc_lossage
+    if test "$ac_cv_red_hat_gcc_lossage" = yes ; then
+      rh_defines="-D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE";
+      CC="$CC $rh_defines"
+      AC_MSG_RESULT(yes: need $rh_defines)
+    else
+      AC_MSG_RESULT(no)
+    fi
+  fi
+])
+
+
 ###############################################################################
 #
 #       Function to figure out how to create directory trees.
@@ -674,6 +705,7 @@ AC_DEFUN(HANDLE_X_PATH_ARG, [
 # random compiler setup
 AC_CANONICAL_HOST
 AC_PROG_CC_ANSI
+AC_ESCHEW_REDHAT_GCC_LOSSAGE
 AC_PROG_CPP
 AC_C_CONST
 AC_C_INLINE
@@ -997,14 +1029,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; SAVER_LIBS="$SAVER_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)
@@ -1619,8 +1659,8 @@ if test "$with_gtk" = yes; then
     gtk_path="$gnome_dir:$gtk_path"
   fi
 
-  AC_PATH_PROGS(glib_config,  glib-config,,  $gtk_path)
-  AC_PATH_PROGS(gtk_config,   gtk-config,,   $gtk_path)
+  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)
@@ -1635,7 +1675,7 @@ if test "$with_gtk" = yes; then
 
   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)
@@ -1671,7 +1711,7 @@ if test "$with_gtk" = yes; then
     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 -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_cflags=''
        else
          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
@@ -1689,7 +1729,7 @@ if test "$with_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 -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_libs=''
        else
          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
@@ -2016,28 +2056,6 @@ EOF
     #
     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
@@ -2066,9 +2084,14 @@ 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
 
   if test "$have_gle" = yes ; then
@@ -2092,6 +2115,13 @@ if test "$with_gle" = yes; then
 #                   [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, 
@@ -2103,6 +2133,9 @@ if test "$with_gle" = yes; then
 
   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
@@ -2614,7 +2647,8 @@ warn() {
   warnpre
   if test "$warning" = long ; then echo '' ; fi
   warning=yes
-  echo "$warn_prefix $@"
+  rest="$@"
+  echo "$warn_prefix $rest"
 }
 
 warnL() {
@@ -2622,11 +2656,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
 }