1 # configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
4 AC_INIT(driver/subprocs.c)
5 AC_CONFIG_HEADER(config.h)
10 if test -z "$GCC"; then
11 AC_MSG_CHECKING(how to request ANSI compilation)
14 AC_MSG_RESULT(HPUX: adding -Ae)
18 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
19 CC="$CC -qlanglvl=ansi -qhalt=e"
22 AC_MSG_RESULT(no idea)
28 AC_MSG_CHECKING([whether the compiler works on ANSI C])
29 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
32 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
33 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
37 if test -n "$GCC"; then
38 AC_MSG_RESULT(Turning on gcc compiler warnings.)
39 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
42 AC_MSG_RESULT(Turning on SGI compiler warnings.)
43 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
67 AC_MSG_CHECKING(how to call gettimeofday)
68 AC_CACHE_VAL(ac_cv_gettimeofday_args,
69 [AC_TRY_COMPILE([#include <stdlib.h>
70 #include <sys/time.h>],
71 [struct timeval tv; gettimeofday(&tv);],
72 [ac_gettimeofday_args=1],
73 [AC_TRY_COMPILE([#include <stdlib.h>
74 #include <sys/time.h>],
75 [struct timeval tv; struct timezone tzp;
76 gettimeofday(&tv, &tzp);],
77 [ac_gettimeofday_args=2],
78 [ac_gettimeofday_args=0])])
79 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
80 ac_gettimeofday_args=$ac_cv_gettimeofday_args
81 if test $ac_gettimeofday_args = 1 ; then
82 AC_DEFINE(HAVE_GETTIMEOFDAY)
83 AC_MSG_RESULT(one argument)
84 elif test $ac_gettimeofday_args = 2 ; then
85 AC_DEFINE(HAVE_GETTIMEOFDAY)
86 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
87 AC_MSG_RESULT(two arguments)
89 AC_MSG_RESULT(unknown)
93 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
94 AC_CHECK_HEADERS(unistd.h)
96 dnl /usr/local/src/ssh-1.2.17/putenv.c -- AC_REPLACE_FUNCS(putenv)
99 AC_ARG_ENABLE(subdir,[
100 Installation options:
102 --enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
103 instead of putting them in bindir itself. You can
104 specify the name of the subdirectory. For example,
105 --exec-prefix=/usr/local/bin --enable-subdir=demos
106 would put xscreensaver in /usr/local/bin/, and would
107 put the demos in /usr/local/bin/demos/. Note that if
108 you do this, you must make sure that the directory
109 is on your \$PATH before xscreensaver is started: the
110 directory name is not hardcoded into the program.
111 This merely sets the default installation location.
113 --disable-subdir Just put the demos in \`bindir' (this is the default.)
115 [enable_subdir="$enableval"],[enable_subdir=no])
116 if test x"$enable_subdir" = xno; then
118 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
119 echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
122 HACKDIR='$(bindir)/'$enable_subdir
128 # Try and find the app-defaults directory.
129 # It sucks that autoconf doesn't do this already...
131 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,
134 if mkdir conftestdir; then
136 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
137 cat > Imakefile <<'EOF'
139 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
141 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
142 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
143 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
149 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,
150 [ # Look for the directory under a standard set of common directories.
151 # Check X11 before X11Rn because it's often a symlink to the current release.
153 /usr/X11/lib/app-defaults \
154 /usr/X11R6/lib/app-defaults \
155 /usr/X11R6/lib/X11/app-defaults \
156 /usr/X11R5/lib/app-defaults \
157 /usr/X11R5/lib/X11/app-defaults \
158 /usr/X11R4/lib/app-defaults \
159 /usr/X11R4/lib/X11/app-defaults \
161 /usr/lib/X11/app-defaults \
162 /usr/lib/X11R6/app-defaults \
163 /usr/lib/X11R5/app-defaults \
164 /usr/lib/X11R4/app-defaults \
166 /usr/local/X11/lib/app-defaults \
167 /usr/local/X11R6/lib/app-defaults \
168 /usr/local/X11R5/lib/app-defaults \
169 /usr/local/X11R4/lib/app-defaults \
171 /usr/local/lib/X11/app-defaults \
172 /usr/local/lib/X11R6/app-defaults \
173 /usr/local/lib/X11R6/X11/app-defaults \
174 /usr/local/lib/X11R5/app-defaults \
175 /usr/local/lib/X11R5/X11/app-defaults \
176 /usr/local/lib/X11R4/app-defaults \
177 /usr/local/lib/X11R4/X11/app-defaults \
179 /usr/X386/lib/X11/app-defaults \
180 /usr/x386/lib/X11/app-defaults \
181 /usr/XFree86/lib/X11/app-defaults \
183 /usr/lib/X11/app-defaults \
184 /usr/local/lib/X11/app-defaults \
185 /usr/unsupported/lib/X11/app-defaults \
186 /usr/athena/lib/X11/app-defaults \
187 /usr/local/x11r5/lib/X11/app-defaults \
188 /usr/lpp/Xamples/lib/X11/app-defaults \
189 /lib/usr/lib/X11/app-defaults \
191 /usr/openwin/lib/app-defaults \
192 /usr/openwin/lib/X11/app-defaults \
193 /usr/openwin/share/lib/app-defaults \
194 /usr/openwin/share/lib/X11/app-defaults \
196 /X11R6/lib/app-defaults \
197 /X11R5/lib/app-defaults \
198 /X11R4/lib/app-defaults \
201 if test -d "$ac_dir"; then
202 ac_x_app_defaults=$ac_dir
209 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
211 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
212 [AC_PATH_X_APP_DEFAULTS_XMKMF
213 AC_PATH_X_APP_DEFAULTS_DIRECT
214 if test x"$ac_x_app_defaults" = x; then
215 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
217 # Record where we found app-defaults for the cache.
218 ac_cv_x_app_defaults="$ac_x_app_defaults"
220 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
222 AC_PATH_X_APP_DEFAULTS
224 APPDEFAULTS=$ac_x_app_defaults
227 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
229 AC_DEFUN(AC_CHECK_X_HEADER, [
230 ac_save_CPPFLAGS="$CPPFLAGS"
231 if test \! -z "$includedir" ; then
232 CPPFLAGS="$CPPFLAGS -I$includedir"
234 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
235 AC_CHECK_HEADER([$1], [$2])
236 CPPFLAGS="$ac_save_CPPFLAGS"])
238 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
240 AC_DEFUN(AC_EGREP_X_HEADER, [
241 ac_save_CPPFLAGS="$CPPFLAGS"
242 if test \! -z "$includedir" ; then
243 CPPFLAGS="$CPPFLAGS -I$includedir"
245 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
246 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
247 CPPFLAGS="$ac_save_CPPFLAGS"])
249 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
251 AC_DEFUN(AC_TRY_X_COMPILE, [
252 ac_save_CPPFLAGS="$CPPFLAGS"
253 if test \! -z "$includedir" ; then
254 CPPFLAGS="$CPPFLAGS -I$includedir"
256 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
257 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
258 CPPFLAGS="$ac_save_CPPFLAGS"])
261 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
262 # Use this sparingly; it probably doesn't work very well on X programs.
264 AC_DEFUN(AC_CHECK_X_LIB, [
265 ac_save_CPPFLAGS="$CPPFLAGS"
266 ac_save_LDFLAGS="$LDFLAGS"
267 if test \! -z "$includedir" ; then
268 CPPFLAGS="$CPPFLAGS -I$includedir"
270 if test \! -z "$includedir" ; then
271 CPPFLAGS="$CPPFLAGS -I$includedir"
273 if test \! -z "$libdir" ; then
274 LDFLAGS="$LDFLAGS -L$libdir"
276 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
277 LDFLAGS="$LDFLAGS -L$x_libraries"
278 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
279 CPPFLAGS="$ac_save_CPPFLAGS"
280 LDFLAGS="$ac_save_LDFLAGS"])
285 # check for the HP XHPDisableReset server extension headers.
287 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
288 [AC_DEFINE(HAVE_XHPDISABLERESET)
289 SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
292 # Check for the availability of the XPointer typedef, and define it otherwise.
294 AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
295 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
296 [XPointer foo = (XPointer) 0;],
297 [ac_cv_xpointer=yes],
298 [ac_cv_xpointer=no])])
299 if test $ac_cv_xpointer != yes; then
300 AC_DEFINE(XPointer,[char*])
306 # Thanks for not making xmkmf find this by default, you losers.
307 if test -d /usr/lib/Motif1.2 ; then
308 X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS"
309 X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS"
310 elif test -d /usr/lib/Motif1.1 ; then
311 X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS"
312 X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS"
315 # This too. You losers.
316 if test -d /usr/contrib/X11R6/include ; then
317 X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS"
318 X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS"
319 elif test -d /usr/contrib/X11R5/include ; then
320 X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS"
321 X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS"
326 # Same to you, pinheads. (Is this really the standard location now?
327 # What happened to the joke that this kind of thing went in /opt?)
328 if test -f /usr/dt/include/Xm/Xm.h ; then
329 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
330 X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
332 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
333 AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
340 # Check for Xmu (some fucked up vendors don't ship it...)
343 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
344 if test $have_xmu = no ; then
345 XMU_SRCS='$(UTILS_SRC)/xmu.c'
346 XMU_OBJS='$(UTILS_BIN)/xmu.o'
350 SAVER_LIBS="-lXmu $SAVER_LIBS"
351 HACK_LIBS="-lXmu $HACK_LIBS"
356 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
357 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
359 if test $have_xmu = yes ; then
362 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
364 [ac_save_LDFLAGS="$LDFLAGS"
365 if test \! -z "$x_libraries" ; then
366 LDFLAGS="$LDFLAGS -L$x_libraries"
368 # Note: this trick never works! (Generally.)
369 # We're only getting away with using AC_TRY_LINK
370 # with X libraries because we know it's SunOS.
371 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
373 [ac_cv_sunos_xmu_bug=no],
374 [ac_cv_sunos_xmu_bug=yes])
375 LDFLAGS="$ac_save_LDFLAGS"])
376 if test $ac_cv_sunos_xmu_bug = yes ; then
377 AC_CACHE_CHECK([whether the compiler understands -static],
379 [ac_save_LDFLAGS="$LDFLAGS"
380 LDFLAGS="$LDFLAGS -static"
381 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
382 LDFLAGS="$ac_save_LDFLAGS"])
383 if test $ac_cv_ld_static = yes ; then
384 LDFLAGS="$LDFLAGS -static"
386 LDFLAGS="$LDFLAGS -Bstatic"
394 # Check for the SGI SCREEN_SAVER server extension header.
397 with_sgi_req=unspecified
398 AC_ARG_WITH(sgi-ext,[
401 --with-sgi-ext Include support for the SGI SCREEN_SAVER
402 server extension, if possible (this is the default).
403 --without-sgi-ext Do not compile in support for this extension.],
404 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
405 if test $with_sgi = yes; then
406 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
408 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
410 elif test $with_sgi != no; then
411 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
415 # Check for the MIT-SCREEN-SAVER server extension header,
416 # unless the SGI extension has already been found.
419 with_mit_req=unspecified
421 [ --with-mit-ext Include support for the MIT-SCREEN-SAVER
422 server extension, if possible (this is the default).
423 --without-mit-ext Do not compile in support for this extension.],
424 [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
425 if test $have_sgi != yes; then
426 if test $with_mit = yes; then
427 AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
429 # Now check to see if it's really in the library; XF86Free-3.3 ships
430 # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
432 if test $have_mit = yes; then
433 AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [], [have_mit=no], -lm)
435 if test $have_mit = no; then
436 # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
437 # of in Xext. Thank you master, may I have another.
438 AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
439 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
440 [], -lX11 -lXext -lm)
443 if test $have_mit = no; then
444 # Double fuck! Looks like some versions of XFree86 (whichever version
445 # it is that comes with RedHat Linux 2.0 -- I can't find a version
446 # number) put this garbage in Xss instead of Xext. Thank you master,
447 # may I have another.
448 AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
449 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
450 [], -lX11 -lXext -lm)
453 if test $have_mit = yes; then
454 AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
459 elif test $with_mit != no; then
460 echo "error: must be yes or no: --with-mit-ext=$with_mit"
466 # Check for the XIDLE server extension header,
469 with_xidle_req=unspecified
470 AC_ARG_WITH(xidle-ext,
471 [ --with-xidle-ext Include support for the XIDLE server extension,
472 if possible (this is the default).
473 --without-xidle-ext Do not compile in support for this extension.],
474 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
475 if test $with_xidle = yes; then
476 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
478 AC_DEFINE(HAVE_XIDLE_EXTENSION)])
479 elif test $with_xidle != no; then
480 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
485 # Check for Motif and Athena --with and --without arguments.
489 with_motif_req=unspecified
490 with_athena_req=unspecified
495 --with-motif Use the Motif toolkit for the user interface,
496 if possible (this is the default).
497 --without-motif Do not use Motif.],
498 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
501 [ --with-athena Use the Athena toolkit for the user interface, if
502 possible (this is the default if Motif isn't used.)
503 --without-athena Do not use Athena.],
504 [with_athena="$withval"; with_athena_req="$withval"],[with_athena=no])
506 if test $with_motif != yes -a $with_motif != no ; then
507 echo "error: must be yes or no: --with-motif=$with_motif"
511 if test $with_athena != yes -a $with_athena != no ; then
512 echo "error: must be yes or no: --with-athena=$with_athena"
517 # Saying --without-motif is the same as saying --with-athena.
518 if test $with_motif_req = no ; then
523 # Saying --without-athena is the same as saying --with-motif.
524 if test $with_athena_req = no ; then
529 # Check for Motif and Athena headers.
532 AC_CHECK_X_HEADER(Xm/Xm.h,
534 AC_DEFINE(HAVE_MOTIF)
535 SAVER_LIBS="-lXm $SAVER_LIBS"])
539 AC_CHECK_X_HEADER(X11/Xaw/Dialog.h,
541 AC_DEFINE(HAVE_ATHENA)
542 SAVER_LIBS="-lXaw $SAVER_LIBS"])
546 # If they asked for both motif and athena, check motif then athena.
547 # If they asked for only motif, check motif then athena.
548 # If they asked for only athena, check athena then motif.
549 # If they asked for neither, check motif then athena.
551 if test $with_motif = yes; then
552 # asked for both, or for motif only
554 if test $have_motif = yes; then
561 elif test $with_athena = yes; then
562 # asked for athena only
564 if test $have_athena = yes; then
573 if test $have_motif = yes; then
582 # If we have Athena, check whether it's a version that includes
583 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
584 if test $have_athena = yes ; then
585 AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
586 ac_cv_have_XawViewportSetCoordinates,
587 [ac_cv_have_XawViewportSetCoordinates=no
588 AC_EGREP_X_HEADER(XawViewportSetCoordinates,
590 ac_cv_have_XawViewportSetCoordinates=yes)])
591 if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
592 AC_DEFINE(HAVE_XawViewportSetCoordinates)
597 # If we have Motif, check whether it's really LessTif.
599 if test $have_motif = yes ; then
600 AC_CACHE_CHECK([whether Motif is really LessTif],
602 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
603 [long vers = LesstifVersion;],
604 [ac_cv_have_lesstif=yes],
605 [ac_cv_have_lesstif=no])])
606 have_lesstif=$ac_cv_have_lesstif
610 # check for XPM header.
613 with_xpm_req=unspecified
617 --with-xpm Include support for XPM files in some demos,
618 if possible (this is the default).
619 --without-xpm Do not compile in support for XPM files.],
620 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
621 if test $with_xpm = yes; then
622 AC_CHECK_X_HEADER(X11/xpm.h,
626 elif test $with_xpm != no; then
627 echo "error: must be yes or no: --with-xpm=$with_xpm"
632 # check for the GL header
635 with_gl_req=unspecified
637 [ --with-gl Build those demos which depend on OpenGL,
638 if possible (this is the default).
639 --without-gl Do not build the OpenGL demos.],
640 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
642 if test $with_gl = yes; then
643 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
644 if test $have_gl = yes ; then
645 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
648 # If we have the headers, try and figure out which vendor it's from.
650 if test $have_gl = yes ; then
654 AC_EGREP_X_HEADER(Mesa, GL/glx.h, [have_mesa_gl=yes])
655 if test $have_mesa_gl = no ; then
658 AC_DEFINE(HAVE_MESA_GL)
659 GL_LIBS="-lMesaGL -lMesaGLU"
663 elif test $with_gl != no; then
664 echo "error: must be yes or no: --with-gl=$with_gl"
669 # check for SGI XReadDisplay server extension header.
672 with_readdisplay_req=unspecified
673 AC_ARG_WITH(readdisplay,
674 [ --with-readdisplay Include support for the XReadDisplay server
675 extension if possible (this is the default).
676 --without-readdisplay Do not compile in support for this extension.],
677 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
678 [with_readdisplay=yes])
679 if test $with_readdisplay = yes; then
680 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
681 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
682 elif test $with_readdisplay != no; then
683 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
689 # Try to find a program to generate random text.
691 # Zippy is funnier than the idiocy generally spat out by `fortune',
692 # so try to find that, by invoking Emacs and asking it where its
693 # libexec directory is ("yow" lives in there.)
695 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
696 # and if so, use them.
698 # If that doesn't work, look in /usr/games, and if it's there, use
703 [ --with-zippy=PROGRAM Some demos are able to run an external program and
704 display its text; this names the program to use by
705 default (though it can be overridden with X
706 resources.) If you don't specify this, the default
707 is to use \"yow\" from the Emacs distribution (if you
708 have it) or else to use \"fortune\".],
709 [with_zippy="$withval"])
711 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
715 if test -n "$with_zippy" ; then
716 ac_cv_zippy_program="$with_zippy"
718 elif test -n "$ac_cv_zippy_program"; then
719 AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
723 AC_CHECK_PROGS(emacs_exe, emacs)
724 AC_CHECK_PROGS(xemacs_exe, xemacs)
726 ac_cv_zippy_program=""
727 eargs='-batch -q -nw --eval'
729 if test -n "$emacs_exe" ; then
730 AC_MSG_CHECKING([for emacs yow])
732 # get emacs to tell us where the libexec directory is.
734 dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
735 2>/dev/null | tail -1`
736 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
738 # try running libexec/yow and see if it exits without error.
740 if test x"$dir" != x -a -x $dir/yow ; then
741 if $dir/yow >&- 2>&- ; then
742 ac_cv_zippy_program="$dir/yow"
743 AC_MSG_RESULT($ac_cv_zippy_program)
750 if test -z "$ac_cv_zippy_program" ; then
751 AC_MSG_CHECKING([for xemacs yow])
752 if test -n "$xemacs_exe" ; then
754 # get xemacs to tell us where the libexec directory is.
756 dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
757 2>/dev/null | tail -1`
758 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
760 # try running libexec/yow and see if it exits without error.
762 if test x"$dir" != x -a -x $dir/yow ; then
763 if $dir/yow >&- 2>&- ; then
764 ac_cv_zippy_program="$dir/yow"
765 AC_MSG_RESULT($ac_cv_zippy_program)
768 # in some xemacs installations, the pathname of the yow.lines file
769 # isn't hardcoded into the yow executable, and must be passed on
770 # the command line. See if it's in libexec/../etc/.
774 dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
777 yow="yow -f $dir_up/etc/yow.lines"
778 if $dir/$yow >&- 2>&- ; then
779 ac_cv_zippy_program="$dir/$yow"
780 AC_MSG_RESULT($ac_cv_zippy_program)
789 # if that didn't work, try for some other programs...
790 if test -z "$ac_cv_zippy_program" ; then
792 AC_CHECK_PROGS(fortune, [fortune zippy yow])
793 # if that didn't work, try for those programs in /usr/games...
794 if test -z "$fortune" ; then
795 AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
796 /usr/games:/usr/local/games)
801 if test -z "$ac_cv_zippy_program" ; then
802 ac_cv_zippy_program=fortune
805 AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
810 # Allow locking to be disabled at compile-time.
814 with_kerberos_req=unspecified
816 with_shadow_req=unspecified
819 AC_ARG_ENABLE(locking,[
822 --enable-locking Compile in support for locking the display
823 (this is the default.)
824 --disable-locking Do not allow locking at all.],
825 [enable_locking="$enableval"],[enable_locking=yes])
826 if test $enable_locking = yes; then
828 # Check for Kerberos.
830 AC_ARG_WITH(kerberos, [
831 --with-kerberos Include support for Kerberos authentication,
832 if possible (this is the default.)
833 --without-kerberos Do not compile in support for Kerberos.],
834 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
835 if test $with_kerberos = yes; then
836 AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
837 [AC_TRY_X_COMPILE([#include <krb.h>],,
838 [ac_cv_kerberos=yes],
839 [ac_cv_kerberos=no])])
840 if test $ac_cv_kerberos = yes ; then
842 AC_DEFINE(HAVE_KERBEROS)
843 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket"
845 elif test $with_kerberos != no; then
846 echo "error: must be yes or no: --with-kerberos=$with_kerberos"
850 # Next, check for the nine billion variants of shadow passwords...
854 [ --with-shadow Include support for shadow password authentication,
855 if possible (this is the default, if no Kerberos.)
856 --without-shadow Do not compile in support for shadow passwords.
858 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
859 if test $with_shadow = no; then
860 passwd_cruft_done=yes
861 elif test $with_shadow != yes; then
862 echo "error: must be yes or no: --with-shadow=$with_shadow"
867 # Sun's "adjunct" passwords.
869 if test $passwd_cruft_done = no ; then
870 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
871 [AC_TRY_X_COMPILE([#include <stdlib.h>
873 #include <sys/types.h>
874 #include <sys/label.h>
875 #include <sys/audit.h>
876 #include <pwdadj.h>],
877 [struct passwd_adjunct *p = getpwanam("nobody");
878 const char *pw = p->pwa_passwd;],
879 [ac_cv_sun_adjunct=yes],
880 [ac_cv_sun_adjunct=no])])
881 if test $ac_cv_sun_adjunct = yes; then
884 passwd_cruft_done=yes
885 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
889 # DEC and SCO so-called "enhanced" security.
891 if test $passwd_cruft_done = no ; then
892 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
893 [AC_TRY_X_COMPILE([#include <stdlib.h>
895 #include <sys/types.h>
897 #include <sys/security.h>
899 [struct pr_passwd *p;
901 set_auth_parameters(0, 0);
902 check_auth_parameters();
903 p = getprpwnam("nobody");
904 pw = p->ufld.fd_encrypt;],
905 [ac_cv_enhanced_passwd=yes],
906 [ac_cv_enhanced_passwd=no])])
907 if test $ac_cv_enhanced_passwd = yes; then
910 passwd_cruft_done=yes
911 AC_DEFINE(HAVE_ENHANCED_PASSWD)
913 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
914 # (I'm told it needs -lcurses too, but I don't understand why.)
915 AC_CHECK_LIB(prot, getprpwnam,
916 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
917 [# On DEC, getprpwnam() is in -lsecurity
918 AC_CHECK_LIB(security, getprpwnam,
919 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
924 # HP's entry in the "Not Invented Here" Sweepstakes.
926 if test $passwd_cruft_done = no ; then
927 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
928 [AC_TRY_X_COMPILE([#include <stdlib.h>
930 #include <sys/types.h>
932 #include <hpsecurity.h>
934 [struct s_passwd *p = getspwnam("nobody");
935 const char *pw = p->pw_passwd;],
936 [ac_cv_hpux_passwd=yes],
937 [ac_cv_hpux_passwd=no])])
938 if test $ac_cv_hpux_passwd = yes; then
941 passwd_cruft_done=yes
942 AC_DEFINE(HAVE_HPUX_PASSWD)
944 # on HPUX, bigcrypt is in -lsec
945 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
949 # Traditional (ha!) shadow passwords.
951 if test $passwd_cruft_done = no ; then
952 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
953 [AC_TRY_X_COMPILE([#include <stdlib.h>
955 #include <sys/types.h>
957 #include <shadow.h>],
958 [struct spwd *p = getspnam("nobody");
959 const char *pw = p->sp_pwdp;],
962 if test $ac_cv_shadow = yes; then
965 passwd_cruft_done=yes
966 AC_DEFINE(HAVE_SHADOW_PASSWD)
968 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
970 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
971 if test $have_getspnam = no ; then
972 AC_CHECK_LIB(gen, getspnam,
973 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
978 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
980 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
981 if test $have_crypt = no ; then
982 AC_CHECK_LIB(crypt, crypt,
983 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
987 # Most of the above shadow mechanisms will have set need_setuid to yes,
988 # if they were found. But, on some systems, we need setuid even when
989 # using plain old vanilla passwords.
991 if test $need_setuid = no ; then
993 *-hpux* | *-aix* | *-netbsd* )
999 elif test $enable_locking = no; then
1000 AC_DEFINE(NO_LOCKING)
1002 echo "error: must be yes or no: --enable-locking=$enable_locking"
1008 if test \! -z "$includedir" ; then
1009 INCLUDES="-I$includedir"
1012 if test \! -z "$libdir" ; then
1013 LDFLAGS="$LDFLAGS -L$libdir"
1017 ##### should have options to override the DEPEND crap, I guess...
1024 # Done testing things -- now substitute in some stuff for the Makefiles.
1026 if test $have_motif = yes; then
1027 AC_DEFINE(HAVE_MOTIF)
1028 DIALOG_SRCS='$(MOTIF_SRCS)'
1029 DIALOG_OBJS='$(MOTIF_OBJS)'
1030 elif test $have_athena = yes; then
1031 AC_DEFINE(HAVE_ATHENA)
1032 DIALOG_SRCS='$(ATHENA_SRCS)'
1033 DIALOG_OBJS='$(ATHENA_OBJS)'
1039 if test $have_kerberos = yes; then
1040 PASSWD_SRCS='$(KERBEROS_SRCS)'
1041 PASSWD_OBJS='$(KERBEROS_OBJS)'
1043 PASSWD_SRCS='$(PWENT_SRCS)'
1044 PASSWD_OBJS='$(PWENT_OBJS)'
1047 if test $enable_locking = yes; then
1048 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
1049 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
1055 if test $need_setuid = yes; then
1057 INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
1060 INSTALL_SETUID='$(INSTALL_PROGRAM)'
1064 if test $have_gl = yes; then
1065 GL_EXES='$(GL_EXES)'
1066 GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}' \'
1069 GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
1070 GL_KLUDGE_2='!'${tab}
1075 AC_SUBST(SAVER_LIBS)
1079 AC_SUBST(PASSWD_LIBS)
1080 AC_SUBST(INSTALL_SETUID)
1081 AC_SUBST(NEED_SETUID)
1083 AC_SUBST(DIALOG_SRCS)
1084 AC_SUBST(DIALOG_OBJS)
1085 AC_SUBST(PASSWD_SRCS)
1086 AC_SUBST(PASSWD_OBJS)
1092 AC_SUBST(GL_KLUDGE_1)
1093 AC_SUBST(GL_KLUDGE_2)
1095 AC_SUBST(APPDEFAULTS)
1098 AC_SUBST(DEPEND_FLAGS)
1099 AC_SUBST(DEPEND_DEFINES)
1101 # Print some warnings before emitting the Makefiles.
1104 warnsep=' #################################################################'
1106 if test $warning = no ; then
1107 echo '' ; echo "$warnsep" ; echo ''
1117 if test $with_sgi_req = yes -a $have_sgi = no ; then
1118 warn 'The SGI saver extension was requested, but was not found.'
1121 if test $with_mit_req = yes -a $have_mit = no ; then
1122 warn 'The MIT saver extension was requested, but was not found.'
1125 if test $with_xidle_req = yes -a $have_xidle = no ; then
1126 warn 'The XIdle extension was requested, but was not found.'
1129 if test $have_motif = no -a $have_athena = no ; then
1130 warn "Neither Motif nor Athena widgets seem to be available;"
1131 warn2 "one or the other is required."
1133 elif test $with_motif_req = yes -a $have_motif = no ; then
1134 warn "Use of Motif was requested, but it wasn't found;"
1135 warn2 "Athena will be used instead."
1137 elif test $with_athena_req = yes -a $have_athena = no ; then
1138 warn "Use of Athena was requested, but it wasn't found;"
1139 warn2 "Motif will be used instead."
1142 if test $have_motif = yes -a $have_lesstif = yes ; then
1143 warn "Motif is being used, but it appears to actually be LessTif."
1144 warn2 "XScreenSaver has been reported to have problems with some"
1145 warn2 "versions of LessTif (notably 0.79). You might want to use"
1146 warn2 "Athena instead."
1149 if test $with_xpm_req = yes -a $have_xpm = no ; then
1150 warn 'Use of XPM was requested, but it was not found.'
1153 if test $with_gl_req = yes -a $have_gl = no ; then
1154 warn 'Use of GL was requested, but it was not found.'
1157 if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
1158 warn 'Use of XReadDisplay was requested, but it was not found.'
1161 if test $with_kerberos_req = yes -a $have_kerberos = no ; then
1162 warn 'Use of Kerberos was requested, but it was not found.'
1165 if test $with_shadow_req = yes -a $have_shadow = no ; then
1166 warn 'Use of shadow passwords was requested, but they were not found.'
1169 if test $warning = yes; then
1170 echo '' ; echo "$warnsep" ; echo ''
1179 driver/XScreenSaver.ad)