1 # configure.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski.
5 AC_INIT(driver/subprocs.c)
6 AC_CONFIG_HEADER(config.h)
8 echo "current directory: `pwd`"
9 echo "command line was: $0 $@"
12 # After checking to see that --srcdir is correct (which AC_INIT does)
13 # check for some random other files that come later in the tar file,
14 # to make sure everything is here.
16 for d in driver utils hacks hacks/glx ; do
17 f=$srcdir/$d/Makefile.in
18 if test \! -r $f ; then
20 echo "ERROR: The package is incomplete: $f does not exist."
21 echo " This probably means that your download was truncated."
28 ###############################################################################
30 # Function to figure out how to run the compiler.
32 ###############################################################################
34 AC_DEFUN(AC_PROG_CC_ANSI,
37 if test -z "$GCC"; then
38 AC_MSG_CHECKING(how to request ANSI compilation)
41 AC_MSG_RESULT(HPUX: adding -Ae)
45 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
46 CC="$CC -qlanglvl=ansi -qhalt=e"
50 AC_MSG_RESULT(DEC: adding -std1 -ieee)
55 AC_MSG_RESULT(no idea)
60 AC_MSG_CHECKING([whether the compiler works on ANSI C])
61 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
64 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
65 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
67 if test -n "$GCC"; then
68 AC_MSG_RESULT(Turning on gcc compiler warnings.)
69 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
72 *-irix5* |*-irix6.[0-3]* )
73 AC_MSG_RESULT(Turning on SGI compiler warnings.)
74 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
77 # if test -z "$GCC"; then
78 # AC_MSG_RESULT(Turning on DEC C compiler warnings.)
79 # CC="$CC -migrate -w0 -verbose -warnprotos"
87 ###############################################################################
89 # Functions to figure out how to disable // comments in ANSI C code.
91 # (With recent gcc, this is done with "-std=c89". With older gcc, this
92 # is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
93 # gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang.
94 # so much for compatibility!)
96 ###############################################################################
98 AC_DEFUN(AC_GCC_ACCEPTS_STD,
99 [if test -n "$GCC"; then
100 AC_CACHE_CHECK([whether gcc accepts -std],
101 ac_cv_gcc_accepts_std,
102 [if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
103 grep unrecognized >/dev/null ); then
104 ac_cv_gcc_accepts_std=no
106 ac_cv_gcc_accepts_std=yes
108 ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
112 AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
113 [if test -n "$GCC"; then
115 AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
117 # The reason that // comments are banned from xscreensaver is that gcc is
118 # basically the only compiler in the world that supports them in C code.
119 # All other vendors support them only in their C++ compilers, not in their
120 # ANSI C compilers. This means that it's a portability problem: every time
121 # these comments have snuck into the xscreensaver source code, I've gotten
122 # complaints about it the next day. So we turn off support for them in gcc
123 # as well to prevent them from accidentially slipping in.
125 if test "$ac_gcc_accepts_std" = yes ; then
127 # -std=c89 defines __STRICT_ANSI__, which we don't want.
128 # (That appears to be the only additional preprocessor symbol
129 # it defines, in addition to the syntax changes it makes.)
131 # -std=gnu89 is no good, because // comments were a GNU extension
132 # before they were in the ANSI C 99 spec... (gcc 2.96 permits //
133 # with -std=gnu89 but not with -std=c89.)
135 CC="$CC -std=c89 -U__STRICT_ANSI__"
138 CC="$CC -Wp,-lang-c89"
144 ###############################################################################
146 # Function to figure out how to create directory trees.
148 ###############################################################################
150 AC_DEFUN(AC_PROG_INSTALL_DIRS,
151 [AC_CACHE_CHECK([whether \"\${INSTALL} -d\" creates intermediate directories],
152 ac_cv_install_d_creates_dirs,
153 [ac_cv_install_d_creates_dirs=no
155 if mkdir conftestdir; then
157 ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
158 if test -d dir1/dir2/. ; then
159 ac_cv_install_d_creates_dirs=yes
166 if test "$ac_cv_install_d_creates_dirs" = no ; then
167 AC_CACHE_CHECK([whether \"mkdir -p\" creates intermediate directories],
168 ac_cv_mkdir_p_creates_dirs,
169 [ac_cv_mkdir_p_creates_dirs=no
171 if mkdir conftestdir; then
173 mkdir -p dir1/dir2 >&- 2>&-
174 if test -d dir1/dir2/. ; then
175 ac_cv_mkdir_p_creates_dirs=yes
183 if test "$ac_cv_install_d_creates_dirs" = yes ; then
184 INSTALL_DIRS='${INSTALL} -d'
185 elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
186 INSTALL_DIRS='mkdir -p'
189 INSTALL_DIRS='${INSTALL} -d'
194 ###############################################################################
196 # Function to check whether gettimeofday() exists, and how to call it.
197 # This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
199 ###############################################################################
201 AC_DEFUN(AC_GETTIMEOFDAY_ARGS,
202 [AC_MSG_CHECKING(how to call gettimeofday)
203 AC_CACHE_VAL(ac_cv_gettimeofday_args,
204 [AC_TRY_COMPILE([#include <stdlib.h>
205 #include <sys/time.h>],
206 [struct timeval tv; struct timezone tzp;
207 gettimeofday(&tv, &tzp);],
208 [ac_gettimeofday_args=2],
209 [AC_TRY_COMPILE([#include <stdlib.h>
210 #include <sys/time.h>],
211 [struct timeval tv; gettimeofday(&tv);],
212 [ac_gettimeofday_args=1],
213 [ac_gettimeofday_args=0])])
214 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
215 ac_gettimeofday_args=$ac_cv_gettimeofday_args
216 if test "$ac_gettimeofday_args" = 1 ; then
217 AC_DEFINE(HAVE_GETTIMEOFDAY)
218 AC_MSG_RESULT(one argument)
219 elif test "$ac_gettimeofday_args" = 2 ; then
220 AC_DEFINE(HAVE_GETTIMEOFDAY)
221 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
222 AC_MSG_RESULT(two arguments)
224 AC_MSG_RESULT(unknown)
229 ###############################################################################
231 # Function to find perl5 (defines PERL and PERL_VERSION.)
233 ###############################################################################
235 # M4 sucks!! perl sucks too!!
237 perl_version_cmd='print $]'
240 AC_DEFUN(AC_PROG_PERL,
241 [AC_PATH_PROGS(PERL, [perl5 perl],,)
242 if test -z "$PERL" ; then
245 AC_CACHE_CHECK([perl version], ac_cv_perl_version,
246 [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
247 PERL_VERSION=$ac_cv_perl_version
252 ###############################################################################
254 # Function to demand "bc". Losers.
256 ###############################################################################
258 AC_DEFUN(AC_DEMAND_BC,
259 [ac_bc_result=`echo 6+9 | bc 2>/dev/null`
260 AC_MSG_CHECKING([for bc])
261 if test "$ac_bc_result" = "15" ; then
266 AC_MSG_ERROR([Your system doesn't have \"bc\", which has been a standard
267 part of Unix since the 1970s. Come back when your vendor
272 ###############################################################################
274 # Functions to check how to do ICMP PING requests.
276 ###############################################################################
278 AC_DEFUN(AC_CHECK_ICMP,
279 [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
280 [AC_TRY_COMPILE([#include <stdlib.h>
287 #include <sys/types.h>
288 #include <sys/time.h>
291 #include <sys/socket.h>
292 #include <netinet/in_systm.h>
293 #include <netinet/in.h>
294 #include <netinet/ip.h>
295 #include <netinet/ip_icmp.h>
296 #include <netinet/udp.h>
297 #include <arpa/inet.h>
301 struct sockaddr_in si;
303 i.icmp_type = ICMP_ECHO;
308 si.sin_family = AF_INET;
309 #if defined(__DECC) || defined(_IP_VHL)
315 [ac_cv_have_icmp=yes],
316 [ac_cv_have_icmp=no])])
317 if test "$ac_cv_have_icmp" = yes ; then
321 AC_DEFUN(AC_CHECK_ICMPHDR,
322 [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
323 [AC_TRY_COMPILE([#include <stdlib.h>
330 #include <sys/types.h>
331 #include <sys/time.h>
334 #include <sys/socket.h>
335 #include <netinet/in_systm.h>
336 #include <netinet/in.h>
337 #include <netinet/ip.h>
338 #include <netinet/ip_icmp.h>
339 #include <netinet/udp.h>
340 #include <arpa/inet.h>
344 struct sockaddr_in si;
350 i.un.echo.sequence = 0;
351 si.sin_family = AF_INET;
353 [ac_cv_have_icmphdr=yes],
354 [ac_cv_have_icmphdr=no])])
355 if test "$ac_cv_have_icmphdr" = yes ; then
356 AC_DEFINE(HAVE_ICMPHDR)
360 ###############################################################################
362 # Functions to check for various X11 crap.
364 ###############################################################################
366 # Try and find the app-defaults directory.
367 # It sucks that autoconf doesn't do this already...
369 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
371 if mkdir conftestdir; then
373 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
374 cat > Imakefile <<'EOF'
376 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
378 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
379 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
380 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
386 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
387 # Look for the directory under a standard set of common directories.
388 # Check X11 before X11Rn because it's often a symlink to the current release.
390 /usr/X11/lib/app-defaults \
391 /usr/X11R6/lib/app-defaults \
392 /usr/X11R6/lib/X11/app-defaults \
393 /usr/X11R5/lib/app-defaults \
394 /usr/X11R5/lib/X11/app-defaults \
395 /usr/X11R4/lib/app-defaults \
396 /usr/X11R4/lib/X11/app-defaults \
398 /usr/lib/X11/app-defaults \
399 /usr/lib/X11R6/app-defaults \
400 /usr/lib/X11R5/app-defaults \
401 /usr/lib/X11R4/app-defaults \
403 /usr/local/X11/lib/app-defaults \
404 /usr/local/X11R6/lib/app-defaults \
405 /usr/local/X11R5/lib/app-defaults \
406 /usr/local/X11R4/lib/app-defaults \
408 /usr/local/lib/X11/app-defaults \
409 /usr/local/lib/X11R6/app-defaults \
410 /usr/local/lib/X11R6/X11/app-defaults \
411 /usr/local/lib/X11R5/app-defaults \
412 /usr/local/lib/X11R5/X11/app-defaults \
413 /usr/local/lib/X11R4/app-defaults \
414 /usr/local/lib/X11R4/X11/app-defaults \
416 /usr/X386/lib/X11/app-defaults \
417 /usr/x386/lib/X11/app-defaults \
418 /usr/XFree86/lib/X11/app-defaults \
420 /usr/lib/X11/app-defaults \
421 /usr/local/lib/X11/app-defaults \
422 /usr/unsupported/lib/X11/app-defaults \
423 /usr/athena/lib/X11/app-defaults \
424 /usr/local/x11r5/lib/X11/app-defaults \
425 /usr/lpp/Xamples/lib/X11/app-defaults \
426 /lib/usr/lib/X11/app-defaults \
428 /usr/openwin/lib/app-defaults \
429 /usr/openwin/lib/X11/app-defaults \
430 /usr/openwin/share/lib/app-defaults \
431 /usr/openwin/share/lib/X11/app-defaults \
433 /X11R6/lib/app-defaults \
434 /X11R5/lib/app-defaults \
435 /X11R4/lib/app-defaults \
438 if test -d "$ac_dir"; then
439 ac_x_app_defaults=$ac_dir
445 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
447 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
448 [AC_PATH_X_APP_DEFAULTS_XMKMF
449 if test x"$ac_x_app_defaults" = x; then
450 AC_PATH_X_APP_DEFAULTS_DIRECT
452 if test x"$ac_x_app_defaults" = x; then
453 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
455 # Record where we found app-defaults for the cache.
456 ac_cv_x_app_defaults="$ac_x_app_defaults"
458 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
461 AC_DEFUN(AC_XPOINTER,
462 [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
463 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
464 [XPointer foo = (XPointer) 0;],
465 [ac_cv_xpointer=yes],
466 [ac_cv_xpointer=no])])
467 if test "$ac_cv_xpointer" != yes; then
468 AC_DEFINE(XPointer,[char*])
472 # Random special-cases for X on certain pathological OSes.
473 # You know who you are.
475 AC_DEFUN(AC_X_RANDOM_PATHS,
479 # The following arcana was gleaned from conversations with
480 # Eric Schwartz <erics@col.hp.com>:
482 # On HPUX 10.x, the parts of X that HP considers "standard" live in
483 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
484 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
485 # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
486 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
487 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
488 # you don't need any -I or -L arguments.
490 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
491 # are the same division as 10.x. However, there are no symlinks to
492 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
493 # arguments are always necessary.
495 # However, X11R6 was available on HPUX 9.x as a patch: if that
496 # patch was installed, then all of X11R6 went in to
497 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
499 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
500 # whether R5 was available as a patch; R6 undoubtedly was not.)
502 # So. We try and use the highest numbered pair of
503 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
504 # that are available. We do not mix and match different versions
507 # Question I still don't know the answer to: (do you?)
509 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
510 # /usr/contrib/X11R6/ could be installed as a patch, what was in
511 # that contrib directory? Did it contain so-called "standard"
512 # X11R6, or did it include Xaw and Xmu as well? If the former,
513 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
514 # be a situation where one had to reach into the R5 headers and
515 # libs to find Xmu? That is, must both R6 and R5 directories
516 # be on the -I and -L lists in that case?
518 for version in X11R6 X11R5 X11R4 ; do
519 # if either pair of directories exists...
520 if test -d /usr/include/$version || test -d /usr/contrib/$version/include
522 # if contrib exists, use it...
523 if test -d /usr/contrib/$version/include ; then
524 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
525 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
527 # if the "standard" one exists, use it.
528 if test -d /usr/include/$version ; then
529 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
530 X_LIBS="$X_LIBS -L/usr/lib/$version"
532 # since at least one of the pair exists, go no farther.
537 # Now find Motif. Thanks for not making xmkmf find this by
538 # default, you losers.
540 if test -d /usr/include/Motif2.1 ; then
541 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
542 X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
543 elif test -d /usr/include/Motif1.2 ; then
544 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
545 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
546 elif test -d /usr/include/Motif1.1 ; then
547 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
548 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
551 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
553 if test -d /opt/graphics/OpenGL/include ; then
554 # HP-UX 10.20 puts it here
555 X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
556 X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
557 elif test -d /opt/Mesa/lib ; then
558 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
559 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
563 if test -d /opt/xpm/lib/X11 ; then
564 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
565 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
568 # On HPUX, default to installing in /opt/xscreensaver/ instead of
569 # in /usr/local/, unless there is already an xscreensaver in
570 # /usr/local/bin/. This can be overridden with the --prefix arg
571 # to configure. I'm not sure this is the right thing to do, but
572 # Richard Lloyd says so...
574 if test \! -x /usr/local/bin/xscreensaver ; then
575 ac_default_prefix=/opt/xscreensaver
581 # Thanks for not making xmkmf find this by default, pinheads.
582 # And thanks for moving things around again, too. Is this
583 # really the standard location now? What happened to the
584 # joke that this kind of thing went in /opt?
585 # cthomp says "answer: CDE (Common Disorganized Environment)"
587 if test -f /usr/dt/include/Xm/Xm.h ; then
588 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
589 X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
591 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
592 AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
599 ###############################################################################
601 # Some utility functions to make checking for X things easier.
603 ###############################################################################
605 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
607 AC_DEFUN(AC_CHECK_X_HEADER, [
608 ac_save_CPPFLAGS="$CPPFLAGS"
609 if test \! -z "$includedir" ; then
610 CPPFLAGS="$CPPFLAGS -I$includedir"
612 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
613 AC_CHECK_HEADER([$1], [$2])
614 CPPFLAGS="$ac_save_CPPFLAGS"])
616 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
618 AC_DEFUN(AC_EGREP_X_HEADER, [
619 ac_save_CPPFLAGS="$CPPFLAGS"
620 if test \! -z "$includedir" ; then
621 CPPFLAGS="$CPPFLAGS -I$includedir"
623 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
624 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
625 CPPFLAGS="$ac_save_CPPFLAGS"])
627 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
629 AC_DEFUN(AC_TRY_X_COMPILE, [
630 ac_save_CPPFLAGS="$CPPFLAGS"
631 if test \! -z "$includedir" ; then
632 CPPFLAGS="$CPPFLAGS -I$includedir"
634 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
635 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
636 CPPFLAGS="$ac_save_CPPFLAGS"])
639 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
640 # Use this sparingly; it probably doesn't work very well on X programs.
642 AC_DEFUN(AC_CHECK_X_LIB, [
643 ac_save_CPPFLAGS="$CPPFLAGS"
644 ac_save_LDFLAGS="$LDFLAGS"
645 # ac_save_LIBS="$LIBS"
647 if test \! -z "$includedir" ; then
648 CPPFLAGS="$CPPFLAGS -I$includedir"
650 # note: $X_CFLAGS includes $x_includes
651 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
653 if test \! -z "$libdir" ; then
654 LDFLAGS="$LDFLAGS -L$libdir"
656 # note: $X_LIBS includes $x_libraries
657 LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
659 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
660 CPPFLAGS="$ac_save_CPPFLAGS"
661 LDFLAGS="$ac_save_LDFLAGS"
662 # LIBS="$ac_save_LIBS"
665 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
666 # (But not the -L directories!)
668 AC_DEFUN(AC_TRY_X_RUN, [
669 ac_save_CPPFLAGS="$CPPFLAGS"
670 if test \! -z "$includedir" ; then
671 CPPFLAGS="$CPPFLAGS -I$includedir"
673 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
674 AC_TRY_RUN([$1], [$2], [$3], [$4])
675 CPPFLAGS="$ac_save_CPPFLAGS"])
679 # Usage: HANDLE_X_PATH_ARG([variable_name],
680 # [--command-line-option],
681 # [descriptive string])
683 # All of the --with options take three forms:
685 # --with-foo (or --with-foo=yes)
686 # --without-foo (or --with-foo=no)
689 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
690 # a directory (string beginning with a slash) it checks to see whether
691 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
694 AC_DEFUN(HANDLE_X_PATH_ARG, [
700 AC_MSG_CHECKING([for [$3] headers])
703 X_CFLAGS="-I$d $X_CFLAGS"
706 AC_MSG_RESULT(not found ($d: no such directory))
709 AC_MSG_CHECKING([for [$3] libs])
712 X_LIBS="-L$d $X_LIBS"
715 AC_MSG_RESULT(not found ($d: no such directory))
718 # replace the directory string with "yes".
725 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
726 echo " If it is a directory, then \`DIR/include' will be added to"
727 echo " the -I list, and \`DIR/lib' will be added to the -L list."
735 ###############################################################################
736 ###############################################################################
738 # End of function definitions. Now start actually executing stuff.
740 ###############################################################################
741 ###############################################################################
743 # random compiler setup
746 AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
753 # stuff for Makefiles
758 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
759 # That's wrong: it should be set to '${INSTALL}', so that one can
760 # implement the "install-strip" target properly (strip executables,
761 # but do not try to strip scripts.)
763 INSTALL_SCRIPT='${INSTALL}'
767 AC_CHECK_HEADERS(unistd.h)
776 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
778 AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
781 AC_CHECK_HEADERS(crypt.h sys/select.h)
784 if test -z "$PERL" ; then
785 # don't let it be blank...
791 if test "$have_x" != yes; then
792 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try \`$0 --help'.)
795 AC_PATH_X_APP_DEFAULTS
801 ###############################################################################
803 # Check for -lXmu (some fucked up vendors don't ship it...)
805 ###############################################################################
808 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
809 if test "$have_xmu" = no ; then
810 XMU_SRCS='$(UTILS_SRC)/xmu.c'
811 XMU_OBJS='$(UTILS_BIN)/xmu.o'
821 ###############################################################################
823 # Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
824 # See comp.windows.x FAQ question 124. The right fix is to
825 # get OpenWindows 3.0 patches 100512-02 and 100573-03.
827 ###############################################################################
829 if test "$have_xmu" = yes ; then
832 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
834 [ac_save_LDFLAGS="$LDFLAGS"
835 if test \! -z "$x_libraries" ; then
836 LDFLAGS="$LDFLAGS -L$x_libraries"
838 # Note: this trick never works! (Generally.)
839 # We're only getting away with using AC_TRY_LINK
840 # with X libraries because we know it's SunOS.
841 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
843 [ac_cv_sunos_xmu_bug=no],
844 [ac_cv_sunos_xmu_bug=yes])
845 LDFLAGS="$ac_save_LDFLAGS"])
846 if test "$ac_cv_sunos_xmu_bug" = yes ; then
847 AC_CACHE_CHECK([whether the compiler understands -static],
849 [ac_save_LDFLAGS="$LDFLAGS"
850 LDFLAGS="$LDFLAGS -static"
851 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
852 LDFLAGS="$ac_save_LDFLAGS"])
853 if test "$ac_cv_ld_static" = yes ; then
854 LDFLAGS="$LDFLAGS -static"
856 LDFLAGS="$LDFLAGS -Bstatic"
864 ###############################################################################
866 # Handle the --with-hackdir option
868 ###############################################################################
871 with_hackdir_req=unspecified
872 AC_ARG_WITH(hackdir,[
873 Installation options:
875 --with-hackdir=DIR Where to install the hundreds of demo executables.
876 Default: \`PREFIX/lib/xscreensaver/'],
877 [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes])
879 if test x"$with_hackdir" = xyes; then
880 HACKDIR='${exec_prefix}/lib/xscreensaver'
881 elif test x"$with_hackdir" = xno; then
884 # there must be a better way than this...
885 if test -z "`echo $with_hackdir | sed 's@^/.*@@'`" ; then
887 HACKDIR=$with_hackdir
890 HACKDIR="\${exec_prefix}$with_hackdir"
894 # canonicalize slashes.
895 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
897 # This option used to be called --enable-subdir; make sure that is no longer
898 # used, since configure brain-damagedly ignores unknown --enable options.
901 AC_ARG_ENABLE(subdir,,[obsolete_enable=yes])
902 if test -n "$obsolete_enable"; then
903 echo "error: the --enable-subdir option has been replaced with"
904 echo " the new --with-hackdir option; see \`configure --help'"
905 echo " for more information."
910 ###############################################################################
912 # Handle the --with-configdir option
914 ###############################################################################
917 with_configdir_req=unspecified
918 AC_ARG_WITH(configdir,
919 [ --with-configdir=DIR Where to install the data files that describe each
920 of the display modes to the GUI.
921 Default: \`GNOMEPREFIX/control-center/screensavers/'
922 or \`PREFIX/lib/xscreensaver/config/', depending on
923 whether GNOME is available.
925 [with_configdir="$withval"; with_configdir_req="$withval"],
926 [with_configdir=yes])
928 if test x"$with_configdir" = xyes; then
931 elif test x"$with_configdir" = xno; then
932 echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
935 # there must be a better way than this...
936 if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
938 HACK_CONF_DIR=$with_configdir
941 HACK_CONF_DIR="\${exec_prefix}$with_configdir"
948 ###############################################################################
950 # Check for the SGI SCREEN_SAVER server extension.
952 ###############################################################################
955 with_sgi_req=unspecified
957 [Except where noted, all of the --with options below can also take a
958 directory argument: for example, \`--with-motif=/opt/Motif'. That would
959 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
960 to be added to the -L list, assuming those directories exist.
962 By default, support for each of these options will be built in, if the
963 relevant library routines exist. At run time, they will then be used
964 only if the X server being used supports them. Each --with option has
965 a corresponding --without option, to override building support for them
968 Screen blanking and idle-detection options:
970 --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.],
971 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
973 HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
975 if test "$with_sgi" = yes; then
976 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
978 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
980 elif test "$with_sgi" != no; then
981 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
986 ###############################################################################
988 # Check for the MIT-SCREEN-SAVER server extension.
990 ###############################################################################
993 with_mit_req=unspecified
995 [ --with-mit-ext Include support for the MIT-SCREEN-SAVER extension.],
996 [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
998 HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
1000 if test "$with_mit" = yes; then
1001 AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
1003 # Now check to see if it's really in the library; XF86Free-3.3 ships
1004 # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
1006 if test "$have_mit" = yes; then
1007 AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm)
1009 if test "$have_mit" = no; then
1010 # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
1011 # of in Xext. Thank you master, may I have another.
1012 AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
1013 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
1014 [true], -lX11 -lXext -lm)
1017 if test "$have_mit" = no; then
1018 # Double fuck! Looks like some versions of XFree86 (whichever version
1019 # it is that comes with RedHat Linux 2.0 -- I can't find a version
1020 # number) put this garbage in Xss instead of Xext. Thank you master,
1021 # may I have another.
1022 AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
1023 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
1024 [true], -lX11 -lXext -lm)
1027 if test "$have_mit" = yes; then
1028 AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
1033 elif test "$with_mit" != no; then
1034 echo "error: must be yes or no: --with-mit-ext=$with_mit"
1039 ###############################################################################
1041 # Check for the XIDLE server extension.
1043 ###############################################################################
1046 with_xidle_req=unspecified
1047 AC_ARG_WITH(xidle-ext,
1048 [ --with-xidle-ext Include support for the XIDLE extension.],
1049 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
1051 HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
1053 if test "$with_xidle" = yes; then
1054 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
1056 AC_DEFINE(HAVE_XIDLE_EXTENSION)])
1057 elif test "$with_xidle" != no; then
1058 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
1063 ###############################################################################
1065 # Check for the SGI-VIDEO-CONTROL server extension.
1067 ###############################################################################
1070 with_sgivc_req=unspecified
1071 AC_ARG_WITH(sgivc-ext,
1072 [ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.],
1073 [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
1075 HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
1077 if test "$with_sgivc" = yes; then
1079 # first check for XSGIvc.h
1080 AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
1082 # if that succeeded, then check for the -lXsgivc
1083 if test "$have_sgivc" = yes; then
1085 AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
1086 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
1090 # if that succeeded, then we've really got it.
1091 if test "$have_sgivc" = yes; then
1092 AC_DEFINE(HAVE_SGI_VC_EXTENSION)
1095 elif test "$with_sgivc" != no; then
1096 echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
1101 ###############################################################################
1103 # Check for the DPMS server extension.
1105 ###############################################################################
1108 with_dpms_req=unspecified
1109 AC_ARG_WITH(dpms-ext,
1110 [ --with-dpms-ext Include support for the DPMS extension.],
1111 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
1113 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
1115 if test "$with_dpms" = yes; then
1117 # first check for dpms.h
1118 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
1120 # if that succeeded, then check for the DPMS code in the libraries
1121 if test "$have_dpms" = yes; then
1123 # first look in -lXext (this is where it is with XFree86 4.0)
1125 AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11)
1127 # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
1128 if test "$have_dpms" = no; then
1129 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
1130 [have_dpms=yes; XDPMS_LIBS="-lXdpms"], [true],
1136 # if that succeeded, then we've really got it.
1137 if test "$have_dpms" = yes; then
1138 AC_DEFINE(HAVE_DPMS_EXTENSION)
1141 elif test "$with_dpms" != no; then
1142 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
1147 ###############################################################################
1149 # Check for the XINERAMA server extension.
1151 ###############################################################################
1154 with_xinerama_req=unspecified
1155 AC_ARG_WITH(xinerama-ext,
1156 [ --with-xinerama-ext Include support for the XINERAMA extension.],
1157 [with_xinerama="$withval"; with_xinerama_req="$withval"],[with_xinerama=yes])
1159 HANDLE_X_PATH_ARG(with_xinerama, --with-xinerama-ext, XINERAMA)
1161 if test "$with_xinerama" = yes; then
1163 # first check for Xinerama.h
1164 AC_CHECK_X_HEADER(X11/extensions/Xinerama.h, [have_xinerama=yes])
1166 # if that succeeded, then check for the XINERAMA code in the libraries
1167 if test "$have_xinerama" = yes; then
1169 # first look in -lXext
1171 AC_CHECK_X_LIB(Xext, XineramaQueryExtension, [have_xinerama=yes], [true],
1174 # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
1175 if test "$have_xinerama" = no; then
1176 AC_CHECK_X_LIB(Xinerama, XineramaQueryExtension,
1177 [have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"],
1178 [true], -lXext -lX11)
1182 # if that succeeded, then we've really got it.
1183 if test "$have_xinerama" = yes; then
1184 AC_DEFINE(HAVE_XINERAMA)
1187 elif test "$with_xinerama" != no; then
1188 echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
1193 ###############################################################################
1195 # Check for the XF86VMODE server extension (for virtual screens.)
1197 ###############################################################################
1200 with_xf86vmode_req=unspecified
1201 AC_ARG_WITH(xf86vmode-ext,
1202 [ --with-xf86vmode-ext Include support for XFree86 virtual screens.],
1203 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
1204 [with_xf86vmode=yes])
1206 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1208 if test "$with_xf86vmode" = yes; then
1210 # first check for xf86vmode.h
1211 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes])
1213 # if that succeeded, then check for the -lXxf86vm
1214 if test "$have_xf86vmode" = yes; then
1216 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1217 [have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"],
1218 [true], -lXext -lX11)
1221 # if that succeeded, then we've really got it.
1222 if test "$have_xf86vmode" = yes; then
1223 AC_DEFINE(HAVE_XF86VMODE)
1226 elif test "$with_xf86vmode" != no; then
1227 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
1232 ###############################################################################
1234 # Check for the XF86VMODE server extension (for gamma fading.)
1236 ###############################################################################
1239 have_xf86gamma_ramp=no
1240 with_xf86gamma_req=unspecified
1241 AC_ARG_WITH(xf86gamma-ext,
1242 [ --with-xf86gamma-ext Include support for XFree86 gamma fading.],
1243 [with_xf86gamma="$withval"; with_xf86gamma_req="$withval"],
1244 [with_xf86gamma=yes])
1246 HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma)
1248 if test "$with_xf86gamma" = yes; then
1250 # first check for xf86vmode.h, if we haven't already
1251 if test "$have_xf86vmode" = yes; then
1254 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes])
1257 # if that succeeded, then check for the -lXxf86vm
1258 if test "$have_xf86gamma" = yes; then
1260 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma,
1261 [have_xf86gamma=yes],
1262 [true], -lXext -lX11)
1265 # check for the Ramp versions of the functions too.
1266 if test "$have_xf86gamma" = yes; then
1267 have_xf86gamma_ramp=no
1268 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp,
1269 [have_xf86gamma_ramp=yes],
1270 [true], -lXext -lX11)
1273 # if those tests succeeded, then we've really got the functions.
1274 if test "$have_xf86gamma" = yes; then
1275 AC_DEFINE(HAVE_XF86VMODE_GAMMA)
1278 if test "$have_xf86gamma_ramp" = yes; then
1279 AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP)
1282 # pull in the lib, if we haven't already
1283 if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
1284 SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
1287 elif test "$with_xf86gamma" != no; then
1288 echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
1293 ###############################################################################
1295 # Check for HP XHPDisableReset and XHPEnableReset.
1297 ###############################################################################
1299 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1300 [AC_DEFINE(HAVE_XHPDISABLERESET)
1301 SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
1304 ###############################################################################
1306 # Check for /proc/interrupts.
1308 ###############################################################################
1310 have_proc_interrupts=no
1311 with_proc_interrupts_req=unspecified
1312 AC_ARG_WITH(proc-interrupts,
1313 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
1314 file to notice keyboard activity.],
1315 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
1316 [with_proc_interrupts=yes])
1318 if test "$with_proc_interrupts" = yes; then
1320 AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1321 ac_cv_have_proc_interrupts,
1322 [ac_cv_have_proc_interrupts=no
1323 if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
1324 ac_cv_have_proc_interrupts=yes
1327 have_proc_interrupts=$ac_cv_have_proc_interrupts
1329 if test "$have_proc_interrupts" = yes; then
1330 AC_DEFINE(HAVE_PROC_INTERRUPTS)
1333 elif test "$with_proc_interrupts" != no; then
1334 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
1339 ###############################################################################
1341 # The --enable-locking option
1343 ###############################################################################
1345 AC_ARG_ENABLE(locking,[
1346 Screen locking options:
1348 --enable-locking Compile in support for locking the display.
1349 --disable-locking Do not allow locking at all.
1351 [enable_locking="$enableval"],[enable_locking=yes])
1352 if test "$enable_locking" = yes; then
1354 elif test "$enable_locking" = no; then
1355 AC_DEFINE(NO_LOCKING)
1357 echo "error: must be yes or no: --enable-locking=$enable_locking"
1363 ###############################################################################
1365 # The --enable-vt-locking option
1367 ###############################################################################
1369 #ac_vt_lockswitch=no
1370 #AC_ARG_ENABLE(vt-locking,[
1371 # --enable-vt-locking Compile in support for locking Virtual Terminals.
1372 # This is the default if the system supports it, and
1373 # if locking support is included (--enable-locking.)
1374 # --disable-vt-locking Do not allow locking of VTs, even if locking is
1376 # [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
1377 #if test "$enable_vt_locking" = yes; then
1379 # AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
1380 # [AC_TRY_COMPILE([#include <fcntl.h>
1381 # #include <sys/ioctl.h>
1382 # #include <sys/vt.h>],
1383 # [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
1384 # [ac_cv_vt_lockswitch=yes],
1385 # [ac_cv_vt_lockswitch=no])])
1386 # ac_vt_lockswitch=$ac_cv_vt_lockswitch
1388 #elif test "$enable_vt_locking" = no; then
1391 # echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
1395 #if test "$ac_vt_lockswitch" = yes; then
1396 # AC_DEFINE(HAVE_VT_LOCKSWITCH)
1397 # # the VT_LOCKSWITCH ioctl can only be used when running as root.
1398 # # #### but it doesn't work yet, so don't worry about that for now.
1404 ###############################################################################
1408 ###############################################################################
1412 # Solaris systems tend to come with PAM misconfigured.
1413 # Don't build it by default, even if the headers exist.
1417 # Default to building PAM support on all other systems, if it exists.
1418 with_pam_default=yes
1423 with_pam_req=unspecified
1426 [ --with-pam Include support for PAM (Pluggable Auth Modules.)],
1427 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default])
1429 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
1431 if test "$enable_locking" = yes -a "$with_pam" = yes; then
1432 AC_CACHE_CHECK([for PAM], ac_cv_pam,
1433 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
1436 if test "$ac_cv_pam" = yes ; then
1439 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
1441 # libpam typically requires dlopen and dlsym. On FreeBSD,
1442 # those are in libc. On Linux and Solaris, they're in libdl.
1443 AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
1445 AC_MSG_CHECKING(how to call pam_strerror)
1446 AC_CACHE_VAL(ac_cv_pam_strerror_args,
1447 [AC_TRY_COMPILE([#include <stdio.h>
1449 #include <security/pam_appl.h>],
1450 [pam_handle_t *pamh = 0;
1451 char *s = pam_strerror(pamh, PAM_SUCCESS);],
1452 [ac_pam_strerror_args=2],
1453 [AC_TRY_COMPILE([#include <stdio.h>
1455 #include <security/pam_appl.h>],
1457 pam_strerror(PAM_SUCCESS);],
1458 [ac_pam_strerror_args=1],
1459 [ac_pam_strerror_args=0])])
1460 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
1461 ac_pam_strerror_args=$ac_cv_pam_strerror_args
1462 if test "$ac_pam_strerror_args" = 1 ; then
1463 AC_MSG_RESULT(one argument)
1464 elif test "$ac_pam_strerror_args" = 2 ; then
1465 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
1466 AC_MSG_RESULT(two arguments)
1468 AC_MSG_RESULT(unknown)
1474 ###############################################################################
1476 # Check for Kerberos.
1478 ###############################################################################
1482 with_kerberos_req=unspecified
1484 AC_ARG_WITH(kerberos,
1485 [ --with-kerberos Include support for Kerberos authentication.],
1486 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
1488 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
1490 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
1491 AC_CACHE_CHECK([for Kerberos 4], ac_cv_kerberos,
1492 [AC_TRY_X_COMPILE([#include <krb.h>],,
1493 [ac_cv_kerberos=yes],
1494 [ac_cv_kerberos=no])])
1495 AC_CACHE_CHECK([for Kerberos 5], ac_cv_kerberos5,
1496 [AC_TRY_X_COMPILE([#include <kerberosIV/krb.h>],,
1497 [ac_cv_kerberos5=yes],
1498 [ac_cv_kerberos5=no])])
1500 if test "$ac_cv_kerberos" = yes ; then
1502 AC_DEFINE(HAVE_KERBEROS)
1505 if test "$ac_cv_kerberos5" = yes ; then
1508 AC_DEFINE(HAVE_KERBEROS)
1509 AC_DEFINE(HAVE_KERBEROS5)
1512 if test "$have_kerberos5" = yes ; then
1513 # from Matt Knopp <mhat@infocalypse.netlag.com>
1514 # (who got it from amu@mit.edu)
1515 PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
1516 elif test "$have_kerberos" = yes ; then
1517 # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
1518 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
1521 if test "$have_kerberos" = yes ; then
1522 AC_CHECK_FUNC(res_search,,
1523 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
1524 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
1530 ###############################################################################
1532 # Check for the nine billion variants of shadow passwords...
1534 ###############################################################################
1539 with_shadow_req=unspecified
1542 [ --with-shadow Include support for shadow password authentication.],
1543 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
1545 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
1547 if test "$enable_locking" = no ; then
1553 ###############################################################################
1555 # Check for Sun "adjunct" passwords.
1557 ###############################################################################
1559 if test "$with_shadow" = yes ; then
1560 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
1561 [AC_TRY_X_COMPILE([#include <stdlib.h>
1563 #include <sys/types.h>
1564 #include <sys/label.h>
1565 #include <sys/audit.h>
1566 #include <pwdadj.h>],
1567 [struct passwd_adjunct *p = getpwanam("nobody");
1568 const char *pw = p->pwa_passwd;],
1569 [ac_cv_sun_adjunct=yes],
1570 [ac_cv_sun_adjunct=no])])
1571 if test "$ac_cv_sun_adjunct" = yes; then
1572 have_shadow_adjunct=yes
1579 ###############################################################################
1581 # Check for DEC and SCO so-called "enhanced" security.
1583 ###############################################################################
1585 if test "$with_shadow" = yes ; then
1586 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
1587 [AC_TRY_X_COMPILE([#include <stdlib.h>
1589 #include <sys/types.h>
1591 #include <sys/security.h>
1593 [struct pr_passwd *p;
1595 set_auth_parameters(0, 0);
1596 check_auth_parameters();
1597 p = getprpwnam("nobody");
1598 pw = p->ufld.fd_encrypt;],
1599 [ac_cv_enhanced_passwd=yes],
1600 [ac_cv_enhanced_passwd=no])])
1601 if test $ac_cv_enhanced_passwd = yes; then
1602 have_shadow_enhanced=yes
1606 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
1607 # (I'm told it needs -lcurses too, but I don't understand why.)
1608 # But on DEC, it's in -lsecurity.
1610 AC_CHECK_LIB(prot, getprpwnam,
1611 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
1612 [AC_CHECK_LIB(security, getprpwnam,
1613 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
1618 ###############################################################################
1620 # Check for HP's entry in the "Not Invented Here" Sweepstakes.
1622 ###############################################################################
1624 if test "$with_shadow" = yes ; then
1625 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
1626 [AC_TRY_X_COMPILE([#include <stdlib.h>
1628 #include <sys/types.h>
1630 #include <hpsecurity.h>
1632 [struct s_passwd *p = getspwnam("nobody");
1633 const char *pw = p->pw_passwd;],
1634 [ac_cv_hpux_passwd=yes],
1635 [ac_cv_hpux_passwd=no])])
1636 if test "$ac_cv_hpux_passwd" = yes; then
1637 have_shadow_hpux=yes
1641 # on HPUX, bigcrypt is in -lsec
1642 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
1647 ###############################################################################
1649 # Check for FreeBSD-style shadow passwords.
1651 # On FreeBSD, getpwnam() and friends work just like on non-shadow-
1652 # password systems -- except you only get stuff in the pw_passwd field
1653 # if the running program is setuid. So, guess that we've got this
1654 # lossage to contend with if /etc/master.passwd exists, and default to
1655 # a setuid installation.
1657 ###############################################################################
1659 if test "$with_shadow" = yes ; then
1660 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
1661 [if test -f /etc/master.passwd ; then
1662 ac_cv_master_passwd=yes
1664 ac_cv_master_passwd=no
1666 if test "$ac_cv_master_passwd" = yes; then
1672 ###############################################################################
1674 # Check for traditional (ha!) shadow passwords.
1676 ###############################################################################
1678 if test "$with_shadow" = yes ; then
1679 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
1680 [AC_TRY_X_COMPILE([#include <stdlib.h>
1682 #include <sys/types.h>
1684 #include <shadow.h>],
1685 [struct spwd *p = getspnam("nobody");
1686 const char *pw = p->sp_pwdp;],
1688 [ac_cv_shadow=no])])
1689 if test "$ac_cv_shadow" = yes; then
1693 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
1695 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
1696 if test "$have_getspnam" = no ; then
1697 AC_CHECK_LIB(gen, getspnam,
1698 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
1704 ###############################################################################
1706 # Check for other libraries needed for non-shadow passwords.
1708 ###############################################################################
1710 if test "$enable_locking" = yes ; then
1712 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
1714 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
1715 if test "$have_crypt" = no ; then
1716 AC_CHECK_LIB(crypt, crypt,
1717 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
1722 # Most of the above shadow mechanisms will have set need_setuid to yes,
1723 # if they were found. But, on some systems, we need setuid even when
1724 # using plain old vanilla passwords.
1726 if test "$enable_locking" = yes ; then
1728 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
1735 if test "$have_shadow_adjunct" = yes ; then
1736 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
1737 elif test "$have_shadow_enhanced" = yes ; then
1738 AC_DEFINE(HAVE_ENHANCED_PASSWD)
1739 elif test "$have_shadow_hpux" = yes ; then
1740 AC_DEFINE(HAVE_HPUX_PASSWD)
1741 elif test "$have_shadow" = yes ; then
1742 AC_DEFINE(HAVE_SHADOW_PASSWD)
1746 ###############################################################################
1750 ###############################################################################
1753 with_motif_req=unspecified
1755 User interface options:
1757 --with-motif Use the Motif toolkit for the user interface.],
1758 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=yes])
1760 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
1762 if test "$with_motif" != yes -a "$with_motif" != no ; then
1763 echo "error: must be yes or no: --with-motif=$with_motif"
1767 if test "$with_motif" = yes; then
1769 AC_CHECK_X_HEADER(Xm/Xm.h,
1771 AC_DEFINE(HAVE_MOTIF)
1772 MOTIF_LIBS="$MOTIF_LIBS -lXm"])
1776 if test "$have_motif" = yes; then
1777 AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)])
1781 ###############################################################################
1783 # Check for -lgtk (and Gnome stuff)
1785 ###############################################################################
1788 with_gtk_req=unspecified
1790 [ --with-gtk Use the Gtk toolkit for the user interface.],
1791 [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
1793 # if --with-gtk=/directory/ was specified, remember that directory so that
1794 # we can also look for the `gtk-config' program in that directory.
1804 HANDLE_X_PATH_ARG(with_gtk, --with-gtk, Gtk)
1806 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
1807 echo "error: must be yes or no: --with-gtk=$with_gtk"
1812 with_gnome_req=unspecified
1814 [ --with-gnome Include support for the Gnome Control Center.],
1815 [with_gnome="$withval"; with_gnome_req="$withval"],[with_gnome=yes])
1817 # if --with-gnome=/directory/ was specified, remember that directory so that
1818 # we can also look for the `gnome-config' program in that directory.
1819 case "$with_gnome" in
1821 gnome_dir="$with_gnome"
1828 HANDLE_X_PATH_ARG(with_gnome, --with-gnome, Gnome)
1830 if test "$with_gnome" != yes -a "$with_gnome" != no ; then
1831 echo "error: must be yes or no: --with-gnome=$with_gnome"
1837 if test "$with_gtk" = yes; then
1840 # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
1841 # look in /foo/bin/ for glib-config, gtk-config, and gnome-config.
1845 if test ! -z "$gtk_dir"; then
1846 # canonicalize slashes.
1847 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
1848 gtk_path="$foo:$gtk_path"
1851 if test ! -z "$gnome_dir"; then
1852 # canonicalize slashes.
1853 foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
1854 gtk_path="$foo:$gtk_path"
1857 AC_PATH_PROGS(glib_config, glib12-config glib-config,, $gtk_path)
1858 AC_PATH_PROGS(gtk_config, gtk12-config gtk-config,, $gtk_path)
1860 if test "$with_gnome" = yes; then
1861 AC_PATH_PROGS(gnome_config, gnome-config,, $gtk_path)
1864 if test -n "$glib_config" -a -n "$gtk_config" ; then
1866 if test "$with_gnome" = yes -a -n "$gnome_config" ; then
1871 if test "$have_gtk" = yes; then
1872 AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string,
1873 [ac_cv_gtk_version_string=`$gtk_config --version`])
1874 ac_gtk_version_string=$ac_cv_gtk_version_string
1877 maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
1878 min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
1880 ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
1881 if test -z "$ac_gtk_version"; then
1882 ac_gtk_version=unknown
1883 ac_gtk_version_string=unknown
1885 if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
1893 if test "$have_gtk" = yes; then
1894 AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
1895 [ac_cv_gtk_config_cflags=`$gtk_config --cflags`])
1896 AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
1897 [ac_cv_gtk_config_libs=`$gtk_config --libs`])
1899 ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
1900 ac_gtk_config_libs=$ac_cv_gtk_config_libs
1902 # Check for Gnome Capplet support.
1904 if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1905 gnome_config_libs="gtk capplet gnomeui gdk_pixbuf"
1906 AC_MSG_CHECKING(for Gnome capplet includes)
1907 AC_CACHE_VAL(ac_cv_gnome_config_cflags,
1908 [if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
1909 grep Unknown >/dev/null ) ; then
1910 ac_cv_gnome_config_cflags=''
1912 ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
1914 ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
1915 if test "$ac_gnome_config_cflags" = "" ; then
1919 AC_MSG_RESULT($ac_gnome_config_cflags)
1923 if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1924 AC_MSG_CHECKING(for Gnome capplet libs)
1925 AC_CACHE_VAL(ac_cv_gnome_config_libs,
1926 [if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
1927 grep Unknown >/dev/null ) ; then
1928 ac_cv_gnome_config_libs=''
1930 ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
1932 ac_gnome_config_libs=$ac_cv_gnome_config_libs
1933 if test "$ac_gnome_config_libs" = "" ; then
1937 AC_MSG_RESULT($ac_gnome_config_libs)
1942 if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1943 GNOME_DATADIR=`$gnome_config --datadir`
1947 # If we have Gnome, then override the gtk-config values with
1948 # the gnome-config values.
1950 if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1951 ac_gtk_config_cflags=$ac_gnome_config_cflags
1952 ac_gtk_config_libs=$ac_gnome_config_libs
1953 AC_DEFINE(HAVE_CRAPPLET)
1955 # check for this function that was not in libcapplet 1.2.
1956 AC_CHECK_X_LIB(capplet, capplet_widget_changes_are_immediate,
1957 [AC_DEFINE(HAVE_CRAPPLET_IMMEDIATE)], [true],
1958 $ac_gnome_config_libs)
1962 if test "$have_gtk" = yes; then
1963 INCLUDES="$INCLUDES $ac_gtk_config_cflags"
1964 GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
1971 # Check for the Gnome Help Browser.
1973 if test "$have_gnome" = yes; then
1974 AC_CHECK_PROG(have_gnome_help, gnome-help-browser, yes, no)
1980 ###############################################################################
1984 ###############################################################################
1987 with_xml_req=unspecified
1990 [ --with-xml The XML toolkit is needed for some parts of
1991 the Gtk interface.],
1992 [with_xml="$withval"; with_xml_req="$withval"],[with_xml=yes])
1994 # if --with-xml=/directory/ was specified, remember that directory so that
1995 # we can also look for the `xml-config' program in that directory.
2005 HANDLE_X_PATH_ARG(with_xml, --with-xml, XML)
2007 if test "$with_xml" != yes -a "$with_xml" != no ; then
2008 echo "error: must be yes or no: --with-xml=$with_xml"
2012 if test "$with_xml" = yes; then
2015 # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
2016 # look in /foo/bin/ for for xml-config.
2020 if test ! -z "$gtk_dir"; then
2021 # canonicalize slashes.
2022 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
2023 xml_path="$foo:$xml_path"
2026 if test ! -z "$gnome_dir"; then
2027 # canonicalize slashes.
2028 foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
2029 xml_path="$foo:$xml_path"
2032 AC_PATH_PROGS(xml_config, xml2-config xml-config,, $xml_path)
2034 # If we found the xml-config program, run it to get flags.
2036 if test -n "$xml_config" ; then
2037 AC_CACHE_CHECK([for XML includes], ac_cv_xml_config_cflags,
2038 [ac_cv_xml_config_cflags=`$xml_config --cflags`])
2039 AC_CACHE_CHECK([for XML libs], ac_cv_xml_config_libs,
2040 [ac_cv_xml_config_libs=`$xml_config --libs`])
2041 ac_xml_config_cflags=$ac_cv_xml_config_cflags
2042 ac_xml_config_libs=$ac_cv_xml_config_libs
2045 ac_save_xml_CPPFLAGS="$CPPFLAGS"
2046 CPPFLAGS="$CPPFLAGS $ac_xml_config_cflags"
2047 AC_CHECK_X_HEADER(xmlIO.h, [have_xml=yes])
2048 CPPFLAGS="$ac_save_xml_CPPFLAGS"
2050 if test "$have_xml" = yes; then
2051 # we have the header, now check for the library
2054 AC_CHECK_X_LIB(xml, xmlParseChunk,
2058 AC_DEFINE(HAVE_XML)],
2060 $ac_xml_config_libs)
2063 if test "$have_xml" = yes; then
2064 INCLUDES="$INCLUDES $ac_xml_config_cflags"
2065 GTK_LIBS="$GTK_LIBS $ac_xml_config_libs"
2072 ###############################################################################
2074 # Checking whether Motif is really Lesstif.
2076 ###############################################################################
2079 if test "$have_motif" = yes ; then
2080 AC_CACHE_CHECK([whether Motif is really LessTif],
2082 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
2083 [long vers = LesstifVersion;],
2084 [ac_cv_have_lesstif=yes],
2085 [ac_cv_have_lesstif=no])])
2086 have_lesstif=$ac_cv_have_lesstif
2090 lesstif_version=unknown
2091 lesstif_version_string=unknown
2093 if test "$have_lesstif" = yes ; then
2095 echo unknown > conftest-lt
2096 AC_CACHE_CHECK([LessTif version number],
2097 ac_cv_lesstif_version_string,
2098 [AC_TRY_X_RUN([#include <stdio.h>
2101 FILE *f = fopen("conftest-lt", "w");
2103 fprintf(f, "%d %d.%d\n", LesstifVersion,
2104 LESSTIF_VERSION, LESSTIF_REVISION);
2108 [ltv=`cat conftest-lt`
2109 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
2110 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
2111 [ac_cv_lesstif_version=unknown
2112 ac_cv_lesstif_version_string=unknown],
2113 [ac_cv_lesstif_version=unknown
2114 ac_cv_lesstif_version_string=unknown])])
2116 lesstif_version=$ac_cv_lesstif_version
2117 lesstif_version_string=$ac_cv_lesstif_version_string
2122 if test "$have_motif" = yes ; then
2124 echo unknown > conftest-mt
2125 AC_CACHE_CHECK([Motif version number],
2126 ac_cv_motif_version_string,
2127 [AC_TRY_X_RUN([#include <stdio.h>
2130 FILE *f = fopen("conftest-mt", "w");
2132 fprintf(f, "%d %d.%d\n", XmVersion,
2133 XmVERSION, XmREVISION);
2137 [mtv=`cat conftest-mt`
2138 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
2139 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
2140 [ac_cv_motif_version=unknown
2141 ac_cv_motif_version_string=unknown],
2142 [ac_cv_motif_version=unknown
2143 ac_cv_motif_version_string=unknown])])
2145 motif_version=$ac_cv_motif_version
2146 motif_version_string=$ac_cv_motif_version_string
2151 ###############################################################################
2153 # Checking whether Motif requires -lXpm.
2155 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
2156 # The deal is, Motif 2.x requires XPM -- but it's a compilation option
2157 # of the library whether to build the XPM code into libXm, or whether
2158 # to rely on an external libXm. So the only way to tell whether XPM is
2159 # a link-time requirement is to examine libXm.a, which is very
2160 # difficult to do in an autoconf script. So... if it's Motif 2.x, we
2161 # always link against XPM if the XPM lib exists (and this will be a
2162 # no-op if libXm happens to already have the XPM code in it.)
2164 ###############################################################################
2166 motif_requires_xpm=no
2167 if test "$have_motif" = yes ; then
2168 AC_MSG_CHECKING(whether Motif requires XPM)
2169 if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
2171 motif_requires_xpm=yes
2172 AC_MSG_RESULT(maybe)
2179 ###############################################################################
2181 # Checking whether Motif requires -lXp.
2183 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
2184 # Extension". Why this extension isn't in -lXext with all the others,
2187 ###############################################################################
2190 if test "$have_motif" = yes ; then
2192 AC_CHECK_X_LIB(Xp, XpQueryExtension,
2193 [have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"],
2194 [true], -lX11 -lXext -lm)
2198 ###############################################################################
2200 # Checking whether Motif requires -lXintl (for _Xsetlocale.)
2202 ###############################################################################
2205 if test "$have_motif" = yes ; then
2206 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
2208 if test "$have_xintl" = yes; then
2209 MOTIF_LIBS="$MOTIF_LIBS -lXintl"
2214 ###############################################################################
2216 # Check for -lGL or -lMesaGL.
2218 ###############################################################################
2222 with_gl_req=unspecified
2227 --with-gl Build those demos which depend on OpenGL.],
2228 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
2230 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
2232 ac_mesagl_version=unknown
2233 ac_mesagl_version_string=unknown
2235 if test "$with_gl" = yes; then
2236 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
2237 if test "$have_gl" = yes ; then
2238 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
2241 # If we have the headers, try and figure out which vendor it's from.
2243 if test "$have_gl" = yes ; then
2245 # We need to know whether it's MesaGL so that we know which libraries
2248 AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl,
2249 [ac_cv_have_mesa_gl=no
2250 AC_EGREP_X_HEADER(Mesa|MESA, GL/glx.h, [ac_cv_have_mesa_gl=yes])
2252 ac_have_mesa_gl=$ac_cv_have_mesa_gl
2259 # Some versions of MesaGL are compiled to require -lpthread.
2260 # So if the Mesa headers exist, and -lpthread exists, then always
2261 # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
2263 if test "$ac_have_mesa_gl" = yes; then
2264 AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],)
2268 # If we have Mesa headers, check to see if we can link against -lMesaGL.
2269 # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
2270 # Else, warn that GL is busted. (We have the headers, but no libs.)
2273 if test "$ac_have_mesa_gl" = yes ; then
2274 AC_CHECK_X_LIB(MesaGL, glXCreateContext,
2276 GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"],
2277 [], -lMesaGLU $GL_LIBS -lX11 -lXext -lm)
2280 if test "$gl_lib_1" = "" ; then
2281 AC_CHECK_X_LIB(GL, glXCreateContext,
2283 GL_LIBS="-lGL -lGLU $GL_LIBS"],
2284 [], -lGLU $GL_LIBS -lX11 -lXext -lm)
2287 if test "$gl_lib_1" = "" ; then
2288 # we have headers, but no libs -- bail.
2293 # linking works -- we can build the GL hacks.
2295 if test "$ac_have_mesa_gl" = yes ; then
2296 AC_DEFINE(HAVE_MESA_GL)
2302 # Now that we know we have GL headers and libs, do some more GL testing.
2305 if test "$have_gl" = yes ; then
2306 # If it's MesaGL, we'd like to issue a warning if the version number
2307 # is less than or equal to 2.6, because that version had a security bug.
2309 if test "$ac_have_mesa_gl" = yes; then
2311 AC_CACHE_CHECK([MesaGL version number], ac_cv_mesagl_version_string,
2312 [cat > conftest.$ac_ext <<EOF
2313 #line __oline__ "configure"
2314 #include "confdefs.h"
2316 #ifndef MESA_MAJOR_VERSION
2317 # include <GL/xmesa.h>
2318 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
2319 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
2321 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
2324 ac_save_CPPFLAGS="$CPPFLAGS"
2325 if test \! -z "$includedir" ; then
2326 CPPFLAGS="$CPPFLAGS -I$includedir"
2328 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2332 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
2333 's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
2336 rm -f conftest.$ac_ext
2338 CPPFLAGS="$ac_save_CPPFLAGS"
2340 if test "$mglv" = ""; then
2341 ac_mesagl_version=unknown
2342 ac_mesagl_version_string=unknown
2344 ac_mesagl_version_string=$mglv
2345 maj=`echo $mglv | sed -n 's/\..*//p'`
2346 min=`echo $mglv | sed -n 's/.*\.//p'`
2347 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
2348 if test -z "$ac_mesagl_version"; then
2349 ac_mesagl_version=unknown
2350 ac_mesagl_version_string=unknown
2353 ac_cv_mesagl_version=$ac_mesagl_version
2354 ac_cv_mesagl_version_string=$ac_mesagl_version_string
2356 ac_mesagl_version=$ac_cv_mesagl_version
2357 ac_mesagl_version_string=$ac_cv_mesagl_version_string
2361 # Check for OpenGL 1.1 features.
2363 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
2364 [true], $GL_LIBS -lX11 -lXext -lm)
2367 elif test "$with_gl" != no; then
2368 echo "error: must be yes or no: --with-gl=$with_gl"
2373 ###############################################################################
2377 ###############################################################################
2380 with_gle_req=unspecified
2383 [ --with-gle Build those demos which depend on GLE
2384 (the OpenGL "extrusion" library.)],
2385 [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes])
2387 HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE)
2391 if test "$with_gle" = yes; then
2393 AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no)
2394 if test "$have_gle3" = yes ; then
2397 AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no)
2398 if test "$have_gle" = yes ; then
2399 AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no)
2403 if test "$have_gle" = yes ; then
2406 AC_CHECK_X_LIB(gle, gleCreateGC,
2407 [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"],
2408 [], $GL_LIBS -lX11 -lXext -lm)
2410 if test "$have_gle" = yes ; then
2414 # sometimes the libmatrix stuff is included in libgle. look there first.
2416 # I don't get it. For some reason, this test passes on SGI, as if
2417 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
2418 # Yet the link is succeeding. Why???
2420 # AC_CHECK_X_LIB(gle, uview_direction_d,
2421 # [have_gle=yes; gle_halfassed=no],
2422 # [], $GL_LIBS -lX11 -lXext -lm)
2424 # As of GLE 3 this is in libgle, and has changed name to uview_direction!
2426 if test "$have_gle3" = yes ; then
2427 AC_CHECK_X_LIB(gle, uview_direction,
2428 [have_gle=yes; gle_halfassed=no],
2429 [], $GL_LIBS -lX11 -lXext -lm)
2431 # if it wasn't in libgle, then look in libmatrix.
2432 if test "$have_gle" = no ; then
2433 AC_CHECK_X_LIB(matrix, uview_direction_d,
2434 [have_gle=yes; gle_halfassed=no;
2435 GLE_LIBS="$GLE_LIBS -lmatrix"],
2436 [], $GL_LIBS -lX11 -lXext -lm)
2440 if test "$have_gle" = yes ; then
2442 if test "$have_gle3" = yes ; then
2443 AC_DEFINE(HAVE_GLE3)
2447 elif test "$with_gle" != no; then
2448 echo "error: must be yes or no: --with-gle=$with_gle"
2455 ###############################################################################
2459 ###############################################################################
2462 with_xpm_req=unspecified
2464 [ --with-xpm Include support for XPM files in some demos.],
2465 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
2467 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
2469 if test "$with_xpm" = yes; then
2470 AC_CHECK_X_HEADER(X11/xpm.h,
2474 elif test "$with_xpm" != no; then
2475 echo "error: must be yes or no: --with-xpm=$with_xpm"
2479 # See comment near $motif_requires_xpm, above.
2480 # Need to do this here, after both Motif and XPM have been checked for.
2482 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
2483 if test "$motif_requires_xpm" = yes ; then
2484 MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
2489 ###############################################################################
2491 # Check for -lgdk_pixbuf.
2493 ###############################################################################
2496 with_gdk_pixbuf_req=unspecified
2498 [ --with-pixbuf Include support for the GDK-Pixbuf library in some
2499 demos, which will make it possible for them to read
2500 GIF, JPEG, and PNG files as well.],
2501 [with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"],
2502 [with_gdk_pixbuf=yes])
2504 # if --with-pixbuf=/directory/ was specified, remember that directory so that
2505 # we can also look for the `gdk-pixbuf-config' program in that directory.
2506 case "$with_gdk_pixbuf" in
2508 gdk_pixbuf_dir="$with_gdk_pixbuf"
2515 HANDLE_X_PATH_ARG(with_gdk_pixbuf, --with-pixbuf, GDK_PIXBUF)
2517 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
2518 echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
2522 if test "$with_gdk_pixbuf" = yes; then
2525 # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
2526 # look in /foo/bin/ for for gdk-pixbuf-config.
2528 gdk_pixbuf_path="$PATH"
2530 if test ! -z "$gtk_dir"; then
2531 # canonicalize slashes.
2532 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
2533 gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
2536 if test ! -z "$gnome_dir"; then
2537 # canonicalize slashes.
2538 foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
2539 gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
2542 AC_PATH_PROGS(gdk_pixbuf_config, gdk-pixbuf-config,, $gdk_pixbuf_path)
2544 # If we found the gdk-pixbuf-config program, run it to get flags.
2546 if test -n "$gdk_pixbuf_config" ; then
2547 AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
2548 [ac_cv_gdk_pixbuf_config_cflags=`$gdk_pixbuf_config --cflags`])
2549 AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
2550 [ac_cv_gdk_pixbuf_config_libs=`$gdk_pixbuf_config --libs`])
2551 ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
2552 ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
2555 ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
2556 CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
2558 # check for header 1...
2559 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf.h, [have_gdk_pixbuf=yes])
2561 # if that worked, check for header 2...
2562 if test "$have_gdk_pixbuf" = yes; then
2564 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf-xlib.h, [have_gdk_pixbuf=yes])
2567 CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
2569 if test "$have_gdk_pixbuf" = yes; then
2570 # we have the headers, now check for the libraries
2572 gdk_pixbuf_halfassed=yes
2574 AC_CHECK_X_LIB(gdk_pixbuf, gdk_pixbuf_new_from_file,
2575 [have_gdk_pixbuf=yes], [true],
2576 $ac_gdk_pixbuf_config_libs)
2578 if test "$have_gdk_pixbuf" = yes; then
2579 AC_CHECK_X_LIB(gdk_pixbuf_xlib, gdk_pixbuf_xlib_init,
2580 [have_gdk_pixbuf=yes
2581 gdk_pixbuf_halfassed=no],
2583 $ac_gdk_pixbuf_config_libs)
2587 if test "$have_gdk_pixbuf" = yes; then
2588 INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
2589 XPM_LIBS="$ac_gdk_pixbuf_config_libs -lgdk_pixbuf -lgdk_pixbuf_xlib"
2590 AC_DEFINE(HAVE_GDK_PIXBUF)
2595 ###############################################################################
2599 ###############################################################################
2602 with_jpeg_req=unspecified
2605 [ --with-jpeg Include support for the JPEG library in some demos,
2606 which will make it possible for them to read JPEG
2608 [with_jpeg="$withval"; with_jpeg_req="$withval"],
2611 HANDLE_X_PATH_ARG(with_jpeg, --with-jpeg, JPEG)
2613 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
2614 echo "error: must be yes or no: --with-jpeg=$with_jpeg"
2618 if test "$with_jpeg" = yes; then
2621 AC_CHECK_X_HEADER(jpeglib.h, [have_jpeg=yes])
2623 if test "$have_jpeg" = yes; then
2624 # we have the header, now check for the library
2627 AC_CHECK_X_LIB(jpeg, jpeg_start_compress,
2631 AC_DEFINE(HAVE_JPEGLIB)])
2636 ###############################################################################
2638 # Check for the XSHM server extension.
2640 ###############################################################################
2643 with_xshm_req=unspecified
2644 AC_ARG_WITH(xshm-ext,
2645 [ --with-xshm-ext Include support for the Shared Memory extension.],
2646 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
2648 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
2650 if test "$with_xshm" = yes; then
2652 # first check for Xshm.h.
2653 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
2655 # if that succeeded, then check for sys/ipc.h.
2656 if test "$have_xshm" = yes; then
2658 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
2661 # if that succeeded, then check for sys/shm.h.
2662 if test "$have_xshm" = yes; then
2664 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
2667 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
2668 # to exist, but the library code to not exist. And even better, the library
2669 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
2670 # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
2671 # that's not quite right, but close enough.)
2675 if [ `uname -v` -eq 3 ]; then
2677 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
2678 [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
2679 [true], -lX11 -lXext -lm)
2684 # if that succeeded, then we've really got it.
2685 if test "$have_xshm" = yes; then
2686 AC_DEFINE(HAVE_XSHM_EXTENSION)
2689 elif test "$with_xshm" != no; then
2690 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
2695 ###############################################################################
2697 # Check for the DOUBLE-BUFFER server extension.
2699 ###############################################################################
2702 with_xdbe_req=unspecified
2703 AC_ARG_WITH(xdbe-ext,
2704 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER extension.],
2705 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
2707 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
2709 if test "$with_xdbe" = yes; then
2711 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes])
2712 if test "$have_xdbe" = yes; then
2713 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
2716 elif test "$with_xdbe" != no; then
2717 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
2722 ###############################################################################
2724 # Check for the SGI XReadDisplay server extension.
2726 # Note: this has to be down here, rather than up with the other server
2727 # extension tests, so that the output of `configure --help' is in the
2728 # right order. Arrgh!
2730 ###############################################################################
2733 with_readdisplay_req=unspecified
2734 AC_ARG_WITH(readdisplay,
2735 [ --with-readdisplay Include support for the XReadDisplay extension.],
2736 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
2737 [with_readdisplay=yes])
2739 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
2741 if test "$with_readdisplay" = yes; then
2742 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
2743 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
2744 elif test "$with_readdisplay" != no; then
2745 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
2750 ###############################################################################
2752 # Check for a program to generate random text.
2754 # Zippy is funnier than the idiocy generally spat out by `fortune',
2755 # so first see if "fortune zippy" works. Else, use plain "fortune".
2757 # We used to dig around in Emacs to look for the "yow" program, but
2758 # most people who have Emacs also have "fortune zippy", so nevermind.
2760 ###############################################################################
2763 AC_ARG_WITH(fortune,[
2764 --with-fortune=PROGRAM Some demos are able to run an external program and
2765 display its text; this names the program to use by
2766 default (though it can be overridden with X
2767 resources.) Default is \"/usr/games/fortune\".],
2768 [with_fortune_req="$withval"; with_fortune="$withval"],[with_fortune=yes])
2770 if test "$with_fortune" = no || test "$with_fortune" = yes ; then
2775 if test -n "$with_fortune_req" ; then
2776 ac_cv_fortune_program=""
2777 case "$with_fortune_req" in
2780 set dummy $with_fortune_req ; fortune_tmp=$2
2781 AC_MSG_CHECKING([for $fortune_tmp])
2782 if test -x "$fortune_tmp" ; then
2790 set dummy $with_fortune_req ; fortune_tmp=$2
2792 unset ac_cv_path_fortune_tmp
2793 AC_PATH_PROG(fortune_tmp, $fortune_tmp, [])
2794 if test -z "$fortune_tmp" ; then
2799 ac_cv_fortune_program="$with_fortune"
2801 elif test -n "$ac_cv_fortune_program"; then
2802 AC_MSG_RESULT([checking for fortune... (cached) $ac_cv_fortune_program])
2805 unset ac_cv_path_fortune_tmp
2808 if test -z "$ac_cv_fortune_program" ; then
2810 # first look for fortune in /usr/games/ (and use absolute path)
2811 AC_PATH_PROGS(fortune_tmp, fortune,, "/usr/games")
2813 # if it's not there, look on $PATH (and don't use absolute path)
2814 if test -z "$fortune_tmp" ; then
2815 AC_CHECK_PROGS(fortune_tmp, fortune)
2818 # if we didn't find anything, then just assume /usr/games/
2819 if test -z "$fortune_tmp" ; then
2820 fortune_tmp="/usr/games/fortune"
2823 ac_cv_fortune_program="$fortune_tmp"
2825 # now check to see whether "fortune zippy" works.
2827 fortune_tmp="$fortune_tmp zippy"
2828 AC_MSG_CHECKING([for zippy quotes])
2829 if ( $fortune_tmp >/dev/null 2>&1 ); then
2830 ac_cv_fortune_program="$fortune_tmp"
2831 AC_MSG_RESULT($fortune_tmp)
2838 unset ac_cv_path_fortune_tmp
2841 AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program")
2844 ###############################################################################
2846 # Check whether it's ok to install some hacks as setuid (e.g., "sonar")
2847 # This should be safe, but let's give people the option.
2849 ###############################################################################
2851 setuid_hacks_default=no
2852 setuid_hacks="$setuid_hacks_default"
2853 AC_ARG_WITH(setuid-hacks,
2854 [ --with-setuid-hacks Allow some demos to be installed \`setuid root'
2855 (which is needed in order to ping other hosts.)
2857 [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"])
2859 HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks)
2861 if test "$setuid_hacks" = yes; then
2863 elif test "$setuid_hacks" != no; then
2864 echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
2869 ###############################################################################
2871 # Done testing. Now, set up the various -I and -L variables,
2872 # and decide which GUI program to build by default.
2874 ###############################################################################
2881 if test \! -z "$includedir" ; then
2882 INCLUDES="$INCLUDES -I$includedir"
2885 if test \! -z "$libdir" ; then
2886 LDFLAGS="$LDFLAGS -L$libdir"
2890 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
2892 if test "$have_motif" = yes; then
2893 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
2894 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2896 if test "$have_gtk" = yes; then
2897 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
2898 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
2902 if test "$have_kerberos" = yes; then
2903 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
2904 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
2906 if test "$have_pam" = yes; then
2907 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
2908 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
2909 INSTALL_PAM="install-pam"
2911 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
2912 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
2915 if test "$enable_locking" = yes; then
2916 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
2917 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
2919 LOCK_SRCS='$(NOLOCK_SRCS_1)'
2920 LOCK_OBJS='$(NOLOCK_OBJS_1)'
2923 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
2925 if test "$need_setuid" = yes; then
2931 if test "$setuid_hacks" = yes; then
2938 if test "$have_gl" = yes; then
2939 GL_EXES='$(GL_EXES)'
2940 GL_UTIL_EXES='$(GL_UTIL_EXES)'
2944 GL_KLUDGE="-${tab} "
2947 if test "$have_gle" = yes; then
2948 GLE_EXES='$(GLE_EXES)'
2949 GLE_MEN='$(GLE_MEN)'
2950 GLE_KLUDGE="${tab} "
2952 GLE_KLUDGE="-${tab} "
2955 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
2956 JPEG_EXES='$(JPEG_EXES)'
2960 # Another substitution in the XScreenSaver.ad.in file:
2962 if test "$have_gnome_help" = yes; then
2971 # Now that we know whether we have Gnome, we can decide where the XML
2972 # config files get installed.
2974 if test -z "$HACK_CONF_DIR" ; then
2975 if test -n "$GNOME_DATADIR" ; then
2976 HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
2978 HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
2984 # After computing $HACK_CONF_DIR, make sure $GTK_ICONDIR has a value
2985 # so that we know where to install the Gtk pixmaps.
2987 if test -n "$GNOME_DATADIR" ; then
2988 GTK_ICONDIR='$(GNOME_DATADIR)/pixmaps'
2989 elif test "$have_gtk" = yes; then
2990 # should this be "$(prefix)/share/pixmaps"? But /usr/X11R6/share/ is wrong...
2991 GTK_ICONDIR='/usr/share/pixmaps'
2997 # canonicalize slashes.
2998 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
3002 ###############################################################################
3004 # Perform substitutions and write Makefiles.
3006 ###############################################################################
3010 AC_SUBST(PREFERRED_DEMO_PROGRAM)
3011 AC_SUBST(ALL_DEMO_PROGRAMS)
3012 AC_SUBST(SAVER_LIBS)
3013 AC_SUBST(MOTIF_LIBS)
3021 AC_SUBST(XDPMS_LIBS)
3022 AC_SUBST(PASSWD_LIBS)
3023 AC_SUBST(INSTALL_SETUID)
3024 AC_SUBST(SETUID_HACKS)
3025 AC_SUBST(INSTALL_DIRS)
3026 AC_SUBST(NEED_SETUID)
3027 AC_SUBST(INSTALL_PAM)
3029 AC_SUBST(PASSWD_SRCS)
3030 AC_SUBST(PASSWD_OBJS)
3034 AC_SUBST(SAVER_GL_SRCS)
3035 AC_SUBST(SAVER_GL_OBJS)
3036 AC_SUBST(SAVER_GL_LIBS)
3041 AC_SUBST(GL_UTIL_EXES)
3046 AC_SUBST(GLE_KLUDGE)
3047 AC_SUBST(GNOMEHELP_Y)
3048 AC_SUBST(GNOMEHELP_N)
3050 AC_SUBST(GNOME_DATADIR)
3051 AC_SUBST(GTK_ICONDIR)
3052 AC_SUBST(HACK_CONF_DIR)
3054 APPDEFAULTS=$ac_x_app_defaults
3055 AC_SUBST(APPDEFAULTS)
3058 AC_SUBST(DEPEND_FLAGS)
3059 AC_SUBST(DEPEND_DEFINES)
3067 driver/XScreenSaver.ad)
3069 ###############################################################################
3071 # Print some warnings at the end.
3073 ###############################################################################
3075 warn_prefix_1=" Warning:"
3076 warn_prefix_2=" Note:"
3077 warn_prefix="$warn_prefix_1"
3080 warnsep=' #################################################################'
3083 if test "$warning" = no ; then
3084 echo '' ; echo "$warnsep" ; echo ''
3091 if test "$warning" = long ; then echo '' ; fi
3094 echo "$warn_prefix $rest"
3101 if test "$was" != no ; then echo '' ; fi
3103 echo "$warn_prefix $rest"
3113 warn_prefix="$warn_prefix_2"
3115 warn_prefix="$warn_prefix_1"
3119 warn_prefix="$warn_prefix_2"
3121 warn_prefix="$warn_prefix_1"
3125 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
3126 warn 'The SGI saver extension was requested, but was not found.'
3129 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
3130 warn 'The MIT saver extension was requested, but was not found.'
3133 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
3134 warn 'The XIdle extension was requested, but was not found.'
3137 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
3138 warn 'The XSHM extension was requested, but was not found.'
3141 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
3142 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
3145 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
3146 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
3149 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
3150 warn 'The DPMS extension was requested, but was not found.'
3153 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
3154 warn 'The Xinerama extension was requested, but was not found.'
3157 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
3158 warn 'The XF86VMODE extension was requested, but was not found.'
3161 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
3162 warn "Checking of /proc/interrupts was requested, but it's bogus."
3166 if test "$have_motif" = no -a "$have_gtk" = no; then
3167 warnL "Neither Motif nor Gtk seem to be available;"
3168 warn2 "the \`xscreensaver-demo' program requires one of these."
3170 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
3171 warnL "Use of Motif was requested, but it wasn't found;"
3172 warn2 "Gtk will be used instead."
3174 elif test "$jurassic_gtk" = yes ; then
3178 v="$ac_gtk_version_string"
3179 if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
3180 warnL "Use of Gtk was requested, but its version number is unknown;"
3181 elif test "$with_gtk_req" = yes ; then
3182 warnL "Use of Gtk was requested, but it is version $v;"
3184 warnL "Gtk was found on this system, but it is version $v;"
3187 warn2 "Gtk $pref_gtk or newer is required. Motif will be used instead."
3189 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
3190 warnL "Use of Gtk was requested, but it wasn't found;"
3191 warn2 "Motif will be used instead."
3196 if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
3197 warn 'Use of the Gnome Control Panel was requested, but the necessary'
3198 warn2 'headers and/or libraries were not found.'
3201 if test "$have_gtk" = yes ; then
3202 if test "$have_xml" = no ; then
3203 if test "$with_xml_req" = yes ; then
3204 warn 'Use of the XML library was requested, but the necessary'
3205 warn2 'headers and/or libraries were not found.'
3207 warn 'GTK is being used, but the XML library was not found.'
3210 if test "$xml_halfassed" = yes ; then
3212 warn2 'More specifically, we found the headers, but not the'
3213 warn2 'libraries; so either XML is half-installed on this'
3214 warn2 "system, or something else went wrong. The \`config.log'"
3215 warn2 'file might contain some clues.'
3219 warn2 "Without XML, the per-display-mode \`Settings' dialogs"
3220 warn2 'will not be available. Specify the location of the XML'
3221 warn2 'library through the --with-xml option to configure.'
3225 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
3227 preferred_lesstif=0.92
3229 if test "$lesstif_version" = unknown; then
3230 warnL "Unable to determine the LessTif version number!"
3231 warn2 "Make sure you are using version $preferred_lesstif or newer."
3232 warn2 "See <http://www.lesstif.org/>."
3234 elif test \! $lesstif_version -gt 82; then
3235 warnL "LessTif version $lesstif_version_string is being used."
3236 warn2 "LessTif versions 0.82 and earlier are too buggy to"
3237 warn2 "use with XScreenSaver; it is strongly recommended"
3238 warn2 "that you upgrade to at least version $preferred_lesstif!"
3239 warn2 "See <http://www.lesstif.org/>."
3244 if test "$have_motif" = yes -a "$have_gtk" = no ; then
3245 warn 'Motif is being used, and GTK is not.'
3247 warn2 'Though the Motif front-end to xscreensaver is still'
3248 warn2 'maintained, it is no longer being updated with new'
3249 warn2 'features: all new development on the xscreensaver-demo'
3250 warn2 'program is happening in the GTK version, and not in the'
3251 warn2 'Motif version. It is recommended that you build against'
3252 warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
3256 if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
3257 warnL 'Use of XPM was requested, but it was not found.'
3260 if test "$with_gdk_pixbuf_req" = yes -a "$have_gdk_pixbuf" = no; then
3261 warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
3264 if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
3266 if test "$with_xpm_req" = yes ; then
3268 elif test "$with_xpm_req" = no ; then
3269 warnL 'The XPM library is not being used.'
3271 warnL 'The XPM library was not found.'
3274 if test "$with_gdk_pixbuf_req" = yes ; then
3276 elif test "$with_gdk_pixbuf_req" = no ; then
3277 warnL 'The GDK-Pixbuf library is not being used.'
3279 warnL 'The GDK-Pixbuf library was not found.'
3282 if test "$gdk_pixbuf_halfassed" = yes ; then
3284 warn2 'More specifically, we found the headers, but not the'
3285 warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
3286 warn2 "system, or something else went wrong. The \`config.log'"
3287 warn2 'file might contain some clues.'
3291 warn2 'Some of the demos will not be as colorful as they'
3292 warn2 'could be. You should consider installing Pixbuf or'
3293 warn2 'XPM and re-running configure. (Remember to delete'
3294 warn2 'the config.cache file first.) The Pixbuf library is'
3295 warn2 'a part of GNOME. The XPM library comes with most'
3296 warn2 'X11 installations; you can also find it at the X11'
3297 warn2 'archive sites, such as <http://sunsite.unc.edu/>.'
3299 warn2 'GDK-Pixbuf is recommended over XPM, as it provides'
3300 warn2 'support for more image formats.'
3304 if test "$have_jpeg" = no ; then
3305 if test "$with_jpeg_req" = yes ; then
3306 warnL 'Use of libjpeg was requested, but it was not found.'
3307 elif test "$with_jpeg_req" = no ; then
3308 noteL 'The JPEG library is not being used.'
3310 noteL 'The JPEG library was not found.'
3313 if test "$jpeg_halfassed" = yes ; then
3315 warn2 'More specifically, we found the headers, but not the'
3316 warn2 'library; so either JPEG is half-installed on this'
3317 warn2 "system, or something else went wrong. The \`config.log'"
3318 warn2 'file might contain some clues.'
3322 warn2 "This means the \`webcollage' program will be much slower."
3326 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
3327 preferred_mesagl=3.4
3328 mgv="$ac_mesagl_version_string"
3329 pgl="$preferred_mesagl"
3331 if test "$ac_mesagl_version" = unknown; then
3332 warnL "Unable to determine the MesaGL version number!"
3333 warn2 "Make sure you are using version $preferred_mesagl or newer."
3335 elif test \! "$ac_mesagl_version" -gt 2006; then
3336 warnL "MesaGL version $mgv is being used. MesaGL 2.6 and earlier"
3337 warn2 "have a security bug. It is strongly recommended that you"
3338 warn2 "upgrade to at least version $preferred_mesagl."
3340 elif test \! "$ac_mesagl_version" -gt 3003; then
3341 warnL "MesaGL version $mgv is being used. That version has some"
3342 warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
3346 if test "$have_gl" = no ; then
3347 if test "$with_gl_req" = yes ; then
3348 warnL 'Use of GL was requested, but it was not found.'
3349 elif test "$with_gl_req" = no ; then
3350 noteL 'The OpenGL 3D library is not being used.'
3352 noteL 'The OpenGL 3D library was not found.'
3355 if test "$gl_halfassed" = yes ; then
3357 warn2 'More specifically, we found the headers, but not the'
3358 warn2 'libraries; so either GL is half-installed on this'
3359 warn2 "system, or something else went wrong. The \`config.log'"
3360 warn2 'file might contain some clues.'
3364 warn2 'Those demos which use 3D will not be built or installed.'
3365 warn2 'You might want to consider installing OpenGL and'
3366 warn2 're-running configure. (Remember to delete the'
3367 warn2 "config.cache file first.) If your vendor doesn't ship"
3368 warn2 'their own implementation of OpenGL, you can get a free'
3369 warn2 'version at <http://www.mesa3d.org/>. For general OpenGL'
3370 warn2 'info, see <http://www.opengl.org/>.'
3375 if test "$have_gl" = yes -a "$have_gle" = no ; then
3376 if test "$with_gle_req" = yes ; then
3377 noteL 'Use of the GLE (GL Extrusion) library was requested, but'
3378 warn2 'it was not found (though the OpenGL library was found, and'
3379 warn2 'is being used.)'
3380 elif test "$with_gle_req" = no ; then
3381 noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
3382 warn2 'library is not.'
3384 noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
3388 if test "$gle_halfassed" = yes ; then
3390 warn2 'More specifically, we found the headers, but not the'
3391 warn2 'libraries; so either GLE is half-installed on this'
3392 warn2 "system, or something else went wrong. The \`config.log'"
3393 warn2 'file might contain some clues.'
3397 warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
3398 warn2 'will not be built or installed. You might want to consider'
3399 warn2 'installing GLE and re-running configure. (Remember to delete'
3400 warn2 'the config.cache file first.) You can find the GLE library'
3401 warn2 'at <http://www.linas.org/gle/>. For general OpenGL info,'
3402 warn2 'see <http://www.opengl.org/>.'
3407 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
3408 warn 'Use of XReadDisplay was requested, but it was not found.'
3411 if test -n "$with_fortune_req"; then
3412 if test "$with_fortune_req" != "$ac_cv_fortune_program" ; then
3413 warnL "$with_fortune_req was requested as the Fortune program,"
3414 warn2 "but was not found. The default will be used instead."
3418 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
3419 warn 'Use of Kerberos was requested, but it was not found.'
3422 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
3423 warn 'Use of PAM was requested, but it was not found.'
3426 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
3427 warn 'Use of shadow passwords was requested, but they were not found.'
3431 # You are in a twisty maze of namespaces and syntaxes, all alike.
3432 # Fuck the skull of Unix.
3434 eval bindir=${bindir}
3435 eval bindir=${bindir}
3436 eval bindir=${bindir}
3437 eval bindir=${bindir}
3438 eval bindir=${bindir}
3439 eval bindir=${bindir}
3440 eval HACKDIR=${HACKDIR}
3441 eval HACKDIR=${HACKDIR}
3442 eval HACKDIR=${HACKDIR}
3443 eval HACKDIR=${HACKDIR}
3444 eval HACKDIR=${HACKDIR}
3445 eval HACKDIR=${HACKDIR}
3446 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3447 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3448 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3449 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3450 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3451 eval HACK_CONF_DIR=${HACK_CONF_DIR}
3453 # canonicalize slashes.
3454 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
3455 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
3456 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
3459 # Sanity check the hackdir
3460 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
3461 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
3463 AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
3464 There will be an executable installed with that name, so
3465 that can't be the name of a directory as well. Please
3466 re-configure with a different directory name.])
3473 # Now let's see if there's a previous RPM version already installed. Blargh!
3477 rpmv=`(rpm -qv xscreensaver) 2>&- | \
3478 sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
3481 if test \! -z "$rpmv" ; then
3482 rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
3483 rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
3486 warnL "There is already an installed RPM of xscreensaver $rpmv"
3487 warn2 "on this system. You might want to remove it (with"
3488 warn2 '"rpm -ve xscreensaver") before running "make install"'
3489 warn2 "from this directory."
3491 warn2 "Alternately, you could build this version of xscreensaver"
3492 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
3493 warn2 "file is included. See the RPM documentation for more info."
3496 if test "$rpmbdir" = "$rpmhdir" ; then
3497 warn2 "The RPM version was installed in $rpmbdir/."
3499 warn2 "The RPM version was installed in $rpmbdir/,"
3500 warn2 "with demos in $rpmhdir/."
3507 if test "${bindir}" = "${HACKDIR}" ; then
3511 if test "$do_dir_warning" = yes; then
3515 echo ' When you run "make install", the "xscreensaver",'
3516 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
3517 echo " will be installed in ${bindir}/."
3519 echo " The various graphics demos (140+ different executables) will"
3520 echo " be installed in ${HACKDIR}/."
3522 echo " If you would prefer the demos to be installed elsewhere,"
3523 echo " you should re-run configure with the --with-hackdir=DIR"
3524 echo " option. For more information, run \`./configure --help'."
3528 if test "$warning" != no; then
3529 echo '' ; echo "$warnsep" ; echo ''
3532 if test "$do_dir_warning" = no; then
3533 if test "$warning" = no; then
3536 echo "User programs will be installed in ${bindir}/"
3537 echo "Screen savers will be installed in ${HACKDIR}/"
3538 echo "Configuration will be installed in ${HACK_CONF_DIR}/"