esac
fi
+ OBJCC="$CC"
+
AC_MSG_CHECKING([whether the compiler works on ANSI C])
AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
AC_MSG_RESULT(yes),
if test -n "$GCC"; then
AC_MSG_RESULT(Turning on gcc compiler warnings.)
CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs"
+ OBJCC="$OBJCC -Wall"
# supposedly gcc 3.4 will have "-Wdeclaration-after-statement"
# and then perhaps we can do without -pedantic?
else
AC_HEADER_DIRENT
AC_GETTIMEOFDAY_ARGS
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
-
AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
AC_CHECK_ICMP
AC_CHECK_ICMPHDR
AC_X_RANDOM_PATHS
AC_XPOINTER
+AC_MSG_CHECKING(whether this is MacOS X)
+ ac_macosx=no
+ case "$host" in
+ *-apple-darwin* )
+ ac_macosx=yes
+ ;;
+ esac
+AC_MSG_RESULT($ac_macosx)
+
+
###############################################################################
#
ALL_LINGUAS="ca da de es et fi fr hu it ja ko nl no pl pt pt_BR ru sk sv vi wa zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
+MKINSTALLDIRS="$INSTALL_DIRS"
###############################################################################
# first look in -lXext
have_xinerama=no
- AC_CHECK_X_LIB(Xext, XineramaQueryExtension, [have_xinerama=yes], [true],
+ AC_CHECK_X_LIB(Xext, XineramaQueryScreens, [have_xinerama=yes], [true],
-lXext -lX11)
# if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
if test "$have_xinerama" = no; then
- AC_CHECK_X_LIB(Xinerama, XineramaQueryExtension,
+ AC_CHECK_X_LIB(Xinerama, XineramaQueryScreens,
[have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"],
[true], -lXext -lX11)
fi
exit 1
fi
+# We can't lock on MacOS X, so don't even bother compiling in support for it.
+#
+if test "$ac_macosx" = yes; then
+ if test "$enable_locking" = yes; then
+ AC_MSG_RESULT(locking disabled: it doesn't work on MacOS X)
+ enable_locking=no
+ AC_DEFINE(NO_LOCKING)
+ fi
+fi
###############################################################################
# those are in libc. On Linux and Solaris, they're in libdl.
AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
+ # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
+ have_timedwait=no
+ AC_CHECK_LIB(c, sigtimedwait, [have_timedwait=yes])
+ if test "$have_timedwait" = no ; then
+ AC_CHECK_LIB(rt, sigtimedwait, [PASSWD_LIBS="${PASSWD_LIBS} -lrt"])
+ fi
+
AC_MSG_CHECKING(how to call pam_strerror)
AC_CACHE_VAL(ac_cv_pam_strerror_args,
[AC_TRY_COMPILE([#include <stdio.h>
fi
+###############################################################################
+#
+# Check for external password helper
+# On SuSE, instead of having xscreensaver be a setuid program, they
+# fork an external program that takes the password on stdin, and
+# returns true if that password is a valid one. Then only that
+# smaller program needs to be setuid.
+#
+# (Note that this external program is not a GUI: the GUI is still
+# all in xscreensaver itself; the external program just does auth.)
+#
+###############################################################################
+
+have_passwd_helper=no
+with_passwd_helper_req=unspecified
+
+AC_ARG_WITH(passwd-helper,
+[ --with-passwd-helper Include support for an external password
+ verification helper program.],
+ [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no])
+# no HANDLE_X_PATH_ARG for this one
+
+if test "$enable_locking" = no ; then
+ with_passwd_helper_req=no
+ with_passwd_helper=no
+fi
+
+case "$with_passwd_helper" in
+ ""|no) : ;;
+ /*)
+ AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
+ have_passwd_helper=yes;;
+ *)
+ echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
+ exit 1
+esac
+
+
###############################################################################
#
# Check for -lXm.
--with-motif Use the Motif toolkit for the user interface
(not recommended.)],
- [with_motif="$withval"; with_motif_req="$withval"],[with_motif=yes])
+ [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
fi
+###############################################################################
+#
+# Check for pty support for 'phosphor'
+#
+###############################################################################
+
+PTY_LIBS=
+have_ptys=no
+AC_CHECK_X_HEADER(pty.h, [have_ptys=yes])
+if test "$have_ptys" = yes; then
+ # we have the header, now check for the library
+ have_ptys=no
+ AC_CHECK_X_LIB(util, forkpty,
+ [have_ptys=yes
+ PTY_LIBS="-lutil"
+ AC_DEFINE(HAVE_FORKPTY)])
+fi
+
+
###############################################################################
#
# Check for the XSHM server extension.
fi
-PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
+PREFERRED_DEMO_PROGRAM=''
ALL_DEMO_PROGRAMS=
if test "$have_motif" = yes; then
PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
INSTALL_PAM="install-pam"
+fi
+if test "$have_passwd_helper" = yes; then
+ PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
+ PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
fi
PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
LOCK_OBJS='$(NOLOCK_OBJS_1)'
fi
+if test "$ac_macosx" = yes; then
+ EXES_OSX='$(EXES_OSX)'
+ SCRIPTS_OSX='$(SCRIPTS_OSX)'
+ MEN_OSX='$(MEN_OSX)'
+else
+ EXES_OSX=
+ SCRIPTS_OSX=
+ MEN_OSX=
+fi
+
+
INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
if test "$need_setuid" = yes; then
AC_SUBST(JPEG_LIBS)
AC_SUBST(HACK_LIBS)
AC_SUBST(XPM_LIBS)
+AC_SUBST(PTY_LIBS)
AC_SUBST(GL_LIBS)
AC_SUBST(GLE_LIBS)
AC_SUBST(XDPMS_LIBS)
AC_SUBST(NEED_SETUID)
AC_SUBST(INSTALL_PAM)
+AC_SUBST(OBJCC)
+AC_SUBST(EXES_OSX)
+AC_SUBST(SCRIPTS_OSX)
+AC_SUBST(MEN_OSX)
+
AC_SUBST(PASSWD_SRCS)
AC_SUBST(PASSWD_OBJS)
AC_SUBST(XMU_SRCS)
warn "Checking of /proc/interrupts was requested, but it's bogus."
fi
+motif_warn2() {
+ warn2 'Though the Motif front-end to xscreensaver is still'
+ warn2 'maintained, it is no longer being updated with new'
+ warn2 'features: all new development on the xscreensaver-demo'
+ warn2 'program is happening in the GTK version, and not in the'
+ warn2 'Motif version. It is recommended that you build against'
+ warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
+}
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."
+
+ if test "$with_motif" = yes; then
+ warnL "Neither the GTK nor Motif libraries were found; the"
+ warn2 "\`xscreensaver-demo' program requires one of these."
+ echo ''
+ motif_warn2
+ else
+ warnL "The GTK libraries do not seem to be available; the"
+ warn2 "\`xscreensaver-demo' program requires them."
+ echo ''
+ warn2 'You can use Motif or Lesstif instead of GTK (use the'
+ warn2 "\`--with-motif' option) but that is NOT recommended."
+ motif_warn2
+ fi
elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
warnL "Use of Motif was requested, but it wasn't found;"
warnL "Gtk was found on this system, but it is version $v;"
fi
- warn2 "Gtk $pref_gtk or newer is required. Motif will be used instead."
+ warn2 "Gtk $pref_gtk or newer is required."
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."
- fi
fi
if test "$gtk2_halfassed" != no ; then
warnL "GTK version $gtk2_halfassed was found, but at least one supporting"
warn2 "library ($gtk2_halfassed_lib) was not, so GTK 2.x can't be used."
- v="$ac_gtk_version_string"
- warn2 "GTK $v is also installed, so it will be used instead."
- warn2 "Please read the above output and the \`config.log' file"
- warn2 "for more details."
+ if test "$have_gtk" = yes ; then
+ v="$ac_gtk_version_string"
+ warn2 "GTK $v is also installed, so it will be used instead."
+ warn2 "Please read the above output and the \`config.log' file"
+ warn2 "for more details."
+ fi
fi
if test "$have_motif" = yes -a "$have_gtk" = no ; then
warn 'Motif is being used, and GTK is not.'
echo ''
- warn2 'Though the Motif front-end to xscreensaver is still'
- warn2 'maintained, it is no longer being updated with new'
- warn2 'features: all new development on the xscreensaver-demo'
- warn2 'program is happening in the GTK version, and not in the'
- warn2 'Motif version. It is recommended that you build against'
- warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
+ motif_warn2
fi
echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
echo " will be installed in ${bindir}/."
echo ""
- echo " The various graphics demos (160+ different executables) will"
+ echo " The various graphics demos (175+ different executables) will"
echo " be installed in ${HACKDIR}/."
echo ""
echo " If you would prefer the demos to be installed elsewhere,"