1 # configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
4 AC_INIT(driver/subprocs.c)
6 echo "current directory: `pwd`"
7 echo "command line was: $0 $@"
9 AC_CONFIG_HEADER(config.h)
14 if test -z "$GCC"; then
15 AC_MSG_CHECKING(how to request ANSI compilation)
18 AC_MSG_RESULT(HPUX: adding -Ae)
22 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
23 CC="$CC -qlanglvl=ansi -qhalt=e"
27 AC_MSG_RESULT(DEC: adding -std1)
32 AC_MSG_RESULT(no idea)
38 AC_MSG_CHECKING([whether the compiler works on ANSI C])
39 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
42 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
43 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
46 *-irix5* |*-irix6.[0-3]* )
47 if test -n "$GCC"; then
48 AC_MSG_RESULT(Turning on gcc compiler warnings.)
49 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
52 AC_MSG_RESULT(Turning on SGI compiler warnings.)
53 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
58 AC_MSG_RESULT(Turning on gcc compiler warnings.)
59 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
63 # if test -z "$GCC"; then
64 # AC_MSG_RESULT(Turning on DEC C compiler warnings.)
65 # CC="$CC -migrate -w0 -verbose -warnprotos"
72 # Try and determine whether ${INSTALL} can create intermediate directories,
73 # and if not, whether "mkdir -p" works instead. This sets ${INSTALL_DIRS}.
74 # (But autoconf should earn its keep and do this for us!)
76 AC_DEFUN(AC_PROG_INSTALL_DIRS,
77 [INSTALL_DIRS='${INSTALL} -d'
78 AC_MSG_CHECKING(whether \"\${INSTALL} -d\" creates intermediate directories)
80 if mkdir conftestdir; then
83 ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
84 if test -d dir1/dir2 ; then
88 AC_MSG_CHECKING(whether \"mkdir -p\" creates intermediate directories)
90 mkdir -p dir1/dir2 >&- 2>&-
91 if test -d dir1/dir2/. ; then
93 INSTALL_DIRS='mkdir -p'
122 AC_MSG_CHECKING(how to call gettimeofday)
123 AC_CACHE_VAL(ac_cv_gettimeofday_args,
124 [AC_TRY_COMPILE([#include <stdlib.h>
125 #include <sys/time.h>],
126 [struct timeval tv; struct timezone tzp;
127 gettimeofday(&tv, &tzp);],
128 [ac_gettimeofday_args=2],
129 [AC_TRY_COMPILE([#include <stdlib.h>
130 #include <sys/time.h>],
131 [struct timeval tv; gettimeofday(&tv);],
132 [ac_gettimeofday_args=1],
133 [ac_gettimeofday_args=0])])
134 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
135 ac_gettimeofday_args=$ac_cv_gettimeofday_args
136 if test "$ac_gettimeofday_args" = 1 ; then
137 AC_DEFINE(HAVE_GETTIMEOFDAY)
138 AC_MSG_RESULT(one argument)
139 elif test "$ac_gettimeofday_args" = 2 ; then
140 AC_DEFINE(HAVE_GETTIMEOFDAY)
141 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
142 AC_MSG_RESULT(two arguments)
144 AC_MSG_RESULT(unknown)
148 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
149 AC_CHECK_FUNCS(sigaction syslog)
151 AC_CHECK_HEADERS(unistd.h crypt.h sys/select.h)
153 dnl /usr/local/src/ssh-1.2.17/putenv.c -- AC_REPLACE_FUNCS(putenv)
156 AC_ARG_ENABLE(subdir,[
157 Installation options:
159 --enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
160 instead of putting them in bindir itself. You can
161 specify the name of the subdirectory. For example,
162 \`--exec-prefix=/usr/local --enable-subdir=demos'
163 would put xscreensaver in /usr/local/bin/, and would
164 put the demos in /usr/local/bin/demos/. (If DIR
165 begins with /, then bindir will not be prepended.)
167 --disable-subdir Just put the demos in \`bindir' (this is the default.)
169 [enable_subdir="$enableval"],[enable_subdir=no])
170 if test x"$enable_subdir" = xno; then
172 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
173 echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
176 # there must be a better way than this...
177 if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
179 HACKDIR=$enable_subdir
182 HACKDIR='${bindir}/'$enable_subdir
186 # canonicalize slashes.
187 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
192 if test "$have_x" != yes; then
193 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try \`$0 --help'.)
197 # Try and find the app-defaults directory.
198 # It sucks that autoconf doesn't do this already...
200 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
202 if mkdir conftestdir; then
204 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
205 cat > Imakefile <<'EOF'
207 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
209 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
210 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
211 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
217 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
218 # Look for the directory under a standard set of common directories.
219 # Check X11 before X11Rn because it's often a symlink to the current release.
221 /usr/X11/lib/app-defaults \
222 /usr/X11R6/lib/app-defaults \
223 /usr/X11R6/lib/X11/app-defaults \
224 /usr/X11R5/lib/app-defaults \
225 /usr/X11R5/lib/X11/app-defaults \
226 /usr/X11R4/lib/app-defaults \
227 /usr/X11R4/lib/X11/app-defaults \
229 /usr/lib/X11/app-defaults \
230 /usr/lib/X11R6/app-defaults \
231 /usr/lib/X11R5/app-defaults \
232 /usr/lib/X11R4/app-defaults \
234 /usr/local/X11/lib/app-defaults \
235 /usr/local/X11R6/lib/app-defaults \
236 /usr/local/X11R5/lib/app-defaults \
237 /usr/local/X11R4/lib/app-defaults \
239 /usr/local/lib/X11/app-defaults \
240 /usr/local/lib/X11R6/app-defaults \
241 /usr/local/lib/X11R6/X11/app-defaults \
242 /usr/local/lib/X11R5/app-defaults \
243 /usr/local/lib/X11R5/X11/app-defaults \
244 /usr/local/lib/X11R4/app-defaults \
245 /usr/local/lib/X11R4/X11/app-defaults \
247 /usr/X386/lib/X11/app-defaults \
248 /usr/x386/lib/X11/app-defaults \
249 /usr/XFree86/lib/X11/app-defaults \
251 /usr/lib/X11/app-defaults \
252 /usr/local/lib/X11/app-defaults \
253 /usr/unsupported/lib/X11/app-defaults \
254 /usr/athena/lib/X11/app-defaults \
255 /usr/local/x11r5/lib/X11/app-defaults \
256 /usr/lpp/Xamples/lib/X11/app-defaults \
257 /lib/usr/lib/X11/app-defaults \
259 /usr/openwin/lib/app-defaults \
260 /usr/openwin/lib/X11/app-defaults \
261 /usr/openwin/share/lib/app-defaults \
262 /usr/openwin/share/lib/X11/app-defaults \
264 /X11R6/lib/app-defaults \
265 /X11R5/lib/app-defaults \
266 /X11R4/lib/app-defaults \
269 if test -d "$ac_dir"; then
270 ac_x_app_defaults=$ac_dir
277 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
279 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
280 [AC_PATH_X_APP_DEFAULTS_XMKMF
281 if test x"$ac_x_app_defaults" = x; then
282 AC_PATH_X_APP_DEFAULTS_DIRECT
284 if test x"$ac_x_app_defaults" = x; then
285 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
287 # Record where we found app-defaults for the cache.
288 ac_cv_x_app_defaults="$ac_x_app_defaults"
290 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
292 AC_PATH_X_APP_DEFAULTS
294 APPDEFAULTS=$ac_x_app_defaults
297 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
299 AC_DEFUN(AC_CHECK_X_HEADER, [
300 ac_save_CPPFLAGS="$CPPFLAGS"
301 if test \! -z "$includedir" ; then
302 CPPFLAGS="$CPPFLAGS -I$includedir"
304 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
305 AC_CHECK_HEADER([$1], [$2])
306 CPPFLAGS="$ac_save_CPPFLAGS"])
308 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
310 AC_DEFUN(AC_EGREP_X_HEADER, [
311 ac_save_CPPFLAGS="$CPPFLAGS"
312 if test \! -z "$includedir" ; then
313 CPPFLAGS="$CPPFLAGS -I$includedir"
315 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
316 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
317 CPPFLAGS="$ac_save_CPPFLAGS"])
319 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
321 AC_DEFUN(AC_TRY_X_COMPILE, [
322 ac_save_CPPFLAGS="$CPPFLAGS"
323 if test \! -z "$includedir" ; then
324 CPPFLAGS="$CPPFLAGS -I$includedir"
326 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
327 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
328 CPPFLAGS="$ac_save_CPPFLAGS"])
331 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
332 # Use this sparingly; it probably doesn't work very well on X programs.
334 AC_DEFUN(AC_CHECK_X_LIB, [
335 ac_save_CPPFLAGS="$CPPFLAGS"
336 ac_save_LDFLAGS="$LDFLAGS"
338 if test \! -z "$includedir" ; then
339 CPPFLAGS="$CPPFLAGS -I$includedir"
341 # note: $X_CFLAGS includes $x_includes
342 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
344 if test \! -z "$libdir" ; then
345 LDFLAGS="$LDFLAGS -L$libdir"
347 # note: $X_LIBS includes $x_libraries
348 LDFLAGS="$LDFLAGS $X_LIBS"
350 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
351 CPPFLAGS="$ac_save_CPPFLAGS"
352 LDFLAGS="$ac_save_LDFLAGS"])
354 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
355 # (But not the -L directories!)
357 AC_DEFUN(AC_TRY_X_RUN, [
358 ac_save_CPPFLAGS="$CPPFLAGS"
359 if test \! -z "$includedir" ; then
360 CPPFLAGS="$CPPFLAGS -I$includedir"
362 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
363 AC_TRY_RUN([$1], [$2], [$3], [$4])
364 CPPFLAGS="$ac_save_CPPFLAGS"])
368 # Usage: HANDLE_X_PATH_ARG([variable_name],
369 # [--command-line-option],
370 # [descriptive string])
372 # All of the --with options take three forms:
374 # --with-foo (or --with-foo=yes)
375 # --without-foo (or --with-foo=no)
378 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
379 # a directory (string beginning with a slash) it checks to see whether
380 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
383 AC_DEFUN(HANDLE_X_PATH_ARG, [
389 AC_MSG_CHECKING([for [$3] headers])
392 X_CFLAGS="-I$d $X_CFLAGS"
395 AC_MSG_RESULT(not found ($d: no such directory))
398 AC_MSG_CHECKING([for [$3] libs])
401 X_LIBS="-L$d $X_LIBS"
404 AC_MSG_RESULT(not found ($d: no such directory))
407 # replace the directory string with "yes".
414 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
415 echo " If it is a directory, then \`DIR/include' will be added to"
416 echo " the -I list, and \`DIR/lib' will be added to the -L list."
421 # why is this necessary?
422 # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
423 # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
429 # check for the HP XHPDisableReset server extension headers.
431 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
432 [AC_DEFINE(HAVE_XHPDISABLERESET)
433 SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
436 # Check for the availability of the XPointer typedef, and define it otherwise.
438 AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
439 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
440 [XPointer foo = (XPointer) 0;],
441 [ac_cv_xpointer=yes],
442 [ac_cv_xpointer=no])])
443 if test "$ac_cv_xpointer" != yes; then
444 AC_DEFINE(XPointer,[char*])
448 # Random special-cases for certain pathological OSes. You know who you are.
453 # The following arcana was gleaned from conversations with
454 # Eric Schwartz <erics@col.hp.com>:
456 # On HPUX 10.x, the parts of X that HP considers "standard" live in
457 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
458 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
459 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
460 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
461 # you don't need any -I or -L arguments.
463 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
464 # are the same division as 10.x. However, there are no symlinks to
465 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
466 # arguments are always necessary.
468 # However, X11R6 was available on HPUX 9.x as a patch: if that
469 # patch was installed, then all of X11R6 went in to
470 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
472 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
473 # whether R5 was available as a patch; R6 undoubtedly was not.)
475 # So. We try and use the highest numbered pair of
476 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
477 # that are available. We do not mix and match different versions
480 # Questions I still don't know the answers to: (do you?)
482 # * Does HPUX 10.x come with /usr/contrib/X11R6/ standard?
483 # Or does that need to be installed separately?
485 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
486 # /usr/contrib/X11R6/ could be installed as a patch, what was in
487 # that contrib directory? Did it contain so-called "standard"
488 # X11R6, or did it include Xaw and Xmu as well? If the former,
489 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
490 # be a situation where one had to reach into the R5 headers and
491 # libs to find Xmu? That is, must both R6 and R5 directories
492 # be on the -I and -L lists in that case?
494 for version in X11R6 X11R5 X11R4 ; do
495 # if either pair of directories exists...
496 if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib ; then
497 # if contrib exists, use it...
498 if test -d /usr/contrib/$version/lib ; then
499 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
500 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
502 # if the "standard" one exists, use it.
503 if test -d /usr/lib/$version ; then
504 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
505 X_LIBS="$X_LIBS -L/usr/lib/$version"
507 # since at least one of the pair exists, go no farther.
512 # Now find Motif. Thanks for not making xmkmf find this by
513 # default, you losers.
515 if test -d /usr/lib/Motif1.2 ; then
516 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
517 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
518 elif test -d /usr/lib/Motif1.1 ; then
519 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
520 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
523 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
525 if test -d /opt/Mesa/lib ; then
526 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
527 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
530 if test -d /opt/xpm/lib/X11 ; then
531 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
532 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
535 # On HPUX, default to installing in /opt/xscreensaver/ instead of
536 # in /usr/local/, unless there is already an xscreensaver in
537 # /usr/local/bin/. This can be overridden with the --prefix arg
538 # to configure. I'm not sure this is the right thing to do, but
539 # Richard Lloyd says so...
541 if test \! -x /usr/local/bin/xscreensaver ; then
542 ac_default_prefix=/opt/xscreensaver
548 # Thanks for not making xmkmf find this by default, pinheads.
549 # And thanks for moving things around again, too. Is this
550 # really the standard location now? What happened to the
551 # joke that this kind of thing went in /opt?
552 # cthomp says "answer: CDE (Common Disorganized Environment)"
554 if test -f /usr/dt/include/Xm/Xm.h ; then
555 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
556 X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
558 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
559 AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
566 # Check for Xmu (some fucked up vendors don't ship it...)
569 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
570 if test "$have_xmu" = no ; then
571 XMU_SRCS='$(UTILS_SRC)/xmu.c'
572 XMU_OBJS='$(UTILS_BIN)/xmu.o'
576 SAVER_LIBS="-lXmu $SAVER_LIBS"
577 HACK_LIBS="-lXmu $HACK_LIBS"
578 TOOLKIT_LIBS="-lXmu $TOOLKIT_LIBS"
583 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
584 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
586 if test "$have_xmu" = yes ; then
589 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
591 [ac_save_LDFLAGS="$LDFLAGS"
592 if test \! -z "$x_libraries" ; then
593 LDFLAGS="$LDFLAGS -L$x_libraries"
595 # Note: this trick never works! (Generally.)
596 # We're only getting away with using AC_TRY_LINK
597 # with X libraries because we know it's SunOS.
598 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
600 [ac_cv_sunos_xmu_bug=no],
601 [ac_cv_sunos_xmu_bug=yes])
602 LDFLAGS="$ac_save_LDFLAGS"])
603 if test "$ac_cv_sunos_xmu_bug" = yes ; then
604 AC_CACHE_CHECK([whether the compiler understands -static],
606 [ac_save_LDFLAGS="$LDFLAGS"
607 LDFLAGS="$LDFLAGS -static"
608 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
609 LDFLAGS="$ac_save_LDFLAGS"])
610 if test "$ac_cv_ld_static" = yes ; then
611 LDFLAGS="$LDFLAGS -static"
613 LDFLAGS="$LDFLAGS -Bstatic"
621 # Check for the SGI SCREEN_SAVER server extension header.
624 with_sgi_req=unspecified
626 [Except where noted, all of the --with options below can also take a
627 directory argument: for example, --with-motif=/opt/Motif. That would
628 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
629 to be added to the -L list, assuming those directories exist.
631 X Server Extension options:
633 --with-sgi-ext Include support for the SGI SCREEN_SAVER
634 server extension, if possible (this is the default).
635 --without-sgi-ext Do not compile in support for this extension.],
636 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
638 HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
640 if test "$with_sgi" = yes; then
641 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
643 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
645 elif test "$with_sgi" != no; then
646 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
650 # Check for the MIT-SCREEN-SAVER server extension header,
651 # unless the SGI extension has already been found.
654 with_mit_req=unspecified
656 [ --with-mit-ext Include support for the MIT-SCREEN-SAVER
657 server extension, if possible (this is the default).
658 --without-mit-ext Do not compile in support for this extension.],
659 [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
661 HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
663 if test "$have_sgi" != yes; then
664 if test "$with_mit" = yes; then
665 AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
667 # Now check to see if it's really in the library; XF86Free-3.3 ships
668 # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
670 if test "$have_mit" = yes; then
671 AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [], [have_mit=no], -lm)
673 if test "$have_mit" = no; then
674 # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
675 # of in Xext. Thank you master, may I have another.
676 AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
677 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
678 [], -lX11 -lXext -lm)
681 if test "$have_mit" = no; then
682 # Double fuck! Looks like some versions of XFree86 (whichever version
683 # it is that comes with RedHat Linux 2.0 -- I can't find a version
684 # number) put this garbage in Xss instead of Xext. Thank you master,
685 # may I have another.
686 AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
687 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
688 [], -lX11 -lXext -lm)
691 if test "$have_mit" = yes; then
692 AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
697 elif test "$with_mit" != no; then
698 echo "error: must be yes or no: --with-mit-ext=$with_mit"
704 # Check for the XIDLE server extension header.
707 with_xidle_req=unspecified
708 AC_ARG_WITH(xidle-ext,
709 [ --with-xidle-ext Include support for the XIDLE server extension,
710 if possible (this is the default).
711 --without-xidle-ext Do not compile in support for this extension.],
712 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
714 HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
716 if test "$with_xidle" = yes; then
717 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
719 AC_DEFINE(HAVE_XIDLE_EXTENSION)])
720 elif test "$with_xidle" != no; then
721 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
726 # Check for the XSHM server extension header.
729 with_xshm_req=unspecified
730 AC_ARG_WITH(xshm-ext,
731 [ --with-xshm-ext Include support for the XSHM (Shared Memory) server
732 extension, if possible (this is the default).
733 --without-xshm-ext Do not compile in support for this extension.],
734 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
736 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
738 if test "$with_xshm" = yes; then
740 # first check for Xshm.h.
741 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
743 # if that succeeded, then check for sys/ipc.h.
744 if test "$have_xshm" = yes; then
746 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
749 # if that succeeded, then check for sys/shm.h.
750 if test "$have_xshm" = yes; then
752 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
755 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
756 # to exist, but the library code to not exist. And even better, the library
757 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
758 # lib doesn't exist, give up.
763 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
764 [have_xshm=yes; SAVER_LIBS="$SAVER_LIBS -lXextSam"],
765 [], -lX11 -lXext -lm)
769 # if that succeeded, then we've really got it.
770 if test "$have_xshm" = yes; then
771 AC_DEFINE(HAVE_XSHM_EXTENSION)
774 elif test "$with_xshm" != no; then
775 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
780 # Check for the DOUBLE-BUFFER server extension header.
783 with_xdbe_req=unspecified
784 AC_ARG_WITH(xdbe-ext,
785 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER server
786 extension, if possible (this is the default).
787 --without-xdbe-ext Do not compile in support for this extension.],
788 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
790 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
792 if test "$with_xdbe" = yes; then
794 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes])
795 if test "$have_xdbe" = yes; then
796 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
799 elif test "$with_xdbe" != no; then
800 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
805 # Check for the SGI-VIDEO-CONTROL server extension header.
808 with_sgivc_req=unspecified
809 AC_ARG_WITH(sgivc-ext,
810 [ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL server
811 extension, if possible (this is the default).
812 --without-sgivc-ext Do not compile in support for this extension.],
813 [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
815 HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
817 if test "$with_sgivc" = yes; then
819 # first check for XSGIvc.h
820 AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
822 # if that succeeded, then check for the -lXsgivc
823 if test "$have_sgivc" = yes; then
825 AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
826 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [],
830 # if that succeeded, then we've really got it.
831 if test "$have_sgivc" = yes; then
832 AC_DEFINE(HAVE_SGI_VC_EXTENSION)
835 elif test "$with_sgivc" != no; then
836 echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
841 # Check for the DPMS server extension header.
844 with_dpms_req=unspecified
845 AC_ARG_WITH(dpms-ext,
846 [ --with-dpms-ext Include support for the DPMS server extension,
847 if possible (this is the default).
848 --without-dpms-ext Do not compile in support for this extension.],
849 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
851 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
853 if test "$with_dpms" = yes; then
855 # first check for dpms.h
856 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
858 # if that succeeded, then check for the -lXdpms
859 if test "$have_dpms" = yes; then
861 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
862 [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [],
866 # if that succeeded, then we've really got it.
867 if test "$have_dpms" = yes; then
868 AC_DEFINE(HAVE_DPMS_EXTENSION)
871 elif test "$with_dpms" != no; then
872 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
877 # Check for the XF86VMODE server extension header.
880 with_xf86vmode_req=unspecified
881 AC_ARG_WITH(xf86vmode-ext,
882 [ --with-xf86vmode-ext Include support for XFree86 virtual screens, if
883 possible (this is the default).
884 --without-xf86vmode-ext Do not compile in support for this extension.],
885 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
886 [with_xf86vmode=yes])
888 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
890 if test "$with_xf86vmode" = yes; then
892 # first check for xf86vmode.h
893 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes])
895 # if that succeeded, then check for the -lXxf86vm
896 if test "$have_xf86vmode" = yes; then
898 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
899 [have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"], [],
903 # if that succeeded, then we've really got it.
904 if test "$have_xf86vmode" = yes; then
905 AC_DEFINE(HAVE_XF86VMODE)
908 elif test "$with_xf86vmode" != no; then
909 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
914 # Check for /proc/interrupts
916 have_proc_interrupts=no
917 with_proc_interrupts_req=unspecified
918 AC_ARG_WITH(proc-interrupts,
919 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
920 file to notice keyboard activity, if possible.
921 --without-proc-interrupts Do not compile in support for this method.],
922 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
923 [with_proc_interrupts=yes])
925 if test "$with_proc_interrupts" = yes; then
927 AC_MSG_CHECKING(whether /proc/interrupts contains keyboard data)
928 AC_CACHE_VAL(ac_cv_have_proc_interrupts,
929 [ac_cv_have_proc_interrupts=no
930 if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
931 ac_cv_have_proc_interrupts=yes
934 have_proc_interrupts=$ac_cv_have_proc_interrupts
936 AC_MSG_RESULT($have_proc_interrupts)
938 if test "$have_proc_interrupts" = yes; then
939 AC_DEFINE(HAVE_PROC_INTERRUPTS)
942 elif test "$with_proc_interrupts" != no; then
943 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
949 # Check for Motif and Athena --with and --without arguments.
954 with_motif_req=unspecified
955 with_athena_req=unspecified
958 X Client Toolkit options:
960 --with-motif Use the Motif toolkit for the user interface, if
961 possible (this is the default).
962 --without-motif Do not use Motif.],
963 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
965 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
968 [ --with-athena Use the Athena toolkit for the user interface, if
969 possible (this is the default if Motif isn't used.)
970 --without-athena Do not use Athena.],
971 [with_athena="$withval"; with_athena_req="$withval"],[with_athena=no])
973 HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena)
975 if test "$with_motif" != yes -a "$with_motif" != no ; then
976 echo "error: must be yes or no: --with-motif=$with_motif"
980 if test "$with_athena" != yes -a "$with_athena" != no ; then
981 echo "error: must be yes or no: --with-athena=$with_athena"
986 # Saying --without-motif is the same as saying --with-athena.
987 if test "$with_motif_req" = no ; then
992 # Saying --without-athena is the same as saying --with-motif.
993 if test "$with_athena_req" = no ; then
998 # Check for Motif and Athena headers.
1001 AC_CHECK_X_HEADER(Xm/Xm.h,
1003 AC_DEFINE(HAVE_MOTIF)
1004 TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS"])
1010 AC_CHECK_X_HEADER(X11/Xaw/Dialog.h, [have_athena=yes])
1011 if test "$have_athena" = yes; then
1012 AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
1013 [have_athena=yes; have_athena3d=yes], [],
1014 -lXt -lXmu -lXext -lX11)
1017 if test "$have_athena3d" = yes; then
1018 TOOLKIT_LIBS="-lXaw3d $TOOLKIT_LIBS"
1019 elif test "$have_athena" = yes; then
1020 TOOLKIT_LIBS="-lXaw $TOOLKIT_LIBS"
1025 # If they asked for both motif and athena, check motif then athena.
1026 # If they asked for only motif, check motif then athena.
1027 # If they asked for only athena, check athena then motif.
1028 # If they asked for neither, check motif then athena.
1030 proselytize_motif=yes
1031 if test "$with_motif" = yes; then
1032 # asked for both, or for motif only
1034 if test "$have_motif" = yes; then
1041 elif test "$with_athena" = yes; then
1042 # asked for athena only
1044 if test "$have_athena" = yes; then
1046 proselytize_motif=no
1054 if test "$have_motif" = yes; then
1062 if test "$have_motif" = yes; then
1063 proselytize_motif=no
1066 # If we have Athena, check whether it's a version that includes
1067 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
1068 if test "$have_athena" = yes ; then
1069 AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
1070 ac_cv_have_XawViewportSetCoordinates,
1071 [ac_cv_have_XawViewportSetCoordinates=no
1072 AC_EGREP_X_HEADER(XawViewportSetCoordinates,
1074 ac_cv_have_XawViewportSetCoordinates=yes)])
1075 if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
1076 AC_DEFINE(HAVE_XawViewportSetCoordinates)
1081 # If we have Motif, check whether it's really LessTif.
1084 if test "$have_motif" = yes ; then
1085 AC_CACHE_CHECK([whether Motif is really LessTif],
1087 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
1088 [long vers = LesstifVersion;],
1089 [ac_cv_have_lesstif=yes],
1090 [ac_cv_have_lesstif=no])])
1091 have_lesstif=$ac_cv_have_lesstif
1095 unset ac_cv_lesstif_version
1096 unset ac_cv_lesstif_version_string
1098 lesstif_version=unknown
1099 lesstif_version_string=unknown
1101 if test "$have_lesstif" = yes ; then
1103 echo unknown > conftest-lt
1104 AC_CACHE_CHECK([LessTif version number],
1105 ac_cv_lesstif_version_string,
1106 [AC_TRY_X_RUN([#include <stdio.h>
1109 FILE *f = fopen("conftest-lt", "w");
1111 fprintf(f, "%d %d.%d\n", LesstifVersion,
1112 LESSTIF_VERSION, LESSTIF_REVISION);
1116 [ltv=`cat conftest-lt`
1117 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
1118 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
1119 [ac_cv_lesstif_version=unknown
1120 ac_cv_lesstif_version_string=unknown],
1121 [ac_cv_lesstif_version=unknown
1122 ac_cv_lesstif_version_string=unknown])])
1124 lesstif_version=$ac_cv_lesstif_version
1125 lesstif_version_string=$ac_cv_lesstif_version_string
1130 if test "$have_motif" = yes ; then
1132 echo unknown > conftest-mt
1133 AC_CACHE_CHECK([Motif version number],
1134 ac_cv_motif_version_string,
1135 [AC_TRY_X_RUN([#include <stdio.h>
1138 FILE *f = fopen("conftest-mt", "w");
1140 fprintf(f, "%d %d.%d\n", XmVersion,
1141 XmVERSION, XmREVISION);
1145 [mtv=`cat conftest-mt`
1146 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
1147 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
1148 [ac_cv_motif_version=unknown
1149 ac_cv_motif_version_string=unknown],
1150 [ac_cv_motif_version=unknown
1151 ac_cv_motif_version_string=unknown])])
1153 motif_version=$ac_cv_motif_version
1154 motif_version_string=$ac_cv_motif_version_string
1159 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
1160 # The deal is, Motif 2.x requires XPM -- but it's a compilation option of
1161 # the library whether to build the XPM code into libXm, or whether to rely
1162 # on an external libXm. So the only way to tell whether XPM is a link-time
1163 # requirement is to examine libXm.a, which is very difficult to do in an
1164 # autoconf script. So... if it's Motif 2.x, we always link against XPM if
1165 # the XPM lib exists (and this will be a no-op if libXm happens to already
1166 # have the XPM code in it.)
1168 motif_requires_xpm=no
1169 if test "$have_motif" = yes ; then
1170 AC_MSG_CHECKING(whether Motif requires XPM)
1171 if test "$motif_version" -ge 2000; then
1172 motif_requires_xpm=yes
1173 AC_MSG_RESULT(maybe)
1181 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
1182 # Extension". Why this extension isn't in -lXext with all the others,
1186 if test "$have_motif" = yes ; then
1188 AC_CHECK_X_LIB(Xp, XpQueryExtension,
1189 [have_xp_ext=yes; TOOLKIT_LIBS="$TOOLKIT_LIBS -lXp"],
1190 [], -lX11 -lXext -lm)
1194 # Check for _Xsetlocale in -lXintl, since at least some recent versions
1195 # of Motif (on Linux) need it.
1198 if test "$have_motif" = yes ; then
1199 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
1201 if test "$have_xintl" = yes; then
1202 TOOLKIT_LIBS="$TOOLKIT_LIBS -lXintl"
1207 # check for XPM header.
1210 with_xpm_req=unspecified
1212 Graphics Demo options:
1214 --with-xpm Include support for XPM files in some demos,
1215 if possible (this is the default).
1216 --without-xpm Do not compile in support for XPM files.],
1217 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
1219 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
1221 if test "$with_xpm" = yes; then
1222 AC_CHECK_X_HEADER(X11/xpm.h,
1226 elif test "$with_xpm" != no; then
1227 echo "error: must be yes or no: --with-xpm=$with_xpm"
1231 # See comment near $motif_requires_xpm, above.
1232 # Need to do this here, after both Motif and XPM have been checked for.
1234 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
1235 if test "$motif_requires_xpm" = yes ; then
1236 TOOLKIT_LIBS="$TOOLKIT_LIBS $XPM_LIBS"
1241 # check for the GL header
1245 with_gl_req=unspecified
1247 [ --with-gl Build those demos which depend on OpenGL,
1248 if possible (this is the default).
1249 --without-gl Do not build the OpenGL demos.],
1250 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
1252 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
1254 ac_mesagl_version=unknown
1255 ac_mesagl_version_string=unknown
1257 if test "$with_gl" = yes; then
1258 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
1259 if test "$have_gl" = yes ; then
1260 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
1263 # If we have the headers, try and figure out which vendor it's from.
1265 if test "$have_gl" = yes ; then
1269 # We need to know whether it's MesaGL so that we know which libraries
1272 AC_MSG_CHECKING(whether GL is really MesaGL)
1273 AC_CACHE_VAL(ac_cv_have_mesa_gl,
1274 [ac_cv_have_mesa_gl=no
1275 AC_EGREP_X_HEADER(Mesa, GL/glx.h, [ac_cv_have_mesa_gl=yes])
1277 ac_have_mesa_gl=$ac_cv_have_mesa_gl
1278 AC_MSG_RESULT($ac_have_mesa_gl)
1280 if test "$ac_have_mesa_gl" = no ; then
1282 GL_LIBS="-lGL -lGLU"
1284 AC_DEFINE(HAVE_MESA_GL)
1286 GL_LIBS="-lMesaGL -lMesaGLU"
1290 # If it's MesaGL, we'd like to issue a warning if the version number
1291 # is less than or equal to 2.6, because that version had a security bug.
1293 if test "$ac_have_mesa_gl" = yes; then
1295 # don't cache these.
1296 unset ac_cv_mesagl_version
1297 unset ac_cv_mesagl_version_string
1299 AC_MSG_CHECKING(MesaGL version number)
1300 AC_CACHE_VAL(ac_cv_mesagl_version_string,
1301 [cat > conftest.$ac_ext <<EOF
1302 #line __oline__ "configure"
1303 #include "confdefs.h"
1305 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
1308 ac_save_CPPFLAGS="$CPPFLAGS"
1309 if test \! -z "$includedir" ; then
1310 CPPFLAGS="$CPPFLAGS -I$includedir"
1312 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1316 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
1317 's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
1320 rm -f conftest.$ac_ext
1322 CPPFLAGS="$ac_save_CPPFLAGS"
1324 if test "$mglv" = ""; then
1325 ac_mesagl_version=unknown
1326 ac_mesagl_version_string=unknown
1328 ac_mesagl_version_string=$mglv
1329 maj=`echo $mglv | sed -n 's/\..*//p'`
1330 min=`echo $mglv | sed -n 's/.*\.//p'`
1331 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
1332 if test -z "$ac_mesagl_version"; then
1333 ac_mesagl_version=unknown
1334 ac_mesagl_version_string=unknown
1337 ac_cv_mesagl_version=$ac_mesagl_version
1338 ac_cv_mesagl_version_string=$ac_mesagl_version_string
1340 ac_mesagl_version=$ac_cv_mesagl_version
1341 ac_mesagl_version_string=$ac_cv_mesagl_version_string
1342 AC_MSG_RESULT($ac_cv_mesagl_version_string)
1346 # If it's MesaGL, check to see if it requires -lpthread.
1349 mesa_requires_pthread=no
1350 if test "$ac_have_mesa_gl" = yes; then
1352 AC_CHECK_LIB(pthread, pthread_create, [have_pthread=yes], [],)
1353 if test "$have_pthread" = yes; then
1354 AC_CHECK_X_LIB($gl_lib_1, gl_get_thread_context,
1355 [mesa_requires_pthread=yes], [],
1356 $GL_LIBS -lpthread -lX11 -lXext -lm)
1359 if test "$mesa_requires_pthread" = yes; then
1360 GL_LIBS="$GL_LIBS -lpthread"
1364 # Check for OpenGL 1.1 features.
1366 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
1367 [], $GL_LIBS -lX11 -lXext -lm)
1370 # Check whether the `xscreensaver' executable should link against GL.
1371 # See comments in utils/visual-gl.c for why this is sometimes necessary.
1373 AC_MSG_CHECKING(whether drastic GL measures must be taken)
1376 AC_MSG_RESULT([yes -- hello, SGI.])
1377 AC_DEFINE(DAEMON_USE_GL)
1378 SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
1379 SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
1380 SAVER_GL_LIBS="$GL_LIBS"
1383 AC_MSG_RESULT([no -- non-SGI.])
1392 elif test "$with_gl" != no; then
1393 echo "error: must be yes or no: --with-gl=$with_gl"
1398 # check for SGI XReadDisplay server extension header.
1401 with_readdisplay_req=unspecified
1402 AC_ARG_WITH(readdisplay,
1403 [ --with-readdisplay Include support for the XReadDisplay server
1404 extension if possible (this is the default).
1405 --without-readdisplay Do not compile in support for this extension.],
1406 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
1407 [with_readdisplay=yes])
1409 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
1411 if test "$with_readdisplay" = yes; then
1412 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
1413 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
1414 elif test "$with_readdisplay" != no; then
1415 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
1420 # check for SGI's Iris Video Library header.
1423 with_sgivideo_req=unspecified
1424 AC_ARG_WITH(sgivideo,
1425 [ --with-sgivideo Include support for SGI's Iris Video Library
1426 if possible (this is the default).
1427 --without-sgivideo Do not compile in support for this library.],
1428 [with_sgivideo="$withval"; with_sgivideo_req="$withval"],
1429 [with_sgivideo=yes])
1431 HANDLE_X_PATH_ARG(with_sgivideo, --with-sgivideo, Iris Video)
1433 if test "$with_sgivideo" = yes; then
1434 AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes)
1435 if test "$have_sgivideo" = yes; then
1437 AC_CHECK_LIB(vl, vlOpenVideo, have_sgivideo=yes)
1438 if test "$have_sgivideo" = yes; then
1439 SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
1440 SGI_VIDEO_LIBS="-lvl"
1441 AC_DEFINE(HAVE_SGI_VIDEO)
1444 elif test "$with_sgivideo" != no; then
1445 echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
1451 # Try to find a program to generate random text.
1453 # Zippy is funnier than the idiocy generally spat out by `fortune',
1454 # so try to find that, by invoking Emacs and asking it where its
1455 # libexec directory is ("yow" lives in there.)
1457 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
1458 # and if so, use them.
1460 # If that doesn't work, look in /usr/games, and if it's there, use
1461 # the full pathname.
1465 [ --with-zippy=PROGRAM Some demos are able to run an external program and
1466 display its text; this names the program to use by
1467 default (though it can be overridden with X
1468 resources.) If you don't specify this, the default
1469 is to use \"yow\" from the Emacs distribution (if you
1470 have it) or else to use \"fortune\".],
1471 [ with_zippy_req="$withval"; with_zippy="$withval" ],
1472 [ with_zippy_req="$withval"; with_zippy="$withval" ])
1474 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
1479 if test -n "$with_zippy_req" ; then
1480 ac_cv_zippy_program=""
1481 case "$with_zippy_req" in
1483 AC_MSG_CHECKING([for $with_zippy_req])
1484 if test -x "$with_zippy_req" ; then
1493 unset ac_cv_path_zip2
1494 AC_PATH_PROG(zip2, $with_zippy_req, [])
1495 if test "$zip2" = ""; then
1500 ac_cv_zippy_program="$with_zippy"
1502 elif test -n "$ac_cv_zippy_program"; then
1503 AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
1506 if test ! -n "$ac_cv_zippy_program"; then
1508 AC_CHECK_PROGS(emacs_exe, emacs)
1509 AC_CHECK_PROGS(xemacs_exe, xemacs)
1511 ac_cv_zippy_program=""
1512 eargs='-batch -q -nw --eval'
1514 if test -n "$emacs_exe" ; then
1515 AC_MSG_CHECKING([for emacs yow])
1517 # get emacs to tell us where the libexec directory is.
1519 dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
1520 2>/dev/null | tail -1`
1521 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
1523 # try running libexec/yow and see if it exits without error.
1525 if test x"$dir" != x -a -x "$dir/yow" ; then
1526 if $dir/yow >&- 2>&- ; then
1527 ac_cv_zippy_program="$dir/yow"
1528 AC_MSG_RESULT($ac_cv_zippy_program)
1535 if test -z "$ac_cv_zippy_program" ; then
1536 AC_MSG_CHECKING([for xemacs yow])
1537 if test -n "$xemacs_exe" ; then
1539 # get xemacs to tell us where the libexec directory is.
1541 dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
1542 2>/dev/null | tail -1`
1543 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
1545 # try running libexec/yow and see if it exits without error.
1547 if test x"$dir" != x -a -x "$dir/yow" ; then
1548 if $dir/yow >&- 2>&- ; then
1549 ac_cv_zippy_program="$dir/yow"
1550 AC_MSG_RESULT($ac_cv_zippy_program)
1553 # in some xemacs installations, the pathname of the yow.lines file
1554 # isn't hardcoded into the yow executable, and must be passed on
1555 # the command line. See if it's in libexec/../etc/.
1559 dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
1562 yowlines="$dir_up/etc/yow.lines"
1563 if $dir/yow -f $yowlines >&- 2>&- ; then
1564 ac_cv_zippy_program="$dir/yow -f $yowlines"
1565 AC_MSG_RESULT($ac_cv_zippy_program)
1568 # In newer XEmacs releases, yow.lines is in a different place,
1569 # and the easiest way to get it is by calling the new function
1570 # `locate-data-file'.
1572 yowlines=`$xemacs_exe $eargs \
1573 '(princ (concat (locate-data-file "yow.lines") "\n"))' \
1574 2>/dev/null | tail -1`
1575 if $dir/yow -f $yowlines >&- 2>&- ; then
1576 ac_cv_zippy_program="$dir/yow -f $yowlines"
1577 AC_MSG_RESULT($ac_cv_zippy_program)
1587 # if that didn't work, try for some other programs...
1588 if test -z "$ac_cv_zippy_program" ; then
1590 AC_CHECK_PROGS(fortune, [fortune zippy yow])
1591 # if that didn't work, try for those programs in /usr/games...
1592 if test -z "$fortune" ; then
1593 AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
1594 /usr/games:/usr/local/games)
1599 if test -z "$ac_cv_zippy_program" ; then
1600 ac_cv_zippy_program=fortune
1603 AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
1608 # Allow locking to be disabled at compile-time.
1611 with_kerberos_req=unspecified
1613 with_shadow_req=unspecified
1615 with_pam_req=unspecified
1618 AC_ARG_ENABLE(locking,[
1619 Screen Locking options:
1621 --enable-locking Compile in support for locking the display
1622 (this is the default.)
1623 --disable-locking Do not allow locking at all.],
1624 [enable_locking="$enableval"],[enable_locking=yes])
1625 if test "$enable_locking" = yes; then
1627 elif test "$enable_locking" = no; then
1628 AC_DEFINE(NO_LOCKING)
1630 echo "error: must be yes or no: --enable-locking=$enable_locking"
1636 # Check to see if we can lock Virtual-Terminal switching, but allow that
1637 # to be disabled at compile-time.
1640 AC_ARG_ENABLE(vt-locking,[
1641 --enable-vt-locking Compile in support for locking Virtual Terminals.
1642 This is the default if the system supports it, and
1643 if locking support is included (--enable-locking.)
1644 --disable-vt-locking Do not allow locking of VTs, even if locking is
1646 [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
1647 if test "$enable_vt_locking" = yes; then
1649 AC_MSG_CHECKING(for the VT_LOCKSWITCH ioctl)
1650 AC_CACHE_VAL(ac_cv_vt_lockswitch,
1651 [AC_TRY_COMPILE([#include <fcntl.h>
1652 #include <sys/ioctl.h>
1653 #include <sys/vt.h>],
1654 [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
1655 [ac_cv_vt_lockswitch=yes],
1656 [ac_cv_vt_lockswitch=no])])
1657 ac_vt_lockswitch=$ac_cv_vt_lockswitch
1658 AC_MSG_RESULT($ac_vt_lockswitch)
1660 elif test "$enable_vt_locking" = no; then
1663 echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
1667 if test "$ac_vt_lockswitch" = yes; then
1668 AC_DEFINE(HAVE_VT_LOCKSWITCH)
1669 # the VT_LOCKSWITCH ioctl can only be used when running as root.
1670 # #### but it doesn't work yet, so don't worry about that for now.
1676 if test "$enable_locking" = yes; then
1678 # Check for Kerberos.
1680 AC_ARG_WITH(kerberos, [
1681 --with-kerberos Include support for Kerberos authentication,
1682 if possible (this is the default.)
1683 --without-kerberos Do not compile in support for Kerberos.],
1684 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
1686 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
1688 if test "$with_kerberos" = yes; then
1689 AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
1690 [AC_TRY_X_COMPILE([#include <krb.h>],,
1691 [ac_cv_kerberos=yes],
1692 [ac_cv_kerberos=no])])
1693 if test "$ac_cv_kerberos" = yes ; then
1695 AC_DEFINE(HAVE_KERBEROS)
1697 # from Tim Showalter <tjs+@andrew.cmu.edu>
1698 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
1699 AC_CHECK_FUNC(res_search,,
1700 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
1701 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
1705 elif test "$with_kerberos" != no; then
1706 echo "error: must be yes or no: --with-kerberos=$with_kerberos"
1712 [ --with-pam Include support for PAM (Pluggable Authentication
1713 Modules) if possible (this is the default.)
1714 --without-pam Do not compile in support for PAM.],
1715 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=yes])
1717 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
1719 if test "$with_pam" = yes; then
1720 AC_CACHE_CHECK([for PAM], ac_cv_pam,
1721 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
1724 if test "$ac_cv_pam" = yes ; then
1727 PASSWD_LIBS="${PASSWD_LIBS} -lpam -ldl"
1730 AC_MSG_CHECKING(how to call pam_strerror)
1731 AC_CACHE_VAL(ac_cv_pam_strerror_args,
1732 [AC_TRY_COMPILE([#include <stdio.h>
1734 #include <security/pam_appl.h>],
1735 [pam_handle_t *pamh = 0;
1736 char *s = pam_strerror(pamh, PAM_SUCCESS);],
1737 [ac_pam_strerror_args=2],
1738 [AC_TRY_COMPILE([#include <stdio.h>
1740 #include <security/pam_appl.h>],
1742 pam_strerror(PAM_SUCCESS);],
1743 [ac_pam_strerror_args=1],
1744 [ac_pam_strerror_args=0])])
1745 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
1746 ac_pam_strerror_args=$ac_cv_pam_strerror_args
1747 if test "$ac_pam_strerror_args" = 1 ; then
1748 AC_MSG_RESULT(one argument)
1749 elif test "$ac_pam_strerror_args" = 2 ; then
1750 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
1751 AC_MSG_RESULT(two arguments)
1753 AC_MSG_RESULT(unknown)
1756 elif test "$with_pam" != no; then
1757 echo "error: must be yes or no: --with-pam=$with_pam"
1761 # Next, check for the nine billion variants of shadow passwords...
1765 [ --with-shadow Include support for shadow password authentication,
1766 if possible (this is the default, if no Kerberos or
1768 --without-shadow Do not compile in support for shadow passwords.
1770 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
1772 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
1774 if test "$with_shadow" = no; then
1775 pwent_cruft_done=yes
1776 elif test "$with_shadow" != yes; then
1777 echo "error: must be yes or no: --with-shadow=$with_shadow"
1782 # Sun's "adjunct" passwords.
1784 if test "$pwent_cruft_done" = no ; then
1785 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
1786 [AC_TRY_X_COMPILE([#include <stdlib.h>
1788 #include <sys/types.h>
1789 #include <sys/label.h>
1790 #include <sys/audit.h>
1791 #include <pwdadj.h>],
1792 [struct passwd_adjunct *p = getpwanam("nobody");
1793 const char *pw = p->pwa_passwd;],
1794 [ac_cv_sun_adjunct=yes],
1795 [ac_cv_sun_adjunct=no])])
1796 if test "$ac_cv_sun_adjunct" = yes; then
1799 pwent_cruft_done=yes
1800 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
1804 # DEC and SCO so-called "enhanced" security.
1806 if test "$pwent_cruft_done" = no ; then
1807 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
1808 [AC_TRY_X_COMPILE([#include <stdlib.h>
1810 #include <sys/types.h>
1812 #include <sys/security.h>
1814 [struct pr_passwd *p;
1816 set_auth_parameters(0, 0);
1817 check_auth_parameters();
1818 p = getprpwnam("nobody");
1819 pw = p->ufld.fd_encrypt;],
1820 [ac_cv_enhanced_passwd=yes],
1821 [ac_cv_enhanced_passwd=no])])
1822 if test $ac_cv_enhanced_passwd = yes; then
1825 pwent_cruft_done=yes
1826 AC_DEFINE(HAVE_ENHANCED_PASSWD)
1828 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
1829 # (I'm told it needs -lcurses too, but I don't understand why.)
1830 AC_CHECK_LIB(prot, getprpwnam,
1831 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
1832 [# On DEC, getprpwnam() is in -lsecurity
1833 AC_CHECK_LIB(security, getprpwnam,
1834 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
1839 # HP's entry in the "Not Invented Here" Sweepstakes.
1841 if test "$pwent_cruft_done" = no ; then
1842 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
1843 [AC_TRY_X_COMPILE([#include <stdlib.h>
1845 #include <sys/types.h>
1847 #include <hpsecurity.h>
1849 [struct s_passwd *p = getspwnam("nobody");
1850 const char *pw = p->pw_passwd;],
1851 [ac_cv_hpux_passwd=yes],
1852 [ac_cv_hpux_passwd=no])])
1853 if test "$ac_cv_hpux_passwd" = yes; then
1856 pwent_cruft_done=yes
1857 AC_DEFINE(HAVE_HPUX_PASSWD)
1859 # on HPUX, bigcrypt is in -lsec
1860 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
1864 # Traditional (ha!) shadow passwords.
1866 if test "$pwent_cruft_done" = no ; then
1867 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
1868 [AC_TRY_X_COMPILE([#include <stdlib.h>
1870 #include <sys/types.h>
1872 #include <shadow.h>],
1873 [struct spwd *p = getspnam("nobody");
1874 const char *pw = p->sp_pwdp;],
1876 [ac_cv_shadow=no])])
1877 if test "$ac_cv_shadow" = yes; then
1880 pwent_cruft_done=yes
1881 AC_DEFINE(HAVE_SHADOW_PASSWD)
1883 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
1885 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
1886 if test "$have_getspnam" = no ; then
1887 AC_CHECK_LIB(gen, getspnam,
1888 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
1893 # On FreeBSD, getpwnam() and friends work just like on non-shadow-password
1894 # systems -- except you only get stuff in the pw_passwd field if the running
1895 # program is setuid. So, guess that we've got this lossage to contend with
1896 # if /etc/master.passwd exists, and default to a setuid installation.
1898 if test "$pwent_cruft_done" = no ; then
1899 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
1900 [if test -f /etc/master.passwd ; then
1901 ac_cv_master_passwd=yes
1903 ac_cv_master_passwd=no
1905 if test "$ac_cv_master_passwd" = yes; then
1907 pwent_cruft_done=yes
1911 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
1913 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
1914 if test "$have_crypt" = no ; then
1915 AC_CHECK_LIB(crypt, crypt,
1916 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
1920 # Most of the above shadow mechanisms will have set need_setuid to yes,
1921 # if they were found. But, on some systems, we need setuid even when
1922 # using plain old vanilla passwords.
1924 if test "$need_setuid" = no ; then
1926 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
1935 # for the "sonar" hack -- check how to ping.
1937 AC_MSG_CHECKING(for struct icmp)
1938 AC_CACHE_VAL(ac_cv_have_icmp,
1939 [AC_TRY_COMPILE([#include <stdlib.h>
1946 #include <sys/types.h>
1947 #include <sys/time.h>
1948 #include <sys/ipc.h>
1949 #include <sys/shm.h>
1950 #include <sys/socket.h>
1951 #include <netinet/in_systm.h>
1952 #include <netinet/in.h>
1953 #include <netinet/ip.h>
1954 #include <netinet/ip_icmp.h>
1955 #include <netinet/udp.h>
1956 #include <arpa/inet.h>
1957 #include <netdb.h>],
1960 struct sockaddr_in si;
1962 i.icmp_type = ICMP_ECHO;
1967 si.sin_family = AF_INET;
1969 [ac_cv_have_icmp=yes],
1970 [ac_cv_have_icmp=no])])
1971 ac_have_icmp=$ac_cv_have_icmp
1972 AC_MSG_RESULT($ac_cv_have_icmp)
1974 AC_MSG_CHECKING(for struct icmphdr)
1975 AC_CACHE_VAL(ac_cv_have_icmphdr,
1976 [AC_TRY_COMPILE([#include <stdlib.h>
1983 #include <sys/types.h>
1984 #include <sys/time.h>
1985 #include <sys/ipc.h>
1986 #include <sys/shm.h>
1987 #include <sys/socket.h>
1988 #include <netinet/in_systm.h>
1989 #include <netinet/in.h>
1990 #include <netinet/ip.h>
1991 #include <netinet/ip_icmp.h>
1992 #include <netinet/udp.h>
1993 #include <arpa/inet.h>
1994 #include <netdb.h>],
1997 struct sockaddr_in si;
2003 i.un.echo.sequence = 0;
2004 si.sin_family = AF_INET;
2006 [ac_cv_have_icmphdr=yes],
2007 [ac_cv_have_icmphdr=no])])
2008 ac_have_icmphdr=$ac_cv_have_icmphdr
2009 AC_MSG_RESULT($ac_cv_have_icmphdr)
2011 if test "$ac_have_icmp" = yes ; then
2012 AC_DEFINE(HAVE_ICMP)
2014 if test "$ac_have_icmphdr" = yes ; then
2015 AC_DEFINE(HAVE_ICMPHDR)
2020 ########################## end of tests.
2023 if test \! -z "$includedir" ; then
2024 INCLUDES="-I$includedir"
2027 if test \! -z "$libdir" ; then
2028 LDFLAGS="$LDFLAGS -L$libdir"
2032 ##### should have options to override the DEPEND crap, I guess...
2038 # Done testing things -- now substitute in some stuff for the Makefiles.
2040 if test "$have_motif" = yes; then
2041 AC_DEFINE(HAVE_MOTIF)
2042 TOOLKIT_SRCS='$(MOTIF_SRCS)'
2043 TOOLKIT_OBJS='$(MOTIF_OBJS)'
2044 elif test "$have_athena" = yes; then
2045 AC_DEFINE(HAVE_ATHENA)
2046 TOOLKIT_SRCS='$(ATHENA_SRCS)'
2047 TOOLKIT_OBJS='$(ATHENA_OBJS)'
2053 if test "$have_kerberos" = yes; then
2054 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
2055 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
2057 if test "$have_pam" = yes; then
2058 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
2059 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
2060 INSTALL_PAM="install-pam"
2062 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
2063 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
2066 if test "$enable_locking" = yes; then
2067 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
2068 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
2074 if test "$need_setuid" = yes; then
2076 INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
2079 INSTALL_SETUID='$(INSTALL_PROGRAM)'
2083 if test "$have_gl" = yes; then
2084 GL_EXES='$(GL_EXES)'
2088 GL_KLUDGE=" -${tab} "
2093 AC_SUBST(SAVER_LIBS)
2094 AC_SUBST(TOOLKIT_LIBS)
2098 AC_SUBST(PASSWD_LIBS)
2099 AC_SUBST(INSTALL_SETUID)
2100 AC_SUBST(INSTALL_DIRS)
2101 AC_SUBST(NEED_SETUID)
2102 AC_SUBST(INSTALL_PAM)
2103 AC_SUBST(SGI_VIDEO_OBJS)
2104 AC_SUBST(SGI_VIDEO_LIBS)
2106 AC_SUBST(TOOLKIT_SRCS)
2107 AC_SUBST(TOOLKIT_OBJS)
2108 AC_SUBST(PASSWD_SRCS)
2109 AC_SUBST(PASSWD_OBJS)
2112 AC_SUBST(SAVER_GL_SRCS)
2113 AC_SUBST(SAVER_GL_OBJS)
2114 AC_SUBST(SAVER_GL_LIBS)
2121 AC_SUBST(APPDEFAULTS)
2124 AC_SUBST(DEPEND_FLAGS)
2125 AC_SUBST(DEPEND_DEFINES)
2127 # Print some warnings before emitting the Makefiles.
2129 warn_prefix_1=" Warning:"
2130 warn_prefix_2=" Note:"
2131 warn_prefix="$warn_prefix_1"
2134 warnsep=' #################################################################'
2137 if test "$warning" = no ; then
2138 echo '' ; echo "$warnsep" ; echo ''
2145 if test "$warning" = long ; then echo '' ; fi
2147 echo "$warn_prefix $@"
2154 if test "$was" != no ; then echo '' ; fi
2155 echo "$warn_prefix $@"
2164 warn_prefix="$warn_prefix_2"
2166 warn_prefix="$warn_prefix_1"
2170 warn_prefix="$warn_prefix_2"
2172 warn_prefix="$warn_prefix_1"
2176 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
2177 warn 'The SGI saver extension was requested, but was not found.'
2180 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
2181 warn 'The MIT saver extension was requested, but was not found.'
2184 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
2185 warn 'The XIdle extension was requested, but was not found.'
2188 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
2189 warn 'The XSHM extension was requested, but was not found.'
2192 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
2193 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
2196 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
2197 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
2200 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
2201 warn 'The DPMS extension was requested, but was not found.'
2204 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
2205 warn 'The XF86VMODE extension was requested, but was not found.'
2208 if test "$have_motif" = no -a "$have_athena" = no ; then
2209 warnL "Neither Motif nor Athena widgets seem to be available;"
2210 warn2 "the \`xscreensaver-demo' program requires one or the"
2212 proselytize_motif=no
2214 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
2215 warnL "Use of Motif was requested, but it wasn't found;"
2216 warn2 "Athena will be used instead."
2218 elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
2219 warnL "Use of Athena was requested, but it wasn't found;"
2220 warn2 "Motif will be used instead."
2223 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
2225 preferred_lesstif=0.86
2227 if test "$lesstif_version" = unknown; then
2228 warnL "Unable to determine the LessTif version number!"
2229 warn2 "Make sure you are using version $preferred_lesstif or newer."
2230 warn2 "See <http://www.lesstif.org/>."
2232 elif test \! $lesstif_version -gt 82; then
2233 warnL "LessTif version $lesstif_version_string is being used."
2234 warn2 "LessTif versions 0.82 and earlier are too buggy to"
2235 warn2 "use with XScreenSaver; it is strongly recommended"
2236 warn2 "that you upgrade to at least version $preferred_lesstif!"
2237 warn2 "See <http://www.lesstif.org/>."
2241 if test "$proselytize_motif" = yes ; then
2242 warnL "Athena widgets are being used instead of Motif."
2243 warn2 "The \`xscreensaver-demo' program looks much better"
2244 warn2 "with Motif. Wouldn't you rather be using Motif?"
2245 warn2 "It is shipped by every commercial Unix vendor;"
2246 warn2 "and there is a free implementation available as"
2247 warn2 "well: see <http://www.lesstif.org/>."
2251 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
2252 preferred_mesagl=3.0
2254 if test "$ac_mesagl_version" = unknown; then
2255 warnL "Unable to determine the MesaGL version number!"
2256 warn2 "Make sure you are using version $preferred_mesagl or newer."
2258 elif test \! "$ac_mesagl_version" -gt 2006; then
2259 warnL "MesaGL version $ac_mesagl_version_string is being used."
2260 warn2 "MesaGL versions 2.6 and earlier have a security bug."
2261 warn2 "It is strongly recommended that you upgrade to at"
2262 warn2 "least version $preferred_mesagl."
2267 if test "$have_xpm" = no ; then
2268 if test "$with_xpm_req" = yes ; then
2269 warnL 'Use of XPM was requested, but it was not found.'
2270 elif test "$with_xpm_req" = no ; then
2271 noteL 'The XPM library is not being used.'
2273 noteL 'The XPM library was not found.'
2277 warn2 'Some of the demos will not be as colorful as they'
2278 warn2 'could be. You might want to consider installing XPM'
2279 warn2 'and re-running configure. (Remember to delete the'
2280 warn2 'config.cache file first.) You can find XPM at most'
2281 warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
2284 if test "$have_gl" = no ; then
2285 if test "$with_gl_req" = yes ; then
2286 warnL 'Use of GL was requested, but it was not found.'
2287 elif test "$with_gl_req" = no ; then
2288 noteL 'The OpenGL 3D library is not being used.'
2290 noteL 'The OpenGL 3D library was not found.'
2294 warn2 'Those demos which use 3D will not be built or installed.'
2295 warn2 'You might want to consider installing OpenGL and'
2296 warn2 're-running configure. (Remember to delete the'
2297 warn2 "config.cache file first.) If your vendor doesn't ship"
2298 warn2 'their own implementation of OpenGL, you can get a free'
2299 warn2 'version at <http://www.mesa3d.org/>. For general OpenGL'
2300 warn2 'info, see <http://www.opengl.org/>.'
2304 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
2305 warn 'Use of XReadDisplay was requested, but it was not found.'
2308 if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
2309 warn 'Use of the Iris Video Library was requested, but it was not found.'
2312 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
2313 warn 'Use of Kerberos was requested, but it was not found.'
2316 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
2317 warn 'Use of PAM was requested, but it was not found.'
2320 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
2321 warn 'Use of shadow passwords was requested, but they were not found.'
2324 if test -n "$with_zippy_req"; then
2325 if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
2326 warnL "$with_zippy_req was requested as the Zippy program,"
2327 warn2 "but was not found. The default will be used instead."
2331 if test "$warning" != no; then
2332 echo '' ; echo "$warnsep" ; echo ''
2341 driver/XScreenSaver.ad)
2343 # You are in a twisty maze of namespaces and syntaxes, all alike.
2344 # Fuck the skull of Unix.
2346 eval bindir=${bindir}
2347 eval bindir=${bindir}
2348 eval bindir=${bindir}
2349 eval bindir=${bindir}
2350 eval bindir=${bindir}
2351 eval bindir=${bindir}
2352 eval HACKDIR=${HACKDIR}
2353 eval HACKDIR=${HACKDIR}
2354 eval HACKDIR=${HACKDIR}
2355 eval HACKDIR=${HACKDIR}
2356 eval HACKDIR=${HACKDIR}
2357 eval HACKDIR=${HACKDIR}
2359 # canonicalize slashes.
2360 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
2361 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
2364 # Sanity check the subdir
2365 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
2366 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
2368 AC_MSG_ERROR([\"--enable-subdir=${bindir}/${bad_choice}\" won't work.
2369 There will be an executable installed with that name, so
2370 that can't be the name of a directory as well. Please
2371 re-configure with a different directory name.])
2378 # Now let's see if there's a previous RPM version already installed. Blargh!
2382 rpmv=`(rpm -qv xscreensaver) 2>&- | \
2383 sed 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-[0-9][0-9]*$/\1/'`
2386 if test \! -z "$rpmv" ; then
2387 rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
2388 rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
2391 warnL "There is already an installed RPM of xscreensaver $rpmv"
2392 warn2 "on this system. You might want to remove it (with"
2393 warn2 '"rpm -ve xscreensaver") before running "make install"'
2394 warn2 "from this directory."
2396 warn2 "Alternately, you could build this version of xscreensaver"
2397 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
2398 warn2 "file is included. See the RPM documentation for more info."
2401 if test "$rpmbdir" = "$rpmhdir" ; then
2402 warn2 "The RPM version was installed in $rpmbdir."
2404 warn2 "The RPM version was installed in $rpmbdir,"
2405 warn2 "with demos in $rpmhdir."
2412 if test "${bindir}" = "${HACKDIR}" ; then
2416 if test "$do_dir_warning" = yes; then
2420 echo ' When you run "make install", the "xscreensaver",'
2421 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
2422 echo " will be installed in ${bindir}."
2424 echo " The various graphics demos (90+ different executables) will"
2425 echo " also be installed in ${HACKDIR}."
2427 echo " If you would prefer the demos to be installed elsewhere"
2428 echo " (for example, in a dedicated directory) you should re-run"
2429 echo " configure with the --enable-subdir=DIR option. For more"
2430 echo " information, run $0 --help."