1 # configure.in --- xscreensaver, Copyright (c) 1997-2005 Jamie Zawinski.
5 AC_INIT(driver/subprocs.c)
6 AC_CONFIG_HEADER(config.h)
8 echo "current directory: `pwd`"
9 echo "command line was: $0 $@"
11 ###############################################################################
15 ###############################################################################
18 /* config.h.in --- xscreensaver, Copyright (c) 1998-2000 Jamie Zawinski.
20 * The best way to set these parameters is by running the included `configure'
21 * script. That examines your system, and generates `config.h' from
24 * If something goes very wrong, you can edit `config.h' directly, but beware
25 * that your changes will be lost if you ever run `configure' again.
29 AH_TEMPLATE([HAVE_READ_DISPLAY_EXTENSION],
30 [Define this if you have the XReadDisplay extension (I think
31 this is an SGI-only thing; it's in
32 <X11/extensions/readdisplay.h>.) A few of the screenhacks will
33 take advantage of this if it's available.])
35 AH_TEMPLATE([HAVE_XHPDISABLERESET],
36 [Define this if you have the XHPDisableReset function (an HP only
37 thing which allows the Ctrl-Sh-Reset key sequence to be
38 temporarily disabled.)])
40 AH_TEMPLATE([HAVE_XIDLE_EXTENSION],
41 [Define this if you have the XIDLE extension installed. If you
42 have the XIDLE extension, this is recommended. (You have this
43 extension if the file /usr/include/X11/extensions/xidle.h
44 exists.) Turning on this flag lets XScreenSaver work better with
45 servers which support this extension; but it will still work
46 with servers which do not suport it, so it's a good idea to
47 compile in support for it if you can.])
49 AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION],
50 [Define this if you have the MIT-SCREEN-SAVER extension
51 installed. See the caveats about this extension, above.
52 (It's available if /usr/include/X11/extensions/scrnsaver.h
55 AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION],
56 [Define this if you have the SGI SCREEN_SAVER extension. This is
57 standard on Irix systems, and not available elsewhere.])
59 AH_TEMPLATE([HAVE_SGI_VC_EXTENSION],
60 [Define this if you have the SGI-VIDEO-CONTROL extension. This
61 is standard on Irix systems, and not available elsewhere.])
63 AH_TEMPLATE([HAVE_DPMS_EXTENSION],
64 [Define this if you have the XDPMS extension. This is standard
65 on sufficiently-recent XFree86 systems, and possibly elsewhere.
66 (It's available if the file /usr/include/X11/extensions/dpms.h
69 AH_TEMPLATE([HAVE_XF86VMODE],
70 [Define this if you have the functions XF86VidModeGetModeLine()
71 and XF86VidModeGetViewPort(), in support of virtual desktops
72 where the X server's root window is bigger than the actual
73 screen. This is an XFree86 thing, and probably doesn't exist
74 elsewhere. (It's available if the file
75 /usr/include/X11/extensions/xf86vmode.h exists.)])
77 AH_TEMPLATE([HAVE_XF86VMODE_GAMMA],
78 [Define this if you have the functions XF86VidModeGetGamma() and
79 XF86VidModeSetGamma(), which allow clients to change the gamma
80 response of the monitor. This is an XFree86 4.0.x thing, and
81 probably doesn't exist elsewhere. (It's available if the file
82 /usr/include/X11/extensions/xf86vmode.h exists and has stuff about
85 AH_TEMPLATE([HAVE_XF86VMODE_GAMMA_RAMP],
86 [Define this if you have the functions XF86VidModeGetGammaRamp()
87 and XF86VidModeSetGammaRamp(), which provide finer-grained
88 control than XF86VidMode[GS]etGamma(). These appeared in
91 AH_TEMPLATE([HAVE_XINERAMA],
92 [Define this if you have the Xinerama extension. This is
93 standard on sufficiently-recent XFree86 systems, and possibly
94 elsewhere. (It's available if the file
95 /usr/include/X11/extensions/Xinerama.h exists.)])
97 AH_TEMPLATE([HAVE_XF86MISCSETGRABKEYSSTATE],
98 [Define this if you have the XF86MiscSetGrabKeysState function
99 (which allows the Ctrl-Alt-KP_star and Ctrl-Alt-KP_slash key
100 sequences to be temporarily disabled. Sadly, it doesn't affect
101 Ctrl-Alt-BS or Ctrl-Alt-F1.)])
103 AH_TEMPLATE([HAVE_RANDR],
104 [Define this if you have the Resize and Rotate extension.
105 This is standard on sufficiently-recent XFree86 systems, and
106 possibly elsewhere. (It's available if the file
107 /usr/include/X11/extensions/Xrandr.h exists.)])
109 AH_TEMPLATE([HAVE_RANDR_12],
110 [Define this if the RANDR library is version 1.2 or newer.])
112 AH_TEMPLATE([HAVE_PROC_INTERRUPTS],
113 [Define this if you have a Linux-like /proc/interrupts file which
114 can be examined to determine when keyboard activity has
117 AH_TEMPLATE([HAVE_MOTIF],[Define this if you have Motif.])
119 AH_TEMPLATE([HAVE_XMCOMBOBOX],
120 [Define this if you have the XmComboBox Motif widget (Motif 2.0.)])
122 AH_TEMPLATE([HAVE_GTK],[Define this if you have Gtk (any version.)])
123 AH_TEMPLATE([HAVE_GTK2],[Define this if you have Gtk 2.x.])
125 AH_TEMPLATE([HAVE_CRAPPLET],
126 [Define this if you have Gnome and want to build support for the
127 xscreensaver control panel in the Gnome Control Center
128 (gnomecc). (This is needed only with Gtk 1.x.)])
130 AH_TEMPLATE([HAVE_CRAPPLET_IMMEDIATE],
131 [Define this if HAVE_CRAPPLET is defined, and the function
132 capplet_widget_changes_are_immediate() is available.])
134 AH_TEMPLATE([HAVE_XML],[Define this if you have the XML library.])
136 AH_TEMPLATE([HAVE_OLD_XML_HEADERS],
137 [Define this if you have the XML library headers in their old,
138 non-namespaced location (you lack the gnome-xml/libxml symlink)])
140 AH_TEMPLATE([HAVE_XPM],
141 [Define this if you have the XPM library installed. Some of the
142 demos can make use of this if it is available.])
144 AH_TEMPLATE([HAVE_GDK_PIXBUF],
145 [Define this if you have the GDK_Pixbuf library installed. Some
146 of the demos can make use of this if it is available.])
148 AH_TEMPLATE([HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION],
149 [Define this if you have the gdk_pixbuf_apply_embedded_orientation
150 function (gdk-pixbuf 2.12).])
152 AH_TEMPLATE([HAVE_JPEGLIB],
153 [Define this if you have the Independent JPEG Group's JPEG
154 library installed. Some of the demos can make use of this if it
157 AH_TEMPLATE([HAVE_XMU],
158 [Define this if you have the Xmu library. This is standard part
159 of X, and if your vendor doesn't ship it, you should report that
162 AH_TEMPLATE([HAVE_GL],
163 [Define this if you have OpenGL. Some of the demos require it,
164 so if you don't have it, then those particular demos won't be
165 built. (This won't affect the screen saver as a whole.)])
167 AH_TEMPLATE([HAVE_MESA_GL],
168 [Define this if you have OpenGL, but it's the MesaGL variant.
169 (The libraries have different names.) (HAVE_GL should be defined
172 AH_TEMPLATE([HAVE_GLBINDTEXTURE],
173 [Define this if your version of OpenGL has the glBindTexture()
174 routine. This is the case for OpenGL 1.1, but not for OpenGL
177 AH_TEMPLATE([HAVE_GLE],
178 [Define this if you have the -lgle and -lmatrix libraries (GL
181 AH_TEMPLATE([HAVE_GLE3],[Define this if you have the -lgle from GLE version 3])
183 AH_TEMPLATE([HAVE_XSHM_EXTENSION],
184 [Define this if you have the X Shared Memory Extension.])
186 AH_TEMPLATE([HAVE_DOUBLE_BUFFER_EXTENSION],
187 [Define this if you have the X Double Buffer Extension.])
189 AH_TEMPLATE([FORTUNE_PROGRAM],
190 [Some screenhacks like to run an external program to generate
191 random pieces of text; set this to the one you like. Note that
192 this is just the default; X resources can be used to override
195 AH_TEMPLATE([PASSWD_HELPER_PROGRAM],
196 [Set the name of the password helper program, if any])
198 AH_TEMPLATE([NO_LOCKING],
199 [Define this to remove the option of locking the screen at all.])
201 AH_TEMPLATE([ALLOW_ROOT_PASSWD],
202 [Define this to allow the root password to unlock the screen.])
204 AH_TEMPLATE([HAVE_KERBEROS],
205 [Define this if you want to use Kerberos authentication to
206 lock/unlock the screen instead of your local password. This
207 currently uses Kerberos V4, but a V5 server with V4
208 compatibility will work. WARNING: DO NOT USE AFS string-to-key
209 passwords with this option. This option currently *only* works
210 with standard Kerberos des_string_to_key. If your password is
211 an AFS password and not a kerberos password, it will not
212 authenticate properly. See the comments in driver/kpasswd.c for
213 more information if you need it.])
215 AH_TEMPLATE([HAVE_KERBEROS5],
216 [Define this if you have Kerberos 5, meaning we need to use the
217 Kerberos 4 compatibility layer.])
219 AH_TEMPLATE([HAVE_PAM],
220 [Define this if you want to use PAM (Pluggable Authentication
221 Modules) to lock/unlock the screen, instead of standard
222 /etc/passwd authentication.])
224 AH_TEMPLATE([PAM_SERVICE_NAME],
225 [If PAM is being used, this is the name of the PAM service that
226 xscreensaver will authenticate as. The default is
227 "xscreensaver", which means that the PAM library will look for
228 an "xscreensaver" line in /etc/pam.conf, or (on recent Linux
229 systems) will look for a file called /etc/pam.d/xscreensaver.
230 Some systems might already have a PAM installation that is
231 configured for xlock, so setting this to "xlock" would also work
234 AH_TEMPLATE([HAVE_PAM_FAIL_DELAY],
235 [Define this if you have pam_fail_delay function.
236 see driver/passwd-pam.c.])
238 AH_TEMPLATE([PAM_STRERROR_TWO_ARGS],
239 [Define if you have PAM and pam_strerror() requires two
242 AH_TEMPLATE([HAVE_SIGTIMEDWAIT],
243 [Define to 1 if you have the `sigtimedwait' function.])
245 AH_TEMPLATE([HAVE_SHADOW_PASSWD],
246 [Define this if your system uses 'shadow' passwords, that is, the
247 passwords live in /etc/shadow instead of /etc/passwd, and one
248 reads them with getspnam() instead of getpwnam(). (Note that
249 SCO systems do some random other thing; others might as well.
250 See the ifdefs in driver/passwd-pwent.c if you're having trouble
251 related to reading passwords.)])
253 AH_TEMPLATE([HAVE_ENHANCED_PASSWD],
254 [Define this if your system is Digital or SCO Unix with so-called
255 ``Enhanced Security'', that is, the passwords live in
256 /tcb/files/auth/<x>/<xyz> instead of in /etc/passwd, and one
257 reads them with getprpwnam() instead of getpwnam().])
259 AH_TEMPLATE([HAVE_ADJUNCT_PASSWD],
260 [Define this if your system is Solaris with ``adjunct'' passwords
261 (this is the version where one gets at the passwords with
262 getpwanam() instead of getpwnam().) I haven't tested this one,
263 let me know if it works.])
265 AH_TEMPLATE([HAVE_HPUX_PASSWD],
266 [Define this if you are running HPUX with so-called ``Secure
267 Passwords'' (if you have /usr/include/hpsecurity.h, you probably
268 have this.) I haven't tested this one, let me know if it works.])
270 AH_TEMPLATE([HAVE_SYSLOG],
271 [Define this if you the openlog(), syslog(), and closelog()
272 functions. This is used for logging failed login attempts.])
274 AH_TEMPLATE([HAVE_ICMP],
275 [Define this if you do pings with a `struct icmp' and an
278 AH_TEMPLATE([HAVE_ICMPHDR],
279 [Define this if you do pings with a `struct icmphdr' and an
282 AH_TEMPLATE([HAVE_FORKPTY],
283 [Define this if you have the 'forkpty' function:
284 This allows 'phosphor' and 'apple2' to run curses-based
285 programs, or be used as terminal windows.])
287 AH_TEMPLATE([HAVE_GETTIMEOFDAY],
288 [Define this if you have the gettimeofday function.])
290 AH_TEMPLATE([GETTIMEOFDAY_TWO_ARGS],
291 [Define this if gettimeofday() takes two arguments.])
293 AH_TEMPLATE([XPointer],
294 [Define this to void* if you're using X11R4 or earlier.])
296 # After checking to see that --srcdir is correct (which AC_INIT does)
297 # check for some random other files that come later in the tar file,
298 # to make sure everything is here.
300 for d in driver utils hacks hacks/glx ; do
301 f=$srcdir/$d/Makefile.in
302 if test \! -r $f ; then
304 echo "ERROR: The package is incomplete: $f does not exist."
305 echo " This probably means that your download was truncated."
311 ###############################################################################
313 # Function to figure out how to run the compiler.
315 ###############################################################################
317 AC_DEFUN(AC_PROG_CC_ANSI,
320 if test -z "$GCC"; then
322 AC_MSG_CHECKING(how to request ANSI compilation)
325 AC_MSG_RESULT(HPUX: adding -Ae)
329 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
330 CC="$CC -qlanglvl=ansi -qhalt=e"
333 AC_MSG_RESULT(DEC: adding -std1 -ieee)
337 AC_MSG_RESULT(no idea)
344 AC_MSG_RESULT(Solaris: adding -D__EXTENSIONS__)
345 CC="$CC -D__EXTENSIONS__"
352 AC_MSG_CHECKING([whether the compiler works on ANSI C])
353 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
356 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
357 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
359 if test -n "$GCC"; then
360 AC_MSG_RESULT(Turning on gcc compiler warnings.)
361 CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes"
363 # As of gcc 3.4, we have "-Wdeclaration-after-statement"
364 # and so perhaps now we can do without -pedantic?
367 *-irix5* |*-irix6.[0-3]* )
368 AC_MSG_RESULT(Turning on SGI compiler warnings.)
369 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
372 # if test -z "$GCC"; then
373 # AC_MSG_RESULT(Turning on DEC C compiler warnings.)
374 # CC="$CC -migrate -w0 -verbose -warnprotos"
382 ###############################################################################
384 # Check for availability of various gcc command-line options.
386 ###############################################################################
388 AC_DEFUN(AC_CHECK_GCC_ARG,
389 [if test -n "$GCC"; then
390 AC_CACHE_CHECK([whether gcc accepts [$2]],
391 ac_cv_gcc_accepts_[$1],
392 [rm -rf conftest.$ac_ext
393 touch conftest.$ac_ext
394 if ( ( gcc -c [$2] conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
395 grep unrecognized >/dev/null ); then
396 ac_cv_gcc_accepts_[$1]=no
398 ac_cv_gcc_accepts_[$1]=yes
401 ac_gcc_accepts_[$1]="$ac_cv_gcc_accepts_[$1]"
405 AC_DEFUN(AC_NO_LONG_STRING_WARNINGS,
406 [AC_CHECK_GCC_ARG(no_overlength, -Wno-overlength-strings)])
408 AC_DEFUN(AC_NO_MISPLACED_DECLARATIONS,
409 [AC_CHECK_GCC_ARG(no_decl_after, -Wdeclaration-after-statement)])
411 # Need to disable Objective C extensions in ANSI C on MacOS X to work
412 # around an Apple-specific gcc bug.
414 AC_DEFUN(AC_NO_OBJECTIVE_C,
415 [AC_CHECK_GCC_ARG(no_cpp_precomp, -no-cpp-precomp)])
417 ###############################################################################
419 # Function to figure out how to disable // comments in ANSI C code.
421 # (With recent gcc, this is done with "-std=c89". With older gcc, this
422 # is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
423 # gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang.
424 # so much for compatibility!)
426 # UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
427 # declarations preceed statements, without resorting to "-pedantic".
428 # This means that there is no way to get gcc3 to issue warnings that
429 # ensure that your code complies with the ANSI/ISO C89 standard, without
430 # also drowning in totally useless warnings. Thank you master may I
433 # So, I give up, let's just use -pedantic.
435 ###############################################################################
437 AC_DEFUN(AC_GCC_ACCEPTS_STD, [
440 # Fucking Apple let // comments sneak into OpenGL headers, so
441 # we *must* allow // comments when compiling on Mac OS 10.6! FUCK!
444 AC_CHECK_GCC_ARG(std, -std=c89)
449 AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
450 [if test -n "$GCC"; then
452 AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
454 # The reason that // comments are banned from xscreensaver is that gcc is
455 # basically the only compiler in the world that supports them in C code.
456 # All other vendors support them only in their C++ compilers, not in their
457 # ANSI C compilers. This means that it's a portability problem: every time
458 # these comments have snuck into the xscreensaver source code, I've gotten
459 # complaints about it the next day. So we turn off support for them in gcc
460 # as well to prevent them from accidentially slipping in.
462 if test "$ac_gcc_accepts_std" = yes ; then
464 # -std=c89 defines __STRICT_ANSI__, which we don't want.
465 # (That appears to be the only additional preprocessor symbol
466 # it defines, in addition to the syntax changes it makes.)
468 # -std=gnu89 is no good, because // comments were a GNU extension
469 # before they were in the ANSI C 99 spec... (gcc 2.96 permits //
470 # with -std=gnu89 but not with -std=c89.)
472 # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD
473 CC="$CC -U__STRICT_ANSI__"
476 # CC="$CC -Wp,-lang-c89"
482 ###############################################################################
484 # Function to figure out how to create directory trees.
486 ###############################################################################
488 AC_DEFUN(AC_PROG_INSTALL_DIRS,
489 [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories],
490 ac_cv_install_d_creates_dirs,
491 [ac_cv_install_d_creates_dirs=no
493 if mkdir conftestdir; then
494 cd conftestdir 2>/dev/null
495 ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
496 if test -d dir1/dir2/. ; then
497 ac_cv_install_d_creates_dirs=yes
504 if test "$ac_cv_install_d_creates_dirs" = no ; then
505 AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories],
506 ac_cv_mkdir_p_creates_dirs,
507 [ac_cv_mkdir_p_creates_dirs=no
509 if mkdir conftestdir; then
510 cd conftestdir 2>/dev/null
511 mkdir -p dir1/dir2 >/dev/null 2>&1
512 if test -d dir1/dir2/. ; then
513 ac_cv_mkdir_p_creates_dirs=yes
521 if test "$ac_cv_install_d_creates_dirs" = yes ; then
522 INSTALL_DIRS='${INSTALL} -d'
523 elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
524 INSTALL_DIRS='mkdir -p'
527 INSTALL_DIRS='${INSTALL} -d'
532 ###############################################################################
534 # Function to check whether gettimeofday() exists, and how to call it.
535 # This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
537 ###############################################################################
539 AC_DEFUN(AC_GETTIMEOFDAY_ARGS,
540 [AC_MSG_CHECKING(how to call gettimeofday)
541 AC_CACHE_VAL(ac_cv_gettimeofday_args,
542 [AC_TRY_COMPILE([#include <stdlib.h>
543 #include <sys/time.h>],
544 [struct timeval tv; struct timezone tzp;
545 gettimeofday(&tv, &tzp);],
546 [ac_gettimeofday_args=2],
547 [AC_TRY_COMPILE([#include <stdlib.h>
548 #include <sys/time.h>],
549 [struct timeval tv; gettimeofday(&tv);],
550 [ac_gettimeofday_args=1],
551 [ac_gettimeofday_args=0])])
552 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
553 ac_gettimeofday_args=$ac_cv_gettimeofday_args
554 if test "$ac_gettimeofday_args" = 1 ; then
555 AC_DEFINE(HAVE_GETTIMEOFDAY)
556 AC_MSG_RESULT(one argument)
557 elif test "$ac_gettimeofday_args" = 2 ; then
558 AC_DEFINE(HAVE_GETTIMEOFDAY)
559 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
560 AC_MSG_RESULT(two arguments)
562 AC_MSG_RESULT(unknown)
567 ###############################################################################
569 # Function to find perl5 (defines PERL and PERL_VERSION.)
571 ###############################################################################
573 # M4 sucks!! perl sucks too!!
575 perl_version_cmd='print $]'
578 AC_DEFUN(AC_PROG_PERL,
579 [AC_PATH_PROGS(PERL, [perl5 perl],,)
580 if test -z "$PERL" ; then
583 AC_CACHE_CHECK([perl version], ac_cv_perl_version,
584 [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
585 PERL_VERSION=$ac_cv_perl_version
590 ###############################################################################
592 # Function to demand "bc". Losers.
594 ###############################################################################
596 AC_DEFUN(AC_DEMAND_BC,
597 [ac_bc_result=`echo 6+9 | bc 2>/dev/null`
598 AC_MSG_CHECKING([for bc])
599 if test "$ac_bc_result" = "15" ; then
604 AC_MSG_ERROR([Your system doesn't have \"bc\", which has been a standard
605 part of Unix since the 1970s. Come back when your vendor
610 ###############################################################################
612 # Functions to check how to do ICMP PING requests.
614 ###############################################################################
616 AC_DEFUN(AC_CHECK_ICMP,
617 [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
618 [AC_TRY_COMPILE([#include <stdlib.h>
625 #include <sys/types.h>
626 #include <sys/time.h>
629 #include <sys/socket.h>
630 #include <netinet/in_systm.h>
631 #include <netinet/in.h>
632 #include <netinet/ip.h>
633 #include <netinet/ip_icmp.h>
634 #include <netinet/udp.h>
635 #include <arpa/inet.h>
639 struct sockaddr_in si;
641 i.icmp_type = ICMP_ECHO;
646 si.sin_family = AF_INET;
647 #if defined(__DECC) || defined(_IP_VHL)
653 [ac_cv_have_icmp=yes],
654 [ac_cv_have_icmp=no])])
655 if test "$ac_cv_have_icmp" = yes ; then
659 AC_DEFUN(AC_CHECK_ICMPHDR,
660 [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
661 [AC_TRY_COMPILE([#include <stdlib.h>
668 #include <sys/types.h>
669 #include <sys/time.h>
672 #include <sys/socket.h>
673 #include <netinet/in_systm.h>
674 #include <netinet/in.h>
675 #include <netinet/ip.h>
676 #include <netinet/ip_icmp.h>
677 #include <netinet/udp.h>
678 #include <arpa/inet.h>
682 struct sockaddr_in si;
688 i.un.echo.sequence = 0;
689 si.sin_family = AF_INET;
691 [ac_cv_have_icmphdr=yes],
692 [ac_cv_have_icmphdr=no])])
693 if test "$ac_cv_have_icmphdr" = yes ; then
694 AC_DEFINE(HAVE_ICMPHDR)
698 ###############################################################################
700 # Functions to check for various X11 crap.
702 ###############################################################################
704 # Try and find the app-defaults directory.
705 # It sucks that autoconf doesn't do this already...
707 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
709 if mkdir conftestdir; then
710 cd conftestdir 2>/dev/null
711 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
712 cat > Imakefile <<'EOF'
714 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
716 if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
717 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
718 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
724 ###############################################################################
726 # Handle the --with-x-app-defaults option HERE
728 ###############################################################################
730 AC_ARG_WITH(x-app-defaults,[],
731 [ac_cv_x_app_defaults="$withval"],
732 [eval ac_x_app_defaults="$withval"])
735 AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
736 # Look for the directory under a standard set of common directories.
737 # Check X11 before X11Rn because it's often a symlink to the current release.
739 /usr/X11/lib/app-defaults \
740 /usr/X11R6/lib/app-defaults \
741 /usr/X11R6/lib/X11/app-defaults \
742 /usr/X11R5/lib/app-defaults \
743 /usr/X11R5/lib/X11/app-defaults \
744 /usr/X11R4/lib/app-defaults \
745 /usr/X11R4/lib/X11/app-defaults \
747 /usr/lib/X11/app-defaults \
748 /usr/lib/X11R6/app-defaults \
749 /usr/lib/X11R5/app-defaults \
750 /usr/lib/X11R4/app-defaults \
752 /usr/local/X11/lib/app-defaults \
753 /usr/local/X11R6/lib/app-defaults \
754 /usr/local/X11R5/lib/app-defaults \
755 /usr/local/X11R4/lib/app-defaults \
757 /usr/local/lib/X11/app-defaults \
758 /usr/local/lib/X11R6/app-defaults \
759 /usr/local/lib/X11R6/X11/app-defaults \
760 /usr/local/lib/X11R5/app-defaults \
761 /usr/local/lib/X11R5/X11/app-defaults \
762 /usr/local/lib/X11R4/app-defaults \
763 /usr/local/lib/X11R4/X11/app-defaults \
765 /usr/X386/lib/X11/app-defaults \
766 /usr/x386/lib/X11/app-defaults \
767 /usr/XFree86/lib/X11/app-defaults \
769 /usr/lib/X11/app-defaults \
770 /usr/local/lib/X11/app-defaults \
771 /usr/unsupported/lib/X11/app-defaults \
772 /usr/athena/lib/X11/app-defaults \
773 /usr/local/x11r5/lib/X11/app-defaults \
774 /usr/lpp/Xamples/lib/X11/app-defaults \
775 /lib/usr/lib/X11/app-defaults \
777 /usr/openwin/lib/app-defaults \
778 /usr/openwin/lib/X11/app-defaults \
779 /usr/openwin/share/lib/app-defaults \
780 /usr/openwin/share/lib/X11/app-defaults \
782 /X11R6/lib/app-defaults \
783 /X11R5/lib/app-defaults \
784 /X11R4/lib/app-defaults \
787 if test -d "$ac_dir"; then
788 ac_x_app_defaults=$ac_dir
794 AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
796 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
797 [AC_PATH_X_APP_DEFAULTS_XMKMF
798 if test x"$ac_x_app_defaults" = x; then
799 AC_PATH_X_APP_DEFAULTS_DIRECT
801 if test x"$ac_x_app_defaults" = x; then
802 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
804 # Record where we found app-defaults for the cache.
805 ac_cv_x_app_defaults="$ac_x_app_defaults"
807 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
810 AC_DEFUN(AC_XPOINTER,
811 [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
812 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
813 [XPointer foo = (XPointer) 0;],
814 [ac_cv_xpointer=yes],
815 [ac_cv_xpointer=no])])
816 if test "$ac_cv_xpointer" != yes; then
817 AC_DEFINE(XPointer,[char*])
821 # Random special-cases for X on certain pathological OSes.
822 # You know who you are.
824 AC_DEFUN(AC_X_RANDOM_PATHS,
828 # The following arcana was gleaned from conversations with
829 # Eric Schwartz <erics@col.hp.com>:
831 # On HPUX 10.x, the parts of X that HP considers "standard" live in
832 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
833 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
834 # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
835 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
836 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
837 # you don't need any -I or -L arguments.
839 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
840 # are the same division as 10.x. However, there are no symlinks to
841 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
842 # arguments are always necessary.
844 # However, X11R6 was available on HPUX 9.x as a patch: if that
845 # patch was installed, then all of X11R6 went in to
846 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
848 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
849 # whether R5 was available as a patch; R6 undoubtedly was not.)
851 # So. We try and use the highest numbered pair of
852 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
853 # that are available. We do not mix and match different versions
856 # Question I still don't know the answer to: (do you?)
858 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
859 # /usr/contrib/X11R6/ could be installed as a patch, what was in
860 # that contrib directory? Did it contain so-called "standard"
861 # X11R6, or did it include Xaw and Xmu as well? If the former,
862 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
863 # be a situation where one had to reach into the R5 headers and
864 # libs to find Xmu? That is, must both R6 and R5 directories
865 # be on the -I and -L lists in that case?
867 for version in X11R6 X11R5 X11R4 ; do
868 # if either pair of directories exists...
869 if test -d /usr/include/$version || test -d /usr/contrib/$version/include
871 # if contrib exists, use it...
872 if test -d /usr/contrib/$version/include ; then
873 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
874 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
876 # if the "standard" one exists, use it.
877 if test -d /usr/include/$version ; then
878 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
879 X_LIBS="$X_LIBS -L/usr/lib/$version"
881 # since at least one of the pair exists, go no farther.
886 # Now find Motif. Thanks for not making xmkmf find this by
887 # default, you losers.
889 if test -d /usr/include/Motif2.1 ; then
890 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
891 X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
892 elif test -d /usr/include/Motif1.2 ; then
893 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
894 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
895 elif test -d /usr/include/Motif1.1 ; then
896 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
897 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
900 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
902 if test -d /opt/graphics/OpenGL/include ; then
903 # HP-UX 10.20 puts it here
904 X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
905 X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
906 elif test -d /opt/Mesa/lib ; then
907 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
908 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
912 if test -d /opt/xpm/lib/X11 ; then
913 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
914 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
917 # On HPUX, default to installing in /opt/xscreensaver/ instead of
918 # in /usr/local/, unless there is already an xscreensaver in
919 # /usr/local/bin/. This can be overridden with the --prefix arg
920 # to configure. I'm not sure this is the right thing to do, but
921 # Richard Lloyd says so...
923 if test \! -x /usr/local/bin/xscreensaver ; then
924 ac_default_prefix=/opt/xscreensaver
930 # Thanks for not making xmkmf find this by default, pinheads.
931 # And thanks for moving things around again, too. Is this
932 # really the standard location now? What happened to the
933 # joke that this kind of thing went in /opt?
934 # cthomp says "answer: CDE (Common Disorganized Environment)"
936 if test -f /usr/dt/include/Xm/Xm.h ; then
937 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
938 MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
940 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
941 AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
947 # On MacOS X (10.x with "fink"), many things are under /sw/.
949 if test -d /sw/include ; then
950 X_CFLAGS="-I/sw/include $X_CFLAGS"
951 X_LIBS="-L/sw/lib $X_LIBS"
958 ###############################################################################
960 # Some utility functions to make checking for X things easier.
962 ###############################################################################
964 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
966 AC_DEFUN(AC_CHECK_X_HEADER, [
967 ac_save_CPPFLAGS="$CPPFLAGS"
968 if test \! -z "$includedir" ; then
969 CPPFLAGS="$CPPFLAGS -I$includedir"
971 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
972 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
973 AC_CHECK_HEADER([$1],[$2],[$3],[$4])
974 CPPFLAGS="$ac_save_CPPFLAGS"])
976 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
978 AC_DEFUN(AC_EGREP_X_HEADER, [
979 ac_save_CPPFLAGS="$CPPFLAGS"
980 if test \! -z "$includedir" ; then
981 CPPFLAGS="$CPPFLAGS -I$includedir"
983 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
984 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
985 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
986 CPPFLAGS="$ac_save_CPPFLAGS"])
988 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
990 AC_DEFUN(AC_TRY_X_COMPILE, [
991 ac_save_CPPFLAGS="$CPPFLAGS"
992 if test \! -z "$includedir" ; then
993 CPPFLAGS="$CPPFLAGS -I$includedir"
995 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
996 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
997 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
998 CPPFLAGS="$ac_save_CPPFLAGS"])
1001 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
1002 # Use this sparingly; it probably doesn't work very well on X programs.
1004 AC_DEFUN(AC_CHECK_X_LIB, [
1005 ac_save_CPPFLAGS="$CPPFLAGS"
1006 ac_save_LDFLAGS="$LDFLAGS"
1007 # ac_save_LIBS="$LIBS"
1009 if test \! -z "$includedir" ; then
1010 CPPFLAGS="$CPPFLAGS -I$includedir"
1012 # note: $X_CFLAGS includes $x_includes
1013 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1015 if test \! -z "$libdir" ; then
1016 LDFLAGS="$LDFLAGS -L$libdir"
1018 # note: $X_LIBS includes $x_libraries
1019 LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
1021 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1022 LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
1023 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
1024 CPPFLAGS="$ac_save_CPPFLAGS"
1025 LDFLAGS="$ac_save_LDFLAGS"
1026 # LIBS="$ac_save_LIBS"
1029 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
1030 # (But not the -L directories!)
1032 AC_DEFUN(AC_TRY_X_RUN, [
1033 ac_save_CPPFLAGS="$CPPFLAGS"
1034 if test \! -z "$includedir" ; then
1035 CPPFLAGS="$CPPFLAGS -I$includedir"
1037 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1038 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1039 AC_TRY_RUN([$1], [$2], [$3], [$4])
1040 CPPFLAGS="$ac_save_CPPFLAGS"])
1044 # Usage: HANDLE_X_PATH_ARG([variable_name],
1045 # [--command-line-option],
1046 # [descriptive string])
1048 # All of the --with options take three forms:
1050 # --with-foo (or --with-foo=yes)
1051 # --without-foo (or --with-foo=no)
1054 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
1055 # a directory (string beginning with a slash) it checks to see whether
1056 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
1059 AC_DEFUN(HANDLE_X_PATH_ARG, [
1065 AC_MSG_CHECKING([for [$3] headers])
1068 X_CFLAGS="-I$d $X_CFLAGS"
1071 AC_MSG_RESULT(not found ($d: no such directory))
1074 AC_MSG_CHECKING([for [$3] libs])
1077 X_LIBS="-L$d $X_LIBS"
1080 AC_MSG_RESULT(not found ($d: no such directory))
1083 # replace the directory string with "yes".
1090 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
1091 echo " If it is a directory, then \`DIR/include' will be added to"
1092 echo " the -I list, and \`DIR/lib' will be added to the -L list."
1100 ###############################################################################
1101 ###############################################################################
1103 # End of function definitions. Now start actually executing stuff.
1105 ###############################################################################
1106 ###############################################################################
1108 # WTF! autoconf emits this *way* too late. Do it earlier.
1109 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1110 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1113 # random compiler setup
1116 AC_NO_LONG_STRING_WARNINGS
1117 AC_NO_MISPLACED_DECLARATIONS
1119 AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
1126 # stuff for Makefiles
1128 AC_PROG_INSTALL_DIRS
1131 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1132 # That's wrong: it should be set to '${INSTALL}', so that one can
1133 # implement the "install-strip" target properly (strip executables,
1134 # but do not try to strip scripts.)
1136 INSTALL_SCRIPT='${INSTALL}'
1140 AC_CHECK_HEADERS(unistd.h)
1148 AC_GETTIMEOFDAY_ARGS
1149 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
1150 AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
1151 AC_CHECK_FUNCS(setlocale)
1154 AC_CHECK_HEADERS(crypt.h sys/select.h)
1157 if test -z "$PERL" ; then
1158 # don't let it be blank...
1164 if test "$have_x" != yes; then
1165 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try `$0 --help'.)
1168 AC_PATH_X_APP_DEFAULTS
1172 AC_MSG_CHECKING(whether this is MacOS X)
1179 AC_MSG_RESULT($ac_macosx)
1182 ###############################################################################
1186 ###############################################################################
1189 GETTEXT_PACKAGE=xscreensaver
1190 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
1191 [This is the name of the gettext package to use.])
1192 AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE",
1193 [This is the same as GETTEXT_PACKAGE, but for the glade
1195 AC_SUBST(GETTEXT_PACKAGE)
1197 ALL_LINGUAS="ca da de es et fi fr hu it ja ko nb nl pl pt pt_BR ru sk sv vi wa zh_CN zh_TW"
1199 MKINSTALLDIRS="$INSTALL_DIRS"
1202 ###############################################################################
1204 # Check for -lXmu (some fucked up vendors don't ship it...)
1206 ###############################################################################
1209 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes],,
1210 [#include <stdlib.h>
1212 #include <X11/Intrinsic.h>])
1213 if test "$have_xmu" = no ; then
1214 XMU_SRCS='$(UTILS_SRC)/xmu.c'
1215 XMU_OBJS='$(UTILS_BIN)/xmu.o'
1225 ###############################################################################
1227 # Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
1228 # See comp.windows.x FAQ question 124. The right fix is to
1229 # get OpenWindows 3.0 patches 100512-02 and 100573-03.
1231 ###############################################################################
1233 if test "$have_xmu" = yes ; then
1236 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
1237 ac_cv_sunos_xmu_bug,
1238 [ac_save_LDFLAGS="$LDFLAGS"
1239 if test \! -z "$x_libraries" ; then
1240 LDFLAGS="$LDFLAGS -L$x_libraries"
1242 # Note: this trick never works! (Generally.)
1243 # We're only getting away with using AC_TRY_LINK
1244 # with X libraries because we know it's SunOS.
1245 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
1247 [ac_cv_sunos_xmu_bug=no],
1248 [ac_cv_sunos_xmu_bug=yes])
1249 LDFLAGS="$ac_save_LDFLAGS"])
1250 if test "$ac_cv_sunos_xmu_bug" = yes ; then
1251 AC_CACHE_CHECK([whether the compiler understands -static],
1253 [ac_save_LDFLAGS="$LDFLAGS"
1254 LDFLAGS="$LDFLAGS -static"
1255 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
1256 LDFLAGS="$ac_save_LDFLAGS"])
1257 if test "$ac_cv_ld_static" = yes ; then
1258 LDFLAGS="$LDFLAGS -static"
1260 LDFLAGS="$LDFLAGS -Bstatic"
1268 ###############################################################################
1270 # Handle the --with-hackdir option
1272 ###############################################################################
1275 with_hackdir_req=unspecified
1276 AC_ARG_WITH(hackdir,[
1278 Installation options:
1279 --with-hackdir=DIR Where to install the hundreds of demo executables.
1280 Default: `PREFIX/libexec/xscreensaver/'],
1281 [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes])
1283 if test x"$with_hackdir" = xyes; then
1284 HACKDIR='${libexecdir}/xscreensaver'
1285 elif test x"$with_hackdir" = xno; then
1288 HACKDIR=$with_hackdir
1291 # canonicalize slashes.
1292 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
1294 # Expand HACKDIR as HACKDIR_FULL
1295 HACKDIR_FULL=`eval eval eval eval eval eval eval eval eval echo $HACKDIR`
1297 # This option used to be called --enable-subdir; make sure that is no longer
1298 # used, since configure brain-damagedly ignores unknown --enable options.
1301 AC_ARG_ENABLE(subdir,,[obsolete_enable=yes])
1302 if test -n "$obsolete_enable"; then
1303 echo "error: the --enable-subdir option has been replaced with"
1304 echo " the new --with-hackdir option; see \`configure --help'"
1305 echo " for more information."
1310 ###############################################################################
1312 # Handle the --with-configdir option
1313 # Help for --with-x-app-defaults option added..
1315 ###############################################################################
1318 with_configdir_req=unspecified
1319 AC_ARG_WITH(configdir,
1320 [ --with-configdir=DIR Where to install the data files that describe each
1321 of the display modes to the GUI.
1322 Default: `PREFIX/share/xscreensaver/config/'
1323 --with-x-app-defaults=DIR
1324 Where to install xscreensaver configuration file.
1326 [with_configdir="$withval"; with_configdir_req="$withval"],
1327 [with_configdir=yes])
1329 if test x"$with_configdir" = xyes; then
1330 HACK_CONF_DIR='${datadir}/xscreensaver/config'
1331 elif test x"$with_configdir" = xno; then
1332 echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
1335 # there must be a better way than this...
1336 if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
1338 HACK_CONF_DIR=$with_configdir
1341 HACK_CONF_DIR="\${exec_prefix}$with_configdir"
1348 ###############################################################################
1350 # Check for the SGI SCREEN_SAVER server extension.
1352 ###############################################################################
1355 with_sgi_req=unspecified
1356 AC_ARG_WITH(sgi-ext,
1357 [Except where noted, all of the --with options below can also take a
1358 directory argument: for example, `--with-motif=/opt/Motif'. That would
1359 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
1360 to be added to the -L list, assuming those directories exist.
1362 By default, support for each of these options will be built in, if the
1363 relevant library routines exist. At run time, they will then be used
1364 only if the X server being used supports them. Each --with option has
1365 a corresponding --without option, to override building support for them
1368 Screen blanking and idle-detection options:
1370 --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.],
1371 [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
1373 HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
1375 if test "$with_sgi" = yes; then
1376 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
1378 AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
1379 [#include <X11/Xlib.h>])
1381 elif test "$with_sgi" != no; then
1382 echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
1387 ###############################################################################
1389 # Check for the XIDLE server extension.
1391 ###############################################################################
1394 with_xidle_req=unspecified
1395 AC_ARG_WITH(xidle-ext,
1396 [ --with-xidle-ext Include support for the XIDLE extension.],
1397 [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
1399 HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
1401 if test "$with_xidle" = yes; then
1402 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
1404 AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
1405 [#include <X11/Xlib.h>])
1406 elif test "$with_xidle" != no; then
1407 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
1412 ###############################################################################
1414 # Check for the SGI-VIDEO-CONTROL server extension.
1416 ###############################################################################
1419 with_sgivc_req=unspecified
1420 AC_ARG_WITH(sgivc-ext,
1421 [ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.],
1422 [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
1424 HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
1426 if test "$with_sgivc" = yes; then
1428 # first check for XSGIvc.h
1429 AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],,
1430 [#include <X11/Xlib.h>])
1432 # if that succeeded, then check for the -lXsgivc
1433 if test "$have_sgivc" = yes; then
1435 AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
1436 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
1440 # if that succeeded, then we've really got it.
1441 if test "$have_sgivc" = yes; then
1442 AC_DEFINE(HAVE_SGI_VC_EXTENSION)
1445 elif test "$with_sgivc" != no; then
1446 echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
1451 ###############################################################################
1453 # Check for the DPMS server extension.
1455 ###############################################################################
1458 with_dpms_req=unspecified
1459 AC_ARG_WITH(dpms-ext,
1460 [ --with-dpms-ext Include support for the DPMS extension.],
1461 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
1463 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
1465 if test "$with_dpms" = yes; then
1467 # first check for dpms.h
1468 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
1469 [#include <X11/Xlib.h>
1470 #include <X11/Xmd.h>])
1472 # if that succeeded, then check for the DPMS code in the libraries
1473 if test "$have_dpms" = yes; then
1475 # first look in -lXext (this is where it is with XFree86 4.0)
1477 AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11)
1479 # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
1480 if test "$have_dpms" = no; then
1481 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
1482 [have_dpms=yes; XDPMS_LIBS="-lXdpms"], [true],
1488 # if that succeeded, then we've really got it.
1489 if test "$have_dpms" = yes; then
1490 AC_DEFINE(HAVE_DPMS_EXTENSION)
1493 elif test "$with_dpms" != no; then
1494 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
1499 ###############################################################################
1501 # Check for the XINERAMA server extension.
1503 ###############################################################################
1506 with_xinerama_req=unspecified
1507 AC_ARG_WITH(xinerama-ext,
1508 [ --with-xinerama-ext Include support for the XINERAMA extension.],
1509 [with_xinerama="$withval"; with_xinerama_req="$withval"],[with_xinerama=yes])
1511 HANDLE_X_PATH_ARG(with_xinerama, --with-xinerama-ext, XINERAMA)
1513 if test "$with_xinerama" = yes; then
1515 # first check for Xinerama.h
1516 AC_CHECK_X_HEADER(X11/extensions/Xinerama.h, [have_xinerama=yes],,
1517 [#include <X11/Xlib.h>])
1519 # if that succeeded, then check for the XINERAMA code in the libraries
1520 if test "$have_xinerama" = yes; then
1522 # first look in -lXext
1524 AC_CHECK_X_LIB(Xext, XineramaQueryScreens, [have_xinerama=yes], [true],
1527 # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
1528 if test "$have_xinerama" = no; then
1529 AC_CHECK_X_LIB(Xinerama, XineramaQueryScreens,
1530 [have_xinerama=yes; XINERAMA_LIBS="-lXinerama"],
1531 [true], -lXext -lX11)
1535 # if that succeeded, then we've really got it.
1536 if test "$have_xinerama" = yes; then
1537 AC_DEFINE(HAVE_XINERAMA)
1540 elif test "$with_xinerama" != no; then
1541 echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
1546 ###############################################################################
1548 # Check for the XF86VMODE server extension (for virtual screens.)
1550 ###############################################################################
1553 with_xf86vmode_req=unspecified
1554 AC_ARG_WITH(xf86vmode-ext,
1555 [ --with-xf86vmode-ext Include support for XFree86 virtual screens.],
1556 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
1557 [with_xf86vmode=yes])
1559 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1563 if test "$with_xf86vmode" = yes; then
1565 # first check for xf86vmode.h
1566 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes],,
1567 [#include <X11/Xlib.h>])
1569 # if that succeeded, then check for the -lXxf86vm
1570 if test "$have_xf86vmode" = yes; then
1572 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1573 [have_xf86vmode=yes;
1574 VIDMODE_LIBS="-lXxf86vm";
1575 SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS"],
1576 [true], -lXext -lX11)
1579 # if that succeeded, then we've really got it.
1580 if test "$have_xf86vmode" = yes; then
1581 AC_DEFINE(HAVE_XF86VMODE)
1584 elif test "$with_xf86vmode" != no; then
1585 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
1590 ###############################################################################
1592 # Check for the XF86VMODE server extension (for gamma fading.)
1594 ###############################################################################
1597 have_xf86gamma_ramp=no
1598 with_xf86gamma_req=unspecified
1599 AC_ARG_WITH(xf86gamma-ext,
1600 [ --with-xf86gamma-ext Include support for XFree86 gamma fading.],
1601 [with_xf86gamma="$withval"; with_xf86gamma_req="$withval"],
1602 [with_xf86gamma=yes])
1604 HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma)
1606 if test "$with_xf86gamma" = yes; then
1608 # first check for xf86vmode.h, if we haven't already
1609 if test "$have_xf86vmode" = yes; then
1612 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes],,
1613 [#include <X11/Xlib.h>])
1616 # if that succeeded, then check for the -lXxf86vm
1617 if test "$have_xf86gamma" = yes; then
1619 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma,
1620 [have_xf86gamma=yes],
1621 [true], -lXext -lX11)
1624 # check for the Ramp versions of the functions too.
1625 if test "$have_xf86gamma" = yes; then
1626 have_xf86gamma_ramp=no
1627 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp,
1628 [have_xf86gamma_ramp=yes],
1629 [true], -lXext -lX11)
1632 # if those tests succeeded, then we've really got the functions.
1633 if test "$have_xf86gamma" = yes; then
1634 AC_DEFINE(HAVE_XF86VMODE_GAMMA)
1637 if test "$have_xf86gamma_ramp" = yes; then
1638 AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP)
1641 # pull in the lib, if we haven't already
1642 if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
1643 SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
1646 elif test "$with_xf86gamma" != no; then
1647 echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
1652 ###############################################################################
1654 # Check for the RANDR (Resize and Rotate) server extension.
1656 # We need this to detect when the resolution of the desktop
1657 # has changed out from under us (this is a newer, different
1658 # mechanism than the XF86VMODE virtual viewports.)
1660 ###############################################################################
1663 with_randr_req=unspecified
1664 AC_ARG_WITH(randr-ext,
1665 [ --with-randr-ext Include support for the X Resize+Rotate extension.],
1666 [with_randr="$withval"; with_randr_req="$withval"],[with_randr=yes])
1668 HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR)
1670 if test "$with_randr" = yes; then
1672 # first check for Xrandr.h
1673 AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],,
1674 [#include <X11/Xlib.h>])
1676 # if that succeeded, then check for the XRR code in the libraries
1677 if test "$have_randr" = yes; then
1679 # RANDR probably needs -lXrender
1681 AC_CHECK_X_LIB(Xrender, XRenderSetSubpixelOrder,
1682 [xrender_libs="-lXrender"], [true], -lXext -lX11)
1684 # first look for RANDR in -lXext
1686 AC_CHECK_X_LIB(Xext, XRRGetScreenInfo,
1687 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"],
1688 [true], $xrender_libs -lXext -lX11)
1690 # if that failed, look in -lXrandr
1691 if test "$have_randr" = no; then
1692 AC_CHECK_X_LIB(Xrandr, XRRGetScreenInfo,
1693 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"],
1694 [true], $xrender_libs -lXext -lX11)
1698 # if that succeeded, then we've really got it.
1699 if test "$have_randr" = yes; then
1700 AC_DEFINE(HAVE_RANDR)
1702 # Now check for version 1.2 in the same libs.
1703 # Try to compile, since on MacOS 10.5.7, headers are older than libs!
1704 AC_CACHE_CHECK([for XRRGetScreenResources], ac_cv_randr_12,
1706 AC_TRY_X_COMPILE([#include <stdlib.h>
1707 #include <X11/Xlib.h>
1708 #include <X11/extensions/Xrandr.h>],
1709 [XRRScreenResources *res =
1710 XRRGetScreenResources (0, 0);],
1711 [ac_cv_randr_12=yes],
1712 [ac_cv_randr_12=no])])
1713 if test "$ac_cv_randr_12" = yes ; then
1714 AC_DEFINE(HAVE_RANDR_12)
1716 # AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)],
1717 # [true], $SAVER_LIBS)
1721 elif test "$with_randr" != no; then
1722 echo "error: must be yes or no: --with-randr-ext=$with_randr"
1727 ###############################################################################
1729 # Check for XF86MiscSetGrabKeysState (but only bother if we are already
1730 # using other XF86 stuff.)
1732 ###############################################################################
1734 have_xf86miscsetgrabkeysstate=no
1735 if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
1736 AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
1737 [have_xf86miscsetgrabkeysstate=yes],
1738 [true], -lXext -lX11)
1739 if test "$have_xf86miscsetgrabkeysstate" = yes ; then
1740 SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
1741 AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
1746 ###############################################################################
1748 # Check for HP XHPDisableReset and XHPEnableReset.
1750 ###############################################################################
1752 AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
1753 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1754 [AC_DEFINE(HAVE_XHPDISABLERESET)
1755 SAVER_LIBS="-lXhp11 $SAVER_LIBS"
1756 AC_MSG_RESULT(yes)],
1757 [AC_MSG_RESULT(no)])
1760 ###############################################################################
1762 # Check for /proc/interrupts.
1764 ###############################################################################
1766 have_proc_interrupts=no
1767 with_proc_interrupts_req=unspecified
1768 AC_ARG_WITH(proc-interrupts,
1769 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
1770 file to notice keyboard activity.],
1771 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
1772 [with_proc_interrupts=yes])
1774 if test "$with_proc_interrupts" = yes; then
1776 # Note that we may be building in an environment (e.g. Debian buildd chroot)
1777 # without a proper /proc filesystem. If /proc/interrupts exists, then we'll
1778 # check that it has the bits we need, but otherwise we'll just go on faith.
1780 have_proc_interrupts=yes
1782 if test -f /proc/interrupts; then
1783 AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1784 ac_cv_have_proc_interrupts,
1785 [ac_cv_have_proc_interrupts=no
1786 if grep 'keyboard\|i8042' /proc/interrupts >/dev/null 2>&1 ; then
1787 ac_cv_have_proc_interrupts=yes
1790 have_proc_interrupts=$ac_cv_have_proc_interrupts
1793 if test "$have_proc_interrupts" = yes; then
1794 AC_DEFINE(HAVE_PROC_INTERRUPTS)
1797 elif test "$with_proc_interrupts" != no; then
1798 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
1803 ###############################################################################
1805 # The --enable-locking option
1807 ###############################################################################
1809 AC_ARG_ENABLE(locking,[Screen locking options:
1810 --enable-locking Compile in support for locking the display.
1811 --disable-locking Do not allow locking at all.],
1812 [enable_locking="$enableval"],
1813 [if test "$ac_macosx" = yes; then
1814 # We can't lock on MacOS X, so default to not compiling in support for it.
1815 # But allow --enable-locking to override that, so I can debug Linux locking
1821 if test "$enable_locking" = yes; then
1823 elif test "$enable_locking" = no; then
1824 AC_DEFINE(NO_LOCKING)
1826 echo "error: must be yes or no: --enable-locking=$enable_locking"
1831 ###############################################################################
1833 # Whether to allow root password to unblank.
1835 ###############################################################################
1836 AC_ARG_ENABLE(root-passwd, [
1837 --enable-root-passwd Allow root passwd to unlock screen.
1838 --disable-root-passwd Do not allow that.],
1839 [enable_root_passwd="$enableval"],[enable_root_passwd=yes])
1840 if test "$enable_root_passwd" = yes; then
1841 AC_DEFINE(ALLOW_ROOT_PASSWD)
1843 elif test "$enable_root_passwd" != no; then
1844 echo "error: must be yes or no: --enable-root-passwd=$enable_root_passwd"
1848 ###############################################################################
1852 ###############################################################################
1856 # Solaris systems tend to come with PAM misconfigured.
1857 # Don't build it by default, even if the headers exist.
1861 # Default to building PAM support on all other systems, if it exists.
1862 with_pam_default=yes
1867 with_pam_req=unspecified
1870 [ --with-pam Include support for PAM (Pluggable Auth Modules.)],
1871 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default])
1873 AC_ARG_WITH([pam_service_name],
1874 AC_HELP_STRING([--with-pam-service-name=NAME],
1875 [NAME is the name of the PAM service that
1876 xscreensaver will authenticate as.]),
1877 [pam_service_name="$withval"],[pam_service_name="xscreensaver"])
1879 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
1881 if test "$enable_locking" = yes -a "$with_pam" = yes; then
1882 AC_CACHE_CHECK([for PAM], ac_cv_pam,
1883 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
1886 if test "$ac_cv_pam" = yes ; then
1889 AC_DEFINE_UNQUOTED(PAM_SERVICE_NAME,"$pam_service_name")
1891 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
1893 # libpam typically requires dlopen and dlsym. On FreeBSD,
1894 # those are in libc. On Linux and Solaris, they're in libdl.
1895 AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
1897 # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
1899 AC_CHECK_LIB(c, sigtimedwait,
1901 AC_DEFINE(HAVE_SIGTIMEDWAIT)])
1902 if test "$have_timedwait" = no ; then
1903 AC_CHECK_LIB(rt, sigtimedwait, [have_timedwait=yes
1904 AC_DEFINE(HAVE_SIGTIMEDWAIT)
1905 PASSWD_LIBS="${PASSWD_LIBS} -lrt"])
1908 AC_MSG_CHECKING(how to call pam_strerror)
1909 AC_CACHE_VAL(ac_cv_pam_strerror_args,
1910 [AC_TRY_X_COMPILE([#include <stdio.h>
1912 #include <security/pam_appl.h>],
1913 [pam_handle_t *pamh = 0;
1914 char *s = pam_strerror(pamh, PAM_SUCCESS);],
1915 [ac_pam_strerror_args=2],
1916 [AC_TRY_X_COMPILE([#include <stdio.h>
1918 #include <security/pam_appl.h>],
1920 pam_strerror(PAM_SUCCESS);],
1921 [ac_pam_strerror_args=1],
1922 [ac_pam_strerror_args=0])])
1923 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
1924 ac_pam_strerror_args=$ac_cv_pam_strerror_args
1925 if test "$ac_pam_strerror_args" = 1 ; then
1926 AC_MSG_RESULT(one argument)
1927 elif test "$ac_pam_strerror_args" = 2 ; then
1928 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
1929 AC_MSG_RESULT(two arguments)
1931 AC_MSG_RESULT(unknown)
1934 # Check pam_fail_delay
1935 AC_MSG_CHECKING(pam_fail_delay in -lpam)
1936 AC_CACHE_VAL(ac_cv_pam_fail_delay,
1937 [ac_save_LDFLAGS="$LDFLAGS"
1939 AC_TRY_LINK([#include <security/pam_appl.h>],
1940 [pam_handle_t *pamh = 0;
1941 unsigned int usec = 1;
1942 int status = pam_fail_delay (pamh, usec);],
1943 [ac_pam_fail_delay=yes],
1944 [ac_pam_fail_delay=no])
1945 ac_cv_pam_fail_delay=$ac_pam_fail_delay,
1946 LDFLAGS=$ac_save_LDFLAGS])
1948 if test "$ac_pam_fail_delay" = yes ; then
1950 AC_DEFINE(HAVE_PAM_FAIL_DELAY)
1959 ###############################################################################
1961 # Check for Kerberos.
1963 ###############################################################################
1967 with_kerberos_req=unspecified
1969 AC_ARG_WITH(kerberos,
1970 [ --with-kerberos Include support for Kerberos authentication.],
1971 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
1973 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
1975 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
1976 AC_CACHE_CHECK([for Kerberos 4], ac_cv_kerberos,
1977 [AC_TRY_X_COMPILE([#include <krb.h>],,
1978 [ac_cv_kerberos=yes],
1979 [ac_cv_kerberos=no])])
1980 AC_CACHE_CHECK([for Kerberos 5], ac_cv_kerberos5,
1981 [AC_TRY_X_COMPILE([#include <kerberosIV/krb.h>],,
1982 [ac_cv_kerberos5=yes],
1983 [ac_cv_kerberos5=no])])
1985 if test "$ac_cv_kerberos" = yes ; then
1987 AC_DEFINE(HAVE_KERBEROS)
1990 if test "$ac_cv_kerberos5" = yes ; then
1992 # Andrew Snare <ajs@pigpond.com> wrote:
1994 # You were assuming that if kerberosV (krb5) was found, then kerberosIV
1995 # (krb4) was also available. This turns out not to be the case with
1996 # mit-krb-1.2.7; apparently backwards-compatibility with KerberosIV
1999 # So, disable kerberosV support if libkrb4 can't be found.
2000 # This is not the best solution, but it makes the compile not fail.
2002 AC_CHECK_X_LIB(krb4, krb_get_tf_realm,
2003 [have_kerberos=yes],
2005 if test "$have_kerberos" = yes ; then
2007 AC_DEFINE(HAVE_KERBEROS)
2008 AC_DEFINE(HAVE_KERBEROS5)
2011 AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
2016 if test "$have_kerberos5" = yes ; then
2017 # from Matt Knopp <mhat@infocalypse.netlag.com>
2018 # (who got it from amu@mit.edu)
2020 PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
2022 # jwz: MacOS X uses -lkrb5, but not -lcrypt
2023 AC_CHECK_X_LIB(crypt, crypt, [PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2025 elif test "$have_kerberos" = yes ; then
2026 # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
2027 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
2030 if test "$have_kerberos" = yes ; then
2031 AC_CHECK_FUNC(res_search,,
2032 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
2033 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
2039 ###############################################################################
2041 # Check for the nine billion variants of shadow passwords...
2043 ###############################################################################
2048 with_shadow_req=unspecified
2051 [ --with-shadow Include support for shadow password authentication.],
2052 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
2054 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
2056 if test "$enable_locking" = no ; then
2062 ###############################################################################
2064 # Check for Sun "adjunct" passwords.
2066 ###############################################################################
2068 if test "$with_shadow" = yes ; then
2069 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
2070 [AC_TRY_X_COMPILE([#include <stdlib.h>
2072 #include <sys/types.h>
2073 #include <sys/label.h>
2074 #include <sys/audit.h>
2075 #include <pwdadj.h>],
2076 [struct passwd_adjunct *p = getpwanam("nobody");
2077 const char *pw = p->pwa_passwd;],
2078 [ac_cv_sun_adjunct=yes],
2079 [ac_cv_sun_adjunct=no])])
2080 if test "$ac_cv_sun_adjunct" = yes; then
2081 have_shadow_adjunct=yes
2088 ###############################################################################
2090 # Check for DEC and SCO so-called "enhanced" security.
2092 ###############################################################################
2094 if test "$with_shadow" = yes ; then
2095 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
2096 [AC_TRY_X_COMPILE([#include <stdlib.h>
2098 #include <sys/types.h>
2100 #include <sys/security.h>
2102 [struct pr_passwd *p;
2104 set_auth_parameters(0, 0);
2105 check_auth_parameters();
2106 p = getprpwnam("nobody");
2107 pw = p->ufld.fd_encrypt;],
2108 [ac_cv_enhanced_passwd=yes],
2109 [ac_cv_enhanced_passwd=no])])
2110 if test $ac_cv_enhanced_passwd = yes; then
2111 have_shadow_enhanced=yes
2115 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
2116 # (I'm told it needs -lcurses too, but I don't understand why.)
2117 # But on DEC, it's in -lsecurity.
2119 AC_CHECK_LIB(prot, getprpwnam,
2120 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
2121 [AC_CHECK_LIB(security, getprpwnam,
2122 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
2127 ###############################################################################
2129 # Check for HP's entry in the "Not Invented Here" Sweepstakes.
2131 ###############################################################################
2133 if test "$with_shadow" = yes ; then
2134 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
2135 [AC_TRY_X_COMPILE([#include <stdlib.h>
2137 #include <sys/types.h>
2139 #include <hpsecurity.h>
2141 [struct s_passwd *p = getspwnam("nobody");
2142 const char *pw = p->pw_passwd;],
2143 [ac_cv_hpux_passwd=yes],
2144 [ac_cv_hpux_passwd=no])])
2145 if test "$ac_cv_hpux_passwd" = yes; then
2146 have_shadow_hpux=yes
2150 # on HPUX, bigcrypt is in -lsec
2151 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
2156 ###############################################################################
2158 # Check for FreeBSD-style shadow passwords.
2160 # On FreeBSD, getpwnam() and friends work just like on non-shadow-
2161 # password systems -- except you only get stuff in the pw_passwd field
2162 # if the running program is setuid. So, guess that we've got this
2163 # lossage to contend with if /etc/master.passwd exists, and default to
2164 # a setuid installation.
2166 ###############################################################################
2168 if test "$with_shadow" = yes ; then
2169 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
2170 [if test -f /etc/master.passwd ; then
2171 ac_cv_master_passwd=yes
2173 ac_cv_master_passwd=no
2175 if test "$ac_cv_master_passwd" = yes; then
2181 ###############################################################################
2183 # Check for traditional (ha!) shadow passwords.
2185 ###############################################################################
2187 if test "$with_shadow" = yes ; then
2188 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
2189 [AC_TRY_X_COMPILE([#include <stdlib.h>
2191 #include <sys/types.h>
2193 #include <shadow.h>],
2194 [struct spwd *p = getspnam("nobody");
2195 const char *pw = p->sp_pwdp;],
2197 [ac_cv_shadow=no])])
2198 if test "$ac_cv_shadow" = yes; then
2202 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
2204 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
2205 if test "$have_getspnam" = no ; then
2206 AC_CHECK_LIB(gen, getspnam,
2207 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
2213 ###############################################################################
2215 # Check for other libraries needed for non-shadow passwords.
2217 ###############################################################################
2219 if test "$enable_locking" = yes ; then
2221 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
2223 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
2224 if test "$have_crypt" = no ; then
2225 AC_CHECK_LIB(crypt, crypt,
2226 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2231 # Most of the above shadow mechanisms will have set need_setuid to yes,
2232 # if they were found. But, on some systems, we need setuid even when
2233 # using plain old vanilla passwords.
2235 if test "$enable_locking" = yes ; then
2237 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
2244 if test "$have_shadow_adjunct" = yes ; then
2245 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
2246 elif test "$have_shadow_enhanced" = yes ; then
2247 AC_DEFINE(HAVE_ENHANCED_PASSWD)
2248 elif test "$have_shadow_hpux" = yes ; then
2249 AC_DEFINE(HAVE_HPUX_PASSWD)
2250 elif test "$have_shadow" = yes ; then
2251 AC_DEFINE(HAVE_SHADOW_PASSWD)
2255 ###############################################################################
2257 # Check for external password helper
2258 # On SuSE, instead of having xscreensaver be a setuid program, they
2259 # fork an external program that takes the password on stdin, and
2260 # returns true if that password is a valid one. Then only that
2261 # smaller program needs to be setuid.
2263 # (Note that this external program is not a GUI: the GUI is still
2264 # all in xscreensaver itself; the external program just does auth.)
2266 ###############################################################################
2268 have_passwd_helper=no
2269 with_passwd_helper_req=unspecified
2271 AC_ARG_WITH(passwd-helper,
2272 [ --with-passwd-helper Include support for an external password
2273 verification helper program.],
2274 [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no])
2275 # no HANDLE_X_PATH_ARG for this one
2277 if test "$enable_locking" = no ; then
2278 with_passwd_helper_req=no
2279 with_passwd_helper=no
2282 case "$with_passwd_helper" in
2285 AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
2286 have_passwd_helper=yes;;
2288 echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
2293 ###############################################################################
2295 # Check for a login manager for a "New Login" button on the lock dialog.
2296 # Usually this will be "/usr/bin/gdmflexiserver".
2298 ###############################################################################
2300 have_login_manager=no
2301 with_login_manager_req=unspecified
2302 default_login_manager='gdmflexiserver -ls'
2304 AC_ARG_WITH(login-manager,
2305 [ --with-login-manager Put a "New Login" button on the unlock dialog that
2306 runs a login manager such as gdmflexiserver.],
2307 [with_login_manager="$withval"; with_login_manager_req="$withval"],
2308 [with_login_manager=no])
2309 # no HANDLE_X_PATH_ARG for this one
2311 if test "$enable_locking" = no ; then
2312 with_login_manager_req=no
2313 with_login_manager=no
2316 if test -n "$with_login_manager_req" ; then
2317 ac_cv_login_manager_program=""
2319 if test "$with_login_manager_req" = "yes" ; then
2320 with_login_manager_req=$default_login_manager
2323 case "$with_login_manager_req" in
2325 with_login_manager=""
2329 set dummy $with_login_manager_req ; login_manager_tmp=$2
2330 AC_MSG_CHECKING([for $login_manager_tmp])
2331 if test -x "$login_manager_tmp" ; then
2335 with_login_manager=""
2340 set dummy $with_login_manager_req ; login_manager_tmp=$2
2342 unset ac_cv_path_login_manager_tmp
2343 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2344 if test -z "$login_manager_tmp" ; then
2345 with_login_manager=""
2347 with_login_manager="$login_manager_tmp"
2351 ac_cv_login_manager_program="$with_login_manager"
2353 elif test -n "$ac_cv_login_manager_program"; then
2354 AC_MSG_RESULT([checking for login_manager... (cached) $ac_cv_login_manager_program])
2357 NEW_LOGIN_COMMAND_P=''
2358 NEW_LOGIN_COMMAND="$ac_cv_login_manager_program"
2360 if test -z "$NEW_LOGIN_COMMAND" ; then
2361 NEW_LOGIN_COMMAND="$default_login_manager"
2362 NEW_LOGIN_COMMAND_P='! '
2367 ###############################################################################
2369 # Check for -lgtk (and Gnome stuff)
2371 ###############################################################################
2374 with_gtk_req=unspecified
2376 User interface options:
2378 --with-gtk Use the Gtk toolkit for the user interface.],
2379 [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
2381 # if --with-gtk=/directory/ was specified, remember that directory so that
2382 # we can also look for the `gtk-config' program in that directory.
2392 HANDLE_X_PATH_ARG(with_gtk, --with-gtk, Gtk)
2394 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
2395 echo "error: must be yes or no: --with-gtk=$with_gtk"
2400 parse_gtk_version_string() {
2403 maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
2404 min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
2406 ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
2407 if test -z "$ac_gtk_version"; then
2408 ac_gtk_version=unknown
2409 ac_gtk_version_string=unknown
2413 # Find pkg-config... (need this for both gtk and gdk_pixbuf.)
2414 # if the user specified --with-gtk=/foo/ then look there.
2417 if test ! -z "$gtk_dir"; then
2418 # canonicalize slashes.
2419 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
2420 gtk_path="$foo:$gtk_path"
2423 AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
2425 if test -z "$pkg_config" ; then
2426 AC_MSG_WARN([pkg-config not found!])
2431 # Utility function for running pkg-config-based tests...
2434 pkg_check_version() {
2435 if test "$ok" = yes ; then
2438 AC_MSG_CHECKING(for $req)
2439 if $pkg_config --exists "$req" ; then
2440 vers=`$pkg_config --modversion "$req"`
2441 if $pkg_config --exists "$req >= $min" ; then
2442 AC_MSG_RESULT($vers)
2446 AC_MSG_RESULT($vers (wanted >= $min))
2462 #if test "$with_gtk" = yes; then
2466 pkg_check_version gtk+-2.0 2.0.1 ; ac_gtk_version_string="$vers"
2467 pkg_check_version gmodule-2.0 2.0.0
2468 pkg_check_version libxml-2.0 2.4.6
2469 pkg_check_version libglade-2.0 1.99.0
2470 pkg_check_version gdk-pixbuf-2.0 2.0.0
2471 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
2474 if test "$have_gtk" = no; then
2475 if test -n "$ac_gtk_version_string" ; then
2476 gtk_halfassed="$ac_gtk_version_string"
2477 gtk_halfassed_lib="$req"
2481 if test "$have_gtk" = yes; then
2482 parse_gtk_version_string
2486 if test "$have_gtk" = yes; then
2487 AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
2488 [ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
2489 AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
2490 [ac_cv_gtk_config_libs=`$pkg_config --libs $pkgs`])
2493 ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
2494 ac_gtk_config_libs=$ac_cv_gtk_config_libs
2498 if test "$have_gtk" = yes; then
2499 GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
2500 GTK_DATADIR="$GTK_DATADIR/share"
2503 if test "$have_gtk" = yes; then
2504 INCLUDES="$INCLUDES $ac_gtk_config_cflags"
2505 GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
2507 AC_DEFINE(HAVE_GTK2)
2513 AC_CACHE_CHECK([for DBUS includes], ac_cv_dbus_config_cflags,
2514 [ac_cv_dbus_config_cflags=`$pkg_config --cflags dbus-1`])
2515 AC_CACHE_CHECK([for DBUS includes], ac_cv_dbus_config_libs,
2516 [ac_cv_dbus_config_libs=`$pkg_config --libs dbus-1`])
2518 ac_dbus_config_cflags=$ac_cv_dbus_config_cflags
2519 ac_dbus_config_libs=$ac_cv_dbus_config_libs
2521 INCLUDES="$INCLUDES $ac_dbus_config_cflags"
2522 DBUS_LIBS="$GTK_LIBS $ac_dbus_config_libs"
2524 AC_CACHE_CHECK([for OSSO includes], ac_cv_osso_config_cflags,
2525 [ac_cv_osso_config_cflags=`$pkg_config --cflags libosso`])
2526 AC_CACHE_CHECK([for OSSO includes], ac_cv_osso_config_libs,
2527 [ac_cv_osso_config_libs=`$pkg_config --libs libosso`])
2529 ac_osso_config_cflags=$ac_cv_osso_config_cflags
2530 ac_osso_config_libs=$ac_cv_osso_config_libs
2532 INCLUDES="$INCLUDES $ac_osso_config_cflags"
2533 GTK_LIBS="$GTK_LIBS $ac_osso_config_libs"
2538 # Check for the various Gnome help and URL loading programs.
2540 WITH_BROWSER=gnome-open
2541 if test "$have_gtk" = yes; then
2542 AC_CHECK_PROGS(gnome_open_program, gnome-open)
2543 AC_CHECK_PROGS(gnome_url_show_program, gnome-url-show)
2547 ###############################################################################
2551 ###############################################################################
2554 with_motif_req=unspecified
2555 AC_ARG_WITH(motif,[ --with-motif Use the Motif toolkit for the user interface
2556 (not recommended.)],
2557 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
2559 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
2561 if test "$with_motif" != yes -a "$with_motif" != no ; then
2562 echo "error: must be yes or no: --with-motif=$with_motif"
2566 if test "$with_motif" = yes; then
2568 AC_CHECK_X_HEADER(Xm/Xm.h,
2570 AC_DEFINE(HAVE_MOTIF)
2571 MOTIF_LIBS="$MOTIF_LIBS -lXm"],,
2572 [#include <stdlib.h>
2574 #include <X11/Intrinsic.h>])
2578 if test "$have_motif" = yes; then
2579 AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)],,
2580 [#include <stdlib.h>
2582 #include <X11/Intrinsic.h>])
2586 ###############################################################################
2588 # Checking whether Motif is really Lesstif.
2590 ###############################################################################
2593 if test "$have_motif" = yes ; then
2594 AC_CACHE_CHECK([whether Motif is really LessTif],
2596 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
2597 [long vers = LesstifVersion;],
2598 [ac_cv_have_lesstif=yes],
2599 [ac_cv_have_lesstif=no])])
2600 have_lesstif=$ac_cv_have_lesstif
2604 lesstif_version=unknown
2605 lesstif_version_string=unknown
2607 if test "$have_lesstif" = yes ; then
2609 echo unknown > conftest-lt
2610 AC_CACHE_CHECK([LessTif version number],
2611 ac_cv_lesstif_version_string,
2612 [AC_TRY_X_RUN([#include <stdio.h>
2615 FILE *f = fopen("conftest-lt", "w");
2617 fprintf(f, "%d %d.%d\n", LesstifVersion,
2618 LESSTIF_VERSION, LESSTIF_REVISION);
2622 [ltv=`cat conftest-lt`
2623 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
2624 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
2625 [ac_cv_lesstif_version=unknown
2626 ac_cv_lesstif_version_string=unknown],
2627 [ac_cv_lesstif_version=unknown
2628 ac_cv_lesstif_version_string=unknown])])
2630 lesstif_version=$ac_cv_lesstif_version
2631 lesstif_version_string=$ac_cv_lesstif_version_string
2636 if test "$have_motif" = yes ; then
2638 echo unknown > conftest-mt
2639 AC_CACHE_CHECK([Motif version number],
2640 ac_cv_motif_version_string,
2641 [AC_TRY_X_RUN([#include <stdio.h>
2644 FILE *f = fopen("conftest-mt", "w");
2646 fprintf(f, "%d %d.%d\n", XmVersion,
2647 XmVERSION, XmREVISION);
2651 [mtv=`cat conftest-mt`
2652 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
2653 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
2654 [ac_cv_motif_version=unknown
2655 ac_cv_motif_version_string=unknown],
2656 [ac_cv_motif_version=unknown
2657 ac_cv_motif_version_string=unknown])])
2659 motif_version=$ac_cv_motif_version
2660 motif_version_string=$ac_cv_motif_version_string
2665 ###############################################################################
2667 # Checking whether Motif requires -lXpm.
2669 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
2670 # The deal is, Motif 2.x requires XPM -- but it's a compilation option
2671 # of the library whether to build the XPM code into libXm, or whether
2672 # to rely on an external libXm. So the only way to tell whether XPM is
2673 # a link-time requirement is to examine libXm.a, which is very
2674 # difficult to do in an autoconf script. So... if it's Motif 2.x, we
2675 # always link against XPM if the XPM lib exists (and this will be a
2676 # no-op if libXm happens to already have the XPM code in it.)
2678 ###############################################################################
2680 motif_requires_xpm=no
2681 if test "$have_motif" = yes ; then
2682 AC_MSG_CHECKING(whether Motif requires XPM)
2683 if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
2685 motif_requires_xpm=yes
2686 AC_MSG_RESULT(maybe)
2693 ###############################################################################
2695 # Checking whether Motif requires -lXp.
2697 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
2698 # Extension". Why this extension isn't in -lXext with all the others,
2701 ###############################################################################
2704 if test "$have_motif" = yes ; then
2706 AC_CHECK_X_LIB(Xp, XpQueryExtension,
2707 [have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"],
2708 [true], -lX11 -lXext -lm)
2712 ###############################################################################
2714 # Checking whether Motif requires -lXintl (for _Xsetlocale.)
2716 ###############################################################################
2719 if test "$have_motif" = yes ; then
2720 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
2722 if test "$have_xintl" = yes; then
2723 MOTIF_LIBS="$MOTIF_LIBS -lXintl"
2728 ###############################################################################
2730 # Check for -lGL or -lMesaGL.
2732 ###############################################################################
2736 with_gl_req=unspecified
2741 --with-gl Build those demos which depend on OpenGL.],
2742 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
2744 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
2746 ac_mesagl_version=unknown
2747 ac_mesagl_version_string=unknown
2749 if test "$with_gl" = yes; then
2750 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
2751 if test "$have_gl" = yes ; then
2752 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no,
2753 [#include <GL/gl.h>])
2756 # If we have the headers, try and figure out which vendor it's from.
2758 if test "$have_gl" = yes ; then
2760 # We need to know whether it's MesaGL so that we know which libraries
2763 AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl,
2764 [ac_cv_have_mesa_gl=no
2765 if test "$ac_macosx" = no; then
2766 # WTF! MacOS 10.5.0 ships the Mesa GL headers!
2767 # It's not really Mesa, is it?
2768 AC_EGREP_X_HEADER(Mesa|MESA, GL/glx.h, [ac_cv_have_mesa_gl=yes])
2770 ac_have_mesa_gl=$ac_cv_have_mesa_gl
2775 if test "$ac_macosx" = yes; then
2777 # Without these, every link against libGL gets a bunch of useless
2780 osx_crud="-bind_at_load -multiply_defined suppress"
2781 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2782 GL_LIBS="$GL_LIBS $osx_crud"
2785 # New lossage in 10.5.0: without this, we get:
2786 # ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
2788 osx_crud="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
2789 osx_crud="-Wl,-dylib_file,${osx_crud}:${osx_crud}"
2791 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2792 GL_LIBS="$GL_LIBS $osx_crud"
2797 # Some versions of MesaGL are compiled to require -lpthread.
2798 # So if the Mesa headers exist, and -lpthread exists, then always
2799 # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
2801 if test "$ac_have_mesa_gl" = yes; then
2802 AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],)
2806 # If we have Mesa headers, check to see if we can link against -lMesaGL.
2807 # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
2808 # Else, warn that GL is busted. (We have the headers, but no libs.)
2811 if test "$ac_have_mesa_gl" = yes ; then
2812 AC_CHECK_X_LIB(MesaGL, glXCreateContext,
2814 GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS"],
2815 [], -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2818 if test "$gl_lib_1" = "" ; then
2819 AC_CHECK_X_LIB(GL, glXCreateContext,
2821 GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS"],
2822 [], -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2825 if test "$gl_lib_1" = "" ; then
2826 # we have headers, but no libs -- bail.
2831 # linking works -- we can build the GL hacks.
2833 if test "$ac_have_mesa_gl" = yes ; then
2834 AC_DEFINE(HAVE_MESA_GL)
2840 # Now that we know we have GL headers and libs, do some more GL testing.
2843 if test "$have_gl" = yes ; then
2844 # If it's MesaGL, we'd like to issue a warning if the version number
2845 # is less than or equal to 2.6, because that version had a security bug.
2847 if test "$ac_have_mesa_gl" = yes; then
2849 AC_CACHE_CHECK([MesaGL version number], ac_cv_mesagl_version_string,
2850 [cat > conftest.$ac_ext <<EOF
2851 #line __oline__ "configure"
2852 #include "confdefs.h"
2854 #ifndef MESA_MAJOR_VERSION
2855 # include <GL/xmesa.h>
2856 # ifdef XMESA_MAJOR_VERSION
2857 /* Around Mesa 3.2, they took out the Mesa version number, so instead,
2858 we have to check the XMesa version number (the number of the X protocol
2859 support, which seems to be the same as the Mesa version number.)
2861 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
2862 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
2864 /* Oh great. Some time after 3.4, they took out the xmesa.h header file,
2865 so we have no way of telling what version of Mesa this is at all.
2866 So, we'll guess that the osmesa version (the "offscreen protocol")
2867 is less than or equal to the real mesa version number. Except that
2868 if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
2869 Mesa 3.4. And Mesa 3.3 had xmesa.h. What a complete load of shit!
2871 # include <GL/osmesa.h>
2872 # define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
2873 # define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
2874 # if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
2875 # undef MESA_MINOR_VERSION
2876 # define MESA_MINOR_VERSION 4 or newer, probably?
2880 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
2883 ac_save_CPPFLAGS="$CPPFLAGS"
2884 if test \! -z "$includedir" ; then
2885 CPPFLAGS="$CPPFLAGS -I$includedir"
2887 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2889 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | grep configure:`
2893 mglv=`echo "$mglv" | sed -n \
2894 's/^configure: *\([0-9][0-9]*\) *\([0-9].*\)$/\1.\2/p'`
2897 rm -f conftest.$ac_ext
2899 CPPFLAGS="$ac_save_CPPFLAGS"
2901 if test "$mglv" = ""; then
2902 ac_mesagl_version=unknown
2903 ac_mesagl_version_string=unknown
2905 ac_mesagl_version_string="$mglv"
2908 maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
2909 min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
2911 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
2912 if test -z "$ac_mesagl_version"; then
2913 ac_mesagl_version=unknown
2914 ac_mesagl_version_string=unknown
2917 ac_cv_mesagl_version=$ac_mesagl_version
2918 ac_cv_mesagl_version_string=$ac_mesagl_version_string
2920 ac_mesagl_version=$ac_cv_mesagl_version
2921 ac_mesagl_version_string=$ac_cv_mesagl_version_string
2925 # Check for OpenGL 1.1 features.
2927 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
2928 [true], $GL_LIBS -lX11 -lXext -lm)
2931 elif test "$with_gl" != no; then
2932 echo "error: must be yes or no: --with-gl=$with_gl"
2937 ###############################################################################
2941 ###############################################################################
2944 with_gle_req=unspecified
2947 [ --with-gle Build those demos which depend on GLE
2948 (the OpenGL "extrusion" library.)],
2949 [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes])
2951 HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE)
2955 if test "$have_gl" = no ; then
2957 elif test "$with_gle" = yes; then
2959 AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no,
2960 [#include <GL/gl.h>])
2961 if test "$have_gle3" = yes ; then
2964 AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no,
2965 [#include <GL/gl.h>])
2966 if test "$have_gle" = yes ; then
2967 AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no,
2968 [#include <GL/gl.h>])
2972 if test "$have_gle" = yes ; then
2975 AC_CHECK_X_LIB(gle, gleCreateGC,
2976 [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"],
2977 [], $GL_LIBS -lX11 -lXext -lm)
2979 if test "$have_gle" = yes ; then
2983 # sometimes the libmatrix stuff is included in libgle. look there first.
2985 # I don't get it. For some reason, this test passes on SGI, as if
2986 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
2987 # Yet the link is succeeding. Why???
2989 # AC_CHECK_X_LIB(gle, uview_direction_d,
2990 # [have_gle=yes; gle_halfassed=no],
2991 # [], $GL_LIBS -lX11 -lXext -lm)
2993 # As of GLE 3 this is in libgle, and has changed name to uview_direction!
2995 if test "$have_gle3" = yes ; then
2996 AC_CHECK_X_LIB(gle, uview_direction,
2997 [have_gle=yes; gle_halfassed=no],
2998 [], $GL_LIBS -lX11 -lXext -lm)
3000 # if it wasn't in libgle, then look in libmatrix.
3001 if test "$have_gle" = no ; then
3002 AC_CHECK_X_LIB(matrix, uview_direction_d,
3003 [have_gle=yes; gle_halfassed=no;
3004 GLE_LIBS="$GLE_LIBS -lmatrix"],
3005 [], $GL_LIBS -lX11 -lXext -lm)
3009 if test "$have_gle" = yes ; then
3011 if test "$have_gle3" = yes ; then
3012 AC_DEFINE(HAVE_GLE3)
3016 elif test "$with_gle" != no; then
3017 echo "error: must be yes or no: --with-gle=$with_gle"
3023 ###############################################################################
3025 # Check for -lgdk_pixbuf.
3026 # These tests are for gdk_pixbuf usage of the hacks,
3027 # not xscreensaver-demo (thus we have to test again to get
3028 # the libraries right: don't want to pull in all of GTK
3031 ###############################################################################
3034 with_gdk_pixbuf_req=unspecified
3036 [ --with-pixbuf Include support for the GDK-Pixbuf library in some
3037 demos, which will make it possible for them to read
3038 GIF, JPEG, and PNG files as well.],
3039 [with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"],
3040 [with_gdk_pixbuf=yes])
3042 # if --with-pixbuf=/directory/ was specified, remember that directory so that
3043 # we can also look for the `gdk-pixbuf-config' program in that directory.
3044 case "$with_gdk_pixbuf" in
3046 gdk_pixbuf_dir="$with_gdk_pixbuf"
3053 HANDLE_X_PATH_ARG(with_gdk_pixbuf, --with-pixbuf, GDK_PIXBUF)
3055 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
3056 echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
3060 if test "$with_gdk_pixbuf" = yes; then
3066 pkg_check_version gdk-pixbuf-2.0 2.0.0
3067 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
3068 have_gdk_pixbuf="$ok"
3070 if test "$have_gdk_pixbuf" = yes; then
3071 AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
3072 [ac_cv_gdk_pixbuf_config_cflags=`$pkg_config --cflags $pkgs`])
3073 AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
3074 [ac_cv_gdk_pixbuf_config_libs=`$pkg_config --libs $pkgs`])
3077 ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
3078 ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
3081 if test "$have_gdk_pixbuf" = yes; then
3083 # we appear to have pixbuf; check for headers/libs to be sure.
3085 ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
3086 CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
3090 # check for header A...
3091 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf.h, [have_gdk_pixbuf=yes])
3093 # if that worked, check for header B...
3094 if test "$have_gdk_pixbuf" = yes; then
3096 gdk_pixbuf_halfassed=yes
3097 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf-xlib.h,
3098 [have_gdk_pixbuf=yes
3099 gdk_pixbuf_halfassed=no])
3101 # yay, it has a new name in Gtk 2.x...
3102 if test "$have_gdk_pixbuf" = no; then
3104 gdk_pixbuf_halfassed=yes
3105 AC_CHECK_X_HEADER(gdk-pixbuf-xlib/gdk-pixbuf-xlib.h,
3106 [have_gdk_pixbuf=yes
3107 gdk_pixbuf_halfassed=no])
3110 CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
3113 if test "$have_gdk_pixbuf" = yes; then
3114 # we have the headers, now check for the libraries
3116 gdk_pixbuf_halfassed=yes
3118 AC_MSG_RESULT(checking for gdk_pixbuf usability...)
3121 AC_CHECK_X_LIB(c, gdk_pixbuf_new_from_file, [have_gdk_pixbuf=yes],,
3122 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3124 if test "$have_gdk_pixbuf" = yes; then
3126 AC_CHECK_X_LIB(c, gdk_pixbuf_xlib_init,
3127 [have_gdk_pixbuf=yes
3128 gdk_pixbuf_halfassed=no],,
3129 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3133 if test "$have_gdk_pixbuf" = yes; then
3134 INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
3135 XPM_LIBS="$ac_gdk_pixbuf_config_libs"
3136 AC_DEFINE(HAVE_GDK_PIXBUF)
3138 AC_MSG_RESULT(checking for gdk_pixbuf usability... no)
3141 if test "$have_gdk_pixbuf" = yes; then
3142 AC_CHECK_X_LIB(c, gdk_pixbuf_apply_embedded_orientation,
3143 [AC_DEFINE(HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION)],,
3144 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3149 ###############################################################################
3153 ###############################################################################
3156 with_xpm_req=unspecified
3158 [ --with-xpm Include support for XPM files in some demos.
3159 (Not needed if Pixbuf is used.)],
3160 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
3162 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
3164 if test "$with_xpm" = yes; then
3165 AC_CHECK_X_HEADER(X11/xpm.h,
3168 XPM_LIBS="-lXpm $XPM_LIBS"],,
3169 [#include <X11/Xlib.h>])
3170 elif test "$with_xpm" != no; then
3171 echo "error: must be yes or no: --with-xpm=$with_xpm"
3175 # See comment near $motif_requires_xpm, above.
3176 # Need to do this here, after both Motif and XPM have been checked for.
3178 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
3179 if test "$motif_requires_xpm" = yes ; then
3180 MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
3184 if test "$XPM_LIBS" = "" ; then
3189 ###############################################################################
3193 ###############################################################################
3196 with_jpeg_req=unspecified
3199 [ --with-jpeg Include support for the JPEG library.],
3200 [with_jpeg="$withval"; with_jpeg_req="$withval"],
3203 HANDLE_X_PATH_ARG(with_jpeg, --with-jpeg, JPEG)
3205 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
3206 echo "error: must be yes or no: --with-jpeg=$with_jpeg"
3210 if test "$with_jpeg" = yes; then
3213 AC_CHECK_X_HEADER(jpeglib.h, [have_jpeg=yes])
3215 if test "$have_jpeg" = yes; then
3216 # we have the header, now check for the library
3219 AC_CHECK_X_LIB(jpeg, jpeg_start_compress,
3223 AC_DEFINE(HAVE_JPEGLIB)])
3228 ###############################################################################
3230 # Check for pty support: this allows 'phosphor' and 'apple2'
3231 # to run curses-based programs, or be used as terminal windows.
3233 ###############################################################################
3236 AC_CHECK_HEADERS(pty.h util.h)
3237 AC_CHECK_X_LIB(util, forkpty,
3240 AC_DEFINE(HAVE_FORKPTY)])
3242 if test "$ac_have_forkpty" != yes ; then
3243 # we don't need (or have) -lutil on MacOS 10.4.2...
3244 AC_CHECK_X_LIB(c, forkpty,
3246 AC_DEFINE(HAVE_FORKPTY)])
3249 ###############################################################################
3251 # Check for the XSHM server extension.
3253 ###############################################################################
3256 with_xshm_req=unspecified
3257 AC_ARG_WITH(xshm-ext,
3258 [ --with-xshm-ext Include support for the Shared Memory extension.],
3259 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
3261 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
3263 if test "$with_xshm" = yes; then
3265 # first check for Xshm.h.
3266 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes],,
3267 [#include <X11/Xlib.h>])
3269 # if that succeeded, then check for sys/ipc.h.
3270 if test "$have_xshm" = yes; then
3272 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
3275 # if that succeeded, then check for sys/shm.h.
3276 if test "$have_xshm" = yes; then
3278 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
3281 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
3282 # to exist, but the library code to not exist. And even better, the library
3283 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
3284 # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
3285 # that's not quite right, but close enough.)
3289 if [ `uname -v` -eq 3 ]; then
3291 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
3292 [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
3293 [true], -lX11 -lXext -lm)
3298 # if that succeeded, then we've really got it.
3299 if test "$have_xshm" = yes; then
3300 AC_DEFINE(HAVE_XSHM_EXTENSION)
3303 elif test "$with_xshm" != no; then
3304 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
3309 ###############################################################################
3311 # Check for the DOUBLE-BUFFER server extension.
3313 ###############################################################################
3316 with_xdbe_req=unspecified
3317 AC_ARG_WITH(xdbe-ext,
3318 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER extension.],
3319 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
3321 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
3323 if test "$with_xdbe" = yes; then
3325 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes],,
3326 [#include <X11/Xlib.h>])
3327 if test "$have_xdbe" = yes; then
3328 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
3331 elif test "$with_xdbe" != no; then
3332 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
3337 ###############################################################################
3339 # Check for the SGI XReadDisplay server extension.
3341 # Note: this has to be down here, rather than up with the other server
3342 # extension tests, so that the output of `configure --help' is in the
3343 # right order. Arrgh!
3345 ###############################################################################
3348 with_readdisplay_req=unspecified
3349 AC_ARG_WITH(readdisplay,
3350 [ --with-readdisplay Include support for the XReadDisplay extension.],
3351 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
3352 [with_readdisplay=yes])
3354 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
3356 if test "$with_readdisplay" = yes; then
3357 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
3358 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION),,
3359 [#include <X11/Xlib.h>])
3360 elif test "$with_readdisplay" != no; then
3361 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
3366 ###############################################################################
3368 # Check for a directory full of images to use as the default value
3369 # of the "imageDirectory" preference.
3371 ###############################################################################
3374 with_imagedir_req=unspecified
3376 AC_ARG_WITH(image-directory,
3377 [ --with-image-directory=DIR By default, some demos may display random images
3378 from this directory.],
3379 [with_imagedir="$withval"; with_imagedir_req="$withval"],
3380 [with_imagedir=yes])
3381 # no HANDLE_X_PATH_ARG for this one
3383 case "$with_imagedir" in
3386 AC_MSG_CHECKING([for image directory $with_imagedir])
3387 if test -d "$with_imagedir" ; then
3397 #### Could use some more defaults here...
3399 "/usr/share/backgrounds/images/" \
3400 "/usr/share/wallpapers/" \
3401 "/Library/Desktop Pictures/" \
3403 if test -z "$with_imagedir"; then
3404 AC_MSG_CHECKING([for image directory $dd])
3405 if test -d "$dd" ; then
3420 echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req"
3424 ac_cv_imagedir="$with_imagedir"
3426 DEFAULT_IMAGES_P='True'
3427 DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir"
3429 if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then
3430 DEFAULT_IMAGES_P='False'
3434 ###############################################################################
3436 # Pick a text file to use as the default of the "textFile" preference.
3437 # Any old file will do, but preferably one that will make interesting
3438 # shapes when displayed by "starwars" and "fontglide".
3440 ###############################################################################
3443 with_textfile_req=unspecified
3445 AC_ARG_WITH(text-file,
3446 [ --with-text-file=FILE By default, some demos may display this file.],
3447 [with_textfile="$withval"; with_textfile_req="$withval"],
3448 [with_textfile=yes])
3449 # no HANDLE_X_PATH_ARG for this one
3451 case "$with_textfile" in
3454 AC_MSG_CHECKING([for text file $with_textfile])
3455 if test -f "$with_textfile" ; then
3465 #### Could use some more defaults here...
3467 "/usr/X11R6/lib/X11/doc/README" \
3468 "/usr/share/doc/xserver-common/copyright" \
3469 "/usr/share/doc/xserver-xorg-core/copyright" \
3470 "/usr/X11R6/README" \
3471 "/usr/share/doc/debian/debian-manifesto" \
3473 if test -z "$with_textfile"; then
3474 AC_MSG_CHECKING([for text file $f])
3475 if test -f "$f" ; then
3490 echo "error: must be an absolute path: --with-text-file=$with_textfile_req"
3494 ac_cv_textfile="$with_textfile"
3496 DEFAULT_TEXT_FILE="$ac_cv_textfile"
3499 ###############################################################################
3501 # Check the browser to see help URL
3503 ###############################################################################
3506 with_browser_req=unspecified
3508 AC_ARG_WITH(browser,
3509 [ --with-browser=BROWSER Specify the browser to show help URL.],
3510 [with_browser="$withval"; with_browser_req="$withval"],
3512 # no HANDLE_X_PATH_ARG for this one
3514 case "$with_browser" in
3518 WITH_BROWSER=$with_browser
3519 gnome_open_program=$with_browser
3520 AC_MSG_CHECKING([for browser $with_browser])
3521 with_browser_fullpath=`which $with_browser 2>/dev/null`
3522 case $with_browser_fullpath in
3529 # Only warning: we don't want to install all packages for the
3530 # dependency of the browser in building stage...
3531 echo "WARNING: browser not found: --with-browser=$with_browser"
3536 ac_cv_browser="$with_browser"
3538 ###############################################################################
3540 # Check whether it's ok to install some hacks as setuid (e.g., "sonar")
3541 # This should be safe, but let's give people the option.
3543 ###############################################################################
3545 setuid_hacks_default=no
3546 setuid_hacks="$setuid_hacks_default"
3547 AC_ARG_WITH(setuid-hacks,
3548 [ --with-setuid-hacks Allow some demos to be installed `setuid root'
3549 (which is needed in order to ping other hosts.)
3551 [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"])
3553 HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks)
3555 if test "$setuid_hacks" = yes; then
3557 elif test "$setuid_hacks" != no; then
3558 echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
3563 ###############################################################################
3565 # Done testing. Now, set up the various -I and -L variables,
3566 # and decide which GUI program to build by default.
3568 ###############################################################################
3575 if test \! -z "$includedir" ; then
3576 INCLUDES="$INCLUDES -I$includedir"
3579 if test \! -z "$libdir" ; then
3580 LDFLAGS="$LDFLAGS -L$libdir"
3584 PREFERRED_DEMO_PROGRAM=''
3586 if test "$have_motif" = yes; then
3587 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
3588 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3590 if test "$have_gtk" = yes; then
3591 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
3592 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3596 if test "$have_kerberos" = yes; then
3597 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
3598 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
3600 if test "$have_pam" = yes; then
3601 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
3602 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
3603 INSTALL_PAM="install-pam"
3605 if test "$have_passwd_helper" = yes; then
3606 PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
3607 PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
3609 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
3610 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
3613 if test "$enable_locking" = yes; then
3614 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
3615 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
3617 LOCK_SRCS='$(NOLOCK_SRCS_1)'
3618 LOCK_OBJS='$(NOLOCK_OBJS_1)'
3621 if test "$ac_macosx" = yes; then
3622 EXES_OSX='$(EXES_OSX)'
3623 SCRIPTS_OSX='$(SCRIPTS_OSX)'
3624 MEN_OSX='$(MEN_OSX)'
3632 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
3634 if test "$need_setuid" = yes; then
3640 if test "$setuid_hacks" = yes; then
3647 if test "$have_gl" = yes; then
3648 GL_EXES='$(GL_EXES)'
3649 SUID_EXES='$(SUID_EXES)'
3650 RETIRED_GL_EXES='$(RETIRED_GL_EXES)'
3651 GL_UTIL_EXES='$(GL_UTIL_EXES)'
3658 if test "$have_gle" = yes; then
3659 GLE_EXES='$(GLE_EXES)'
3665 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
3666 JPEG_EXES='$(JPEG_EXES)'
3670 # Another substitution in the XScreenSaver.ad.in file:
3672 if test "$gnome_open_program" != ''; then
3676 elif test "$gnome_url_show_program" != ''; then
3687 # Set PO_DATADIR to something sensible.
3689 AC_MSG_CHECKING([for locale directory])
3690 if test -n "$GTK_DATADIR" ; then
3691 PO_DATADIR="$GTK_DATADIR"
3692 elif test "$have_gtk" = yes; then
3693 PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
3694 PO_DATADIR="$PO_DATADIR/share"
3697 if test -z "$PO_DATADIR" ; then
3699 # #### Total fucking kludge --
3700 # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
3701 # but of course we need to expand all the nested variables to do that...
3703 dd=`eval eval eval eval eval eval eval eval eval eval eval echo $datadir`
3704 PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'`
3707 AC_MSG_RESULT($PO_DATADIR/locale)
3710 # canonicalize slashes.
3711 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
3713 # gcc 3.0 likes to issue this warning for every file:
3715 # cc1: warning: changing search order for system directory "/usr/local/include"
3716 # cc1: warning: as it has already been specified as a non-system directory
3718 # Yay. We can only avoid that by deleting "-I${prefix}/include" from the list.
3719 # Which *should* be totally redundant, and thus an ok thing to delete?
3721 INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
3724 ###############################################################################
3726 # Perform substitutions and write Makefiles.
3728 ###############################################################################
3732 AC_SUBST(PREFERRED_DEMO_PROGRAM)
3733 AC_SUBST(ALL_DEMO_PROGRAMS)
3734 AC_SUBST(SAVER_LIBS)
3735 AC_SUBST(MOTIF_LIBS)
3745 AC_SUBST(XDPMS_LIBS)
3746 AC_SUBST(XINERAMA_LIBS)
3747 AC_SUBST(PASSWD_LIBS)
3748 AC_SUBST(INSTALL_SETUID)
3749 AC_SUBST(SETUID_HACKS)
3750 AC_SUBST(INSTALL_DIRS)
3751 AC_SUBST(NEED_SETUID)
3752 AC_SUBST(INSTALL_PAM)
3753 AC_SUBST(HAVE_PAM_FAIL_DELAY)
3754 AC_SUBST(NEW_LOGIN_COMMAND)
3755 AC_SUBST(NEW_LOGIN_COMMAND_P)
3756 AC_SUBST(DEFAULT_IMAGES_P)
3757 AC_SUBST(DEFAULT_IMAGE_DIRECTORY)
3758 AC_SUBST(DEFAULT_TEXT_FILE)
3759 AC_SUBST(WITH_BROWSER)
3763 AC_SUBST(SCRIPTS_OSX)
3766 AC_SUBST(PASSWD_SRCS)
3767 AC_SUBST(PASSWD_OBJS)
3771 AC_SUBST(SAVER_GL_SRCS)
3772 AC_SUBST(SAVER_GL_OBJS)
3773 AC_SUBST(SAVER_GL_LIBS)
3778 AC_SUBST(RETIRED_GL_EXES)
3780 AC_SUBST(GL_UTIL_EXES)
3784 AC_SUBST(GLE_KLUDGE)
3789 AC_SUBST(HACKDIR_FULL)
3790 AC_SUBST(GTK_DATADIR)
3791 AC_SUBST(PO_DATADIR)
3792 AC_SUBST(HACK_CONF_DIR)
3793 AC_SUBST(GTK_EXTRA_OBJS)
3795 APPDEFAULTS=$ac_x_app_defaults
3796 AC_SUBST(APPDEFAULTS)
3799 AC_SUBST(DEPEND_FLAGS)
3800 AC_SUBST(DEPEND_DEFINES)
3809 driver/XScreenSaver.ad)
3811 ###############################################################################
3813 # Print some warnings at the end.
3815 ###############################################################################
3817 warn_prefix_1=" Warning:"
3818 warn_prefix_2=" Note:"
3819 warn_prefix="$warn_prefix_1"
3822 warnsep=' #################################################################'
3825 if test "$warning" = no ; then
3826 echo '' ; echo "$warnsep" ; echo ''
3833 if test "$warning" = long ; then echo '' ; fi
3836 echo "$warn_prefix $rest"
3843 if test "$was" != no ; then echo '' ; fi
3845 echo "$warn_prefix $rest"
3855 warn_prefix="$warn_prefix_2"
3857 warn_prefix="$warn_prefix_1"
3861 warn_prefix="$warn_prefix_2"
3863 warn_prefix="$warn_prefix_1"
3867 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
3868 warn 'The SGI saver extension was requested, but was not found.'
3871 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
3872 warn 'The XIdle extension was requested, but was not found.'
3875 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
3876 warn 'The XSHM extension was requested, but was not found.'
3879 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
3880 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
3883 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
3884 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
3887 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
3888 warn 'The DPMS extension was requested, but was not found.'
3891 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
3892 warn 'The Xinerama extension was requested, but was not found.'
3895 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
3896 warn 'The XF86VMODE extension was requested, but was not found.'
3899 if test "$with_randr_req" = yes -a "$have_randr" = no ; then
3900 warn 'The RANDR extension was requested, but was not found.'
3903 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
3904 warn "Checking of /proc/interrupts was requested, but it's bogus."
3907 if test "$pkg_config" = false ; then
3908 warnL 'The "pkg-config" program was not found. Without that,'
3909 warn2 "detection of the various GTK libraries won't work."
3911 pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
3912 if test "x$pkgerr" != "x" ; then
3913 warnL 'The "pkg-config" program produces errors. This often causes'
3914 warn2 "detection of the various GTK libraries to malfunction."
3915 warn2 "The errors are:"
3917 echo "$pkgerr" | sed 's/^/ > /g'
3921 if test "$gtk_halfassed" != no ; then
3922 warnL "GTK version $gtk_halfassed was found, but at least one supporting"
3923 warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used."
3924 warn2 "Perhaps some of the development packages are not installed?"
3925 if test "$have_gtk" = yes ; then
3926 v="$ac_gtk_version_string"
3927 warn2 "GTK $v is also installed, so it will be used instead."
3928 warn2 "Please read the above output and the \`config.log' file"
3929 warn2 "for more details."
3934 warn2 'Though the Motif front-end to xscreensaver is still'
3935 warn2 'maintained, it is no longer being updated with new'
3936 warn2 'features: all new development on the xscreensaver-demo'
3937 warn2 'program is happening in the GTK version, and not in the'
3938 warn2 'Motif version. It is recommended that you build against'
3939 warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
3942 if test "$have_motif" = no -a "$have_gtk" = no; then
3944 if test "$with_motif" = yes; then
3945 warnL "Neither the GTK nor Motif libraries were found; the"
3946 warn2 "\`xscreensaver-demo' program requires one of these."
3950 warnL "The GTK libraries do not seem to be available; the"
3951 warn2 "\`xscreensaver-demo' program requires them."
3953 # warn2 'You can use Motif or Lesstif instead of GTK (use the'
3954 # warn2 "\`--with-motif' option) but that is NOT recommended."
3958 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
3959 warnL "Use of Motif was requested, but it wasn't found;"
3960 warn2 "Gtk will be used instead."
3962 elif test "$jurassic_gtk" = yes ; then
3966 v="$ac_gtk_version_string"
3967 if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
3968 warnL "Use of Gtk was requested, but its version number is unknown;"
3969 elif test "$with_gtk_req" = yes ; then
3970 warnL "Use of Gtk was requested, but it is version $v;"
3972 warnL "Gtk was found on this system, but it is version $v;"
3975 warn2 "Gtk $pref_gtk or newer is required."
3977 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
3978 warnL "Use of Gtk was requested, but it wasn't found."
3982 if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then
3983 warn "GTK is being used, but the GDK-Pixbuf library and/or"
3984 warn2 "headers were not found. That can't be good. Please"
3985 warn2 "install the GDK-Pixbuf development kit and re-configure."
3988 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
3990 preferred_lesstif=0.92
3992 if test "$lesstif_version" = unknown; then
3993 warnL "Unable to determine the LessTif version number!"
3994 warn2 "Make sure you are using version $preferred_lesstif or newer."
3995 warn2 "See <http://www.lesstif.org/>."
3997 elif test \! $lesstif_version -gt 82; then
3998 warnL "LessTif version $lesstif_version_string is being used."
3999 warn2 "LessTif versions 0.82 and earlier are too buggy to"
4000 warn2 "use with XScreenSaver; it is strongly recommended"
4001 warn2 "that you upgrade to at least version $preferred_lesstif!"
4002 warn2 "See <http://www.lesstif.org/>."
4007 if test "$have_motif" = yes -a "$have_gtk" = no ; then
4008 warn 'Motif is being used, and GTK is not.'
4014 if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
4015 warnL 'Use of XPM was requested, but it was not found.'
4018 if test "$with_gdk_pixbuf_req" = yes -a "$have_gdk_pixbuf" = no; then
4019 warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
4022 if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \
4023 test "$have_gdk_pixbuf" = no -a "$have_xpm" = no ; then
4025 if test "$with_gdk_pixbuf_req" = yes ; then
4027 elif test "$with_gdk_pixbuf_req" = no ; then
4028 warnL 'The GDK-Pixbuf library is not being used.'
4030 warnL 'The GDK-Pixbuf library was not found.'
4033 if test "$with_xpm_req" = yes -o "$have_xpm" = yes ; then
4035 elif test "$with_xpm_req" = no ; then
4036 warnL 'The XPM library is not being used.'
4038 warnL 'The XPM library was not found.'
4041 if test "$have_gdk_pixbuf" = no -a "$have_xpm" = yes ; then
4042 warn2 'The XPM library is being used instead.'
4045 if test "$gdk_pixbuf_halfassed" = yes ; then
4047 warn2 'More specifically, we found the headers, but not the'
4048 warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
4049 warn2 "system, or something else went wrong. The \`config.log'"
4050 warn2 'file might contain some clues.'
4054 warn2 'Some of the demos will not use images as much as they could.'
4055 warn2 'You should consider installing GDK-Pixbuf and re-running'
4056 warn2 'configure. (GDK-Pixbuf is recommended over XPM, as it'
4057 warn2 'provides support for more image formats.)'
4061 if test "$have_jpeg" = no ; then
4062 if test "$with_jpeg_req" = yes ; then
4063 warnL 'Use of libjpeg was requested, but it was not found.'
4064 elif test "$with_jpeg_req" = no ; then
4065 noteL 'The JPEG library is not being used.'
4067 noteL 'The JPEG library was not found.'
4070 if test "$jpeg_halfassed" = yes ; then
4072 warn2 'More specifically, we found the headers, but not the'
4073 warn2 'library; so either JPEG is half-installed on this'
4074 warn2 "system, or something else went wrong. The \`config.log'"
4075 warn2 'file might contain some clues.'
4079 if test "$have_gdk_pixbuf" = no ; then
4080 warn2 "This means that it won't be possible for the image-manipulating"
4081 warn2 "display modes to load files from disk; and it also means that"
4082 warn2 "the \`webcollage' program will be much slower."
4084 warn2 "This means the \`webcollage' program will be much slower."
4089 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
4090 preferred_mesagl=3.4
4091 mgv="$ac_mesagl_version_string"
4092 pgl="$preferred_mesagl"
4094 if test "$ac_mesagl_version" = unknown; then
4096 # warnL "Unable to determine the MesaGL version number!"
4097 # warn2 "Make sure you are using version $preferred_mesagl or newer."
4099 elif test \! "$ac_mesagl_version" -gt 2006; then
4100 warnL "MesaGL version number is $mgv --"
4101 warn2 "MesaGL 2.6 and earlier have a security bug. It is strongly"
4102 warn2 "recommended that you upgrade to at least version $preferred_mesagl."
4104 elif test \! "$ac_mesagl_version" -gt 3003; then
4105 warnL "MesaGL version number is $mgv --"
4106 warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
4107 warn2 "that you upgrade to $pgl or newer."
4111 if test "$have_gl" = no ; then
4112 if test "$with_gl_req" = yes ; then
4113 warnL 'Use of GL was requested, but it was not found.'
4114 elif test "$with_gl_req" = no ; then
4115 noteL 'The OpenGL 3D library is not being used.'
4117 noteL 'The OpenGL 3D library was not found.'
4120 if test "$gl_halfassed" = yes ; then
4122 warn2 'More specifically, we found the headers, but not the'
4123 warn2 'libraries; so either GL is half-installed on this'
4124 warn2 "system, or something else went wrong. The \`config.log'"
4125 warn2 'file might contain some clues.'
4129 warn2 'Those demos which use 3D will not be built or installed.'
4130 warn2 'You might want to consider installing OpenGL and'
4131 warn2 "re-running configure. If your vendor doesn't ship"
4132 warn2 'their own implementation of OpenGL, you can get a free'
4133 warn2 'version at <http://www.mesa3d.org/>. For general OpenGL'
4134 warn2 'info, see <http://www.opengl.org/>.'
4139 if test "$have_gl" = yes -a "$have_gle" = no ; then
4141 # nobody cares about this; don't print the warning unless it was
4142 # requested and not found, or halfway-found.
4143 if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
4145 if test "$with_gle_req" = yes ; then
4146 noteL 'Use of the GLE (GL Extrusion) library was requested, but'
4147 warn2 'it was not found (though the OpenGL library was found, and'
4148 warn2 'is being used.)'
4149 elif test "$with_gle_req" = no ; then
4150 noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
4151 warn2 'library is not.'
4153 noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
4157 if test "$gle_halfassed" = yes ; then
4159 warn2 'More specifically, we found the headers, but not the'
4160 warn2 'libraries; so either GLE is half-installed on this'
4161 warn2 "system, or something else went wrong. The \`config.log'"
4162 warn2 'file might contain some clues.'
4166 warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
4167 warn2 'will not be built or installed. You might want to consider'
4168 warn2 'installing GLE and re-running configure. You can find the'
4169 warn2 'GLE library at <http://www.linas.org/gle/>. For general'
4170 warn2 'OpenGL info, see <http://www.opengl.org/>.'
4176 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
4177 warn 'Use of XReadDisplay was requested, but it was not found.'
4180 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
4181 warn 'Use of Kerberos was requested, but it was not found.'
4184 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
4185 warn 'Use of PAM was requested, but it was not found.'
4188 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
4189 warn 'Use of shadow passwords was requested, but they were not found.'
4192 if test "$ac_macosx" = yes ; then
4193 if test "$enable_locking" = yes ; then
4194 warn "You have specified --enable-locking on MacOS X."
4195 warn2 "THIS DOES NOT WORK! Don't do this!"
4200 # You are in a twisty maze of namespaces and syntaxes, all alike.
4201 # Fuck the skull of Unix.
4203 bindir=`eval eval eval eval eval eval eval echo $bindir`
4204 HACKDIR=`eval eval eval eval eval eval eval echo $HACKDIR`
4205 HACK_CONF_DIR=`eval eval eval eval eval eval eval echo $HACK_CONF_DIR`
4207 # canonicalize slashes.
4208 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
4209 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
4210 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
4213 # Sanity check the hackdir
4214 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
4215 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
4217 AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
4218 There will be an executable installed with that name, so
4219 that can't be the name of a directory as well. Please
4220 re-configure with a different directory name.])
4227 # Now let's warn if there's a previous RPM version already installed.
4228 # But don't bother with this test if we are currently *building* an RPM.
4230 if test -z "$RPM_PACKAGE_VERSION" ; then
4232 rpmnames="xscreensaver xscreensaver-base xscreensaver-extras"
4236 rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \
4237 sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \
4241 if test \! -z "$rpmv" ; then
4242 rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
4243 rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
4246 warnL "There is already an installed RPM of xscreensaver $rpmv"
4247 warn2 'on this system. You might want to remove it ("rpm -ve")'
4248 warn2 'before running "make install" in this directory.'
4250 warn2 "Alternately, you could build this version of xscreensaver"
4251 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
4252 warn2 'file is included. Try "rpmbuild -v -ba xscreensaver.spec".'
4253 warn2 "See the RPM documentation for more info."
4256 if test "$rpmbdir" = "$rpmhdir" ; then
4257 warn2 "The RPM version was installed in $rpmbdir/."
4260 warn2 "The RPM version was installed in $rpmbdir/,"
4261 warn2 "with demos in $rpmhdir/."
4266 # Also warn if there's a Debian package installed.
4268 debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
4270 for dpkg in $debnames ; do
4271 if test -z "$debv"; then
4272 debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
4276 if test \! -z "$debv" ; then
4277 debbdir=`dpkg -L $debnames 2>/dev/null | \
4278 sed -n 's@^\(.*/bin/\)xscreensaver$@\1@p'`
4279 debhdir=`dpkg -L $debnames 2>/dev/null | \
4280 sed -n 's@^\(.*/\)popsquares$@\1@p'`
4281 if test -z "$debbdir" ; then debbdir='???'; fi
4282 if test -z "$debhdir" ; then debhdir='???'; fi
4285 warnL "There is already an installed dpkg of xscreensaver"
4286 warn2 "version \"$debv\" on this system."
4288 warn2 "The dpkg was installed in $debbdir,"
4289 warn2 "with demos in $debhdir."
4293 if test "${bindir}" = "${HACKDIR}" ; then
4297 if test "$do_dir_warning" = yes; then
4301 echo ' When you run "make install", the "xscreensaver",'
4302 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
4303 echo " will be installed in ${bindir}/."
4305 echo " The various graphics demos (190+ different executables) will"
4306 echo " be installed in ${HACKDIR}/."
4308 echo " If you would prefer the demos to be installed elsewhere,"
4309 echo " you should re-run configure with the --with-hackdir=DIR"
4310 echo " option. For more information, run \`./configure --help'."
4314 if test "$warning" != no; then
4315 echo '' ; echo "$warnsep" ; echo ''
4318 if test "$do_dir_warning" = no; then
4319 if test "$warning" = no; then
4322 echo "User programs will be installed in ${bindir}/"
4323 echo "Screen savers will be installed in ${HACKDIR}/"
4324 echo "Configuration dialogs will be installed in ${HACK_CONF_DIR}/"
4325 echo "System-wide default settings will be installed in ${APPDEFAULTS}/"