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 # NOTE: for Digital, need to add -std1 to get ANSI, but I'm not sure
23 # yet what $host pattern we should be testing for...
26 AC_MSG_RESULT(no idea)
32 AC_MSG_CHECKING([whether the compiler works on ANSI C])
33 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
36 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
37 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
41 if test -n "$GCC"; then
42 AC_MSG_RESULT(Turning on gcc compiler warnings.)
43 CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
46 AC_MSG_RESULT(Turning on SGI compiler warnings.)
47 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
70 AC_MSG_CHECKING(how to call gettimeofday)
71 AC_CACHE_VAL(ac_cv_gettimeofday_args,
72 [AC_TRY_COMPILE([#include <stdlib.h>
73 #include <sys/time.h>],
74 [struct timeval tv; gettimeofday(&tv);],
75 [ac_gettimeofday_args=1],
76 [AC_TRY_COMPILE([#include <stdlib.h>
77 #include <sys/time.h>],
78 [struct timeval tv; struct timezone tzp;
79 gettimeofday(&tv, &tzp);],
80 [ac_gettimeofday_args=2],
81 [ac_gettimeofday_args=0])])
82 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
83 ac_gettimeofday_args=$ac_cv_gettimeofday_args
84 if test $ac_gettimeofday_args = 1 ; then
85 AC_DEFINE(HAVE_GETTIMEOFDAY)
86 AC_MSG_RESULT(one argument)
87 elif test $ac_gettimeofday_args = 2 ; then
88 AC_DEFINE(HAVE_GETTIMEOFDAY)
89 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
90 AC_MSG_RESULT(two arguments)
92 AC_MSG_RESULT(unknown)
96 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
97 AC_CHECK_FUNCS(sigaction)
99 AC_CHECK_HEADERS(unistd.h)
101 dnl /usr/local/src/ssh-1.2.17/putenv.c -- AC_REPLACE_FUNCS(putenv)
104 AC_ARG_ENABLE(subdir,[
105 Installation options:
107 --enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
108 instead of putting them in bindir itself. You can
109 specify the name of the subdirectory. For example,
110 --exec-prefix=/usr/local/bin --enable-subdir=demos
111 would put xscreensaver in /usr/local/bin/, and would
112 put the demos in /usr/local/bin/demos/. Note that if
113 you do this, you must make sure that the directory
114 is on your \$PATH before xscreensaver is started: the
115 directory name is not hardcoded into the program.
116 This merely sets the default installation location.
118 --disable-subdir Just put the demos in \`bindir' (this is the default.)
120 [enable_subdir="$enableval"],[enable_subdir=no])
121 if test x"$enable_subdir" = xno; then
123 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
124 echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
127 HACKDIR='$(bindir)/'$enable_subdir
133 # Try and find the app-defaults directory.
134 # It sucks that autoconf doesn't do this already...
136 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,
139 if mkdir conftestdir; then
141 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
142 cat > Imakefile <<'EOF'
144 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
146 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
147 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
148 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
154 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,
155 [ # Look for the directory under a standard set of common directories.
156 # Check X11 before X11Rn because it's often a symlink to the current release.
158 /usr/X11/lib/app-defaults \
159 /usr/X11R6/lib/app-defaults \
160 /usr/X11R6/lib/X11/app-defaults \
161 /usr/X11R5/lib/app-defaults \
162 /usr/X11R5/lib/X11/app-defaults \
163 /usr/X11R4/lib/app-defaults \
164 /usr/X11R4/lib/X11/app-defaults \
166 /usr/lib/X11/app-defaults \
167 /usr/lib/X11R6/app-defaults \
168 /usr/lib/X11R5/app-defaults \
169 /usr/lib/X11R4/app-defaults \
171 /usr/local/X11/lib/app-defaults \
172 /usr/local/X11R6/lib/app-defaults \
173 /usr/local/X11R5/lib/app-defaults \
174 /usr/local/X11R4/lib/app-defaults \
176 /usr/local/lib/X11/app-defaults \
177 /usr/local/lib/X11R6/app-defaults \
178 /usr/local/lib/X11R6/X11/app-defaults \
179 /usr/local/lib/X11R5/app-defaults \
180 /usr/local/lib/X11R5/X11/app-defaults \
181 /usr/local/lib/X11R4/app-defaults \
182 /usr/local/lib/X11R4/X11/app-defaults \
184 /usr/X386/lib/X11/app-defaults \
185 /usr/x386/lib/X11/app-defaults \
186 /usr/XFree86/lib/X11/app-defaults \
188 /usr/lib/X11/app-defaults \
189 /usr/local/lib/X11/app-defaults \
190 /usr/unsupported/lib/X11/app-defaults \
191 /usr/athena/lib/X11/app-defaults \
192 /usr/local/x11r5/lib/X11/app-defaults \
193 /usr/lpp/Xamples/lib/X11/app-defaults \
194 /lib/usr/lib/X11/app-defaults \
196 /usr/openwin/lib/app-defaults \
197 /usr/openwin/lib/X11/app-defaults \
198 /usr/openwin/share/lib/app-defaults \
199 /usr/openwin/share/lib/X11/app-defaults \
201 /X11R6/lib/app-defaults \
202 /X11R5/lib/app-defaults \
203 /X11R4/lib/app-defaults \
206 if test -d "$ac_dir"; then
207 ac_x_app_defaults=$ac_dir
214 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
216 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
217 [AC_PATH_X_APP_DEFAULTS_XMKMF
218 AC_PATH_X_APP_DEFAULTS_DIRECT
219 if test x"$ac_x_app_defaults" = x; then
220 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
222 # Record where we found app-defaults for the cache.
223 ac_cv_x_app_defaults="$ac_x_app_defaults"
225 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
227 AC_PATH_X_APP_DEFAULTS
229 APPDEFAULTS=$ac_x_app_defaults
232 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
234 AC_DEFUN(AC_CHECK_X_HEADER, [
235 ac_save_CPPFLAGS="$CPPFLAGS"
236 if test \! -z "$includedir" ; then
237 CPPFLAGS="$CPPFLAGS -I$includedir"
239 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
240 AC_CHECK_HEADER([$1], [$2])
241 CPPFLAGS="$ac_save_CPPFLAGS"])
243 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
245 AC_DEFUN(AC_EGREP_X_HEADER, [
246 ac_save_CPPFLAGS="$CPPFLAGS"
247 if test \! -z "$includedir" ; then
248 CPPFLAGS="$CPPFLAGS -I$includedir"
250 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
251 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
252 CPPFLAGS="$ac_save_CPPFLAGS"])
254 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
256 AC_DEFUN(AC_TRY_X_COMPILE, [
257 ac_save_CPPFLAGS="$CPPFLAGS"
258 if test \! -z "$includedir" ; then
259 CPPFLAGS="$CPPFLAGS -I$includedir"
261 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
262 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
263 CPPFLAGS="$ac_save_CPPFLAGS"])
266 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
267 # Use this sparingly; it probably doesn't work very well on X programs.
269 AC_DEFUN(AC_CHECK_X_LIB, [
270 ac_save_CPPFLAGS="$CPPFLAGS"
271 ac_save_LDFLAGS="$LDFLAGS"
272 if test \! -z "$includedir" ; then
273 CPPFLAGS="$CPPFLAGS -I$includedir"
275 if test \! -z "$includedir" ; then
276 CPPFLAGS="$CPPFLAGS -I$includedir"
278 if test \! -z "$libdir" ; then
279 LDFLAGS="$LDFLAGS -L$libdir"
281 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
282 if test \! -z "$x_libraries" ; then
283 LDFLAGS="$LDFLAGS -L$x_libraries"
285 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
286 CPPFLAGS="$ac_save_CPPFLAGS"
287 LDFLAGS="$ac_save_LDFLAGS"])
289 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
290 # (But not the -L directories!)
292 AC_DEFUN(AC_TRY_X_RUN, [
293 ac_save_CPPFLAGS="$CPPFLAGS"
294 if test \! -z "$includedir" ; then
295 CPPFLAGS="$CPPFLAGS -I$includedir"
297 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
298 AC_TRY_RUN([$1], [$2], [$3], [$4])
299 CPPFLAGS="$ac_save_CPPFLAGS"])
305 # check for the HP XHPDisableReset server extension headers.
307 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
308 [AC_DEFINE(HAVE_XHPDISABLERESET)
309 SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
312 # Check for the availability of the XPointer typedef, and define it otherwise.
314 AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
315 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
316 [XPointer foo = (XPointer) 0;],
317 [ac_cv_xpointer=yes],
318 [ac_cv_xpointer=no])])
319 if test $ac_cv_xpointer != yes; then
320 AC_DEFINE(XPointer,[char*])
326 # Thanks for not making xmkmf find this by default, you losers.
327 if test -d /usr/lib/Motif1.2 ; then
328 X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS"
329 X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS"
330 elif test -d /usr/lib/Motif1.1 ; then
331 X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS"
332 X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS"
335 # This too. You losers.
336 if test -d /usr/contrib/X11R6/include ; then
337 X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS"
338 X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS"
339 elif test -d /usr/X11R6/include ; then
340 X_CFLAGS="-I/usr/X11R6/include $X_CFLAGS"
341 X_LIBS="-L/usr/X11R6/lib $X_LIBS"
342 elif test -d /usr/contrib/X11R5/include ; then
343 X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS"
344 X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS"
345 elif test -d /usr/X11R5/include ; then
346 X_CFLAGS="-I/usr/X11R5/include $X_CFLAGS"
347 X_LIBS="-L/usr/X11R5/lib $X_LIBS"
352 # Same to you, pinheads. (Is this really the standard location now?
353 # What happened to the joke that this kind of thing went in /opt?)
354 # cthomp says "answer: CDE (Common Disorganized Environment)"
355 if test -f /usr/dt/include/Xm/Xm.h ; then
356 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
357 X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
359 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
360 AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
367 # Check for Xmu (some fucked up vendors don't ship it...)
370 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
371 if test $have_xmu = no ; then
372 XMU_SRCS='$(UTILS_SRC)/xmu.c'
373 XMU_OBJS='$(UTILS_BIN)/xmu.o'
377 SAVER_LIBS="-lXmu $SAVER_LIBS"
378 HACK_LIBS="-lXmu $HACK_LIBS"
383 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
384 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
386 if test $have_xmu = yes ; then
389 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
391 [ac_save_LDFLAGS="$LDFLAGS"
392 if test \! -z "$x_libraries" ; then
393 LDFLAGS="$LDFLAGS -L$x_libraries"
395 # Note: this trick never works! (Generally.)
396 # We're only getting away with using AC_TRY_LINK
397 # with X libraries because we know it's SunOS.
398 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
400 [ac_cv_sunos_xmu_bug=no],
401 [ac_cv_sunos_xmu_bug=yes])
402 LDFLAGS="$ac_save_LDFLAGS"])
403 if test $ac_cv_sunos_xmu_bug = yes ; then
404 AC_CACHE_CHECK([whether the compiler understands -static],
406 [ac_save_LDFLAGS="$LDFLAGS"
407 LDFLAGS="$LDFLAGS -static"
408 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
409 LDFLAGS="$ac_save_LDFLAGS"])
410 if test $ac_cv_ld_static = yes ; then
411 LDFLAGS="$LDFLAGS -static"
413 LDFLAGS="$LDFLAGS -Bstatic"
421 # Check for the SGI SCREEN_SAVER server extension header.
424 with_sgi_req=unspecified
425 AC_ARG_WITH(sgi-ext,[
428 --with-sgi-ext Include support for the SGI SCREEN_SAVER
429 server extension, if possible (this is the default).
430 --without-sgi-ext Do not compile in support for this extension.],
431 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
432 if test $with_sgi = yes; then
433 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
435 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
437 elif test $with_sgi != no; then
438 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
442 # Check for the MIT-SCREEN-SAVER server extension header,
443 # unless the SGI extension has already been found.
446 with_mit_req=unspecified
448 [ --with-mit-ext Include support for the MIT-SCREEN-SAVER
449 server extension, if possible (this is the default).
450 --without-mit-ext Do not compile in support for this extension.],
451 [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
452 if test $have_sgi != yes; then
453 if test $with_mit = yes; then
454 AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
456 # Now check to see if it's really in the library; XF86Free-3.3 ships
457 # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
459 if test $have_mit = yes; then
460 AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [], [have_mit=no], -lm)
462 if test $have_mit = no; then
463 # Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
464 # of in Xext. Thank you master, may I have another.
465 AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
466 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
467 [], -lX11 -lXext -lm)
470 if test $have_mit = no; then
471 # Double fuck! Looks like some versions of XFree86 (whichever version
472 # it is that comes with RedHat Linux 2.0 -- I can't find a version
473 # number) put this garbage in Xss instead of Xext. Thank you master,
474 # may I have another.
475 AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
476 [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
477 [], -lX11 -lXext -lm)
480 if test $have_mit = yes; then
481 AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
486 elif test $with_mit != no; then
487 echo "error: must be yes or no: --with-mit-ext=$with_mit"
493 # Check for the XIDLE server extension header.
496 with_xidle_req=unspecified
497 AC_ARG_WITH(xidle-ext,
498 [ --with-xidle-ext Include support for the XIDLE server extension,
499 if possible (this is the default).
500 --without-xidle-ext Do not compile in support for this extension.],
501 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
502 if test $with_xidle = yes; then
503 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
505 AC_DEFINE(HAVE_XIDLE_EXTENSION)])
506 elif test $with_xidle != no; then
507 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
512 # Check for the XSHM server extension header.
515 with_xshm_req=unspecified
516 AC_ARG_WITH(xshm-ext,
517 [ --with-xshm-ext Include support for the XSHM (Shared Memory) server
518 extension, if possible (this is the default).
519 --without-xshm-ext Do not compile in support for this extension.],
520 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
521 if test $with_xshm = yes; then
523 # first check for Xshm.h.
524 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
526 # if that succeeded, then check for sys/ipc.h.
527 if test $have_xshm = yes; then
529 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
532 # if that succeeded, then check for sys/shm.h.
533 if test $have_xshm = yes; then
535 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
538 # if that succeeded, then we've really got it.
539 if test $have_xshm = yes; then
540 AC_DEFINE(HAVE_XSHM_EXTENSION)
543 elif test $with_xshm != no; then
544 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
549 # Check for the SGI-VIDEO-CONTROL server extension header.
552 with_sgivc_req=unspecified
553 AC_ARG_WITH(sgivc-ext,
554 [ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL server
555 extension, if possible (this is the default).
556 --without-sgivc-ext Do not compile in support for this extension.],
557 [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
558 if test $with_sgivc = yes; then
560 # first check for XSGIvc.h
561 AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
563 # if that succeeded, then check for the -lXsgivc
564 if test $have_sgivc = yes; then
566 AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
567 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [],
571 # if that succeeded, then we've really got it.
572 if test $have_sgivc = yes; then
573 AC_DEFINE(HAVE_SGI_VC_EXTENSION)
576 elif test $with_sgivc != no; then
577 echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
588 # Check for Motif and Athena --with and --without arguments.
592 with_motif_req=unspecified
593 with_athena_req=unspecified
598 --with-motif Use the Motif toolkit for the user interface,
599 if possible (this is the default).
600 --without-motif Do not use Motif.],
601 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
604 [ --with-athena Use the Athena toolkit for the user interface, if
605 possible (this is the default if Motif isn't used.)
606 --without-athena Do not use Athena.],
607 [with_athena="$withval"; with_athena_req="$withval"],[with_athena=no])
609 if test $with_motif != yes -a $with_motif != no ; then
610 echo "error: must be yes or no: --with-motif=$with_motif"
614 if test $with_athena != yes -a $with_athena != no ; then
615 echo "error: must be yes or no: --with-athena=$with_athena"
620 # Saying --without-motif is the same as saying --with-athena.
621 if test $with_motif_req = no ; then
626 # Saying --without-athena is the same as saying --with-motif.
627 if test $with_athena_req = no ; then
632 # Check for Motif and Athena headers.
635 AC_CHECK_X_HEADER(Xm/Xm.h,
637 AC_DEFINE(HAVE_MOTIF)
638 SAVER_LIBS="-lXm $SAVER_LIBS"])
642 AC_CHECK_X_HEADER(X11/Xaw/Dialog.h,
644 AC_DEFINE(HAVE_ATHENA)
645 SAVER_LIBS="-lXaw $SAVER_LIBS"])
649 # If they asked for both motif and athena, check motif then athena.
650 # If they asked for only motif, check motif then athena.
651 # If they asked for only athena, check athena then motif.
652 # If they asked for neither, check motif then athena.
654 proselytize_motif=yes
655 if test $with_motif = yes; then
656 # asked for both, or for motif only
658 if test $have_motif = yes; then
665 elif test $with_athena = yes; then
666 # asked for athena only
668 if test $have_athena = yes; then
678 if test $have_motif = yes; then
686 if test $have_motif = yes; then
690 # If we have Athena, check whether it's a version that includes
691 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
692 if test $have_athena = yes ; then
693 AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
694 ac_cv_have_XawViewportSetCoordinates,
695 [ac_cv_have_XawViewportSetCoordinates=no
696 AC_EGREP_X_HEADER(XawViewportSetCoordinates,
698 ac_cv_have_XawViewportSetCoordinates=yes)])
699 if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
700 AC_DEFINE(HAVE_XawViewportSetCoordinates)
705 # If we have Motif, check whether it's really LessTif.
708 if test $have_motif = yes ; then
709 AC_CACHE_CHECK([whether Motif is really LessTif],
711 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
712 [long vers = LesstifVersion;],
713 [ac_cv_have_lesstif=yes],
714 [ac_cv_have_lesstif=no])])
715 have_lesstif=$ac_cv_have_lesstif
719 unset ac_cv_good_lesstif
722 if test $have_lesstif = yes ; then
723 # It must be at least "GNU Lesstif 0.82".
724 # #### If you change this, also sync the warning message lower down.
725 AC_CACHE_CHECK([whether LessTif is of a recent enough vintage],
727 [AC_TRY_X_RUN([#include <Xm/Xm.h>
728 int main() { exit(LesstifVersion < 82); }],
729 [ac_cv_good_lesstif=yes],
730 [ac_cv_good_lesstif=no],
731 # cross compiling? Make an ass out of umption.
732 [ac_cv_good_lesstif=yes])])
733 good_lesstif=$ac_cv_good_lesstif
737 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
738 # Extension". Why this extension isn't in -lXext with all the others,
742 if test $have_motif = yes ; then
744 AC_CHECK_X_LIB(Xp, XpQueryExtension,
745 [have_xp_ext=yes; SAVER_LIBS="$SAVER_LIBS -lXp"],
746 [], -lX11 -lXext -lm)
750 # check for XPM header.
753 with_xpm_req=unspecified
757 --with-xpm Include support for XPM files in some demos,
758 if possible (this is the default).
759 --without-xpm Do not compile in support for XPM files.],
760 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
761 if test $with_xpm = yes; then
762 AC_CHECK_X_HEADER(X11/xpm.h,
766 elif test $with_xpm != no; then
767 echo "error: must be yes or no: --with-xpm=$with_xpm"
772 # check for the GL header
775 with_gl_req=unspecified
777 [ --with-gl Build those demos which depend on OpenGL,
778 if possible (this is the default).
779 --without-gl Do not build the OpenGL demos.],
780 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
782 if test $with_gl = yes; then
783 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
784 if test $have_gl = yes ; then
785 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
788 # If we have the headers, try and figure out which vendor it's from.
790 if test $have_gl = yes ; then
794 AC_EGREP_X_HEADER(Mesa, GL/glx.h, [have_mesa_gl=yes])
795 if test $have_mesa_gl = no ; then
798 AC_DEFINE(HAVE_MESA_GL)
799 GL_LIBS="-lMesaGL -lMesaGLU"
803 elif test $with_gl != no; then
804 echo "error: must be yes or no: --with-gl=$with_gl"
809 # check for SGI XReadDisplay server extension header.
812 with_readdisplay_req=unspecified
813 AC_ARG_WITH(readdisplay,
814 [ --with-readdisplay Include support for the XReadDisplay server
815 extension if possible (this is the default).
816 --without-readdisplay Do not compile in support for this extension.],
817 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
818 [with_readdisplay=yes])
819 if test $with_readdisplay = yes; then
820 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
821 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
822 elif test $with_readdisplay != no; then
823 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
828 # check for SGI's Iris Video Library header.
831 with_sgivideo_req=unspecified
832 AC_ARG_WITH(sgivideo,
833 [ --with-sgivideo Include support for SGI's Iris Video Library
834 if possible (this is the default).
835 --without-sgivideo Do not compile in support for this library.],
836 [with_sgivideo="$withval"; with_sgivideo_req="$withval"],
838 if test $with_sgivideo = yes; then
839 AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes)
840 if test $have_sgivideo = yes; then
842 AC_CHECK_LIB(vl, vlOpenVideo, have_sgivideo=yes)
843 if test $have_sgivideo = yes; then
844 SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
845 SGI_VIDEO_LIBS="-lvl"
846 AC_DEFINE(HAVE_SGI_VIDEO)
849 elif test $with_sgivideo != no; then
850 echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
856 # Try to find a program to generate random text.
858 # Zippy is funnier than the idiocy generally spat out by `fortune',
859 # so try to find that, by invoking Emacs and asking it where its
860 # libexec directory is ("yow" lives in there.)
862 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
863 # and if so, use them.
865 # If that doesn't work, look in /usr/games, and if it's there, use
870 [ --with-zippy=PROGRAM Some demos are able to run an external program and
871 display its text; this names the program to use by
872 default (though it can be overridden with X
873 resources.) If you don't specify this, the default
874 is to use \"yow\" from the Emacs distribution (if you
875 have it) or else to use \"fortune\".],
876 [ with_zippy_req="$withval"; with_zippy="$withval" ],
877 [ with_zippy_req="$withval"; with_zippy="$withval" ])
879 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
884 if test -n "$with_zippy_req" ; then
885 ac_cv_zippy_program=""
886 case "$with_zippy_req" in
888 AC_MSG_CHECKING([for $with_zippy_req])
889 if test -x "$with_zippy_req" ; then
898 unset ac_cv_path_zip2
899 AC_PATH_PROG(zip2, $with_zippy_req, [])
900 if test "$zip2" = ""; then
905 ac_cv_zippy_program="$with_zippy"
907 elif test -n "$ac_cv_zippy_program"; then
908 AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
911 if test ! -n "$ac_cv_zippy_program"; then
913 AC_CHECK_PROGS(emacs_exe, emacs)
914 AC_CHECK_PROGS(xemacs_exe, xemacs)
916 ac_cv_zippy_program=""
917 eargs='-batch -q -nw --eval'
919 if test -n "$emacs_exe" ; then
920 AC_MSG_CHECKING([for emacs yow])
922 # get emacs to tell us where the libexec directory is.
924 dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
925 2>/dev/null | tail -1`
926 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
928 # try running libexec/yow and see if it exits without error.
930 if test x"$dir" != x -a -x $dir/yow ; then
931 if $dir/yow >&- 2>&- ; then
932 ac_cv_zippy_program="$dir/yow"
933 AC_MSG_RESULT($ac_cv_zippy_program)
940 if test -z "$ac_cv_zippy_program" ; then
941 AC_MSG_CHECKING([for xemacs yow])
942 if test -n "$xemacs_exe" ; then
944 # get xemacs to tell us where the libexec directory is.
946 dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
947 2>/dev/null | tail -1`
948 dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
950 # try running libexec/yow and see if it exits without error.
952 if test x"$dir" != x -a -x $dir/yow ; then
953 if $dir/yow >&- 2>&- ; then
954 ac_cv_zippy_program="$dir/yow"
955 AC_MSG_RESULT($ac_cv_zippy_program)
958 # in some xemacs installations, the pathname of the yow.lines file
959 # isn't hardcoded into the yow executable, and must be passed on
960 # the command line. See if it's in libexec/../etc/.
964 dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
967 yow="yow -f $dir_up/etc/yow.lines"
968 if $dir/$yow >&- 2>&- ; then
969 ac_cv_zippy_program="$dir/$yow"
970 AC_MSG_RESULT($ac_cv_zippy_program)
979 # if that didn't work, try for some other programs...
980 if test -z "$ac_cv_zippy_program" ; then
982 AC_CHECK_PROGS(fortune, [fortune zippy yow])
983 # if that didn't work, try for those programs in /usr/games...
984 if test -z "$fortune" ; then
985 AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
986 /usr/games:/usr/local/games)
991 if test -z "$ac_cv_zippy_program" ; then
992 ac_cv_zippy_program=fortune
995 AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
1000 # Allow locking to be disabled at compile-time.
1004 with_kerberos_req=unspecified
1006 with_shadow_req=unspecified
1009 AC_ARG_ENABLE(locking,[
1012 --enable-locking Compile in support for locking the display
1013 (this is the default.)
1014 --disable-locking Do not allow locking at all.],
1015 [enable_locking="$enableval"],[enable_locking=yes])
1016 if test $enable_locking = yes; then
1018 # Check for Kerberos.
1020 AC_ARG_WITH(kerberos, [
1021 --with-kerberos Include support for Kerberos authentication,
1022 if possible (this is the default.)
1023 --without-kerberos Do not compile in support for Kerberos.],
1024 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
1025 if test $with_kerberos = yes; then
1026 AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
1027 [AC_TRY_X_COMPILE([#include <krb.h>],,
1028 [ac_cv_kerberos=yes],
1029 [ac_cv_kerberos=no])])
1030 if test $ac_cv_kerberos = yes ; then
1032 AC_DEFINE(HAVE_KERBEROS)
1033 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket"
1035 elif test $with_kerberos != no; then
1036 echo "error: must be yes or no: --with-kerberos=$with_kerberos"
1040 # Next, check for the nine billion variants of shadow passwords...
1042 passwd_cruft_done=no
1044 [ --with-shadow Include support for shadow password authentication,
1045 if possible (this is the default, if no Kerberos.)
1046 --without-shadow Do not compile in support for shadow passwords.
1048 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
1049 if test $with_shadow = no; then
1050 passwd_cruft_done=yes
1051 elif test $with_shadow != yes; then
1052 echo "error: must be yes or no: --with-shadow=$with_shadow"
1057 # Sun's "adjunct" passwords.
1059 if test $passwd_cruft_done = no ; then
1060 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
1061 [AC_TRY_X_COMPILE([#include <stdlib.h>
1063 #include <sys/types.h>
1064 #include <sys/label.h>
1065 #include <sys/audit.h>
1066 #include <pwdadj.h>],
1067 [struct passwd_adjunct *p = getpwanam("nobody");
1068 const char *pw = p->pwa_passwd;],
1069 [ac_cv_sun_adjunct=yes],
1070 [ac_cv_sun_adjunct=no])])
1071 if test $ac_cv_sun_adjunct = yes; then
1074 passwd_cruft_done=yes
1075 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
1079 # DEC and SCO so-called "enhanced" security.
1081 if test $passwd_cruft_done = no ; then
1082 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
1083 [AC_TRY_X_COMPILE([#include <stdlib.h>
1085 #include <sys/types.h>
1087 #include <sys/security.h>
1089 [struct pr_passwd *p;
1091 set_auth_parameters(0, 0);
1092 check_auth_parameters();
1093 p = getprpwnam("nobody");
1094 pw = p->ufld.fd_encrypt;],
1095 [ac_cv_enhanced_passwd=yes],
1096 [ac_cv_enhanced_passwd=no])])
1097 if test $ac_cv_enhanced_passwd = yes; then
1100 passwd_cruft_done=yes
1101 AC_DEFINE(HAVE_ENHANCED_PASSWD)
1103 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
1104 # (I'm told it needs -lcurses too, but I don't understand why.)
1105 AC_CHECK_LIB(prot, getprpwnam,
1106 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
1107 [# On DEC, getprpwnam() is in -lsecurity
1108 AC_CHECK_LIB(security, getprpwnam,
1109 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
1114 # HP's entry in the "Not Invented Here" Sweepstakes.
1116 if test $passwd_cruft_done = no ; then
1117 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
1118 [AC_TRY_X_COMPILE([#include <stdlib.h>
1120 #include <sys/types.h>
1122 #include <hpsecurity.h>
1124 [struct s_passwd *p = getspwnam("nobody");
1125 const char *pw = p->pw_passwd;],
1126 [ac_cv_hpux_passwd=yes],
1127 [ac_cv_hpux_passwd=no])])
1128 if test $ac_cv_hpux_passwd = yes; then
1131 passwd_cruft_done=yes
1132 AC_DEFINE(HAVE_HPUX_PASSWD)
1134 # on HPUX, bigcrypt is in -lsec
1135 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
1139 # Traditional (ha!) shadow passwords.
1141 if test $passwd_cruft_done = no ; then
1142 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
1143 [AC_TRY_X_COMPILE([#include <stdlib.h>
1145 #include <sys/types.h>
1147 #include <shadow.h>],
1148 [struct spwd *p = getspnam("nobody");
1149 const char *pw = p->sp_pwdp;],
1151 [ac_cv_shadow=no])])
1152 if test $ac_cv_shadow = yes; then
1155 passwd_cruft_done=yes
1156 AC_DEFINE(HAVE_SHADOW_PASSWD)
1158 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
1160 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
1161 if test $have_getspnam = no ; then
1162 AC_CHECK_LIB(gen, getspnam,
1163 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
1168 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
1170 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
1171 if test $have_crypt = no ; then
1172 AC_CHECK_LIB(crypt, crypt,
1173 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
1177 # Most of the above shadow mechanisms will have set need_setuid to yes,
1178 # if they were found. But, on some systems, we need setuid even when
1179 # using plain old vanilla passwords.
1181 if test $need_setuid = no ; then
1183 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
1189 elif test $enable_locking = no; then
1190 AC_DEFINE(NO_LOCKING)
1192 echo "error: must be yes or no: --enable-locking=$enable_locking"
1198 if test \! -z "$includedir" ; then
1199 INCLUDES="-I$includedir"
1202 if test \! -z "$libdir" ; then
1203 LDFLAGS="$LDFLAGS -L$libdir"
1207 ##### should have options to override the DEPEND crap, I guess...
1214 # Done testing things -- now substitute in some stuff for the Makefiles.
1216 if test $have_motif = yes; then
1217 AC_DEFINE(HAVE_MOTIF)
1218 DIALOG_SRCS='$(MOTIF_SRCS)'
1219 DIALOG_OBJS='$(MOTIF_OBJS)'
1220 elif test $have_athena = yes; then
1221 AC_DEFINE(HAVE_ATHENA)
1222 DIALOG_SRCS='$(ATHENA_SRCS)'
1223 DIALOG_OBJS='$(ATHENA_OBJS)'
1229 if test $have_kerberos = yes; then
1230 PASSWD_SRCS='$(KERBEROS_SRCS)'
1231 PASSWD_OBJS='$(KERBEROS_OBJS)'
1233 PASSWD_SRCS='$(PWENT_SRCS)'
1234 PASSWD_OBJS='$(PWENT_OBJS)'
1237 if test $enable_locking = yes; then
1238 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
1239 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
1245 if test $need_setuid = yes; then
1247 INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
1250 INSTALL_SETUID='$(INSTALL_PROGRAM)'
1254 if test $have_gl = yes; then
1255 GL_EXES='$(GL_EXES)'
1256 GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}' \'
1259 GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
1260 GL_KLUDGE_2='!'${tab}
1265 AC_SUBST(SAVER_LIBS)
1269 AC_SUBST(PASSWD_LIBS)
1270 AC_SUBST(INSTALL_SETUID)
1271 AC_SUBST(NEED_SETUID)
1272 AC_SUBST(SGI_VIDEO_OBJS)
1273 AC_SUBST(SGI_VIDEO_LIBS)
1275 AC_SUBST(DIALOG_SRCS)
1276 AC_SUBST(DIALOG_OBJS)
1277 AC_SUBST(PASSWD_SRCS)
1278 AC_SUBST(PASSWD_OBJS)
1284 AC_SUBST(GL_KLUDGE_1)
1285 AC_SUBST(GL_KLUDGE_2)
1287 AC_SUBST(APPDEFAULTS)
1290 AC_SUBST(DEPEND_FLAGS)
1291 AC_SUBST(DEPEND_DEFINES)
1293 # Print some warnings before emitting the Makefiles.
1296 warnsep=' #################################################################'
1298 if test $warning = no ; then
1299 echo '' ; echo "$warnsep" ; echo ''
1306 if test $warning = long ; then echo '' ; fi
1315 if test $was != no ; then echo '' ; fi
1324 if test $with_sgi_req = yes -a $have_sgi = no ; then
1325 warn 'The SGI saver extension was requested, but was not found.'
1328 if test $with_mit_req = yes -a $have_mit = no ; then
1329 warn 'The MIT saver extension was requested, but was not found.'
1332 if test $with_xidle_req = yes -a $have_xidle = no ; then
1333 warn 'The XIdle extension was requested, but was not found.'
1336 if test $with_xshm_req = yes -a $have_xshm = no ; then
1337 warn 'The XSHM extension was requested, but was not found.'
1340 if test $with_sgivc_req = yes -a $have_sgivc = no ; then
1341 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
1344 if test $have_motif = no -a $have_athena = no ; then
1345 warnL "Neither Motif nor Athena widgets seem to be available;"
1346 warn2 "one or the other is required."
1347 proselytize_motif=no
1349 elif test $with_motif_req = yes -a $have_motif = no ; then
1350 warnL "Use of Motif was requested, but it wasn't found;"
1351 warn2 "Athena will be used instead."
1353 elif test $with_athena_req = yes -a $have_athena = no ; then
1354 warnL "Use of Athena was requested, but it wasn't found;"
1355 warn2 "Motif will be used instead."
1358 if test $have_motif = yes -a $have_lesstif = yes ; then
1359 if test $good_lesstif != yes ; then
1360 warnL "Motif is being used, but it appears to actually be"
1361 warn2 "LessTif, and the version number is less than 0.82!"
1362 warn2 "Such old versions of LessTif are too buggy to use"
1363 warn2 "with XScreenSaver; it is strongly recommended that"
1364 warn2 "you upgrade! See <http://www.lesstif.org/>."
1368 if test $proselytize_motif = yes ; then
1369 warnL "Athena widgets are being used instead of Motif."
1370 warn2 "XScreenSaver looks much better with Motif, and has"
1371 warn2 "a few extra features as well. Wouldn't you rather"
1372 warn2 "be using Motif? It is shipped by every commercial"
1373 warn2 "Unix vendor; and there is a free implementation"
1374 warn2 "available as well: see <http://www.lesstif.org/>."
1377 if test $with_xpm_req = yes -a $have_xpm = no ; then
1378 warn 'Use of XPM was requested, but it was not found.'
1381 if test $with_gl_req = yes -a $have_gl = no ; then
1382 warn 'Use of GL was requested, but it was not found.'
1385 if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
1386 warn 'Use of XReadDisplay was requested, but it was not found.'
1389 if test $with_sgivideo_req = yes -a $have_sgivideo = no ; then
1390 warn 'Use of the Iris Video Library was requested, but it was not found.'
1393 if test $with_kerberos_req = yes -a $have_kerberos = no ; then
1394 warn 'Use of Kerberos was requested, but it was not found.'
1397 if test $with_shadow_req = yes -a $have_shadow = no ; then
1398 warn 'Use of shadow passwords was requested, but they were not found.'
1401 if test -n "$with_zippy_req"; then
1402 if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
1403 warnL "$with_zippy_req was requested as the Zippy program,"
1404 warn2 "but was not found. The default will be used instead."
1408 if test $warning != no; then
1409 echo '' ; echo "$warnsep" ; echo ''
1418 driver/XScreenSaver.ad)