http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.31.tar.gz
[xscreensaver] / configure.in
index 8dae53f587149f56cf2d4f86ca746c7bb564b881..342988f7f9cd447006979626f285af9922729cda 100644 (file)
@@ -112,14 +112,24 @@ 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...
+     # -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
@@ -295,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
@@ -751,7 +766,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
@@ -2368,8 +2383,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
@@ -2504,6 +2518,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,
@@ -2558,12 +2597,18 @@ else
   LOCK_OBJS='$(NOLOCK_OBJS_1)'
 fi
 
+INSTALL_SETUID='$(INSTALL) $(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='  '
@@ -2604,6 +2649,7 @@ 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)
@@ -3008,7 +3054,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"