1 # configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
4 AC_INIT(driver/subprocs.c)
5 AC_CONFIG_HEADER(config.h)
7 echo "current directory: `pwd`"
8 echo "command line was: $0 $@"
11 # After checking to see that --srcdir is correct (which AC_INIT does)
12 # check for some random other files that come later in the tar file,
13 # to make sure everything is here.
15 for d in driver utils hacks hacks/glx ; do
16 f=$srcdir/$d/Makefile.in
17 if test \! -r $f ; then
19 echo "ERROR: The package is incomplete: $f does not exist."
20 echo " This probably means that your download was truncated."
27 ###############################################################################
29 # Function to figure out how to run the compiler.
31 ###############################################################################
33 AC_DEFUN(AC_PROG_CC_ANSI,
36 if test -z "$GCC"; then
37 AC_MSG_CHECKING(how to request ANSI compilation)
40 AC_MSG_RESULT(HPUX: adding -Ae)
44 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
45 CC="$CC -qlanglvl=ansi -qhalt=e"
49 AC_MSG_RESULT(DEC: adding -std1)
54 AC_MSG_RESULT(no idea)
59 AC_MSG_CHECKING([whether the compiler works on ANSI C])
60 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
63 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
64 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
66 if test -n "$GCC"; then
67 AC_MSG_RESULT(Turning on gcc compiler warnings.)
68 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
71 *-irix5* |*-irix6.[0-3]* )
72 AC_MSG_RESULT(Turning on SGI compiler warnings.)
73 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
76 # if test -z "$GCC"; then
77 # AC_MSG_RESULT(Turning on DEC C compiler warnings.)
78 # CC="$CC -migrate -w0 -verbose -warnprotos"
86 ###############################################################################
88 # Function to figure out how to create directory trees.
90 ###############################################################################
92 AC_DEFUN(AC_PROG_INSTALL_DIRS,
93 [AC_CACHE_CHECK([whether \"\${INSTALL} -d\" creates intermediate directories],
94 ac_cv_install_d_creates_dirs,
95 [ac_cv_install_d_creates_dirs=no
97 if mkdir conftestdir; then
99 ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
100 if test -d dir1/dir2/. ; then
101 ac_cv_install_d_creates_dirs=yes
108 if test "$ac_cv_install_d_creates_dirs" = no ; then
109 AC_CACHE_CHECK([whether \"mkdir -p\" creates intermediate directories],
110 ac_cv_mkdir_p_creates_dirs,
111 [ac_cv_mkdir_p_creates_dirs=no
113 if mkdir conftestdir; then
115 mkdir -p dir1/dir2 >&- 2>&-
116 if test -d dir1/dir2/. ; then
117 ac_cv_mkdir_p_creates_dirs=yes
125 if test "$ac_cv_install_d_creates_dirs" = yes ; then
126 INSTALL_DIRS='${INSTALL} -d'
127 elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
128 INSTALL_DIRS='mkdir -p'
131 INSTALL_DIRS='${INSTALL} -d'
136 ###############################################################################
138 # Function to check whether gettimeofday() exists, and how to call it.
139 # This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
141 ###############################################################################
143 AC_DEFUN(AC_GETTIMEOFDAY_ARGS,
144 [AC_MSG_CHECKING(how to call gettimeofday)
145 AC_CACHE_VAL(ac_cv_gettimeofday_args,
146 [AC_TRY_COMPILE([#include <stdlib.h>
147 #include <sys/time.h>],
148 [struct timeval tv; struct timezone tzp;
149 gettimeofday(&tv, &tzp);],
150 [ac_gettimeofday_args=2],
151 [AC_TRY_COMPILE([#include <stdlib.h>
152 #include <sys/time.h>],
153 [struct timeval tv; gettimeofday(&tv);],
154 [ac_gettimeofday_args=1],
155 [ac_gettimeofday_args=0])])
156 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
157 ac_gettimeofday_args=$ac_cv_gettimeofday_args
158 if test "$ac_gettimeofday_args" = 1 ; then
159 AC_DEFINE(HAVE_GETTIMEOFDAY)
160 AC_MSG_RESULT(one argument)
161 elif test "$ac_gettimeofday_args" = 2 ; then
162 AC_DEFINE(HAVE_GETTIMEOFDAY)
163 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
164 AC_MSG_RESULT(two arguments)
166 AC_MSG_RESULT(unknown)
171 ###############################################################################
173 # Function to find perl5 (defines PERL and PERL_VERSION.)
175 ###############################################################################
177 # M4 sucks!! perl sucks too!!
179 perl_version_cmd='print $]'
182 AC_DEFUN(AC_PROG_PERL,
184 AC_PATH_PROGS(PERL, [perl5 perl],,)
185 if test -z "$PERL" ; then
188 AC_CACHE_CHECK([perl version], ac_cv_perl_version,
189 [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
190 PERL_VERSION=$ac_cv_perl_version
195 ###############################################################################
197 # Functions to check how to do ICMP PING requests.
199 ###############################################################################
201 AC_DEFUN(AC_CHECK_ICMP,
202 [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
203 [AC_TRY_COMPILE([#include <stdlib.h>
210 #include <sys/types.h>
211 #include <sys/time.h>
214 #include <sys/socket.h>
215 #include <netinet/in_systm.h>
216 #include <netinet/in.h>
217 #include <netinet/ip.h>
218 #include <netinet/ip_icmp.h>
219 #include <netinet/udp.h>
220 #include <arpa/inet.h>
224 struct sockaddr_in si;
226 i.icmp_type = ICMP_ECHO;
231 si.sin_family = AF_INET;
233 [ac_cv_have_icmp=yes],
234 [ac_cv_have_icmp=no])])
235 if test "$ac_cv_have_icmp" = yes ; then
239 AC_DEFUN(AC_CHECK_ICMPHDR,
240 [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
241 [AC_TRY_COMPILE([#include <stdlib.h>
248 #include <sys/types.h>
249 #include <sys/time.h>
252 #include <sys/socket.h>
253 #include <netinet/in_systm.h>
254 #include <netinet/in.h>
255 #include <netinet/ip.h>
256 #include <netinet/ip_icmp.h>
257 #include <netinet/udp.h>
258 #include <arpa/inet.h>
262 struct sockaddr_in si;
268 i.un.echo.sequence = 0;
269 si.sin_family = AF_INET;
271 [ac_cv_have_icmphdr=yes],
272 [ac_cv_have_icmphdr=no])])
273 if test "$ac_cv_have_icmphdr" = yes ; then
274 AC_DEFINE(HAVE_ICMPHDR)
278 ###############################################################################
280 # Functions to check for various X11 crap.
282 ###############################################################################
284 # Try and find the app-defaults directory.
285 # It sucks that autoconf doesn't do this already...
287 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
289 if mkdir conftestdir; then
291 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
292 cat > Imakefile <<'EOF'
294 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
296 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
297 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
298 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
304 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
305 # Look for the directory under a standard set of common directories.
306 # Check X11 before X11Rn because it's often a symlink to the current release.
308 /usr/X11/lib/app-defaults \
309 /usr/X11R6/lib/app-defaults \
310 /usr/X11R6/lib/X11/app-defaults \
311 /usr/X11R5/lib/app-defaults \
312 /usr/X11R5/lib/X11/app-defaults \
313 /usr/X11R4/lib/app-defaults \
314 /usr/X11R4/lib/X11/app-defaults \
316 /usr/lib/X11/app-defaults \
317 /usr/lib/X11R6/app-defaults \
318 /usr/lib/X11R5/app-defaults \
319 /usr/lib/X11R4/app-defaults \
321 /usr/local/X11/lib/app-defaults \
322 /usr/local/X11R6/lib/app-defaults \
323 /usr/local/X11R5/lib/app-defaults \
324 /usr/local/X11R4/lib/app-defaults \
326 /usr/local/lib/X11/app-defaults \
327 /usr/local/lib/X11R6/app-defaults \
328 /usr/local/lib/X11R6/X11/app-defaults \
329 /usr/local/lib/X11R5/app-defaults \
330 /usr/local/lib/X11R5/X11/app-defaults \
331 /usr/local/lib/X11R4/app-defaults \
332 /usr/local/lib/X11R4/X11/app-defaults \
334 /usr/X386/lib/X11/app-defaults \
335 /usr/x386/lib/X11/app-defaults \
336 /usr/XFree86/lib/X11/app-defaults \
338 /usr/lib/X11/app-defaults \
339 /usr/local/lib/X11/app-defaults \
340 /usr/unsupported/lib/X11/app-defaults \
341 /usr/athena/lib/X11/app-defaults \
342 /usr/local/x11r5/lib/X11/app-defaults \
343 /usr/lpp/Xamples/lib/X11/app-defaults \
344 /lib/usr/lib/X11/app-defaults \
346 /usr/openwin/lib/app-defaults \
347 /usr/openwin/lib/X11/app-defaults \
348 /usr/openwin/share/lib/app-defaults \
349 /usr/openwin/share/lib/X11/app-defaults \
351 /X11R6/lib/app-defaults \
352 /X11R5/lib/app-defaults \
353 /X11R4/lib/app-defaults \
356 if test -d "$ac_dir"; then
357 ac_x_app_defaults=$ac_dir
363 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
365 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
366 [AC_PATH_X_APP_DEFAULTS_XMKMF
367 if test x"$ac_x_app_defaults" = x; then
368 AC_PATH_X_APP_DEFAULTS_DIRECT
370 if test x"$ac_x_app_defaults" = x; then
371 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
373 # Record where we found app-defaults for the cache.
374 ac_cv_x_app_defaults="$ac_x_app_defaults"
376 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
379 AC_DEFUN(AC_XPOINTER,
380 [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
381 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
382 [XPointer foo = (XPointer) 0;],
383 [ac_cv_xpointer=yes],
384 [ac_cv_xpointer=no])])
385 if test "$ac_cv_xpointer" != yes; then
386 AC_DEFINE(XPointer,[char*])
390 # Random special-cases for X on certain pathological OSes.
391 # You know who you are.
393 AC_DEFUN(AC_X_RANDOM_PATHS,
397 # The following arcana was gleaned from conversations with
398 # Eric Schwartz <erics@col.hp.com>:
400 # On HPUX 10.x, the parts of X that HP considers "standard" live in
401 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
402 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
403 # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
404 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
405 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
406 # you don't need any -I or -L arguments.
408 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
409 # are the same division as 10.x. However, there are no symlinks to
410 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
411 # arguments are always necessary.
413 # However, X11R6 was available on HPUX 9.x as a patch: if that
414 # patch was installed, then all of X11R6 went in to
415 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
417 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
418 # whether R5 was available as a patch; R6 undoubtedly was not.)
420 # So. We try and use the highest numbered pair of
421 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
422 # that are available. We do not mix and match different versions
425 # Question I still don't know the answer to: (do you?)
427 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
428 # /usr/contrib/X11R6/ could be installed as a patch, what was in
429 # that contrib directory? Did it contain so-called "standard"
430 # X11R6, or did it include Xaw and Xmu as well? If the former,
431 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
432 # be a situation where one had to reach into the R5 headers and
433 # libs to find Xmu? That is, must both R6 and R5 directories
434 # be on the -I and -L lists in that case?
436 for version in X11R6 X11R5 X11R4 ; do
437 # if either pair of directories exists...
438 if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib
440 # if contrib exists, use it...
441 if test -d /usr/contrib/$version/lib ; then
442 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
443 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
445 # if the "standard" one exists, use it.
446 if test -d /usr/lib/$version ; then
447 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
448 X_LIBS="$X_LIBS -L/usr/lib/$version"
450 # since at least one of the pair exists, go no farther.
455 # Now find Motif. Thanks for not making xmkmf find this by
456 # default, you losers.
458 if test -d /usr/lib/Motif1.2 ; then
459 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
460 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
461 elif test -d /usr/lib/Motif1.1 ; then
462 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
463 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
466 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
468 if test -d /opt/Mesa/lib ; then
469 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
470 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
473 if test -d /opt/xpm/lib/X11 ; then
474 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
475 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
478 # On HPUX, default to installing in /opt/xscreensaver/ instead of
479 # in /usr/local/, unless there is already an xscreensaver in
480 # /usr/local/bin/. This can be overridden with the --prefix arg
481 # to configure. I'm not sure this is the right thing to do, but
482 # Richard Lloyd says so...
484 if test \! -x /usr/local/bin/xscreensaver ; then
485 ac_default_prefix=/opt/xscreensaver
491 # Thanks for not making xmkmf find this by default, pinheads.
492 # And thanks for moving things around again, too. Is this
493 # really the standard location now? What happened to the
494 # joke that this kind of thing went in /opt?
495 # cthomp says "answer: CDE (Common Disorganized Environment)"
497 if test -f /usr/dt/include/Xm/Xm.h ; then
498 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
499 X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
501 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
502 AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
509 ###############################################################################
511 # Some utility functions to make checking for X things easier.
513 ###############################################################################
515 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
517 AC_DEFUN(AC_CHECK_X_HEADER, [
518 ac_save_CPPFLAGS="$CPPFLAGS"
519 if test \! -z "$includedir" ; then
520 CPPFLAGS="$CPPFLAGS -I$includedir"
522 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
523 AC_CHECK_HEADER([$1], [$2])
524 CPPFLAGS="$ac_save_CPPFLAGS"])
526 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
528 AC_DEFUN(AC_EGREP_X_HEADER, [
529 ac_save_CPPFLAGS="$CPPFLAGS"
530 if test \! -z "$includedir" ; then
531 CPPFLAGS="$CPPFLAGS -I$includedir"
533 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
534 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
535 CPPFLAGS="$ac_save_CPPFLAGS"])
537 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
539 AC_DEFUN(AC_TRY_X_COMPILE, [
540 ac_save_CPPFLAGS="$CPPFLAGS"
541 if test \! -z "$includedir" ; then
542 CPPFLAGS="$CPPFLAGS -I$includedir"
544 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
545 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
546 CPPFLAGS="$ac_save_CPPFLAGS"])
549 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
550 # Use this sparingly; it probably doesn't work very well on X programs.
552 AC_DEFUN(AC_CHECK_X_LIB, [
553 ac_save_CPPFLAGS="$CPPFLAGS"
554 ac_save_LDFLAGS="$LDFLAGS"
555 # ac_save_LIBS="$LIBS"
557 if test \! -z "$includedir" ; then
558 CPPFLAGS="$CPPFLAGS -I$includedir"
560 # note: $X_CFLAGS includes $x_includes
561 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
563 if test \! -z "$libdir" ; then
564 LDFLAGS="$LDFLAGS -L$libdir"
566 # note: $X_LIBS includes $x_libraries
567 LDFLAGS="$LDFLAGS $X_LIBS"
569 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
570 CPPFLAGS="$ac_save_CPPFLAGS"
571 LDFLAGS="$ac_save_LDFLAGS"
572 # LIBS="$ac_save_LIBS"
575 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
576 # (But not the -L directories!)
578 AC_DEFUN(AC_TRY_X_RUN, [
579 ac_save_CPPFLAGS="$CPPFLAGS"
580 if test \! -z "$includedir" ; then
581 CPPFLAGS="$CPPFLAGS -I$includedir"
583 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
584 AC_TRY_RUN([$1], [$2], [$3], [$4])
585 CPPFLAGS="$ac_save_CPPFLAGS"])
589 # Usage: HANDLE_X_PATH_ARG([variable_name],
590 # [--command-line-option],
591 # [descriptive string])
593 # All of the --with options take three forms:
595 # --with-foo (or --with-foo=yes)
596 # --without-foo (or --with-foo=no)
599 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
600 # a directory (string beginning with a slash) it checks to see whether
601 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
604 AC_DEFUN(HANDLE_X_PATH_ARG, [
610 AC_MSG_CHECKING([for [$3] headers])
613 X_CFLAGS="-I$d $X_CFLAGS"
616 AC_MSG_RESULT(not found ($d: no such directory))
619 AC_MSG_CHECKING([for [$3] libs])
622 X_LIBS="-L$d $X_LIBS"
625 AC_MSG_RESULT(not found ($d: no such directory))
628 # replace the directory string with "yes".
635 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
636 echo " If it is a directory, then \`DIR/include' will be added to"
637 echo " the -I list, and \`DIR/lib' will be added to the -L list."
645 ###############################################################################
646 ###############################################################################
648 # End of function definitions. Now start actually executing stuff.
650 ###############################################################################
651 ###############################################################################
653 # random compiler setup
660 # stuff for Makefiles
667 AC_CHECK_HEADERS(unistd.h)
676 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
678 AC_CHECK_FUNCS(sigaction syslog realpath)
681 AC_CHECK_HEADERS(crypt.h sys/select.h)
684 if test -z "$PERL" ; then
685 # don't let it be blank...
686 PERL=/usr/local/bin/perl5
691 if test "$have_x" != yes; then
692 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try \`$0 --help'.)
695 AC_PATH_X_APP_DEFAULTS
701 ###############################################################################
703 # Check for -lXmu (some fucked up vendors don't ship it...)
705 ###############################################################################
708 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
709 if test "$have_xmu" = no ; then
710 XMU_SRCS='$(UTILS_SRC)/xmu.c'
711 XMU_OBJS='$(UTILS_BIN)/xmu.o'
715 SAVER_LIBS="-lXmu $SAVER_LIBS"
716 HACK_LIBS="-lXmu $HACK_LIBS"
717 MOTIF_LIBS="-lXmu $MOTIF_LIBS"
718 GTK_LIBS="-lXmu $GTK_LIBS"
719 ATHENA_LIBS="-lXmu $ATHENA_LIBS"
720 ATHENA3D_LIBS="-lXmu $ATHENA3D_LIBS"
725 ###############################################################################
727 # Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
728 # See comp.windows.x FAQ question 124. The right fix is to
729 # get OpenWindows 3.0 patches 100512-02 and 100573-03.
731 ###############################################################################
733 if test "$have_xmu" = yes ; then
736 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
738 [ac_save_LDFLAGS="$LDFLAGS"
739 if test \! -z "$x_libraries" ; then
740 LDFLAGS="$LDFLAGS -L$x_libraries"
742 # Note: this trick never works! (Generally.)
743 # We're only getting away with using AC_TRY_LINK
744 # with X libraries because we know it's SunOS.
745 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
747 [ac_cv_sunos_xmu_bug=no],
748 [ac_cv_sunos_xmu_bug=yes])
749 LDFLAGS="$ac_save_LDFLAGS"])
750 if test "$ac_cv_sunos_xmu_bug" = yes ; then
751 AC_CACHE_CHECK([whether the compiler understands -static],
753 [ac_save_LDFLAGS="$LDFLAGS"
754 LDFLAGS="$LDFLAGS -static"
755 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
756 LDFLAGS="$ac_save_LDFLAGS"])
757 if test "$ac_cv_ld_static" = yes ; then
758 LDFLAGS="$LDFLAGS -static"
760 LDFLAGS="$LDFLAGS -Bstatic"
768 ###############################################################################
770 # Handle the --enable-subdir option
772 ###############################################################################
774 AC_ARG_ENABLE(subdir,[
775 Installation options:
777 --enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
778 instead of putting them in bindir itself. You can
779 specify the name of the subdirectory. For example,
780 \`--exec-prefix=/usr/local --enable-subdir=demos'
781 would put xscreensaver in /usr/local/bin/, and would
782 put the demos in /usr/local/bin/demos/. (If DIR
783 begins with /, then bindir will not be prepended.)
785 --disable-subdir Just put the demos in \`bindir' (this is the default.)
787 [enable_subdir="$enableval"],[enable_subdir=no])
788 if test x"$enable_subdir" = xno; then
790 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
791 echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
794 # there must be a better way than this...
795 if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
797 HACKDIR=$enable_subdir
800 HACKDIR='${bindir}/'$enable_subdir
804 # canonicalize slashes.
805 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
808 ###############################################################################
810 # Check for the SGI SCREEN_SAVER server extension.
812 ###############################################################################
815 with_sgi_req=unspecified
817 [Except where noted, all of the --with options below can also take a
818 directory argument: for example, \`--with-motif=/opt/Motif'. That would
819 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
820 to be added to the -L list, assuming those directories exist.
822 By default, support for each of these options will be built in, if the
823 relevant library routines exist. At run time, they will then be used
824 only if the X server being used supports them. Each --with option has
825 a corresponding --without option, to override building support for them
828 Screen blanking and idle-detection options:
830 --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.],
831 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
833 HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
835 if test "$with_sgi" = yes; then
836 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
838 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
840 elif test "$with_sgi" != no; then
841 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
846 ###############################################################################
848 # Check for the MIT-SCREEN-SAVER server extension.
850 ###############################################################################
853 with_mit_req=unspecified
855 [ --with-mit-ext Include support for the MIT-SCREEN-SAVER extension.],
856 [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
858 HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
860 if test "$with_mit" = yes; then
861 AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
863 # Now check to see if it's really in the library; XF86Free-3.3 ships
864 # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
866 if test "$have_mit" = yes; then
867 AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm)
869 if test "$have_mit" = no; then
870 # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
871 # of in Xext. Thank you master, may I have another.
872 AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
873 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
874 [true], -lX11 -lXext -lm)
877 if test "$have_mit" = no; then
878 # Double fuck! Looks like some versions of XFree86 (whichever version
879 # it is that comes with RedHat Linux 2.0 -- I can't find a version
880 # number) put this garbage in Xss instead of Xext. Thank you master,
881 # may I have another.
882 AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
883 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
884 [true], -lX11 -lXext -lm)
887 if test "$have_mit" = yes; then
888 AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
893 elif test "$with_mit" != no; then
894 echo "error: must be yes or no: --with-mit-ext=$with_mit"
899 ###############################################################################
901 # Check for the XIDLE server extension.
903 ###############################################################################
906 with_xidle_req=unspecified
907 AC_ARG_WITH(xidle-ext,
908 [ --with-xidle-ext Include support for the XIDLE extension.],
909 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
911 HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
913 if test "$with_xidle" = yes; then
914 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
916 AC_DEFINE(HAVE_XIDLE_EXTENSION)])
917 elif test "$with_xidle" != no; then
918 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
923 ###############################################################################
925 # Check for the SGI-VIDEO-CONTROL server extension.
927 ###############################################################################
930 with_sgivc_req=unspecified
931 AC_ARG_WITH(sgivc-ext,
932 [ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.],
933 [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
935 HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
937 if test "$with_sgivc" = yes; then
939 # first check for XSGIvc.h
940 AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
942 # if that succeeded, then check for the -lXsgivc
943 if test "$have_sgivc" = yes; then
945 AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
946 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
950 # if that succeeded, then we've really got it.
951 if test "$have_sgivc" = yes; then
952 AC_DEFINE(HAVE_SGI_VC_EXTENSION)
955 elif test "$with_sgivc" != no; then
956 echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
961 ###############################################################################
963 # Check for the DPMS server extension.
965 ###############################################################################
968 with_dpms_req=unspecified
969 AC_ARG_WITH(dpms-ext,
970 [ --with-dpms-ext Include support for the DPMS extension.],
971 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
973 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
975 if test "$with_dpms" = yes; then
977 # first check for dpms.h
978 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
980 # if that succeeded, then check for the -lXdpms
981 if test "$have_dpms" = yes; then
983 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
984 [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [true],
988 # if that succeeded, then we've really got it.
989 if test "$have_dpms" = yes; then
990 AC_DEFINE(HAVE_DPMS_EXTENSION)
993 elif test "$with_dpms" != no; then
994 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
999 ###############################################################################
1001 # Check for the XF86VMODE server extension.
1003 ###############################################################################
1006 with_xf86vmode_req=unspecified
1007 AC_ARG_WITH(xf86vmode-ext,
1008 [ --with-xf86vmode-ext Include support for XFree86 virtual screens.],
1009 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
1010 [with_xf86vmode=yes])
1012 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1014 if test "$with_xf86vmode" = yes; then
1016 # first check for xf86vmode.h
1017 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes])
1019 # if that succeeded, then check for the -lXxf86vm
1020 if test "$have_xf86vmode" = yes; then
1022 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1023 [have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"],
1024 [true], -lXext -lX11)
1027 # if that succeeded, then we've really got it.
1028 if test "$have_xf86vmode" = yes; then
1029 AC_DEFINE(HAVE_XF86VMODE)
1032 elif test "$with_xf86vmode" != no; then
1033 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
1038 ###############################################################################
1040 # Check for HP XHPDisableReset and XHPEnableReset.
1042 ###############################################################################
1044 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1045 [AC_DEFINE(HAVE_XHPDISABLERESET)
1046 SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
1049 ###############################################################################
1051 # Check for /proc/interrupts.
1053 ###############################################################################
1055 have_proc_interrupts=no
1056 with_proc_interrupts_req=unspecified
1057 AC_ARG_WITH(proc-interrupts,
1058 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
1059 file to notice keyboard activity.],
1060 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
1061 [with_proc_interrupts=yes])
1063 if test "$with_proc_interrupts" = yes; then
1065 AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1066 ac_cv_have_proc_interrupts,
1067 [ac_cv_have_proc_interrupts=no
1068 if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
1069 ac_cv_have_proc_interrupts=yes
1072 have_proc_interrupts=$ac_cv_have_proc_interrupts
1074 if test "$have_proc_interrupts" = yes; then
1075 AC_DEFINE(HAVE_PROC_INTERRUPTS)
1078 elif test "$with_proc_interrupts" != no; then
1079 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
1084 ###############################################################################
1086 # The --enable-locking option
1088 ###############################################################################
1090 AC_ARG_ENABLE(locking,[
1091 Screen locking options:
1093 --enable-locking Compile in support for locking the display.
1094 --disable-locking Do not allow locking at all.
1096 [enable_locking="$enableval"],[enable_locking=yes])
1097 if test "$enable_locking" = yes; then
1099 elif test "$enable_locking" = no; then
1100 AC_DEFINE(NO_LOCKING)
1102 echo "error: must be yes or no: --enable-locking=$enable_locking"
1108 ###############################################################################
1110 # The --enable-vt-locking option
1112 ###############################################################################
1114 #ac_vt_lockswitch=no
1115 #AC_ARG_ENABLE(vt-locking,[
1116 # --enable-vt-locking Compile in support for locking Virtual Terminals.
1117 # This is the default if the system supports it, and
1118 # if locking support is included (--enable-locking.)
1119 # --disable-vt-locking Do not allow locking of VTs, even if locking is
1121 # [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
1122 #if test "$enable_vt_locking" = yes; then
1124 # AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
1125 # [AC_TRY_COMPILE([#include <fcntl.h>
1126 # #include <sys/ioctl.h>
1127 # #include <sys/vt.h>],
1128 # [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
1129 # [ac_cv_vt_lockswitch=yes],
1130 # [ac_cv_vt_lockswitch=no])])
1131 # ac_vt_lockswitch=$ac_cv_vt_lockswitch
1133 #elif test "$enable_vt_locking" = no; then
1136 # echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
1140 #if test "$ac_vt_lockswitch" = yes; then
1141 # AC_DEFINE(HAVE_VT_LOCKSWITCH)
1142 # # the VT_LOCKSWITCH ioctl can only be used when running as root.
1143 # # #### but it doesn't work yet, so don't worry about that for now.
1149 ###############################################################################
1153 ###############################################################################
1157 # Solaris systems tend to come with PAM misconfigured.
1158 # Don't build it by default, even if the headers exist.
1162 # Default to building PAM support on all other systems, if it exists.
1163 with_pam_default=yes
1168 with_pam_req=unspecified
1171 [ --with-pam Include support for PAM (Pluggable Auth Modules.)],
1172 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default])
1174 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
1176 if test "$enable_locking" = yes -a "$with_pam" = yes; then
1177 AC_CACHE_CHECK([for PAM], ac_cv_pam,
1178 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
1181 if test "$ac_cv_pam" = yes ; then
1184 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
1186 # libpam typically requires dlopen and dlsym. On FreeBSD,
1187 # those are in libc. On Linux and Solaris, they're in libdl.
1188 AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
1190 AC_MSG_CHECKING(how to call pam_strerror)
1191 AC_CACHE_VAL(ac_cv_pam_strerror_args,
1192 [AC_TRY_COMPILE([#include <stdio.h>
1194 #include <security/pam_appl.h>],
1195 [pam_handle_t *pamh = 0;
1196 char *s = pam_strerror(pamh, PAM_SUCCESS);],
1197 [ac_pam_strerror_args=2],
1198 [AC_TRY_COMPILE([#include <stdio.h>
1200 #include <security/pam_appl.h>],
1202 pam_strerror(PAM_SUCCESS);],
1203 [ac_pam_strerror_args=1],
1204 [ac_pam_strerror_args=0])])
1205 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
1206 ac_pam_strerror_args=$ac_cv_pam_strerror_args
1207 if test "$ac_pam_strerror_args" = 1 ; then
1208 AC_MSG_RESULT(one argument)
1209 elif test "$ac_pam_strerror_args" = 2 ; then
1210 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
1211 AC_MSG_RESULT(two arguments)
1213 AC_MSG_RESULT(unknown)
1219 ###############################################################################
1221 # Check for Kerberos.
1223 ###############################################################################
1226 with_kerberos_req=unspecified
1228 AC_ARG_WITH(kerberos,
1229 [ --with-kerberos Include support for Kerberos authentication.],
1230 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
1232 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
1234 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
1235 AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
1236 [AC_TRY_X_COMPILE([#include <krb.h>],,
1237 [ac_cv_kerberos=yes],
1238 [ac_cv_kerberos=no])])
1239 if test "$ac_cv_kerberos" = yes ; then
1241 AC_DEFINE(HAVE_KERBEROS)
1243 # from Tim Showalter <tjs+@andrew.cmu.edu>
1244 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
1245 AC_CHECK_FUNC(res_search,,
1246 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
1247 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
1254 ###############################################################################
1256 # Check for the nine billion variants of shadow passwords...
1258 ###############################################################################
1263 with_shadow_req=unspecified
1266 [ --with-shadow Include support for shadow password authentication.],
1267 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
1269 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
1271 if test "$enable_locking" = no ; then
1277 ###############################################################################
1279 # Check for Sun "adjunct" passwords.
1281 ###############################################################################
1283 if test "$with_shadow" = yes ; then
1284 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
1285 [AC_TRY_X_COMPILE([#include <stdlib.h>
1287 #include <sys/types.h>
1288 #include <sys/label.h>
1289 #include <sys/audit.h>
1290 #include <pwdadj.h>],
1291 [struct passwd_adjunct *p = getpwanam("nobody");
1292 const char *pw = p->pwa_passwd;],
1293 [ac_cv_sun_adjunct=yes],
1294 [ac_cv_sun_adjunct=no])])
1295 if test "$ac_cv_sun_adjunct" = yes; then
1296 have_shadow_adjunct=yes
1303 ###############################################################################
1305 # Check for DEC and SCO so-called "enhanced" security.
1307 ###############################################################################
1309 if test "$with_shadow" = yes ; then
1310 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
1311 [AC_TRY_X_COMPILE([#include <stdlib.h>
1313 #include <sys/types.h>
1315 #include <sys/security.h>
1317 [struct pr_passwd *p;
1319 set_auth_parameters(0, 0);
1320 check_auth_parameters();
1321 p = getprpwnam("nobody");
1322 pw = p->ufld.fd_encrypt;],
1323 [ac_cv_enhanced_passwd=yes],
1324 [ac_cv_enhanced_passwd=no])])
1325 if test $ac_cv_enhanced_passwd = yes; then
1326 have_shadow_enhanced=yes
1330 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
1331 # (I'm told it needs -lcurses too, but I don't understand why.)
1332 # But on DEC, it's in -lsecurity.
1334 AC_CHECK_LIB(prot, getprpwnam,
1335 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
1336 [AC_CHECK_LIB(security, getprpwnam,
1337 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
1342 ###############################################################################
1344 # Check for HP's entry in the "Not Invented Here" Sweepstakes.
1346 ###############################################################################
1348 if test "$with_shadow" = yes ; then
1349 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
1350 [AC_TRY_X_COMPILE([#include <stdlib.h>
1352 #include <sys/types.h>
1354 #include <hpsecurity.h>
1356 [struct s_passwd *p = getspwnam("nobody");
1357 const char *pw = p->pw_passwd;],
1358 [ac_cv_hpux_passwd=yes],
1359 [ac_cv_hpux_passwd=no])])
1360 if test "$ac_cv_hpux_passwd" = yes; then
1361 have_shadow_hpux=yes
1365 # on HPUX, bigcrypt is in -lsec
1366 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
1371 ###############################################################################
1373 # Check for FreeBSD-style shadow passwords.
1375 # On FreeBSD, getpwnam() and friends work just like on non-shadow-
1376 # password systems -- except you only get stuff in the pw_passwd field
1377 # if the running program is setuid. So, guess that we've got this
1378 # lossage to contend with if /etc/master.passwd exists, and default to
1379 # a setuid installation.
1381 ###############################################################################
1383 if test "$with_shadow" = yes ; then
1384 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
1385 [if test -f /etc/master.passwd ; then
1386 ac_cv_master_passwd=yes
1388 ac_cv_master_passwd=no
1390 if test "$ac_cv_master_passwd" = yes; then
1396 ###############################################################################
1398 # Check for traditional (ha!) shadow passwords.
1400 ###############################################################################
1402 if test "$with_shadow" = yes ; then
1403 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
1404 [AC_TRY_X_COMPILE([#include <stdlib.h>
1406 #include <sys/types.h>
1408 #include <shadow.h>],
1409 [struct spwd *p = getspnam("nobody");
1410 const char *pw = p->sp_pwdp;],
1412 [ac_cv_shadow=no])])
1413 if test "$ac_cv_shadow" = yes; then
1417 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
1419 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
1420 if test "$have_getspnam" = no ; then
1421 AC_CHECK_LIB(gen, getspnam,
1422 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
1428 ###############################################################################
1430 # Check for other libraries needed for non-shadow passwords.
1432 ###############################################################################
1434 if test "$enable_locking" = yes ; then
1436 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
1438 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
1439 if test "$have_crypt" = no ; then
1440 AC_CHECK_LIB(crypt, crypt,
1441 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
1446 # Most of the above shadow mechanisms will have set need_setuid to yes,
1447 # if they were found. But, on some systems, we need setuid even when
1448 # using plain old vanilla passwords.
1450 if test "$enable_locking" = yes ; then
1452 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
1459 if test "$have_shadow_adjunct" = yes ; then
1460 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
1461 elif test "$have_shadow_enhanced" = yes ; then
1462 AC_DEFINE(HAVE_ENHANCED_PASSWD)
1463 elif test "$have_shadow_hpux" = yes ; then
1464 AC_DEFINE(HAVE_HPUX_PASSWD)
1465 elif test "$have_shadow" = yes ; then
1466 AC_DEFINE(HAVE_SHADOW_PASSWD)
1470 ###############################################################################
1474 ###############################################################################
1477 with_motif_req=unspecified
1479 User interface options:
1481 --with-motif Use the Motif toolkit for the user interface.],
1482 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=yes])
1484 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
1486 if test "$with_motif" != yes -a "$with_motif" != no ; then
1487 echo "error: must be yes or no: --with-motif=$with_motif"
1491 if test "$with_motif" = yes; then
1493 AC_CHECK_X_HEADER(Xm/Xm.h,
1495 AC_DEFINE(HAVE_MOTIF)
1496 MOTIF_LIBS="$MOTIF_LIBS -lXm"])
1500 ###############################################################################
1504 ###############################################################################
1507 with_gtk_req=unspecified
1509 [ --with-gtk Use the Gtk toolkit for the user interface.],
1510 [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
1512 # if --with-gtk=/directory/ was specified, remember that directory so that
1513 # we can also look for the `gtk-config' program in that directory.
1523 HANDLE_X_PATH_ARG(with_gtk, --with-gtk, Gtk)
1525 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
1526 echo "error: must be yes or no: --with-gtk=$with_gtk"
1531 if test "$with_gtk" = yes; then
1534 # if the user specified --with-gtk=/foo/ then look in /foo/bin/
1535 # for glib-config and gtk-config.
1539 if test ! -z "$gtk_dir"; then
1540 # canonicalize slashes.
1541 gtk_dir=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
1542 gtk_path="$gtk_dir:$gtk_dir:$gtk_path"
1545 AC_PATH_PROGS(glib_config, glib-config,, $gtk_path)
1546 AC_PATH_PROGS(gtk_config, gtk-config,, $gtk_path)
1548 if test -n "$glib_config" -a -n "gtk_config" ; then
1551 if test "$have_gtk" = yes; then
1552 AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string,
1553 [ac_cv_gtk_version_string=`$glib_config --version`])
1554 ac_gtk_version_string=$ac_cv_gtk_version_string
1557 maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
1558 min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
1560 ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
1561 if test -z "$ac_gtk_version"; then
1562 ac_gtk_version=unknown
1563 ac_gtk_version_string=unknown
1565 if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
1571 if test "$have_gtk" = yes; then
1572 AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
1573 [ac_cv_gtk_config_cflags=`$gtk_config --cflags`])
1574 AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
1575 [ac_cv_gtk_config_libs=`$gtk_config --libs`])
1576 INCLUDES="$INCLUDES $ac_cv_gtk_config_cflags"
1577 GTK_LIBS="$GTK_LIBS $ac_cv_gtk_config_libs"
1583 ###############################################################################
1585 # Check for -lXaw and -lXaw3d.
1587 ###############################################################################
1591 with_athena_req=unspecified
1593 [ --with-athena Use the Athena toolkit for the user interface.],
1594 [with_athena="$withval"; with_athena_req="$withval"],[with_athena=yes])
1596 HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena)
1599 if test "$with_athena" != yes -a "$with_athena" != no ; then
1600 echo "error: must be yes or no: --with-athena=$with_athena"
1605 if test "$with_athena" = yes; then
1607 AC_CHECK_X_HEADER(X11/Xaw/Dialog.h, [have_athena=yes])
1608 if test "$have_athena" = yes; then
1609 AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
1610 [have_athena=yes; have_athena3d=yes], [true],
1611 -lXt -lXmu -lXext -lX11)
1615 if test "$have_athena" = yes; then
1616 AC_DEFINE(HAVE_ATHENA)
1617 ATHENA_LIBS="-lXaw $ATHENA_LIBS"
1620 if test "$have_athena3d" = yes; then
1621 ATHENA3D_LIBS="-lXaw3d $ATHENA3D_LIBS"
1625 # If we have Athena, check whether it's a version that includes
1626 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
1627 if test "$have_athena" = yes ; then
1628 AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
1629 ac_cv_have_XawViewportSetCoordinates,
1630 [ac_cv_have_XawViewportSetCoordinates=no
1631 AC_EGREP_X_HEADER(XawViewportSetCoordinates,
1633 ac_cv_have_XawViewportSetCoordinates=yes)])
1634 if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
1635 AC_DEFINE(HAVE_XawViewportSetCoordinates)
1640 ###############################################################################
1642 # Checking whether Motif is really Lesstif.
1644 ###############################################################################
1647 if test "$have_motif" = yes ; then
1648 AC_CACHE_CHECK([whether Motif is really LessTif],
1650 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
1651 [long vers = LesstifVersion;],
1652 [ac_cv_have_lesstif=yes],
1653 [ac_cv_have_lesstif=no])])
1654 have_lesstif=$ac_cv_have_lesstif
1658 lesstif_version=unknown
1659 lesstif_version_string=unknown
1661 if test "$have_lesstif" = yes ; then
1663 echo unknown > conftest-lt
1664 AC_CACHE_CHECK([LessTif version number],
1665 ac_cv_lesstif_version_string,
1666 [AC_TRY_X_RUN([#include <stdio.h>
1669 FILE *f = fopen("conftest-lt", "w");
1671 fprintf(f, "%d %d.%d\n", LesstifVersion,
1672 LESSTIF_VERSION, LESSTIF_REVISION);
1676 [ltv=`cat conftest-lt`
1677 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
1678 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
1679 [ac_cv_lesstif_version=unknown
1680 ac_cv_lesstif_version_string=unknown],
1681 [ac_cv_lesstif_version=unknown
1682 ac_cv_lesstif_version_string=unknown])])
1684 lesstif_version=$ac_cv_lesstif_version
1685 lesstif_version_string=$ac_cv_lesstif_version_string
1690 if test "$have_motif" = yes ; then
1692 echo unknown > conftest-mt
1693 AC_CACHE_CHECK([Motif version number],
1694 ac_cv_motif_version_string,
1695 [AC_TRY_X_RUN([#include <stdio.h>
1698 FILE *f = fopen("conftest-mt", "w");
1700 fprintf(f, "%d %d.%d\n", XmVersion,
1701 XmVERSION, XmREVISION);
1705 [mtv=`cat conftest-mt`
1706 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
1707 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
1708 [ac_cv_motif_version=unknown
1709 ac_cv_motif_version_string=unknown],
1710 [ac_cv_motif_version=unknown
1711 ac_cv_motif_version_string=unknown])])
1713 motif_version=$ac_cv_motif_version
1714 motif_version_string=$ac_cv_motif_version_string
1719 ###############################################################################
1721 # Checking whether Motif requires -lXpm.
1723 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
1724 # The deal is, Motif 2.x requires XPM -- but it's a compilation option
1725 # of the library whether to build the XPM code into libXm, or whether
1726 # to rely on an external libXm. So the only way to tell whether XPM is
1727 # a link-time requirement is to examine libXm.a, which is very
1728 # difficult to do in an autoconf script. So... if it's Motif 2.x, we
1729 # always link against XPM if the XPM lib exists (and this will be a
1730 # no-op if libXm happens to already have the XPM code in it.)
1732 ###############################################################################
1734 motif_requires_xpm=no
1735 if test "$have_motif" = yes ; then
1736 AC_MSG_CHECKING(whether Motif requires XPM)
1737 if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
1739 motif_requires_xpm=yes
1740 AC_MSG_RESULT(maybe)
1747 ###############################################################################
1749 # Checking whether Motif requires -lXp.
1751 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
1752 # Extension". Why this extension isn't in -lXext with all the others,
1755 ###############################################################################
1758 if test "$have_motif" = yes ; then
1760 AC_CHECK_X_LIB(Xp, XpQueryExtension,
1761 [have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"],
1762 [true], -lX11 -lXext -lm)
1766 ###############################################################################
1768 # Checking whether Motif requires -lXintl (for _Xsetlocale.)
1770 ###############################################################################
1773 if test "$have_motif" = yes ; then
1774 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
1776 if test "$have_xintl" = yes; then
1777 MOTIF_LIBS="$MOTIF_LIBS -lXintl"
1782 ###############################################################################
1784 # Check for -lGL or -lMesa.
1786 ###############################################################################
1790 with_gl_req=unspecified
1794 --with-gl Build those demos which depend on OpenGL.],
1795 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
1797 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
1799 ac_mesagl_version=unknown
1800 ac_mesagl_version_string=unknown
1802 if test "$with_gl" = yes; then
1803 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
1804 if test "$have_gl" = yes ; then
1805 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
1808 # If we have the headers, try and figure out which vendor it's from.
1810 if test "$have_gl" = yes ; then
1812 # We need to know whether it's MesaGL so that we know which libraries
1815 AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl,
1816 [ac_cv_have_mesa_gl=no
1817 AC_EGREP_X_HEADER(Mesa, GL/glx.h, [ac_cv_have_mesa_gl=yes])
1819 ac_have_mesa_gl=$ac_cv_have_mesa_gl
1822 # If we have Mesa headers, check to see if we can link against -lMesaGL.
1823 # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
1824 # Else, warn that GL is busted. (We have the headers, but no libs.)
1829 if test "$ac_have_mesa_gl" = yes ; then
1830 AC_CHECK_X_LIB(MesaGL, glXCreateContext,
1832 GL_LIBS="-lMesaGL -lMesaGLU"],
1833 [], -lMesaGLU -lX11 -lXext -lm)
1836 if test "$gl_lib_1" = "" ; then
1837 AC_CHECK_X_LIB(GL, glXCreateContext,
1839 GL_LIBS="-lGL -lGLU"],
1840 [], -lGLU -lX11 -lXext -lm)
1843 if test "$gl_lib_1" = "" ; then
1844 # we have headers, but no libs -- bail.
1848 # linking works -- we can build the GL hacks.
1850 if test "$ac_have_mesa_gl" = yes ; then
1851 AC_DEFINE(HAVE_MESA_GL)
1857 # Now that we know we have GL headers and libs, do some more GL testing.
1860 if test "$have_gl" = yes ; then
1861 # If it's MesaGL, we'd like to issue a warning if the version number
1862 # is less than or equal to 2.6, because that version had a security bug.
1864 if test "$ac_have_mesa_gl" = yes; then
1866 AC_CACHE_CHECK([MesaGL version number], ac_cv_mesagl_version_string,
1867 [cat > conftest.$ac_ext <<EOF
1868 #line __oline__ "configure"
1869 #include "confdefs.h"
1871 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
1874 ac_save_CPPFLAGS="$CPPFLAGS"
1875 if test \! -z "$includedir" ; then
1876 CPPFLAGS="$CPPFLAGS -I$includedir"
1878 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1882 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
1883 's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
1886 rm -f conftest.$ac_ext
1888 CPPFLAGS="$ac_save_CPPFLAGS"
1890 if test "$mglv" = ""; then
1891 ac_mesagl_version=unknown
1892 ac_mesagl_version_string=unknown
1894 ac_mesagl_version_string=$mglv
1895 maj=`echo $mglv | sed -n 's/\..*//p'`
1896 min=`echo $mglv | sed -n 's/.*\.//p'`
1897 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
1898 if test -z "$ac_mesagl_version"; then
1899 ac_mesagl_version=unknown
1900 ac_mesagl_version_string=unknown
1903 ac_cv_mesagl_version=$ac_mesagl_version
1904 ac_cv_mesagl_version_string=$ac_mesagl_version_string
1906 ac_mesagl_version=$ac_cv_mesagl_version
1907 ac_mesagl_version_string=$ac_cv_mesagl_version_string
1911 # If it's MesaGL, check to see if it requires -lpthread.
1914 mesa_requires_pthread=no
1915 if test "$ac_have_mesa_gl" = yes; then
1917 AC_CHECK_LIB(pthread, pthread_create, [have_pthread=yes], [],)
1918 if test "$have_pthread" = yes; then
1919 AC_CHECK_X_LIB($gl_lib_1, gl_get_thread_context,
1920 [mesa_requires_pthread=yes], [true],
1921 $GL_LIBS -lpthread -lX11 -lXext -lm)
1924 if test "$mesa_requires_pthread" = yes; then
1925 GL_LIBS="$GL_LIBS -lpthread"
1929 # Check for OpenGL 1.1 features.
1931 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
1932 [true], $GL_LIBS -lX11 -lXext -lm)
1935 # Check whether the `xscreensaver' executable should link against GL.
1936 # See comments in utils/visual-gl.c for why this is sometimes necessary.
1938 AC_MSG_CHECKING(whether drastic GL measures must be taken)
1941 AC_MSG_RESULT([yes -- hello, SGI.])
1942 AC_DEFINE(DAEMON_USE_GL)
1943 SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
1944 SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
1945 SAVER_GL_LIBS="$GL_LIBS"
1948 AC_MSG_RESULT([no -- non-SGI.])
1957 elif test "$with_gl" != no; then
1958 echo "error: must be yes or no: --with-gl=$with_gl"
1963 ###############################################################################
1967 ###############################################################################
1970 with_xpm_req=unspecified
1972 [ --with-xpm Include support for XPM files in some demos.],
1973 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
1975 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
1977 if test "$with_xpm" = yes; then
1978 AC_CHECK_X_HEADER(X11/xpm.h,
1982 elif test "$with_xpm" != no; then
1983 echo "error: must be yes or no: --with-xpm=$with_xpm"
1987 # See comment near $motif_requires_xpm, above.
1988 # Need to do this here, after both Motif and XPM have been checked for.
1990 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
1991 if test "$motif_requires_xpm" = yes ; then
1992 MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
1997 ###############################################################################
1999 # Check for the XSHM server extension.
2001 ###############################################################################
2004 with_xshm_req=unspecified
2005 AC_ARG_WITH(xshm-ext,
2006 [ --with-xshm-ext Include support for the XSHM extension.],
2007 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
2009 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
2011 if test "$with_xshm" = yes; then
2013 # first check for Xshm.h.
2014 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
2016 # if that succeeded, then check for sys/ipc.h.
2017 if test "$have_xshm" = yes; then
2019 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
2022 # if that succeeded, then check for sys/shm.h.
2023 if test "$have_xshm" = yes; then
2025 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
2028 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
2029 # to exist, but the library code to not exist. And even better, the library
2030 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
2031 # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
2032 # that's not quite right, but close enough.)
2037 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
2038 [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
2039 [true], -lX11 -lXext -lm)
2043 # if that succeeded, then we've really got it.
2044 if test "$have_xshm" = yes; then
2045 AC_DEFINE(HAVE_XSHM_EXTENSION)
2048 elif test "$with_xshm" != no; then
2049 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
2054 ###############################################################################
2056 # Check for the DOUBLE-BUFFER server extension.
2058 ###############################################################################
2061 with_xdbe_req=unspecified
2062 AC_ARG_WITH(xdbe-ext,
2063 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER extension.],
2064 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
2066 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
2068 if test "$with_xdbe" = yes; then
2070 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes])
2071 if test "$have_xdbe" = yes; then
2072 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
2075 elif test "$with_xdbe" != no; then
2076 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
2081 ###############################################################################
2083 # Check for the SGI XReadDisplay server extension.
2085 # Note: this has to be down here, rather than up with the other server
2086 # extension tests, so that the output of `configure --help' is in the
2087 # right order. Arrgh!
2089 ###############################################################################
2092 with_readdisplay_req=unspecified
2093 AC_ARG_WITH(readdisplay,
2094 [ --with-readdisplay Include support for the XReadDisplay extension.],
2095 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
2096 [with_readdisplay=yes])
2098 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
2100 if test "$with_readdisplay" = yes; then
2101 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
2102 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
2103 elif test "$with_readdisplay" != no; then
2104 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
2109 ###############################################################################
2111 # Check for the SGI Iris Video Library.
2113 ###############################################################################
2116 with_sgivideo_req=unspecified
2117 AC_ARG_WITH(sgivideo,
2118 [ --with-sgivideo Include support for SGI's Iris Video Library.],
2119 [with_sgivideo="$withval"; with_sgivideo_req="$withval"],
2120 [with_sgivideo=yes])
2122 HANDLE_X_PATH_ARG(with_sgivideo, --with-sgivideo, Iris Video)
2124 if test "$with_sgivideo" = yes; then
2125 AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes)
2126 if test "$have_sgivideo" = yes; then
2128 AC_CHECK_LIB(vl, vlOpenVideo, [have_sgivideo=yes])
2129 if test "$have_sgivideo" = yes; then
2130 SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
2131 SGI_VIDEO_LIBS="-lvl"
2132 AC_DEFINE(HAVE_SGI_VIDEO)
2135 elif test "$with_sgivideo" != no; then
2136 echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
2141 ###############################################################################
2143 # Check for a program to generate random text.
2145 # Zippy is funnier than the idiocy generally spat out by `fortune',
2146 # so try to find that, by invoking Emacs and asking it where its
2147 # libexec directory is ("yow" lives in there.)
2149 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
2150 # and if so, use them.
2152 # If that doesn't work, look in /usr/games, and if it's there, use
2153 # the full pathname.
2155 ###############################################################################
2159 --with-zippy=PROGRAM Some demos are able to run an external program and
2160 display its text; this names the program to use by
2161 default (though it can be overridden with X
2162 resources.) If you don't specify this, the default
2163 is to use \"yow\" from the Emacs distribution (if you
2164 have it) or else to use \"fortune\".
2166 [with_zippy_req="$withval"; with_zippy="$withval"],[with_zippy=yes])
2168 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
2173 if test -n "$with_zippy_req" ; then
2174 ac_cv_zippy_program=""
2175 case "$with_zippy_req" in
2177 AC_MSG_CHECKING([for $with_zippy_req])
2178 if test -x "$with_zippy_req" ; then
2187 unset ac_cv_path_zip2
2188 AC_PATH_PROG(zip2, $with_zippy_req, [])
2189 if test "$zip2" = ""; then
2194 ac_cv_zippy_program="$with_zippy"
2196 elif test -n "$ac_cv_zippy_program"; then
2197 AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
2200 if test ! -n "$ac_cv_zippy_program"; then
2202 AC_CHECK_PROGS(emacs_exe, emacs)
2203 AC_CHECK_PROGS(xemacs_exe, xemacs)
2205 ac_cv_zippy_program=""
2206 eargs='-batch -q -nw --eval'
2208 if test -n "$emacs_exe" ; then
2209 AC_MSG_CHECKING([for emacs yow])
2211 # get emacs to tell us where the libexec directory is.
2213 dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
2214 2>/dev/null | tail -1`
2215 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
2217 # try running libexec/yow and see if it exits without error.
2219 if test x"$dir" != x -a -x "$dir/yow" ; then
2220 if $dir/yow >&- 2>&- ; then
2221 ac_cv_zippy_program="$dir/yow"
2222 AC_MSG_RESULT($ac_cv_zippy_program)
2229 if test -z "$ac_cv_zippy_program" ; then
2230 AC_MSG_CHECKING([for xemacs yow])
2231 if test -n "$xemacs_exe" ; then
2233 # get xemacs to tell us where the libexec directory is.
2235 dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
2236 2>/dev/null | tail -1`
2237 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
2239 # try running libexec/yow and see if it exits without error.
2241 if test x"$dir" != x -a -x "$dir/yow" ; then
2242 if $dir/yow >&- 2>&- ; then
2243 ac_cv_zippy_program="$dir/yow"
2244 AC_MSG_RESULT($ac_cv_zippy_program)
2247 # in some xemacs installations, the pathname of the yow.lines file
2248 # isn't hardcoded into the yow executable, and must be passed on
2249 # the command line. See if it's in libexec/../etc/.
2253 dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
2256 yowlines="$dir_up/etc/yow.lines"
2257 if $dir/yow -f $yowlines >&- 2>&- ; then
2258 ac_cv_zippy_program="$dir/yow -f $yowlines"
2259 AC_MSG_RESULT($ac_cv_zippy_program)
2262 # In newer XEmacs releases, yow.lines is in a different place,
2263 # and the easiest way to get it is by calling the new function
2264 # `locate-data-file'.
2266 yowlines=`$xemacs_exe $eargs \
2267 '(princ (concat (locate-data-file "yow.lines") "\n"))' \
2268 2>/dev/null | tail -1`
2269 if $dir/yow -f $yowlines >&- 2>&- ; then
2270 ac_cv_zippy_program="$dir/yow -f $yowlines"
2271 AC_MSG_RESULT($ac_cv_zippy_program)
2281 # if that didn't work, try for some other programs...
2282 if test -z "$ac_cv_zippy_program" ; then
2284 AC_CHECK_PROGS(fortune, [fortune zippy yow])
2285 # if that didn't work, try for those programs in /usr/games...
2286 if test -z "$fortune" ; then
2287 AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
2288 /usr/games:/usr/local/games:$PATH)
2293 if test -z "$ac_cv_zippy_program" ; then
2294 ac_cv_zippy_program=fortune
2297 AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
2300 ###############################################################################
2302 # Done testing. Now, set up the various -I and -L variables,
2303 # and decide which GUI program to build by default.
2305 ###############################################################################
2312 if test \! -z "$includedir" ; then
2313 INCLUDES="$INCLUDES -I$includedir"
2316 if test \! -z "$libdir" ; then
2317 LDFLAGS="$LDFLAGS -L$libdir"
2322 if test "$have_athena3d" = yes; then
2323 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw3d
2324 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2326 if test "$have_athena" = yes; then
2327 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw
2328 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2330 if test "$have_gtk" = yes; then
2331 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
2332 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2334 if test "$have_motif" = yes; then
2335 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
2336 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2340 if test "$have_kerberos" = yes; then
2341 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
2342 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
2344 if test "$have_pam" = yes; then
2345 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
2346 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
2347 INSTALL_PAM="install-pam"
2349 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
2350 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
2353 if test "$enable_locking" = yes; then
2354 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
2355 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
2361 if test "$need_setuid" = yes; then
2363 INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
2366 INSTALL_SETUID='$(INSTALL_PROGRAM)'
2370 if test "$have_gl" = yes; then
2371 GL_EXES='$(GL_EXES)'
2375 GL_KLUDGE=" -${tab} "
2379 ###############################################################################
2381 # Perform substitutions and write Makefiles.
2383 ###############################################################################
2387 AC_SUBST(PREFERRED_DEMO_PROGRAM)
2388 AC_SUBST(ALL_DEMO_PROGRAMS)
2389 AC_SUBST(SAVER_LIBS)
2390 AC_SUBST(MOTIF_LIBS)
2392 AC_SUBST(ATHENA_LIBS)
2393 AC_SUBST(ATHENA3D_LIBS)
2397 AC_SUBST(PASSWD_LIBS)
2398 AC_SUBST(INSTALL_SETUID)
2399 AC_SUBST(INSTALL_DIRS)
2400 AC_SUBST(NEED_SETUID)
2401 AC_SUBST(INSTALL_PAM)
2402 AC_SUBST(SGI_VIDEO_OBJS)
2403 AC_SUBST(SGI_VIDEO_LIBS)
2405 AC_SUBST(PASSWD_SRCS)
2406 AC_SUBST(PASSWD_OBJS)
2409 AC_SUBST(SAVER_GL_SRCS)
2410 AC_SUBST(SAVER_GL_OBJS)
2411 AC_SUBST(SAVER_GL_LIBS)
2419 APPDEFAULTS=$ac_x_app_defaults
2420 AC_SUBST(APPDEFAULTS)
2423 AC_SUBST(DEPEND_FLAGS)
2424 AC_SUBST(DEPEND_DEFINES)
2432 driver/XScreenSaver.ad)
2434 ###############################################################################
2436 # Print some warnings at the end.
2438 ###############################################################################
2440 warn_prefix_1=" Warning:"
2441 warn_prefix_2=" Note:"
2442 warn_prefix="$warn_prefix_1"
2445 warnsep=' #################################################################'
2448 if test "$warning" = no ; then
2449 echo '' ; echo "$warnsep" ; echo ''
2456 if test "$warning" = long ; then echo '' ; fi
2458 echo "$warn_prefix $@"
2465 if test "$was" != no ; then echo '' ; fi
2466 echo "$warn_prefix $@"
2475 warn_prefix="$warn_prefix_2"
2477 warn_prefix="$warn_prefix_1"
2481 warn_prefix="$warn_prefix_2"
2483 warn_prefix="$warn_prefix_1"
2487 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
2488 warn 'The SGI saver extension was requested, but was not found.'
2491 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
2492 warn 'The MIT saver extension was requested, but was not found.'
2495 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
2496 warn 'The XIdle extension was requested, but was not found.'
2499 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
2500 warn 'The XSHM extension was requested, but was not found.'
2503 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
2504 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
2507 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
2508 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
2511 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
2512 warn 'The DPMS extension was requested, but was not found.'
2515 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
2516 warn 'The XF86VMODE extension was requested, but was not found.'
2519 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
2520 warn "Checking of /proc/interrupts was requested, but it's bogus."
2524 if test "$have_motif" = no -a "$have_gtk" = no -a "$have_athena" = no ; then
2525 warnL "None of Motif, Gtk, or Athena widgets seem to be available;"
2526 warn2 "the \`xscreensaver-demo' program requires one of these."
2528 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
2529 warnL "Use of Motif was requested, but it wasn't found;"
2530 if test "$have_gtk" = yes; then
2531 warn2 "Gtk will be used instead."
2533 warn2 "Athena will be used instead."
2536 elif test "$jurassic_gtk" = yes ; then
2540 v="$ac_gtk_version_string"
2541 if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
2542 warnL "Use of Gtk was requested, but its version number is unknown;"
2543 elif test "$with_gtk_req" = yes ; then
2544 warnL "Use of Gtk was requested, but it is version $v;"
2546 warnL "Gtk was found on this system, but it is version $v;"
2549 if test "$have_motif" = yes; then
2555 warn2 "Gtk $pref_gtk or newer is required. $which will be used instead."
2557 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
2558 warnL "Use of Gtk was requested, but it wasn't found;"
2559 if test "$have_motif" = yes; then
2560 warn2 "Motif will be used instead."
2562 warn2 "Athena will be used instead."
2565 elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
2566 warnL "Use of Athena was requested, but it wasn't found;"
2567 if test "$have_gtk" = yes; then
2568 warn2 "Gtk will be used instead."
2570 warn2 "Motif will be used instead."
2575 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
2577 preferred_lesstif=0.86
2579 if test "$lesstif_version" = unknown; then
2580 warnL "Unable to determine the LessTif version number!"
2581 warn2 "Make sure you are using version $preferred_lesstif or newer."
2582 warn2 "See <http://www.lesstif.org/>."
2584 elif test \! $lesstif_version -gt 82; then
2585 warnL "LessTif version $lesstif_version_string is being used."
2586 warn2 "LessTif versions 0.82 and earlier are too buggy to"
2587 warn2 "use with XScreenSaver; it is strongly recommended"
2588 warn2 "that you upgrade to at least version $preferred_lesstif!"
2589 warn2 "See <http://www.lesstif.org/>."
2593 if test "$have_athena" = yes -a "$have_motif" = no -a "$have_gtk" = no; then
2594 warnL "Athena widgets are being used instead of Motif or Gtk."
2595 warn2 "The \`xscreensaver-demo' program looks much better"
2596 warn2 "with Motif or Gtk. Wouldn't you rather be using Motif?"
2597 warn2 "Motif is shipped by every commercial Unix vendor,"
2598 warn2 "and there is a free implementation available as"
2599 warn2 "well: see <http://www.lesstif.org/>. Gtk is shipped"
2600 warn2 "with most Linux and BSD distributions."
2604 if test "$have_xpm" = no ; then
2605 if test "$with_xpm_req" = yes ; then
2606 warnL 'Use of XPM was requested, but it was not found.'
2607 elif test "$with_xpm_req" = no ; then
2608 noteL 'The XPM library is not being used.'
2610 noteL 'The XPM library was not found.'
2614 warn2 'Some of the demos will not be as colorful as they'
2615 warn2 'could be. You might want to consider installing XPM'
2616 warn2 'and re-running configure. (Remember to delete the'
2617 warn2 'config.cache file first.) You can find XPM at most'
2618 warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
2622 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
2623 preferred_mesagl=3.0
2625 if test "$ac_mesagl_version" = unknown; then
2626 warnL "Unable to determine the MesaGL version number!"
2627 warn2 "Make sure you are using version $preferred_mesagl or newer."
2629 elif test \! "$ac_mesagl_version" -gt 2006; then
2630 warnL "MesaGL version $ac_mesagl_version_string is being used."
2631 warn2 "MesaGL versions 2.6 and earlier have a security bug."
2632 warn2 "It is strongly recommended that you upgrade to at"
2633 warn2 "least version $preferred_mesagl."
2638 if test "$have_gl" = no ; then
2639 if test "$with_gl_req" = yes ; then
2640 warnL 'Use of GL was requested, but it was not found.'
2641 elif test "$with_gl_req" = no ; then
2642 noteL 'The OpenGL 3D library is not being used.'
2644 noteL 'The OpenGL 3D library was not found.'
2648 warn2 'Those demos which use 3D will not be built or installed.'
2649 warn2 'You might want to consider installing OpenGL and'
2650 warn2 're-running configure. (Remember to delete the'
2651 warn2 "config.cache file first.) If your vendor doesn't ship"
2652 warn2 'their own implementation of OpenGL, you can get a free'
2653 warn2 'version at <http://www.mesa3d.org/>. For general OpenGL'
2654 warn2 'info, see <http://www.opengl.org/>.'
2658 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
2659 warn 'Use of XReadDisplay was requested, but it was not found.'
2662 if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
2663 warn 'Use of the Iris Video Library was requested, but it was not found.'
2666 if test -n "$with_zippy_req"; then
2667 if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
2668 warnL "$with_zippy_req was requested as the Zippy program,"
2669 warn2 "but was not found. The default will be used instead."
2673 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
2674 warn 'Use of Kerberos was requested, but it was not found.'
2677 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
2678 warn 'Use of PAM was requested, but it was not found.'
2681 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
2682 warn 'Use of shadow passwords was requested, but they were not found.'
2686 # You are in a twisty maze of namespaces and syntaxes, all alike.
2687 # Fuck the skull of Unix.
2689 eval bindir=${bindir}
2690 eval bindir=${bindir}
2691 eval bindir=${bindir}
2692 eval bindir=${bindir}
2693 eval bindir=${bindir}
2694 eval bindir=${bindir}
2695 eval HACKDIR=${HACKDIR}
2696 eval HACKDIR=${HACKDIR}
2697 eval HACKDIR=${HACKDIR}
2698 eval HACKDIR=${HACKDIR}
2699 eval HACKDIR=${HACKDIR}
2700 eval HACKDIR=${HACKDIR}
2702 # canonicalize slashes.
2703 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
2704 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
2707 # Sanity check the subdir
2708 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
2709 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
2711 AC_MSG_ERROR([\"--enable-subdir=${bindir}/${bad_choice}\" won't work.
2712 There will be an executable installed with that name, so
2713 that can't be the name of a directory as well. Please
2714 re-configure with a different directory name.])
2721 # Now let's see if there's a previous RPM version already installed. Blargh!
2725 rpmv=`(rpm -qv xscreensaver) 2>&- | \
2726 sed 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-[0-9][0-9]*$/\1/'`
2729 if test \! -z "$rpmv" ; then
2730 rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
2731 rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
2734 warnL "There is already an installed RPM of xscreensaver $rpmv"
2735 warn2 "on this system. You might want to remove it (with"
2736 warn2 '"rpm -ve xscreensaver") before running "make install"'
2737 warn2 "from this directory."
2739 warn2 "Alternately, you could build this version of xscreensaver"
2740 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
2741 warn2 "file is included. See the RPM documentation for more info."
2744 if test "$rpmbdir" = "$rpmhdir" ; then
2745 warn2 "The RPM version was installed in $rpmbdir."
2747 warn2 "The RPM version was installed in $rpmbdir,"
2748 warn2 "with demos in $rpmhdir."
2755 # Warn about egregious GNOME bogosity.
2757 if (rpm -qv control-center) >&- 2>&- ; then
2759 warnL "The Gnome Control Center seems to be installed."
2761 warn2 "Note that simply installing this version of xscreensaver"
2762 warn2 "will not cause GNOME to know about the newly-added display"
2763 warn2 "modes -- GNOME is just lame that way. Instead of using the"
2764 warn2 "Control Center, try using the \`xscreensaver-demo' command."
2768 if test "${bindir}" = "${HACKDIR}" ; then
2772 if test "$do_dir_warning" = yes; then
2776 echo ' When you run "make install", the "xscreensaver",'
2777 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
2778 echo " will be installed in ${bindir}."
2780 echo " The various graphics demos (100+ different executables) will"
2781 echo " also be installed in ${HACKDIR}."
2783 echo " If you would prefer the demos to be installed elsewhere"
2784 echo " (for example, in a dedicated directory) you should re-run"
2785 echo " configure with the --enable-subdir=DIR option. For more"
2786 echo " information, run $0 --help."
2790 if test "$warning" != no; then
2791 echo '' ; echo "$warnsep" ; echo ''