-# configure.in --- xscreensaver, Copyright (c) 1997-2002 Jamie Zawinski.
+# configure.in --- xscreensaver, Copyright (c) 1997-2003 Jamie Zawinski.
#
AC_PREREQ(2.52)
])
+###############################################################################
+#
+# Function to figure out how to turn off Objective C on MacOS X.
+# (We have to do this to work around an Apple-specific gcc bug.)
+#
+###############################################################################
+
+AC_DEFUN(AC_GCC_ACCEPTS_NO_CPP_PRECOMP,
+ [if test -n "$GCC"; then
+ AC_CACHE_CHECK([whether gcc accepts -no-cpp-precomp],
+ ac_cv_gcc_accepts_no_cpp_precomp,
+ [if ( ( gcc -E -no-cpp-precomp - </dev/null >/dev/null ) 2>&1 | \
+ grep unrecognized >/dev/null ); then
+ ac_cv_gcc_accepts_no_cpp_precomp=no
+ else
+ ac_cv_gcc_accepts_no_cpp_precomp=yes
+ fi])
+ ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
+ fi
+])
+
+AC_DEFUN(AC_NO_OBJECTIVE_C,
+ [if test -n "$GCC"; then
+ AC_GCC_ACCEPTS_NO_CPP_PRECOMP
+ if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
+ AC_MSG_RESULT(Disabling Objective C extensions in ANSI C code.)
+ CC="$CC -no-cpp-precomp"
+ fi
+ fi
+])
+
+
###############################################################################
#
# Function to figure out how to create directory trees.
# Some versions of Slowlaris Motif require -lgen. But not all. Why?
AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
fi
+
+ ;;
+ *-darwin*)
+
+ # On MacOS X (10.x with "fink"), many things are under /sw/.
+ #
+ if test -d /sw/include ; then
+ X_CFLAGS="-I/sw/include $X_CFLAGS"
+ X_LIBS="-L/sw/lib $X_LIBS"
+ fi
;;
esac])
AC_CANONICAL_HOST
AC_PROG_CC_ANSI
AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
+AC_NO_OBJECTIVE_C
AC_PROG_CPP
AC_C_CONST
AC_C_INLINE
fi
+###############################################################################
+#
+# Check for XF86MiscSetGrabKeysState (but only bother if we are already
+# using other XF86 stuff.)
+#
+###############################################################################
+
+have_xf86miscsetgrabkeysstate=no
+if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
+ AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
+ [have_xf86miscsetgrabkeysstate=yes],
+ [true], -lXext -lX11)
+ if test "$have_xf86miscsetgrabkeysstate" = yes ; then
+ SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
+ AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
+ fi
+fi
+
+
###############################################################################
#
# Check for HP XHPDisableReset and XHPEnableReset.
#
###############################################################################
+AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
[AC_DEFINE(HAVE_XHPDISABLERESET)
- SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
+ SAVER_LIBS="-lXhp11 $SAVER_LIBS"
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
###############################################################################
if test "$have_kerberos5" = yes ; then
# from Matt Knopp <mhat@infocalypse.netlag.com>
# (who got it from amu@mit.edu)
- PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
+
+ PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
+
+ # jwz: MacOS X uses -lkrb5, but not -lcrypt
+ AC_CHECK_X_LIB(crypt, crypt, [PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
+
elif test "$have_kerberos" = yes ; then
# from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string,
[ac_cv_gtk_version_string=`$gtk_config --version`])
ac_gtk_version_string=$ac_cv_gtk_version_string
+ parse_gtk_version_string
fi
- parse_gtk_version_string
-
- if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
- then
- have_gtk=no
- have_gnome=no
- jurassic_gtk=yes
+ if test "$have_gtk" = yes; then
+ if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
+ then
+ have_gtk=no
+ have_gnome=no
+ jurassic_gtk=yes
+ fi
fi
if test "$have_gtk" = yes; then
gnome_config_libs="gtk capplet gnomeui gdk_pixbuf"
AC_MSG_CHECKING(for Gnome capplet includes)
AC_CACHE_VAL(ac_cv_gnome_config_cflags,
- [if ( $gnome_config --cflags $gnome_config_libs >/dev/null 2>&1 | \
+ [if ( $gnome_config --cflags $gnome_config_libs 2>&1 | \
grep Unknown >/dev/null ) ; then
ac_cv_gnome_config_cflags=''
else
if test "$have_gnome" = yes -a "$have_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 >/dev/null 2>&1 |
+ [if ( $gnome_config --libs $gnome_config_libs 2>&1 |
grep Unknown >/dev/null ) ; then
ac_cv_gnome_config_libs=''
else
# M4 sucks!!
changequote(X,Y)
mglv=`echo "$mglv" | sed -n \
- 's/^configure: *\([0-9][0-9]*\) \([0-9].*\)$/\1.\2/p'`
+ 's/^configure: *\([0-9][0-9]*\) *\([0-9].*\)$/\1.\2/p'`
changequote([,])
rm -f conftest.$ac_ext
with_jpeg_req=unspecified
jpeg_halfassed=no
AC_ARG_WITH(jpeg,
-[ --with-jpeg Include support for the JPEG library in some demos.
- (If this library is available, webcollage will be a
- . lot faster.)],
+[ --with-jpeg Include support for the JPEG library.],
[with_jpeg="$withval"; with_jpeg_req="$withval"],
[with_jpeg=yes])
fi
-if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
+if test "$with_gnome_req" = yes -a "$have_gnome" = no \
+ -a "$have_gtk2" = no; then
+ # don't issue this warning if we have GTK2 -- in that case, the
+ # Gnome-specific code isn't needed.
warn 'Use of the Gnome Control Panel was requested, but the necessary'
warn2 'headers and/or libraries were not found.'
fi
echo ''
fi
- warn2 "This means the \`webcollage' program will be much slower."
+ if test "$have_gdk_pixbuf" = no ; then
+ warn2 "This means that it won't be possible for the image-manipulating"
+ warn2 "display modes to load files from disk; and it also means that"
+ warn2 "the \`webcollage' program will be much slower."
+ else
+ warn2 "This means the \`webcollage' program will be much slower."
+ fi
fi
if test "$have_gl" = yes -a "$have_gle" = no ; then
+
+ # nobody cares about this; don't print the warning unless it was
+ # requested and not found, or halfway-found.
+ if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
+
if test "$with_gle_req" = yes ; then
noteL 'Use of the GLE (GL Extrusion) library was requested, but'
warn2 'it was not found (though the OpenGL library was found, and'
warn2 'GLE library at <http://www.linas.org/gle/>. For general'
warn2 'OpenGL info, see <http://www.opengl.org/>.'
+ fi
fi