1 # configure.in --- xscreensaver, Copyright (c) 1997-2014 Jamie Zawinski.
5 AC_INIT(driver/subprocs.c)
6 AC_CONFIG_HEADERS([config.h])
8 echo "current directory: `pwd`"
9 echo "command line was: $0 $@"
11 ###############################################################################
15 ###############################################################################
18 /* config.h.in --- xscreensaver, Copyright (c) 1991-2014 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 # This only ever existed in X11R4 and X11R5.
41 #AH_TEMPLATE([HAVE_XIDLE_EXTENSION],
42 # [Define this if you have the XIDLE extension installed. If you
43 # have the XIDLE extension, this is recommended. (You have this
44 # extension if the file /usr/include/X11/extensions/xidle.h
45 # exists.) Turning on this flag lets XScreenSaver work better with
46 # servers which support this extension; but it will still work
47 # with servers which do not suport it, so it's a good idea to
48 # compile in support for it if you can.])
50 # Using this extension will crash your X server and make fading not work.
51 #AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION],
52 # [Define this if you have the MIT-SCREEN-SAVER extension
53 # installed. See the caveats about this extension, above.
54 # (It's available if /usr/include/X11/extensions/scrnsaver.h
57 # This only ever existed on SGI hardware.
58 #AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION],
59 # [Define this if you have the SGI SCREEN_SAVER extension. This is
60 # standard on Irix systems, and not available elsewhere.])
62 # This only ever existed on SGI hardware.
63 #AH_TEMPLATE([HAVE_SGI_VC_EXTENSION],
64 # [Define this if you have the SGI-VIDEO-CONTROL extension. This
65 # is standard on Irix systems, and not available elsewhere.])
67 AH_TEMPLATE([HAVE_DPMS_EXTENSION],
68 [Define this if you have the XDPMS extension. This is standard
69 on sufficiently-recent XFree86 systems, and possibly elsewhere.
70 (It's available if the file /usr/include/X11/extensions/dpms.h
73 AH_TEMPLATE([HAVE_XF86VMODE],
74 [Define this if you have the functions XF86VidModeGetModeLine()
75 and XF86VidModeGetViewPort(), in support of virtual desktops
76 where the X server's root window is bigger than the actual
77 screen. This is an XFree86 thing, and probably doesn't exist
78 elsewhere. (It's available if the file
79 /usr/include/X11/extensions/xf86vmode.h exists.)])
81 AH_TEMPLATE([HAVE_XF86VMODE_GAMMA],
82 [Define this if you have the functions XF86VidModeGetGamma() and
83 XF86VidModeSetGamma(), which allow clients to change the gamma
84 response of the monitor. This is an XFree86 4.0.x thing, and
85 probably doesn't exist elsewhere. (It's available if the file
86 /usr/include/X11/extensions/xf86vmode.h exists and has stuff about
89 AH_TEMPLATE([HAVE_XF86VMODE_GAMMA_RAMP],
90 [Define this if you have the functions XF86VidModeGetGammaRamp()
91 and XF86VidModeSetGammaRamp(), which provide finer-grained
92 control than XF86VidMode[GS]etGamma(). These appeared in
95 AH_TEMPLATE([HAVE_XINERAMA],
96 [Define this if you have the Xinerama extension. This is
97 standard on sufficiently-recent XFree86 systems, and possibly
98 elsewhere. (It's available if the file
99 /usr/include/X11/extensions/Xinerama.h exists.)])
101 AH_TEMPLATE([HAVE_XINPUT],
102 [Define this if you have the Xinput extension. This is
103 standard since X11R5, and is thus almost everywhere.
104 (It's available if the file /usr/include/X11/extensions/XInput.h
107 AH_TEMPLATE([HAVE_XF86MISCSETGRABKEYSSTATE],
108 [Define this if you have the XF86MiscSetGrabKeysState function
109 (which allows the Ctrl-Alt-KP_star and Ctrl-Alt-KP_slash key
110 sequences to be temporarily disabled. Sadly, it doesn't affect
111 Ctrl-Alt-BS or Ctrl-Alt-F1.)])
113 AH_TEMPLATE([HAVE_RANDR],
114 [Define this if you have the Resize and Rotate extension.
115 This is standard on sufficiently-recent XFree86 systems, and
116 possibly elsewhere. (It's available if the file
117 /usr/include/X11/extensions/Xrandr.h exists.)])
119 AH_TEMPLATE([HAVE_RANDR_12],
120 [Define this if the RANDR library is version 1.2 or newer.])
122 AH_TEMPLATE([HAVE_PROC_INTERRUPTS],
123 [Define this if you have a Linux-like /proc/interrupts file which
124 can be examined to determine when keyboard activity has
127 AH_TEMPLATE([HAVE_MOTIF],[Define this if you have Motif.])
129 AH_TEMPLATE([HAVE_XMCOMBOBOX],
130 [Define this if you have the XmComboBox Motif widget (Motif 2.0.)])
132 AH_TEMPLATE([HAVE_GTK],[Define this if you have Gtk (any version.)])
133 AH_TEMPLATE([HAVE_GTK2],[Define this if you have Gtk 2.x.])
135 AH_TEMPLATE([HAVE_CRAPPLET],
136 [Define this if you have Gnome and want to build support for the
137 xscreensaver control panel in the Gnome Control Center
138 (gnomecc). (This is needed only with Gtk 1.x.)])
140 AH_TEMPLATE([HAVE_CRAPPLET_IMMEDIATE],
141 [Define this if HAVE_CRAPPLET is defined, and the function
142 capplet_widget_changes_are_immediate() is available.])
144 AH_TEMPLATE([HAVE_XML],[Define this if you have the XML library.])
146 AH_TEMPLATE([HAVE_OLD_XML_HEADERS],
147 [Define this if you have the XML library headers in their old,
148 non-namespaced location (you lack the gnome-xml/libxml symlink)])
150 AH_TEMPLATE([HAVE_XPM],
151 [Define this if you have the XPM library installed. Some of the
152 demos can make use of this if it is available.])
154 AH_TEMPLATE([HAVE_GDK_PIXBUF],
155 [Define this if you have the GDK_Pixbuf library installed. Some
156 of the demos can make use of this if it is available.])
158 AH_TEMPLATE([HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION],
159 [Define this if you have the gdk_pixbuf_apply_embedded_orientation
160 function (gdk-pixbuf 2.12).])
162 AH_TEMPLATE([HAVE_JPEGLIB],
163 [Define this if you have the Independent JPEG Group's JPEG
164 library installed. Some of the demos can make use of this if it
167 AH_TEMPLATE([HAVE_XMU],
168 [Define this if you have the Xmu library. This is standard part
169 of X, and if your vendor doesn't ship it, you should report that
172 AH_TEMPLATE([HAVE_XUTF8DRAWSTRING],
173 [Define this if you have the function Xutf8DrawString().])
175 AH_TEMPLATE([HAVE_XFT],
176 [Define this if you have libXft2.])
178 AH_TEMPLATE([HAVE_GL],
179 [Define this if you have OpenGL. Some of the demos require it,
180 so if you don't have it, then those particular demos won't be
181 built. (This won't affect the screen saver as a whole.)])
183 AH_TEMPLATE([HAVE_MESA_GL],
184 [Define this if you have OpenGL, but it's the MesaGL variant.
185 (The libraries have different names.) (HAVE_GL should be defined
188 AH_TEMPLATE([HAVE_GLBINDTEXTURE],
189 [Define this if your version of OpenGL has the glBindTexture()
190 routine. This is the case for OpenGL 1.1, but not for OpenGL
193 AH_TEMPLATE([HAVE_GLE],
194 [Define this if you have the -lgle and -lmatrix libraries (GL
197 AH_TEMPLATE([HAVE_GLE3],[Define this if you have the -lgle from GLE version 3])
199 AH_TEMPLATE([HAVE_JWZGLES],[Define this to target the OpenGL ES 1.x API
200 instead of OpenGL 1.3.])
202 AH_TEMPLATE([HAVE_XSHM_EXTENSION],
203 [Define this if you have the X Shared Memory Extension.])
205 AH_TEMPLATE([HAVE_DOUBLE_BUFFER_EXTENSION],
206 [Define this if you have the X Double Buffer Extension.])
208 AH_TEMPLATE([FORTUNE_PROGRAM],
209 [Some screenhacks like to run an external program to generate
210 random pieces of text; set this to the one you like. Note that
211 this is just the default; X resources can be used to override
214 AH_TEMPLATE([PASSWD_HELPER_PROGRAM],
215 [Set the name of the password helper program, if any])
217 AH_TEMPLATE([NO_LOCKING],
218 [Define this to remove the option of locking the screen at all.])
220 AH_TEMPLATE([ALLOW_ROOT_PASSWD],
221 [Define this to allow the root password to unlock the screen.])
223 AH_TEMPLATE([HAVE_KERBEROS],
224 [Define this if you want to use Kerberos authentication to
225 lock/unlock the screen instead of your local password. This
226 currently uses Kerberos V4, but a V5 server with V4
227 compatibility will work. WARNING: DO NOT USE AFS string-to-key
228 passwords with this option. This option currently *only* works
229 with standard Kerberos des_string_to_key. If your password is
230 an AFS password and not a kerberos password, it will not
231 authenticate properly. See the comments in driver/kpasswd.c for
232 more information if you need it.])
234 AH_TEMPLATE([HAVE_KERBEROS5],
235 [Define this if you have Kerberos 5, meaning we need to use the
236 Kerberos 4 compatibility layer.])
238 AH_TEMPLATE([HAVE_PAM],
239 [Define this if you want to use PAM (Pluggable Authentication
240 Modules) to lock/unlock the screen, instead of standard
241 /etc/passwd authentication.])
243 AH_TEMPLATE([PAM_SERVICE_NAME],
244 [If PAM is being used, this is the name of the PAM service that
245 xscreensaver will authenticate as. The default is
246 "xscreensaver", which means that the PAM library will look for
247 an "xscreensaver" line in /etc/pam.conf, or (on recent Linux
248 systems) will look for a file called /etc/pam.d/xscreensaver.
249 Some systems might already have a PAM installation that is
250 configured for xlock, so setting this to "xlock" would also work
253 AH_TEMPLATE([HAVE_PAM_FAIL_DELAY],
254 [Define this if you have pam_fail_delay function.
255 see driver/passwd-pam.c.])
257 AH_TEMPLATE([PAM_CHECK_ACCOUNT_TYPE],
258 [Whether PAM should check the result of account modules
259 when authenticating. Only do this if you have account
260 configured properly on your system.])
262 AH_TEMPLATE([PAM_STRERROR_TWO_ARGS],
263 [Define if you have PAM and pam_strerror() requires two
266 AH_TEMPLATE([HAVE_SIGTIMEDWAIT],
267 [Define to 1 if you have the `sigtimedwait' function.])
269 AH_TEMPLATE([HAVE_SHADOW_PASSWD],
270 [Define this if your system uses 'shadow' passwords, that is, the
271 passwords live in /etc/shadow instead of /etc/passwd, and one
272 reads them with getspnam() instead of getpwnam(). (Note that
273 SCO systems do some random other thing; others might as well.
274 See the ifdefs in driver/passwd-pwent.c if you're having trouble
275 related to reading passwords.)])
277 AH_TEMPLATE([HAVE_ENHANCED_PASSWD],
278 [Define this if your system is Digital or SCO Unix with so-called
279 ``Enhanced Security'', that is, the passwords live in
280 /tcb/files/auth/<x>/<xyz> instead of in /etc/passwd, and one
281 reads them with getprpwnam() instead of getpwnam().])
283 AH_TEMPLATE([HAVE_ADJUNCT_PASSWD],
284 [Define this if your system is Solaris with ``adjunct'' passwords
285 (this is the version where one gets at the passwords with
286 getpwanam() instead of getpwnam().) I haven't tested this one,
287 let me know if it works.])
289 AH_TEMPLATE([HAVE_HPUX_PASSWD],
290 [Define this if you are running HPUX with so-called ``Secure
291 Passwords'' (if you have /usr/include/hpsecurity.h, you probably
292 have this.) I haven't tested this one, let me know if it works.])
294 AH_TEMPLATE([HAVE_SYSLOG],
295 [Define this if you the openlog(), syslog(), and closelog()
296 functions. This is used for logging failed login attempts.])
298 AH_TEMPLATE([HAVE_ICMP],
299 [Define this if you do pings with a `struct icmp' and an
302 AH_TEMPLATE([HAVE_ICMPHDR],
303 [Define this if you do pings with a `struct icmphdr' and an
306 AH_TEMPLATE([HAVE_GETIFADDRS],
307 [Define this if you have the getifaddrs() function.])
309 AH_TEMPLATE([HAVE_FORKPTY],
310 [Define this if you have the 'forkpty' function:
311 This allows 'phosphor' and 'apple2' to run curses-based
312 programs, or be used as terminal windows.])
314 AH_TEMPLATE([HAVE_GETTIMEOFDAY],
315 [Define this if you have the gettimeofday function.])
317 AH_TEMPLATE([GETTIMEOFDAY_TWO_ARGS],
318 [Define this if gettimeofday() takes two arguments.])
320 AH_TEMPLATE([XPointer],
321 [Define this to void* if you're using X11R4 or earlier.])
323 AH_TEMPLATE([HAVE_PTHREAD],
324 [Define this if your system supports POSIX threads.])
326 AH_TEMPLATE([HAVE_RECORD_ANIM],
327 [Define this to enable recording of videos.])
329 # After checking to see that --srcdir is correct (which AC_INIT does)
330 # check for some random other files that come later in the tar file,
331 # to make sure everything is here.
333 for d in driver utils hacks hacks/glx ; do
334 f=$srcdir/$d/Makefile.in
335 if test \! -r $f ; then
337 echo "ERROR: The package is incomplete: $f does not exist."
338 echo " This probably means that your download was truncated."
344 ###############################################################################
346 # Query AX_PTHREAD, and figure out which compiler gets used.
348 ###############################################################################
350 AC_DEFUN([AC_PROG_CC_PTHREAD],
352 with_pthread_req=unspecified
354 # AX_PTHREAD is from the GNU Autoconf Archive.
355 # https://savannah.gnu.org/projects/autoconf-archive/
356 m4_include(ax_pthread.m4)
358 # This affects CC, LIBS, and CFLAGS, instead of defining new variables.
360 AC_ARG_WITH([pthread],
361 [ --with-pthread Enables POSIX threads, for SMP support.],
362 [with_pthread="$withval"; with_pthread_req="$withval"],
365 if test "$with_pthread" = yes; then
366 # AX_PTHREAD might want a different compiler.
368 [if test "$CC" = "$PTHREAD_CC" -o -z "$ac_original_cc"; then
371 ac_prog_cc_no_pthread=yes
375 if test "$have_pthread" = yes; then
376 AC_DEFINE([HAVE_PTHREAD])
383 ###############################################################################
385 # Function to figure out how to run the compiler.
387 ###############################################################################
389 AC_DEFUN([AC_PROG_CC_ANSI],
390 [AC_REQUIRE([AC_PROG_CC])
392 if test -z "$GCC"; then
394 AC_MSG_CHECKING(how to request ANSI compilation)
397 AC_MSG_RESULT(HPUX: adding -Ae)
401 AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
402 CC="$CC -qlanglvl=ansi -qhalt=e"
405 AC_MSG_RESULT(DEC: adding -std1 -ieee)
409 AC_MSG_RESULT(no idea)
416 AC_MSG_RESULT(Solaris: adding -D__EXTENSIONS__)
417 CC="$CC -D__EXTENSIONS__"
424 AC_MSG_CHECKING([whether the compiler works on ANSI C])
425 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
428 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
429 AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
431 if test -n "$GCC"; then
432 AC_MSG_RESULT(Turning on gcc compiler warnings.)
433 CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes"
435 # As of gcc 3.4, we have "-Wdeclaration-after-statement"
436 # and so perhaps now we can do without -pedantic?
439 *-irix5* |*-irix6.[0-3]* )
440 AC_MSG_RESULT(Turning on SGI compiler warnings.)
441 CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
444 # if test -z "$GCC"; then
445 # AC_MSG_RESULT(Turning on DEC C compiler warnings.)
446 # CC="$CC -migrate -w0 -verbose -warnprotos"
454 ###############################################################################
456 # Check for availability of various gcc command-line options.
458 ###############################################################################
460 AC_DEFUN([AC_CHECK_GCC_ARG],
461 [if test -n "$GCC"; then
462 AC_CACHE_CHECK([whether gcc accepts [$2]],
463 ac_cv_gcc_accepts_[$1],
464 [rm -rf conftest.$ac_ext
465 touch conftest.$ac_ext
466 if ( ( gcc -c [$2] conftest.$ac_ext -o/dev/null >/dev/null ) 2>&1 | \
467 grep unrecognized >/dev/null ); then
468 ac_cv_gcc_accepts_[$1]=no
470 ac_cv_gcc_accepts_[$1]=yes
473 ac_gcc_accepts_[$1]="$ac_cv_gcc_accepts_[$1]"
477 AC_DEFUN([AC_NO_LONG_STRING_WARNINGS],
478 [AC_CHECK_GCC_ARG(no_overlength, -Wno-overlength-strings)])
480 AC_DEFUN([AC_NO_MISPLACED_DECLARATIONS],
481 [AC_CHECK_GCC_ARG(no_decl_after, -Wdeclaration-after-statement)])
483 # Need to disable Objective C extensions in ANSI C on MacOS X to work
484 # around an Apple-specific gcc bug.
486 AC_DEFUN([AC_NO_OBJECTIVE_C],
487 [AC_CHECK_GCC_ARG(no_cpp_precomp, -no-cpp-precomp)])
489 ###############################################################################
491 # Function to figure out how to disable // comments in ANSI C code.
493 # (With recent gcc, this is done with "-std=c89". With older gcc, this
494 # is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
495 # gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang.
496 # so much for compatibility!)
498 # UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
499 # declarations preceed statements, without resorting to "-pedantic".
500 # This means that there is no way to get gcc3 to issue warnings that
501 # ensure that your code complies with the ANSI/ISO C89 standard, without
502 # also drowning in totally useless warnings. Thank you master may I
505 # So, I give up, let's just use -pedantic.
507 ###############################################################################
509 AC_DEFUN([AC_GCC_ACCEPTS_STD], [
512 # Fucking Apple let // comments sneak into OpenGL headers, so
513 # we *must* allow // comments when compiling on Mac OS 10.6! FUCK!
516 AC_CHECK_GCC_ARG(std, -std=c89)
521 AC_DEFUN([AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE],
522 [if test -n "$GCC"; then
524 AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
526 # The reason that // comments are banned from xscreensaver is that gcc is
527 # basically the only compiler in the world that supports them in C code.
528 # All other vendors support them only in their C++ compilers, not in their
529 # ANSI C compilers. This means that it's a portability problem: every time
530 # these comments have snuck into the xscreensaver source code, I've gotten
531 # complaints about it the next day. So we turn off support for them in gcc
532 # as well to prevent them from accidentially slipping in.
534 if test "$ac_gcc_accepts_std" = yes ; then
536 # -std=c89 defines __STRICT_ANSI__, which we don't want.
537 # (That appears to be the only additional preprocessor symbol
538 # it defines, in addition to the syntax changes it makes.)
540 # -std=gnu89 is no good, because // comments were a GNU extension
541 # before they were in the ANSI C 99 spec... (gcc 2.96 permits //
542 # with -std=gnu89 but not with -std=c89.)
544 # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD
545 CC="$CC -U__STRICT_ANSI__"
548 # CC="$CC -Wp,-lang-c89"
554 ###############################################################################
556 # Function to figure out how to create directory trees.
558 ###############################################################################
560 AC_DEFUN([AC_PROG_INSTALL_DIRS],
561 [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories],
562 ac_cv_install_d_creates_dirs,
563 [ac_cv_install_d_creates_dirs=no
565 if mkdir conftestdir; then
566 cd conftestdir 2>/dev/null
567 ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
568 if test -d dir1/dir2/. ; then
569 ac_cv_install_d_creates_dirs=yes
576 if test "$ac_cv_install_d_creates_dirs" = no ; then
577 AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories],
578 ac_cv_mkdir_p_creates_dirs,
579 [ac_cv_mkdir_p_creates_dirs=no
581 if mkdir conftestdir; then
582 cd conftestdir 2>/dev/null
583 mkdir -p dir1/dir2 >/dev/null 2>&1
584 if test -d dir1/dir2/. ; then
585 ac_cv_mkdir_p_creates_dirs=yes
593 if test "$ac_cv_install_d_creates_dirs" = yes ; then
594 INSTALL_DIRS='${INSTALL} -d'
595 elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
596 INSTALL_DIRS='mkdir -p'
599 INSTALL_DIRS='${INSTALL} -d'
604 ###############################################################################
606 # Function to check whether gettimeofday() exists, and how to call it.
607 # This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
609 ###############################################################################
611 AC_DEFUN([AC_GETTIMEOFDAY_ARGS],
612 [AC_MSG_CHECKING(how to call gettimeofday)
613 AC_CACHE_VAL(ac_cv_gettimeofday_args,
614 [AC_TRY_COMPILE([#include <stdlib.h>
615 #include <sys/time.h>],
616 [struct timeval tv; struct timezone tzp;
617 gettimeofday(&tv, &tzp);],
618 [ac_gettimeofday_args=2],
619 [AC_TRY_COMPILE([#include <stdlib.h>
620 #include <sys/time.h>],
621 [struct timeval tv; gettimeofday(&tv);],
622 [ac_gettimeofday_args=1],
623 [ac_gettimeofday_args=0])])
624 ac_cv_gettimeofday_args=$ac_gettimeofday_args])
625 ac_gettimeofday_args=$ac_cv_gettimeofday_args
626 if test "$ac_gettimeofday_args" = 1 ; then
627 AC_DEFINE(HAVE_GETTIMEOFDAY)
628 AC_MSG_RESULT(one argument)
629 elif test "$ac_gettimeofday_args" = 2 ; then
630 AC_DEFINE(HAVE_GETTIMEOFDAY)
631 AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
632 AC_MSG_RESULT(two arguments)
634 AC_MSG_RESULT(unknown)
639 ###############################################################################
641 # Function to find perl5 (defines PERL and PERL_VERSION.)
643 ###############################################################################
645 # M4 sucks!! perl sucks too!!
647 perl_version_cmd='print $]'
650 AC_DEFUN([AC_PROG_PERL],
651 [AC_PATH_PROGS(PERL, [perl5 perl],,)
652 if test -z "$PERL" ; then
655 AC_CACHE_CHECK([perl version], ac_cv_perl_version,
656 [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
657 PERL_VERSION=$ac_cv_perl_version
662 ###############################################################################
664 # Function to demand "bc". Losers.
666 ###############################################################################
668 AC_DEFUN([AC_DEMAND_BC],
669 [ac_bc_result=`echo 6+9 | bc 2>/dev/null`
670 AC_MSG_CHECKING([for bc])
671 if test "$ac_bc_result" = "15" ; then
676 AC_MSG_ERROR([Your system doesn't have \"bc\", which has been a standard
677 part of Unix since the 1970s. Come back when your vendor
682 ###############################################################################
684 # Functions to check how to do ICMP PING requests.
686 ###############################################################################
688 AC_DEFUN([AC_CHECK_ICMP],
689 [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
690 [AC_TRY_COMPILE([#include <stdlib.h>
697 #include <sys/types.h>
698 #include <sys/time.h>
701 #include <sys/socket.h>
702 #include <netinet/in_systm.h>
703 #include <netinet/in.h>
704 #include <netinet/ip.h>
705 #include <netinet/ip_icmp.h>
706 #include <netinet/udp.h>
707 #include <arpa/inet.h>
711 struct sockaddr_in si;
713 i.icmp_type = ICMP_ECHO;
718 si.sin_family = AF_INET;
719 #if defined(__DECC) || defined(_IP_VHL)
725 [ac_cv_have_icmp=yes],
726 [ac_cv_have_icmp=no])])
727 if test "$ac_cv_have_icmp" = yes ; then
731 AC_DEFUN([AC_CHECK_ICMPHDR],
732 [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
733 [AC_TRY_COMPILE([#include <stdlib.h>
740 #include <sys/types.h>
741 #include <sys/time.h>
744 #include <sys/socket.h>
745 #include <netinet/in_systm.h>
746 #include <netinet/in.h>
747 #include <netinet/ip.h>
748 #include <netinet/ip_icmp.h>
749 #include <netinet/udp.h>
750 #include <arpa/inet.h>
754 struct sockaddr_in si;
760 i.un.echo.sequence = 0;
761 si.sin_family = AF_INET;
763 [ac_cv_have_icmphdr=yes],
764 [ac_cv_have_icmphdr=no])])
765 if test "$ac_cv_have_icmphdr" = yes ; then
766 AC_DEFINE(HAVE_ICMPHDR)
770 ###############################################################################
772 # Functions to check for various X11 crap.
774 ###############################################################################
776 # Try and find the app-defaults directory.
777 # It sucks that autoconf doesn't do this already...
779 AC_DEFUN([AC_PATH_X_APP_DEFAULTS_XMKMF],[
781 if mkdir conftestdir; then
782 cd conftestdir 2>/dev/null
783 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
784 cat > Imakefile <<'EOF'
786 @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
788 if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
789 # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
790 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
796 ###############################################################################
798 # Handle the --with-x-app-defaults option HERE
800 ###############################################################################
802 AC_ARG_WITH(x-app-defaults,[],
803 [ac_cv_x_app_defaults="$withval"],
804 [eval ac_x_app_defaults="$withval"])
807 AC_DEFUN([AC_PATH_X_APP_DEFAULTS_DIRECT],[
808 # Look for the directory under a standard set of common directories.
809 # Check X11 before X11Rn because it's often a symlink to the current release.
812 /usr/share/X11/app-defaults \
814 /usr/X11/lib/app-defaults \
815 /usr/X11R6/lib/app-defaults \
816 /usr/X11R6/lib/X11/app-defaults \
817 /usr/X11R5/lib/app-defaults \
818 /usr/X11R5/lib/X11/app-defaults \
819 /usr/X11R4/lib/app-defaults \
820 /usr/X11R4/lib/X11/app-defaults \
822 /usr/lib/X11/app-defaults \
823 /usr/lib/X11R6/app-defaults \
824 /usr/lib/X11R5/app-defaults \
825 /usr/lib/X11R4/app-defaults \
827 /etc/X11/app-defaults \
829 /usr/local/X11/lib/app-defaults \
830 /usr/local/X11R6/lib/app-defaults \
831 /usr/local/X11R5/lib/app-defaults \
832 /usr/local/X11R4/lib/app-defaults \
834 /usr/local/lib/X11/app-defaults \
835 /usr/local/lib/X11R6/app-defaults \
836 /usr/local/lib/X11R6/X11/app-defaults \
837 /usr/local/lib/X11R5/app-defaults \
838 /usr/local/lib/X11R5/X11/app-defaults \
839 /usr/local/lib/X11R4/app-defaults \
840 /usr/local/lib/X11R4/X11/app-defaults \
842 /usr/X386/lib/X11/app-defaults \
843 /usr/x386/lib/X11/app-defaults \
844 /usr/XFree86/lib/X11/app-defaults \
846 /usr/lib/X11/app-defaults \
847 /usr/local/lib/X11/app-defaults \
848 /usr/unsupported/lib/X11/app-defaults \
849 /usr/athena/lib/X11/app-defaults \
850 /usr/local/x11r5/lib/X11/app-defaults \
851 /usr/lpp/Xamples/lib/X11/app-defaults \
852 /lib/usr/lib/X11/app-defaults \
854 /usr/openwin/lib/app-defaults \
855 /usr/openwin/lib/X11/app-defaults \
856 /usr/openwin/share/lib/app-defaults \
857 /usr/openwin/share/lib/X11/app-defaults \
859 /X11R6/lib/app-defaults \
860 /X11R5/lib/app-defaults \
861 /X11R4/lib/app-defaults \
864 if test -d "$ac_dir"; then
865 ac_x_app_defaults=$ac_dir
871 AC_DEFUN([AC_PATH_X_APP_DEFAULTS],
873 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
874 [# skip this, it's always wrong these days.
875 # AC_PATH_X_APP_DEFAULTS_XMKMF
876 if test x"$ac_x_app_defaults" = x; then
877 true AC_PATH_X_APP_DEFAULTS_DIRECT
879 if test x"$ac_x_app_defaults" = x; then
880 /bin/echo -n 'fallback: '
881 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
883 # Record where we found app-defaults for the cache.
884 ac_cv_x_app_defaults="$ac_x_app_defaults"
886 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
889 AC_DEFUN([AC_XPOINTER],
890 [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
891 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
892 [XPointer foo = (XPointer) 0;],
893 [ac_cv_xpointer=yes],
894 [ac_cv_xpointer=no])])
895 if test "$ac_cv_xpointer" != yes; then
896 AC_DEFINE(XPointer,[char*])
900 # Random special-cases for X on certain pathological OSes.
901 # You know who you are.
903 AC_DEFUN([AC_X_RANDOM_PATHS],
907 # The following arcana was gleaned from conversations with
908 # Eric Schwartz <erics@col.hp.com>:
910 # On HPUX 10.x, the parts of X that HP considers "standard" live in
911 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
912 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
913 # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
914 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
915 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
916 # you don't need any -I or -L arguments.
918 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
919 # are the same division as 10.x. However, there are no symlinks to
920 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
921 # arguments are always necessary.
923 # However, X11R6 was available on HPUX 9.x as a patch: if that
924 # patch was installed, then all of X11R6 went in to
925 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
927 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
928 # whether R5 was available as a patch; R6 undoubtedly was not.)
930 # So. We try and use the highest numbered pair of
931 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
932 # that are available. We do not mix and match different versions
935 # Question I still don't know the answer to: (do you?)
937 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
938 # /usr/contrib/X11R6/ could be installed as a patch, what was in
939 # that contrib directory? Did it contain so-called "standard"
940 # X11R6, or did it include Xaw and Xmu as well? If the former,
941 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
942 # be a situation where one had to reach into the R5 headers and
943 # libs to find Xmu? That is, must both R6 and R5 directories
944 # be on the -I and -L lists in that case?
946 for version in X11R6 X11R5 X11R4 ; do
947 # if either pair of directories exists...
948 if test -d /usr/include/$version || test -d /usr/contrib/$version/include
950 # if contrib exists, use it...
951 if test -d /usr/contrib/$version/include ; then
952 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
953 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
955 # if the "standard" one exists, use it.
956 if test -d /usr/include/$version ; then
957 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
958 X_LIBS="$X_LIBS -L/usr/lib/$version"
960 # since at least one of the pair exists, go no farther.
965 # Now find Motif. Thanks for not making xmkmf find this by
966 # default, you losers.
968 if test -d /usr/include/Motif2.1 ; then
969 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
970 X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
971 elif test -d /usr/include/Motif1.2 ; then
972 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
973 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
974 elif test -d /usr/include/Motif1.1 ; then
975 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
976 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
979 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
981 if test -d /opt/graphics/OpenGL/include ; then
982 # HP-UX 10.20 puts it here
983 X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
984 X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
985 elif test -d /opt/Mesa/lib ; then
986 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
987 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
991 if test -d /opt/xpm/lib/X11 ; then
992 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
993 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
996 # On HPUX, default to installing in /opt/xscreensaver/ instead of
997 # in /usr/local/, unless there is already an xscreensaver in
998 # /usr/local/bin/. This can be overridden with the --prefix arg
999 # to configure. I'm not sure this is the right thing to do, but
1000 # Richard Lloyd says so...
1002 if test \! -x /usr/local/bin/xscreensaver ; then
1003 ac_default_prefix=/opt/xscreensaver
1009 # Thanks for not making xmkmf find this by default, pinheads.
1010 # And thanks for moving things around again, too. Is this
1011 # really the standard location now? What happened to the
1012 # joke that this kind of thing went in /opt?
1013 # cthomp says "answer: CDE (Common Disorganized Environment)"
1015 if test -f /usr/dt/include/Xm/Xm.h ; then
1016 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
1017 MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
1019 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
1020 AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
1026 # On MacOS X (10.x with "fink"), many things are under /sw/.
1028 if test -d /sw/include ; then
1029 X_CFLAGS="-I/sw/include $X_CFLAGS"
1030 X_LIBS="-L/sw/lib $X_LIBS"
1035 AC_DEFUN([AC_CHECK_GETIFADDRS],
1036 [AC_CACHE_CHECK([for getifaddrs], ac_cv_have_getifaddrs,
1037 [AC_TRY_COMPILE([#include <stdlib.h>
1039 #include <arpa/inet.h>
1040 #include <ifaddrs.h>],
1041 [struct ifaddrs *ifa;
1044 ifa->ifa_addr->sa_family = 0;],
1045 [ac_cv_have_getifaddrs=yes],
1046 [ac_cv_have_getifaddrs=no])])
1047 if test "$ac_cv_have_getifaddrs" = yes ; then
1048 AC_DEFINE(HAVE_GETIFADDRS)
1052 ###############################################################################
1054 # Some utility functions to make checking for X things easier.
1056 ###############################################################################
1058 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
1060 AC_DEFUN([AC_CHECK_X_HEADER], [
1061 ac_save_CPPFLAGS="$CPPFLAGS"
1062 if test \! -z "$includedir" ; then
1063 CPPFLAGS="$CPPFLAGS -I$includedir"
1065 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1066 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1067 AC_CHECK_HEADER([$1],[$2],[$3],[$4])
1068 CPPFLAGS="$ac_save_CPPFLAGS"])
1070 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
1072 AC_DEFUN([AC_EGREP_X_HEADER], [
1073 ac_save_CPPFLAGS="$CPPFLAGS"
1074 if test \! -z "$includedir" ; then
1075 CPPFLAGS="$CPPFLAGS -I$includedir"
1077 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1078 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1079 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
1080 CPPFLAGS="$ac_save_CPPFLAGS"])
1082 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
1084 AC_DEFUN([AC_TRY_X_COMPILE], [
1085 ac_save_CPPFLAGS="$CPPFLAGS"
1086 if test \! -z "$includedir" ; then
1087 CPPFLAGS="$CPPFLAGS -I$includedir"
1089 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1090 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1091 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
1092 CPPFLAGS="$ac_save_CPPFLAGS"])
1095 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
1096 # Use this sparingly; it probably doesn't work very well on X programs.
1098 AC_DEFUN([AC_CHECK_X_LIB], [
1099 ac_save_CPPFLAGS="$CPPFLAGS"
1100 ac_save_LDFLAGS="$LDFLAGS"
1101 # ac_save_LIBS="$LIBS"
1103 if test \! -z "$includedir" ; then
1104 CPPFLAGS="$CPPFLAGS -I$includedir"
1106 # note: $X_CFLAGS includes $x_includes
1107 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1109 if test \! -z "$libdir" ; then
1110 LDFLAGS="$LDFLAGS -L$libdir"
1112 # note: $X_LIBS includes $x_libraries
1113 LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
1115 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1116 LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
1117 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
1118 CPPFLAGS="$ac_save_CPPFLAGS"
1119 LDFLAGS="$ac_save_LDFLAGS"
1120 # LIBS="$ac_save_LIBS"
1123 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
1124 # (But not the -L directories!)
1126 AC_DEFUN([AC_TRY_X_RUN], [
1127 ac_save_CPPFLAGS="$CPPFLAGS"
1128 if test \! -z "$includedir" ; then
1129 CPPFLAGS="$CPPFLAGS -I$includedir"
1131 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1132 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1133 AC_TRY_RUN([$1], [$2], [$3], [$4])
1134 CPPFLAGS="$ac_save_CPPFLAGS"])
1138 # Usage: HANDLE_X_PATH_ARG([variable_name],
1139 # [--command-line-option],
1140 # [descriptive string])
1142 # All of the --with options take three forms:
1144 # --with-foo (or --with-foo=yes)
1145 # --without-foo (or --with-foo=no)
1148 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
1149 # a directory (string beginning with a slash) it checks to see whether
1150 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
1153 AC_DEFUN([HANDLE_X_PATH_ARG], [
1159 AC_MSG_CHECKING([for [$3] headers])
1162 X_CFLAGS="-I$d $X_CFLAGS"
1165 AC_MSG_RESULT(not found ($d: no such directory))
1168 AC_MSG_CHECKING([for [$3] libs])
1171 X_LIBS="-L$d $X_LIBS"
1174 AC_MSG_RESULT(not found ($d: no such directory))
1177 # replace the directory string with "yes".
1184 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
1185 echo " If it is a directory, then \`DIR/include' will be added to"
1186 echo " the -I list, and \`DIR/lib' will be added to the -L list."
1194 ###############################################################################
1195 ###############################################################################
1197 # End of function definitions. Now start actually executing stuff.
1199 ###############################################################################
1200 ###############################################################################
1202 # WTF! autoconf emits this *way* too late. Do it earlier.
1203 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1204 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1207 # random compiler setup
1212 AC_PROG_CC_PTHREAD # Needs ac_original_cc.
1215 AC_NO_LONG_STRING_WARNINGS
1216 AC_NO_MISPLACED_DECLARATIONS
1218 AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
1225 # stuff for Makefiles
1227 AC_PROG_INSTALL_DIRS
1230 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1231 # That's wrong: it should be set to '${INSTALL}', so that one can
1232 # implement the "install-strip" target properly (strip executables,
1233 # but do not try to strip scripts.)
1235 INSTALL_SCRIPT='${INSTALL}'
1239 AC_CHECK_HEADERS(unistd.h inttypes.h)
1247 AC_GETTIMEOFDAY_ARGS
1249 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
1250 AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
1251 AC_CHECK_FUNCS(setlocale)
1252 AC_CHECK_FUNCS(getaddrinfo)
1253 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,, [[#include <sys/socket.h>]])
1257 AC_CHECK_HEADERS(crypt.h sys/select.h)
1260 if test -z "$PERL" ; then
1261 # don't let it be blank...
1267 if test "$have_x" != yes; then
1268 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try `$0 --help'.)
1271 AC_PATH_X_APP_DEFAULTS
1275 AC_MSG_CHECKING(whether this is MacOS X)
1282 AC_MSG_RESULT($ac_macosx)
1285 ###############################################################################
1289 ###############################################################################
1292 GETTEXT_PACKAGE=xscreensaver
1293 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
1294 [This is the name of the gettext package to use.])
1295 AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE",
1296 [This is the same as GETTEXT_PACKAGE, but for the glade
1298 AC_SUBST(GETTEXT_PACKAGE)
1300 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"
1302 MKINSTALLDIRS="$INSTALL_DIRS"
1305 ###############################################################################
1307 # Check for -lXmu (some fucked up vendors don't ship it...)
1309 ###############################################################################
1312 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes],,
1313 [#include <stdlib.h>
1315 #include <X11/Intrinsic.h>])
1316 if test "$have_xmu" = no ; then
1317 XMU_SRCS='$(UTILS_SRC)/xmu.c'
1318 XMU_OBJS='$(UTILS_BIN)/xmu.o'
1328 ###############################################################################
1330 # Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
1331 # See comp.windows.x FAQ question 124. The right fix is to
1332 # get OpenWindows 3.0 patches 100512-02 and 100573-03.
1334 ###############################################################################
1336 if test "$have_xmu" = yes ; then
1339 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
1340 ac_cv_sunos_xmu_bug,
1341 [ac_save_LDFLAGS="$LDFLAGS"
1342 if test \! -z "$x_libraries" ; then
1343 LDFLAGS="$LDFLAGS -L$x_libraries"
1345 # Note: this trick never works! (Generally.)
1346 # We're only getting away with using AC_TRY_LINK
1347 # with X libraries because we know it's SunOS.
1348 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
1350 [ac_cv_sunos_xmu_bug=no],
1351 [ac_cv_sunos_xmu_bug=yes])
1352 LDFLAGS="$ac_save_LDFLAGS"])
1353 if test "$ac_cv_sunos_xmu_bug" = yes ; then
1354 AC_CACHE_CHECK([whether the compiler understands -static],
1356 [ac_save_LDFLAGS="$LDFLAGS"
1357 LDFLAGS="$LDFLAGS -static"
1358 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
1359 LDFLAGS="$ac_save_LDFLAGS"])
1360 if test "$ac_cv_ld_static" = yes ; then
1361 LDFLAGS="$LDFLAGS -static"
1363 LDFLAGS="$LDFLAGS -Bstatic"
1371 ###############################################################################
1373 # Handle the --with-hackdir option
1375 ###############################################################################
1378 with_hackdir_req=unspecified
1379 AC_ARG_WITH(hackdir,[
1381 Installation options:
1382 --with-hackdir=DIR Where to install the hundreds of demo executables.
1383 Default: `PREFIX/libexec/xscreensaver/'],
1384 [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes])
1386 if test x"$with_hackdir" = xyes; then
1387 HACKDIR='${libexecdir}/xscreensaver'
1388 elif test x"$with_hackdir" = xno; then
1391 HACKDIR=$with_hackdir
1394 # canonicalize slashes.
1395 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
1397 # Expand HACKDIR as HACKDIR_FULL
1398 HACKDIR_FULL=`eval eval eval eval eval eval eval eval eval echo $HACKDIR`
1400 # This option used to be called --enable-subdir; make sure that is no longer
1401 # used, since configure brain-damagedly ignores unknown --enable options.
1404 AC_ARG_ENABLE(subdir,,[obsolete_enable=yes])
1405 if test -n "$obsolete_enable"; then
1406 echo "error: the --enable-subdir option has been replaced with"
1407 echo " the new --with-hackdir option; see \`configure --help'"
1408 echo " for more information."
1413 ###############################################################################
1415 # Handle the --with-configdir option
1416 # Help for --with-x-app-defaults option added.
1418 ###############################################################################
1421 with_configdir_req=unspecified
1422 AC_ARG_WITH(configdir,
1423 [ --with-configdir=DIR Where to install the data files that describe each
1424 of the display modes to the GUI.
1425 Default: `PREFIX/share/xscreensaver/config/'
1426 --with-x-app-defaults=DIR
1427 Where to install xscreensaver configuration file.
1429 [with_configdir="$withval"; with_configdir_req="$withval"],
1430 [with_configdir=yes])
1432 if test x"$with_configdir" = xyes; then
1433 HACK_CONF_DIR='${datadir}/xscreensaver/config'
1434 elif test x"$with_configdir" = xno; then
1435 echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
1438 # there must be a better way than this...
1439 if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
1441 HACK_CONF_DIR=$with_configdir
1444 HACK_CONF_DIR="\${exec_prefix}$with_configdir"
1451 ###############################################################################
1453 # Check for the SGI SCREEN_SAVER server extension.
1455 ###############################################################################
1458 #with_sgi_req=unspecified
1459 #AC_ARG_WITH(sgi-ext,
1460 #[Except where noted, all of the --with options below can also take a
1461 #directory argument: for example, `--with-motif=/opt/Motif'. That would
1462 #cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
1463 #to be added to the -L list, assuming those directories exist.
1465 #By default, support for each of these options will be built in, if the
1466 #relevant library routines exist. At run time, they will then be used
1467 #only if the X server being used supports them. Each --with option has
1468 #a corresponding --without option, to override building support for them
1471 #Screen blanking and idle-detection options:
1473 # --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.],
1474 # [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
1476 #HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
1478 #if test "$with_sgi" = yes; then
1479 # AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
1481 # AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
1482 # [#include <X11/Xlib.h>])
1484 #elif test "$with_sgi" != no; then
1485 # echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
1490 ###############################################################################
1492 # Check for the XIDLE server extension.
1494 ###############################################################################
1497 #with_xidle_req=unspecified
1498 #AC_ARG_WITH(xidle-ext,
1499 #[ --with-xidle-ext Include support for the XIDLE extension.],
1500 # [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
1502 #HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
1504 #if test "$with_xidle" = yes; then
1505 # AC_CHECK_X_HEADER(X11/extensions/xidle.h,
1507 # AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
1508 # [#include <X11/Xlib.h>])
1509 #elif test "$with_xidle" != no; then
1510 # echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
1515 ###############################################################################
1517 # Check for the SGI-VIDEO-CONTROL server extension.
1519 ###############################################################################
1522 #with_sgivc_req=unspecified
1523 #AC_ARG_WITH(sgivc-ext,
1524 #[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.],
1525 # [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
1527 #HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
1529 #if test "$with_sgivc" = yes; then
1531 # # first check for XSGIvc.h
1532 # AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],,
1533 # [#include <X11/Xlib.h>])
1535 # # if that succeeded, then check for the -lXsgivc
1536 # if test "$have_sgivc" = yes; then
1538 # AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
1539 # [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
1543 # # if that succeeded, then we've really got it.
1544 # if test "$have_sgivc" = yes; then
1545 # AC_DEFINE(HAVE_SGI_VC_EXTENSION)
1548 #elif test "$with_sgivc" != no; then
1549 # echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
1554 ###############################################################################
1556 # Check for the DPMS server extension.
1558 ###############################################################################
1561 with_dpms_req=unspecified
1562 AC_ARG_WITH(dpms-ext,
1563 [ --with-dpms-ext Include support for the DPMS extension.],
1564 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
1566 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
1568 if test "$with_dpms" = yes; then
1570 # first check for dpms.h
1571 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
1572 [#include <X11/Xlib.h>
1573 #include <X11/Xmd.h>])
1575 # if that succeeded, then check for the DPMS code in the libraries
1576 if test "$have_dpms" = yes; then
1578 # first look in -lXext (this is where it is with XFree86 4.0)
1580 AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11)
1582 # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
1583 if test "$have_dpms" = no; then
1584 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
1585 [have_dpms=yes; XDPMS_LIBS="-lXdpms"], [true],
1591 # if that succeeded, then we've really got it.
1592 if test "$have_dpms" = yes; then
1593 AC_DEFINE(HAVE_DPMS_EXTENSION)
1596 elif test "$with_dpms" != no; then
1597 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
1602 ###############################################################################
1604 # Check for the XINERAMA server extension.
1606 ###############################################################################
1609 with_xinerama_req=unspecified
1610 AC_ARG_WITH(xinerama-ext,
1611 [ --with-xinerama-ext Include support for the XINERAMA extension.],
1612 [with_xinerama="$withval"; with_xinerama_req="$withval"],[with_xinerama=yes])
1614 HANDLE_X_PATH_ARG(with_xinerama, --with-xinerama-ext, XINERAMA)
1616 if test "$with_xinerama" = yes; then
1618 # first check for Xinerama.h
1619 AC_CHECK_X_HEADER(X11/extensions/Xinerama.h, [have_xinerama=yes],,
1620 [#include <X11/Xlib.h>])
1622 # if that succeeded, then check for the XINERAMA code in the libraries
1623 if test "$have_xinerama" = yes; then
1625 # first look in -lXext
1627 AC_CHECK_X_LIB(Xext, XineramaQueryScreens, [have_xinerama=yes], [true],
1630 # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
1631 if test "$have_xinerama" = no; then
1632 AC_CHECK_X_LIB(Xinerama, XineramaQueryScreens,
1633 [have_xinerama=yes; XINERAMA_LIBS="-lXinerama"],
1634 [true], -lXext -lX11)
1638 # if that succeeded, then we've really got it.
1639 if test "$have_xinerama" = yes; then
1640 AC_DEFINE(HAVE_XINERAMA)
1643 elif test "$with_xinerama" != no; then
1644 echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
1649 ###############################################################################
1651 # Check for the XINPUT server extension.
1653 ###############################################################################
1656 with_xinput_req=unspecified
1657 AC_ARG_WITH(xinput-ext,
1658 [ --with-xinput-ext Include support for the XInput extension.],
1659 [with_xinput="$withval"; with_xinput_req="$withval"], [with_xinput=yes])
1661 HANDLE_X_PATH_ARG(with_xinput, --with-xinput-ext, XINPUT)
1663 if test "$with_xinput" = yes; then
1665 # first check for Xinput.h
1666 AC_CHECK_X_HEADER(X11/extensions/XInput.h, [have_xinput=yes],,
1667 [#include <X11/Xlib.h>])
1669 # if that succeeded, then check for libXi
1670 if test "$have_xinput" = yes; then
1672 AC_CHECK_X_LIB(Xi, XListInputDevices,
1673 [have_xinput=yes; SAVER_LIBS="$SAVER_LIBS -lXi"],
1674 [true], -lXext -lX11)
1677 # if that succeeded, then we've really got it.
1678 if test "$have_xinput" = yes; then
1679 AC_DEFINE(HAVE_XINPUT)
1682 elif test "$with_xinput" != no; then
1683 echo "error: must be yes or no: --with-xinput-ext=$with_xinput"
1688 ###############################################################################
1690 # Check for the XF86VMODE server extension (for virtual screens.)
1692 ###############################################################################
1695 with_xf86vmode_req=unspecified
1696 AC_ARG_WITH(xf86vmode-ext,
1697 [ --with-xf86vmode-ext Include support for XFree86 virtual screens.],
1698 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
1699 [with_xf86vmode=yes])
1701 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1705 if test "$with_xf86vmode" = yes; then
1707 # first check for xf86vmode.h
1708 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes],,
1709 [#include <X11/Xlib.h>])
1711 # if that succeeded, then check for the -lXxf86vm
1712 if test "$have_xf86vmode" = yes; then
1714 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1715 [have_xf86vmode=yes;
1716 VIDMODE_LIBS="-lXxf86vm";
1717 SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS"],
1718 [true], -lXext -lX11)
1721 # if that succeeded, then we've really got it.
1722 if test "$have_xf86vmode" = yes; then
1723 AC_DEFINE(HAVE_XF86VMODE)
1726 elif test "$with_xf86vmode" != no; then
1727 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
1732 ###############################################################################
1734 # Check for the XF86VMODE server extension (for gamma fading.)
1736 ###############################################################################
1739 have_xf86gamma_ramp=no
1740 with_xf86gamma_req=unspecified
1741 AC_ARG_WITH(xf86gamma-ext,
1742 [ --with-xf86gamma-ext Include support for XFree86 gamma fading.],
1743 [with_xf86gamma="$withval"; with_xf86gamma_req="$withval"],
1744 [with_xf86gamma=yes])
1746 HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma)
1748 if test "$with_xf86gamma" = yes; then
1750 # first check for xf86vmode.h, if we haven't already
1751 if test "$have_xf86vmode" = yes; then
1754 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes],,
1755 [#include <X11/Xlib.h>])
1758 # if that succeeded, then check for the -lXxf86vm
1759 if test "$have_xf86gamma" = yes; then
1761 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma,
1762 [have_xf86gamma=yes],
1763 [true], -lXext -lX11)
1766 # check for the Ramp versions of the functions too.
1767 if test "$have_xf86gamma" = yes; then
1768 have_xf86gamma_ramp=no
1769 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp,
1770 [have_xf86gamma_ramp=yes],
1771 [true], -lXext -lX11)
1774 # if those tests succeeded, then we've really got the functions.
1775 if test "$have_xf86gamma" = yes; then
1776 AC_DEFINE(HAVE_XF86VMODE_GAMMA)
1779 if test "$have_xf86gamma_ramp" = yes; then
1780 AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP)
1783 # pull in the lib, if we haven't already
1784 if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
1785 SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
1788 elif test "$with_xf86gamma" != no; then
1789 echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
1794 ###############################################################################
1796 # Check for the RANDR (Resize and Rotate) server extension.
1798 # We need this to detect when the resolution of the desktop
1799 # has changed out from under us (this is a newer, different
1800 # mechanism than the XF86VMODE virtual viewports.)
1802 ###############################################################################
1805 with_randr_req=unspecified
1806 AC_ARG_WITH(randr-ext,
1807 [ --with-randr-ext Include support for the X Resize+Rotate extension.],
1808 [with_randr="$withval"; with_randr_req="$withval"],[with_randr=yes])
1810 HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR)
1812 if test "$with_randr" = yes; then
1814 # first check for Xrandr.h
1815 AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],,
1816 [#include <X11/Xlib.h>])
1818 # if that succeeded, then check for the XRR code in the libraries
1819 if test "$have_randr" = yes; then
1821 # RANDR probably needs -lXrender
1823 AC_CHECK_X_LIB(Xrender, XRenderSetSubpixelOrder,
1824 [xrender_libs="-lXrender"], [true], -lXext -lX11)
1826 # first look for RANDR in -lXext
1828 AC_CHECK_X_LIB(Xext, XRRGetScreenInfo,
1829 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"],
1830 [true], $xrender_libs -lXext -lX11)
1832 # if that failed, look in -lXrandr
1833 if test "$have_randr" = no; then
1834 AC_CHECK_X_LIB(Xrandr, XRRGetScreenInfo,
1835 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"],
1836 [true], $xrender_libs -lXext -lX11)
1840 # if that succeeded, then we've really got it.
1841 if test "$have_randr" = yes; then
1842 AC_DEFINE(HAVE_RANDR)
1844 # Now check for version 1.2 in the same libs.
1845 # Try to compile, since on MacOS 10.5.7, headers are older than libs!
1846 AC_CACHE_CHECK([for XRRGetScreenResources], ac_cv_randr_12,
1848 AC_TRY_X_COMPILE([#include <stdlib.h>
1849 #include <X11/Xlib.h>
1850 #include <X11/extensions/Xrandr.h>],
1851 [XRRScreenResources *res =
1852 XRRGetScreenResources (0, 0);],
1853 [ac_cv_randr_12=yes],
1854 [ac_cv_randr_12=no])])
1855 if test "$ac_cv_randr_12" = yes ; then
1856 AC_DEFINE(HAVE_RANDR_12)
1858 # AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)],
1859 # [true], $SAVER_LIBS)
1863 elif test "$with_randr" != no; then
1864 echo "error: must be yes or no: --with-randr-ext=$with_randr"
1869 ###############################################################################
1871 # Check for XF86MiscSetGrabKeysState (but only bother if we are already
1872 # using other XF86 stuff.)
1874 ###############################################################################
1876 have_xf86miscsetgrabkeysstate=no
1877 if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
1878 AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
1879 [have_xf86miscsetgrabkeysstate=yes],
1880 [true], -lXext -lX11)
1881 if test "$have_xf86miscsetgrabkeysstate" = yes ; then
1882 SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
1883 AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
1888 ###############################################################################
1890 # Check for HP XHPDisableReset and XHPEnableReset.
1892 ###############################################################################
1894 AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
1895 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1896 [AC_DEFINE(HAVE_XHPDISABLERESET)
1897 SAVER_LIBS="-lXhp11 $SAVER_LIBS"
1898 AC_MSG_RESULT(yes)],
1899 [AC_MSG_RESULT(no)])
1902 ###############################################################################
1904 # Check for /proc/interrupts.
1906 ###############################################################################
1908 have_proc_interrupts=no
1909 with_proc_interrupts_req=unspecified
1910 AC_ARG_WITH(proc-interrupts,
1911 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
1912 file to notice keyboard activity.],
1913 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
1914 [with_proc_interrupts=yes])
1916 if test "$with_proc_interrupts" = yes; then
1918 # Note that we may be building in an environment (e.g. Debian buildd chroot)
1919 # without a proper /proc filesystem. If /proc/interrupts exists, then we'll
1920 # check that it has the bits we need, but otherwise we'll just go on faith.
1922 have_proc_interrupts=yes
1924 if test -f /proc/interrupts; then
1925 AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1926 ac_cv_have_proc_interrupts,
1927 [ac_cv_have_proc_interrupts=no
1928 if grep 'keyboard\|i8042' /proc/interrupts >/dev/null 2>&1 ; then
1929 ac_cv_have_proc_interrupts=yes
1932 have_proc_interrupts=$ac_cv_have_proc_interrupts
1935 if test "$have_proc_interrupts" = yes; then
1936 AC_DEFINE(HAVE_PROC_INTERRUPTS)
1939 elif test "$with_proc_interrupts" != no; then
1940 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
1945 ###############################################################################
1947 # The --enable-locking option
1949 ###############################################################################
1951 AC_ARG_ENABLE(locking,[Screen locking options:
1952 --enable-locking Compile in support for locking the display.
1953 --disable-locking Do not allow locking at all.],
1954 [enable_locking="$enableval"],
1955 [if test "$ac_macosx" = yes; then
1956 # We can't lock on MacOS X, so default to not compiling in support for it.
1957 # But allow --enable-locking to override that, so I can debug Linux locking
1963 if test "$enable_locking" = yes; then
1965 elif test "$enable_locking" = no; then
1966 AC_DEFINE(NO_LOCKING)
1968 echo "error: must be yes or no: --enable-locking=$enable_locking"
1973 ###############################################################################
1975 # Whether to allow root password to unblank.
1977 ###############################################################################
1978 AC_ARG_ENABLE(root-passwd, [
1979 --enable-root-passwd Allow root passwd to unlock screen.
1980 --disable-root-passwd Do not allow that.],
1981 [enable_root_passwd="$enableval"],[enable_root_passwd=yes])
1982 if test "$enable_root_passwd" = yes; then
1983 AC_DEFINE(ALLOW_ROOT_PASSWD)
1985 elif test "$enable_root_passwd" != no; then
1986 echo "error: must be yes or no: --enable-root-passwd=$enable_root_passwd"
1990 ###############################################################################
1994 ###############################################################################
1998 # Solaris systems tend to come with PAM misconfigured.
1999 # Don't build it by default, even if the headers exist.
2003 # Default to building PAM support on all other systems, if it exists.
2004 with_pam_default=yes
2009 with_pam_req=unspecified
2012 [ --with-pam Include support for PAM (Pluggable Auth Modules.)],
2013 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default])
2015 AC_ARG_WITH([pam_service_name],
2016 AC_HELP_STRING([--with-pam-service-name],
2017 [NAME arg is the name of the PAM service that
2018 xscreensaver will authenticate as.]),
2019 [pam_service_name="$withval"],[pam_service_name="xscreensaver"])
2021 AC_ARG_ENABLE(pam-check-account-type,
2022 [AC_HELP_STRING([--enable-pam-check-account-type],
2023 [Whether PAM should check the result of account
2024 modules when authenticating. Only do this if you
2025 have account configured properly on your system.])],
2026 [enable_pam_check_account_type="$enableval"],[enable_pam_check_account_type=no])
2027 if test "$enable_pam_check_account_type" = yes ; then
2028 AC_DEFINE(PAM_CHECK_ACCOUNT_TYPE)
2030 elif test "$enable_pam_check_account_type" != no ; then
2031 echo "error: must be yes or no: --enable-pam-check-account-type=$enable_pam_check_account_type"
2035 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
2037 if test "$enable_locking" = yes -a "$with_pam" = yes; then
2038 AC_CACHE_CHECK([for PAM], ac_cv_pam,
2039 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
2042 if test "$ac_cv_pam" = yes ; then
2045 AC_DEFINE_UNQUOTED(PAM_SERVICE_NAME,"$pam_service_name")
2047 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
2049 # libpam typically requires dlopen and dlsym. On FreeBSD,
2050 # those are in libc. On Linux and Solaris, they're in libdl.
2051 AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
2053 # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
2055 AC_CHECK_LIB(c, sigtimedwait,
2057 AC_DEFINE(HAVE_SIGTIMEDWAIT)])
2058 if test "$have_timedwait" = no ; then
2059 AC_CHECK_LIB(rt, sigtimedwait, [have_timedwait=yes
2060 AC_DEFINE(HAVE_SIGTIMEDWAIT)
2061 PASSWD_LIBS="${PASSWD_LIBS} -lrt"])
2064 AC_MSG_CHECKING(how to call pam_strerror)
2065 AC_CACHE_VAL(ac_cv_pam_strerror_args,
2066 [AC_TRY_X_COMPILE([#include <stdio.h>
2068 #include <security/pam_appl.h>],
2069 [pam_handle_t *pamh = 0;
2070 char *s = pam_strerror(pamh, PAM_SUCCESS);],
2071 [ac_pam_strerror_args=2],
2072 [AC_TRY_X_COMPILE([#include <stdio.h>
2074 #include <security/pam_appl.h>],
2076 pam_strerror(PAM_SUCCESS);],
2077 [ac_pam_strerror_args=1],
2078 [ac_pam_strerror_args=0])])
2079 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
2080 ac_pam_strerror_args=$ac_cv_pam_strerror_args
2081 if test "$ac_pam_strerror_args" = 1 ; then
2082 AC_MSG_RESULT(one argument)
2083 elif test "$ac_pam_strerror_args" = 2 ; then
2084 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
2085 AC_MSG_RESULT(two arguments)
2087 AC_MSG_RESULT(unknown)
2090 # Check pam_fail_delay
2091 AC_MSG_CHECKING(pam_fail_delay in -lpam)
2092 AC_CACHE_VAL(ac_cv_pam_fail_delay,
2093 [ac_save_LDFLAGS="$LDFLAGS"
2095 AC_TRY_LINK([#include <security/pam_appl.h>],
2096 [pam_handle_t *pamh = 0;
2097 unsigned int usec = 1;
2098 int status = pam_fail_delay (pamh, usec);],
2099 [ac_pam_fail_delay=yes],
2100 [ac_pam_fail_delay=no])
2101 ac_cv_pam_fail_delay=$ac_pam_fail_delay,
2102 LDFLAGS=$ac_save_LDFLAGS])
2104 if test "$ac_pam_fail_delay" = yes ; then
2106 AC_DEFINE(HAVE_PAM_FAIL_DELAY)
2115 ###############################################################################
2117 # Check for Kerberos.
2119 ###############################################################################
2123 with_kerberos_req=unspecified
2125 AC_ARG_WITH(kerberos,
2126 [ --with-kerberos Include support for Kerberos authentication.],
2127 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
2129 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
2131 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
2132 AC_CACHE_CHECK([for Kerberos 4], ac_cv_kerberos,
2133 [AC_TRY_X_COMPILE([#include <krb.h>],,
2134 [ac_cv_kerberos=yes],
2135 [ac_cv_kerberos=no])])
2136 AC_CACHE_CHECK([for Kerberos 5], ac_cv_kerberos5,
2137 [AC_TRY_X_COMPILE([#include <kerberosIV/krb.h>],,
2138 [ac_cv_kerberos5=yes],
2139 [ac_cv_kerberos5=no])])
2141 if test "$ac_cv_kerberos" = yes ; then
2143 AC_DEFINE(HAVE_KERBEROS)
2146 if test "$ac_cv_kerberos5" = yes ; then
2148 # Andrew Snare <ajs@pigpond.com> wrote:
2150 # You were assuming that if kerberosV (krb5) was found, then kerberosIV
2151 # (krb4) was also available. This turns out not to be the case with
2152 # mit-krb-1.2.7; apparently backwards-compatibility with KerberosIV
2155 # So, disable kerberosV support if libkrb4 can't be found.
2156 # This is not the best solution, but it makes the compile not fail.
2158 AC_CHECK_X_LIB(krb4, krb_get_tf_realm,
2159 [have_kerberos=yes],
2161 if test "$have_kerberos" = yes ; then
2163 AC_DEFINE(HAVE_KERBEROS)
2164 AC_DEFINE(HAVE_KERBEROS5)
2167 AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
2172 if test "$have_kerberos5" = yes ; then
2173 # from Matt Knopp <mhat@infocalypse.netlag.com>
2174 # (who got it from amu@mit.edu)
2176 PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
2178 # jwz: MacOS X uses -lkrb5, but not -lcrypt
2179 AC_CHECK_X_LIB(crypt, crypt, [PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2181 elif test "$have_kerberos" = yes ; then
2182 # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
2183 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
2186 if test "$have_kerberos" = yes ; then
2187 AC_CHECK_FUNC(res_search,,
2188 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
2189 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
2195 ###############################################################################
2197 # Check for the nine billion variants of shadow passwords...
2199 ###############################################################################
2204 with_shadow_req=unspecified
2207 [ --with-shadow Include support for shadow password authentication.],
2208 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
2210 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
2212 if test "$enable_locking" = no ; then
2218 ###############################################################################
2220 # Check for Sun "adjunct" passwords.
2222 ###############################################################################
2224 if test "$with_shadow" = yes ; then
2225 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
2226 [AC_TRY_X_COMPILE([#include <stdlib.h>
2228 #include <sys/types.h>
2229 #include <sys/label.h>
2230 #include <sys/audit.h>
2231 #include <pwdadj.h>],
2232 [struct passwd_adjunct *p = getpwanam("nobody");
2233 const char *pw = p->pwa_passwd;],
2234 [ac_cv_sun_adjunct=yes],
2235 [ac_cv_sun_adjunct=no])])
2236 if test "$ac_cv_sun_adjunct" = yes; then
2237 have_shadow_adjunct=yes
2244 ###############################################################################
2246 # Check for DEC and SCO so-called "enhanced" security.
2248 ###############################################################################
2250 if test "$with_shadow" = yes ; then
2251 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
2252 [AC_TRY_X_COMPILE([#include <stdlib.h>
2254 #include <sys/types.h>
2256 #include <sys/security.h>
2258 [struct pr_passwd *p;
2260 set_auth_parameters(0, 0);
2261 check_auth_parameters();
2262 p = getprpwnam("nobody");
2263 pw = p->ufld.fd_encrypt;],
2264 [ac_cv_enhanced_passwd=yes],
2265 [ac_cv_enhanced_passwd=no])])
2266 if test $ac_cv_enhanced_passwd = yes; then
2267 have_shadow_enhanced=yes
2271 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
2272 # (I'm told it needs -lcurses too, but I don't understand why.)
2273 # But on DEC, it's in -lsecurity.
2275 AC_CHECK_LIB(prot, getprpwnam,
2276 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
2277 [AC_CHECK_LIB(security, getprpwnam,
2278 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
2283 ###############################################################################
2285 # Check for HP's entry in the "Not Invented Here" Sweepstakes.
2287 ###############################################################################
2289 if test "$with_shadow" = yes ; then
2290 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
2291 [AC_TRY_X_COMPILE([#include <stdlib.h>
2293 #include <sys/types.h>
2295 #include <hpsecurity.h>
2297 [struct s_passwd *p = getspwnam("nobody");
2298 const char *pw = p->pw_passwd;],
2299 [ac_cv_hpux_passwd=yes],
2300 [ac_cv_hpux_passwd=no])])
2301 if test "$ac_cv_hpux_passwd" = yes; then
2302 have_shadow_hpux=yes
2306 # on HPUX, bigcrypt is in -lsec
2307 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
2312 ###############################################################################
2314 # Check for FreeBSD-style shadow passwords.
2316 # On FreeBSD, getpwnam() and friends work just like on non-shadow-
2317 # password systems -- except you only get stuff in the pw_passwd field
2318 # if the running program is setuid. So, guess that we've got this
2319 # lossage to contend with if /etc/master.passwd exists, and default to
2320 # a setuid installation.
2322 ###############################################################################
2324 if test "$with_shadow" = yes ; then
2325 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
2326 [if test -f /etc/master.passwd ; then
2327 ac_cv_master_passwd=yes
2329 ac_cv_master_passwd=no
2331 if test "$ac_cv_master_passwd" = yes; then
2337 ###############################################################################
2339 # Check for traditional (ha!) shadow passwords.
2341 ###############################################################################
2343 if test "$with_shadow" = yes ; then
2344 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
2345 [AC_TRY_X_COMPILE([#include <stdlib.h>
2347 #include <sys/types.h>
2349 #include <shadow.h>],
2350 [struct spwd *p = getspnam("nobody");
2351 const char *pw = p->sp_pwdp;],
2353 [ac_cv_shadow=no])])
2354 if test "$ac_cv_shadow" = yes; then
2358 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
2360 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
2361 if test "$have_getspnam" = no ; then
2362 AC_CHECK_LIB(gen, getspnam,
2363 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
2369 ###############################################################################
2371 # Check for other libraries needed for non-shadow passwords.
2373 ###############################################################################
2375 if test "$enable_locking" = yes ; then
2377 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
2379 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
2380 if test "$have_crypt" = no ; then
2381 AC_CHECK_LIB(crypt, crypt,
2382 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2387 # Most of the above shadow mechanisms will have set need_setuid to yes,
2388 # if they were found. But, on some systems, we need setuid even when
2389 # using plain old vanilla passwords.
2391 if test "$enable_locking" = yes ; then
2393 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
2400 if test "$have_shadow_adjunct" = yes ; then
2401 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
2402 elif test "$have_shadow_enhanced" = yes ; then
2403 AC_DEFINE(HAVE_ENHANCED_PASSWD)
2404 elif test "$have_shadow_hpux" = yes ; then
2405 AC_DEFINE(HAVE_HPUX_PASSWD)
2406 elif test "$have_shadow" = yes ; then
2407 AC_DEFINE(HAVE_SHADOW_PASSWD)
2411 ###############################################################################
2413 # Check for external password helper
2414 # On SuSE, instead of having xscreensaver be a setuid program, they
2415 # fork an external program that takes the password on stdin, and
2416 # returns true if that password is a valid one. Then only that
2417 # smaller program needs to be setuid.
2419 # (Note that this external program is not a GUI: the GUI is still
2420 # all in xscreensaver itself; the external program just does auth.)
2422 ###############################################################################
2424 have_passwd_helper=no
2425 with_passwd_helper_req=unspecified
2427 AC_ARG_WITH(passwd-helper,
2428 [ --with-passwd-helper Include support for an external password
2429 verification helper program.],
2430 [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no])
2431 # no HANDLE_X_PATH_ARG for this one
2433 if test "$enable_locking" = no ; then
2434 with_passwd_helper_req=no
2435 with_passwd_helper=no
2438 case "$with_passwd_helper" in
2441 AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
2442 have_passwd_helper=yes;;
2444 echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
2449 ###############################################################################
2451 # Check for a login manager for a "New Login" button on the lock dialog.
2452 # Usually this will be "/usr/bin/gdmflexiserver".
2454 ###############################################################################
2456 with_login_manager_req=unspecified
2457 default_login_manager_1='gdmflexiserver -ls'
2458 default_login_manager_2='kdmctl reserve'
2459 default_login_manager_3='lxdm -c USER_SWITCH'
2460 default_login_manager_4='dm-tool switch-to-greeter'
2462 AC_ARG_WITH(login-manager,
2463 [ --with-login-manager Put a "New Login" button on the unlock dialog that
2464 runs a login manager like gdmflexiserver or kdmctl.],
2465 [with_login_manager="$withval"; with_login_manager_req="$withval"],
2466 [with_login_manager=yes])
2467 # no HANDLE_X_PATH_ARG for this one
2469 if test "$enable_locking" = no ; then
2470 with_login_manager_req=no
2471 with_login_manager=no
2474 case "$with_login_manager_req" in
2476 with_login_manager=""
2480 # Try various defaults, use the first one that exists.
2482 with_login_manager=""
2484 if test -z "$with_login_manager" ; then
2485 set dummy $default_login_manager_1 ; login_manager_tmp=$2
2486 unset ac_cv_path_login_manager_tmp # don't cache
2487 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2488 if test ! -z "$login_manager_tmp" ; then
2489 with_login_manager="$default_login_manager_1"
2493 if test -z "$with_login_manager" ; then
2494 set dummy $default_login_manager_2 ; login_manager_tmp=$2
2495 unset ac_cv_path_login_manager_tmp # don't cache
2496 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2497 if test ! -z "$login_manager_tmp" ; then
2498 with_login_manager="$default_login_manager_2"
2502 if test -z "$with_login_manager" ; then
2503 set dummy $default_login_manager_3 ; login_manager_tmp=$2
2504 unset ac_cv_path_login_manager_tmp # don't cache
2505 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2506 if test ! -z "$login_manager_tmp" ; then
2507 with_login_manager="$default_login_manager_3"
2511 if test -z "$with_login_manager" ; then
2512 set dummy $default_login_manager_4 ; login_manager_tmp=$2
2513 unset ac_cv_path_login_manager_tmp # don't cache
2514 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2515 if test ! -z "$login_manager_tmp" ; then
2516 with_login_manager="$default_login_manager_4"
2523 # absolute path specified on cmd line
2524 set dummy $with_login_manager_req ; login_manager_tmp=$2
2525 AC_MSG_CHECKING([for $login_manager_tmp])
2526 if test -x "$login_manager_tmp" ; then
2530 with_login_manager=""
2535 # relative path specified on cmd line
2536 set dummy $with_login_manager_req ; login_manager_tmp=$2
2537 unset ac_cv_path_login_manager_tmp # don't cache
2538 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2539 if test -z "$login_manager_tmp" ; then
2540 with_login_manager=""
2542 with_login_manager="$login_manager_tmp"
2546 ac_cv_login_manager_program="$with_login_manager"
2548 NEW_LOGIN_COMMAND_P=''
2549 NEW_LOGIN_COMMAND="$ac_cv_login_manager_program"
2551 AC_MSG_CHECKING(for login manager)
2552 if test -z "$NEW_LOGIN_COMMAND" ; then
2553 NEW_LOGIN_COMMAND="$default_login_manager_1"
2554 NEW_LOGIN_COMMAND_P='! '
2555 AC_MSG_RESULT($NEW_LOGIN_COMMAND (disabled))
2557 AC_MSG_RESULT($NEW_LOGIN_COMMAND)
2561 ###############################################################################
2563 # Check for -lgtk (and Gnome stuff)
2565 ###############################################################################
2568 with_gtk_req=unspecified
2570 User interface options:
2572 --with-gtk Use the Gtk toolkit for the user interface.],
2573 [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
2575 # if --with-gtk=/directory/ was specified, remember that directory so that
2576 # we can also look for the `gtk-config' program in that directory.
2586 HANDLE_X_PATH_ARG(with_gtk, --with-gtk, Gtk)
2588 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
2589 echo "error: must be yes or no: --with-gtk=$with_gtk"
2594 parse_gtk_version_string() {
2597 maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
2598 min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
2600 ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
2601 if test -z "$ac_gtk_version"; then
2602 ac_gtk_version=unknown
2603 ac_gtk_version_string=unknown
2607 # Find pkg-config... (need this for both gtk and gdk_pixbuf.)
2608 # if the user specified --with-gtk=/foo/ then look there.
2611 if test ! -z "$gtk_dir"; then
2612 # canonicalize slashes.
2613 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
2614 gtk_path="$foo:$gtk_path"
2617 AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
2619 if test -z "$pkg_config" ; then
2620 AC_MSG_WARN([pkg-config not found!])
2625 # Utility function for running pkg-config-based tests...
2628 pkg_check_version() {
2629 if test "$ok" = yes ; then
2632 AC_MSG_CHECKING(for $req)
2633 if $pkg_config --exists "$req" ; then
2634 vers=`$pkg_config --modversion "$req"`
2635 if $pkg_config --exists "$req >= $min" ; then
2636 AC_MSG_RESULT($vers)
2640 AC_MSG_RESULT($vers (wanted >= $min))
2655 have_gtk_2_22_or_higher=no
2656 COMMENT_DEMO_GLADE2_GTK_2_22_HEAD=""
2657 COMMENT_DEMO_GLADE2_GTK_2_22_TAIL=""
2659 if test "$with_gtk" = yes; then
2663 pkg_check_version gtk+-2.0 2.0.1 ; ac_gtk_version_string="$vers"
2664 pkg_check_version gmodule-2.0 2.0.0
2665 pkg_check_version libxml-2.0 2.4.6
2666 pkg_check_version libglade-2.0 1.99.0
2667 pkg_check_version gdk-pixbuf-2.0 2.0.0
2668 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
2671 if test "$have_gtk" = no; then
2672 if test -n "$ac_gtk_version_string" ; then
2673 gtk_halfassed="$ac_gtk_version_string"
2674 gtk_halfassed_lib="$req"
2678 if test "$have_gtk" = yes; then
2679 parse_gtk_version_string
2683 if test "$have_gtk" = yes; then
2684 AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
2685 [ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
2686 AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
2687 [ac_cv_gtk_config_libs=`$pkg_config --libs $pkgs`])
2690 ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
2691 ac_gtk_config_libs=$ac_cv_gtk_config_libs
2695 if test "$have_gtk" = yes; then
2696 GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
2697 GTK_DATADIR="$GTK_DATADIR/share"
2700 if test "$have_gtk" = yes; then
2701 INCLUDES="$INCLUDES $ac_gtk_config_cflags"
2702 GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
2704 AC_DEFINE(HAVE_GTK2)
2708 if test "$have_gtk" = yes; then
2710 pkg_check_version gtk+-2.0 2.22
2711 have_gtk_2_22_or_higher="$ok"
2712 if test "$have_gtk_2_22_or_higher" = yes; then
2713 COMMENT_DEMO_GLADE2_GTK_2_22_HEAD="<!-- comment>"
2714 COMMENT_DEMO_GLADE2_GTK_2_22_TAIL="</comment -->"
2720 # Check for the various Gnome help and URL loading programs.
2722 WITH_BROWSER=gnome-open
2723 if test "$have_gtk" = yes; then
2724 AC_CHECK_PROGS(gnome_open_program, gnome-open)
2725 AC_CHECK_PROGS(gnome_url_show_program, gnome-url-show)
2729 ###############################################################################
2733 ###############################################################################
2736 with_motif_req=unspecified
2737 AC_ARG_WITH(motif,[ --with-motif Use the Motif toolkit for the user interface
2738 (no longer supported.)],
2739 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
2741 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
2743 if test "$with_motif" != yes -a "$with_motif" != no ; then
2744 echo "error: must be yes or no: --with-motif=$with_motif"
2748 if test "$with_motif" = yes; then
2750 AC_CHECK_X_HEADER(Xm/Xm.h,
2752 AC_DEFINE(HAVE_MOTIF)
2753 MOTIF_LIBS="$MOTIF_LIBS -lXm"],,
2754 [#include <stdlib.h>
2756 #include <X11/Intrinsic.h>])
2760 if test "$have_motif" = yes; then
2761 AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)],,
2762 [#include <stdlib.h>
2764 #include <X11/Intrinsic.h>])
2768 ###############################################################################
2770 # Checking whether Motif is really Lesstif.
2772 ###############################################################################
2775 if test "$have_motif" = yes ; then
2776 AC_CACHE_CHECK([whether Motif is really LessTif],
2778 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
2779 [long vers = LesstifVersion;],
2780 [ac_cv_have_lesstif=yes],
2781 [ac_cv_have_lesstif=no])])
2782 have_lesstif=$ac_cv_have_lesstif
2786 lesstif_version=unknown
2787 lesstif_version_string=unknown
2789 if test "$have_lesstif" = yes ; then
2791 echo unknown > conftest-lt
2792 AC_CACHE_CHECK([LessTif version number],
2793 ac_cv_lesstif_version_string,
2794 [AC_TRY_X_RUN([#include <stdio.h>
2797 FILE *f = fopen("conftest-lt", "w");
2799 fprintf(f, "%d %d.%d\n", LesstifVersion,
2800 LESSTIF_VERSION, LESSTIF_REVISION);
2804 [ltv=`cat conftest-lt`
2805 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
2806 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
2807 [ac_cv_lesstif_version=unknown
2808 ac_cv_lesstif_version_string=unknown],
2809 [ac_cv_lesstif_version=unknown
2810 ac_cv_lesstif_version_string=unknown])])
2812 lesstif_version=$ac_cv_lesstif_version
2813 lesstif_version_string=$ac_cv_lesstif_version_string
2818 if test "$have_motif" = yes ; then
2820 echo unknown > conftest-mt
2821 AC_CACHE_CHECK([Motif version number],
2822 ac_cv_motif_version_string,
2823 [AC_TRY_X_RUN([#include <stdio.h>
2826 FILE *f = fopen("conftest-mt", "w");
2828 fprintf(f, "%d %d.%d\n", XmVersion,
2829 XmVERSION, XmREVISION);
2833 [mtv=`cat conftest-mt`
2834 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
2835 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
2836 [ac_cv_motif_version=unknown
2837 ac_cv_motif_version_string=unknown],
2838 [ac_cv_motif_version=unknown
2839 ac_cv_motif_version_string=unknown])])
2841 motif_version=$ac_cv_motif_version
2842 motif_version_string=$ac_cv_motif_version_string
2847 ###############################################################################
2849 # Checking whether Motif requires -lXpm.
2851 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
2852 # The deal is, Motif 2.x requires XPM -- but it's a compilation option
2853 # of the library whether to build the XPM code into libXm, or whether
2854 # to rely on an external libXm. So the only way to tell whether XPM is
2855 # a link-time requirement is to examine libXm.a, which is very
2856 # difficult to do in an autoconf script. So... if it's Motif 2.x, we
2857 # always link against XPM if the XPM lib exists (and this will be a
2858 # no-op if libXm happens to already have the XPM code in it.)
2860 ###############################################################################
2862 motif_requires_xpm=no
2863 if test "$have_motif" = yes ; then
2864 AC_MSG_CHECKING(whether Motif requires XPM)
2865 if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
2867 motif_requires_xpm=yes
2868 AC_MSG_RESULT(maybe)
2875 ###############################################################################
2877 # Checking whether Motif requires -lXp.
2879 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
2880 # Extension". Why this extension isn't in -lXext with all the others,
2883 ###############################################################################
2886 if test "$have_motif" = yes ; then
2888 AC_CHECK_X_LIB(Xp, XpQueryExtension,
2889 [have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"],
2890 [true], -lX11 -lXext -lm)
2894 ###############################################################################
2896 # Checking whether Motif requires -lXintl (for _Xsetlocale.)
2898 ###############################################################################
2901 if test "$have_motif" = yes ; then
2902 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
2904 if test "$have_xintl" = yes; then
2905 MOTIF_LIBS="$MOTIF_LIBS -lXintl"
2910 ###############################################################################
2912 # Check for -lGL or -lMesaGL.
2914 ###############################################################################
2918 with_gl_req=unspecified
2923 --with-gl Build those demos which depend on OpenGL.],
2924 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
2926 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
2928 ac_mesagl_version=unknown
2929 ac_mesagl_version_string=unknown
2931 if test "$with_gl" = yes; then
2932 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
2933 if test "$have_gl" = yes ; then
2934 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no,
2935 [#include <GL/gl.h>])
2938 # If we have the headers, try and figure out which vendor it's from.
2940 if test "$have_gl" = yes ; then
2942 # We need to know whether it's MesaGL so that we know which libraries
2945 AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl,
2946 [ac_cv_have_mesa_gl=no
2947 if test "$ac_macosx" = no; then
2948 # WTF! MacOS 10.5.0 ships the Mesa GL headers!
2949 # It's not really Mesa, is it?
2950 AC_EGREP_X_HEADER(Mesa|MESA, GL/glx.h, [ac_cv_have_mesa_gl=yes])
2952 ac_have_mesa_gl=$ac_cv_have_mesa_gl
2957 if test "$ac_macosx" = yes; then
2959 # Without these, every link against libGL gets a bunch of useless
2962 osx_crud="-bind_at_load -multiply_defined suppress"
2963 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2964 GL_LIBS="$GL_LIBS $osx_crud"
2967 # New lossage in 10.5.0: without this, we get:
2968 # ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
2970 osx_crud="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
2971 osx_crud="-Wl,-dylib_file,${osx_crud}:${osx_crud}"
2973 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2974 GL_LIBS="$GL_LIBS $osx_crud"
2977 # New lossage in 10.6.8: we can't allow -L/opt/local/lib to be in the
2978 # link line, or at runtime XQueryExtension gets a segv due to some kind
2979 # of library version skew. Libs must come from /usr/X11/lib even if
2980 # $prefix and/or $exec_prefix are set to /opt/local/.
2982 AC_MSG_RESULT(omitting "$libdir" from LDFLAGS)
2988 # Some versions of MesaGL are compiled to require -lpthread.
2989 # So if the Mesa headers exist, and -lpthread exists, then always
2990 # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
2992 # Oftentimes, AX_PTHREAD will bring in -lpthread as well; but that ends
2993 # up before -l(Mesa)GL, instead of after where it would belong.
2995 if test "$ac_have_mesa_gl" = yes; then
2996 AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],)
3000 # If we have Mesa headers, check to see if we can link against -lMesaGL.
3001 # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
3002 # Else, warn that GL is busted. (We have the headers, but no libs.)
3005 if test "$ac_have_mesa_gl" = yes ; then
3006 AC_CHECK_X_LIB(MesaGL, glXCreateContext,
3008 GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS"],
3009 [], -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
3012 if test "$gl_lib_1" = "" ; then
3013 AC_CHECK_X_LIB(GL, glXCreateContext,
3015 GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS"],
3016 [], -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
3019 if test "$gl_lib_1" = "" ; then
3020 # we have headers, but no libs -- bail.
3025 # linking works -- we can build the GL hacks.
3027 if test "$ac_have_mesa_gl" = yes ; then
3028 AC_DEFINE(HAVE_MESA_GL)
3034 # Now that we know we have GL headers and libs, do some more GL testing.
3037 if test "$have_gl" = yes ; then
3038 # If it's MesaGL, we'd like to issue a warning if the version number
3039 # is less than or equal to 2.6, because that version had a security bug.
3041 if test "$ac_have_mesa_gl" = yes; then
3043 AC_CACHE_CHECK([MesaGL version number], ac_cv_mesagl_version_string,
3044 [cat > conftest.$ac_ext <<EOF
3045 #line __oline__ "configure"
3046 #include "confdefs.h"
3048 #ifndef MESA_MAJOR_VERSION
3049 # include <GL/xmesa.h>
3050 # ifdef XMESA_MAJOR_VERSION
3051 /* Around Mesa 3.2, they took out the Mesa version number, so instead,
3052 we have to check the XMesa version number (the number of the X protocol
3053 support, which seems to be the same as the Mesa version number.)
3055 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
3056 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
3058 /* Oh great. Some time after 3.4, they took out the xmesa.h header file,
3059 so we have no way of telling what version of Mesa this is at all.
3060 So, we'll guess that the osmesa version (the "offscreen protocol")
3061 is less than or equal to the real mesa version number. Except that
3062 if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
3063 Mesa 3.4. And Mesa 3.3 had xmesa.h. What a complete load of shit!
3065 # include <GL/osmesa.h>
3066 # define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
3067 # define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
3068 # if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
3069 # undef MESA_MINOR_VERSION
3070 # define MESA_MINOR_VERSION 4 or newer, probably?
3074 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
3077 ac_save_CPPFLAGS="$CPPFLAGS"
3078 if test \! -z "$includedir" ; then
3079 CPPFLAGS="$CPPFLAGS -I$includedir"
3081 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3083 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | grep configure:`
3087 mglv=`echo "$mglv" | sed -n \
3088 's/^configure: *\([0-9][0-9]*\) *\([0-9].*\)$/\1.\2/p'`
3091 rm -f conftest.$ac_ext
3093 CPPFLAGS="$ac_save_CPPFLAGS"
3095 if test "$mglv" = ""; then
3096 ac_mesagl_version=unknown
3097 ac_mesagl_version_string=unknown
3099 ac_mesagl_version_string="$mglv"
3102 maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
3103 min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
3105 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
3106 if test -z "$ac_mesagl_version"; then
3107 ac_mesagl_version=unknown
3108 ac_mesagl_version_string=unknown
3111 ac_cv_mesagl_version=$ac_mesagl_version
3112 ac_cv_mesagl_version_string=$ac_mesagl_version_string
3114 ac_mesagl_version=$ac_cv_mesagl_version
3115 ac_mesagl_version_string=$ac_cv_mesagl_version_string
3119 # Check for OpenGL 1.1 features.
3121 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
3122 [true], $GL_LIBS -lX11 -lXext -lm)
3125 elif test "$with_gl" != no; then
3126 echo "error: must be yes or no: --with-gl=$with_gl"
3131 ###############################################################################
3135 ###############################################################################
3138 with_gle_req=unspecified
3141 [ --with-gle Build those demos which depend on GLE
3142 (the OpenGL "extrusion" library.)],
3143 [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes])
3145 HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE)
3149 if test "$have_gl" = no ; then
3151 elif test "$with_gle" = yes; then
3153 AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no,
3154 [#include <GL/gl.h>])
3155 if test "$have_gle3" = yes ; then
3158 AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no,
3159 [#include <GL/gl.h>])
3160 if test "$have_gle" = yes ; then
3161 AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no,
3162 [#include <GL/gl.h>])
3166 if test "$have_gle" = yes ; then
3169 AC_CHECK_X_LIB(gle, gleCreateGC,
3170 [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"],
3171 [], $GL_LIBS -lX11 -lXext -lm)
3173 if test "$have_gle" = yes ; then
3177 # sometimes the libmatrix stuff is included in libgle. look there first.
3179 # I don't get it. For some reason, this test passes on SGI, as if
3180 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
3181 # Yet the link is succeeding. Why???
3183 # AC_CHECK_X_LIB(gle, uview_direction_d,
3184 # [have_gle=yes; gle_halfassed=no],
3185 # [], $GL_LIBS -lX11 -lXext -lm)
3187 # As of GLE 3 this is in libgle, and has changed name to uview_direction!
3189 if test "$have_gle3" = yes ; then
3190 AC_CHECK_X_LIB(gle, uview_direction,
3191 [have_gle=yes; gle_halfassed=no],
3192 [], $GL_LIBS -lX11 -lXext -lm)
3194 # if it wasn't in libgle, then look in libmatrix.
3195 if test "$have_gle" = no ; then
3196 AC_CHECK_X_LIB(matrix, uview_direction_d,
3197 [have_gle=yes; gle_halfassed=no;
3198 GLE_LIBS="$GLE_LIBS -lmatrix"],
3199 [], $GL_LIBS -lX11 -lXext -lm)
3203 if test "$have_gle" = yes ; then
3205 if test "$have_gle3" = yes ; then
3206 AC_DEFINE(HAVE_GLE3)
3210 elif test "$with_gle" != no; then
3211 echo "error: must be yes or no: --with-gle=$with_gle"
3217 ###############################################################################
3219 # Handle --with-gles
3221 ###############################################################################
3223 with_gles_req=unspecified
3225 [ --with-gles Target OpenGL ES 1.x API instead of OpenGL 1.3.],
3226 [with_gles="$withval"; with_gles_req="$withval"],[with_gles=no])
3228 HANDLE_X_PATH_ARG(with_gles, --with-gles, JWZGLES)
3230 if test "$with_gles" = yes; then
3232 AC_DEFINE(HAVE_JWZGLES)
3233 JWZGLES_OBJS="jwzgles.o"
3234 AC_MSG_RESULT(using OpenGL ES compatiblity shim)
3235 elif test "$with_gles" != no; then
3236 echo "error: must be yes or no: --with-gles=$with_xpm"
3240 ###############################################################################
3242 # Check for -lgdk_pixbuf.
3243 # These tests are for gdk_pixbuf usage of the hacks,
3244 # not xscreensaver-demo (thus we have to test again to get
3245 # the libraries right: don't want to pull in all of GTK
3248 ###############################################################################
3251 with_gdk_pixbuf_req=unspecified
3253 [ --with-pixbuf Include support for the GDK-Pixbuf library in some
3254 demos, which will make it possible for them to read
3255 GIF, JPEG, and PNG files as well.],
3256 [with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"],
3257 [with_gdk_pixbuf=yes])
3259 # if --with-pixbuf=/directory/ was specified, remember that directory so that
3260 # we can also look for the `gdk-pixbuf-config' program in that directory.
3261 case "$with_gdk_pixbuf" in
3263 gdk_pixbuf_dir="$with_gdk_pixbuf"
3270 HANDLE_X_PATH_ARG(with_gdk_pixbuf, --with-pixbuf, GDK_PIXBUF)
3272 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
3273 echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
3277 if test "$with_gdk_pixbuf" = yes; then
3283 pkg_check_version gdk-pixbuf-2.0 2.0.0
3284 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
3285 have_gdk_pixbuf="$ok"
3287 if test "$have_gdk_pixbuf" = yes; then
3288 AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
3289 [ac_cv_gdk_pixbuf_config_cflags=`$pkg_config --cflags $pkgs`])
3290 AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
3291 [ac_cv_gdk_pixbuf_config_libs=`$pkg_config --libs $pkgs`])
3294 ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
3295 ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
3298 if test "$have_gdk_pixbuf" = yes; then
3300 # we appear to have pixbuf; check for headers/libs to be sure.
3302 ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
3303 CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
3307 # check for header A...
3308 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf.h, [have_gdk_pixbuf=yes])
3310 # if that worked, check for header B...
3311 if test "$have_gdk_pixbuf" = yes; then
3313 gdk_pixbuf_halfassed=yes
3314 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf-xlib.h,
3315 [have_gdk_pixbuf=yes
3316 gdk_pixbuf_halfassed=no])
3318 # yay, it has a new name in Gtk 2.x...
3319 if test "$have_gdk_pixbuf" = no; then
3321 gdk_pixbuf_halfassed=yes
3322 AC_CHECK_X_HEADER(gdk-pixbuf-xlib/gdk-pixbuf-xlib.h,
3323 [have_gdk_pixbuf=yes
3324 gdk_pixbuf_halfassed=no])
3327 CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
3330 if test "$have_gdk_pixbuf" = yes; then
3331 # we have the headers, now check for the libraries
3333 gdk_pixbuf_halfassed=yes
3335 AC_MSG_RESULT(checking for gdk_pixbuf usability...)
3338 AC_CHECK_X_LIB(c, gdk_pixbuf_new_from_file, [have_gdk_pixbuf=yes],,
3339 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3341 if test "$have_gdk_pixbuf" = yes; then
3343 AC_CHECK_X_LIB(c, gdk_pixbuf_xlib_init,
3344 [have_gdk_pixbuf=yes
3345 gdk_pixbuf_halfassed=no],,
3346 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3350 if test "$have_gdk_pixbuf" = yes; then
3351 INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
3352 XPM_LIBS="$ac_gdk_pixbuf_config_libs"
3353 AC_DEFINE(HAVE_GDK_PIXBUF)
3355 AC_MSG_RESULT(checking for gdk_pixbuf usability... no)
3358 if test "$have_gdk_pixbuf" = yes; then
3359 AC_CHECK_X_LIB(c, gdk_pixbuf_apply_embedded_orientation,
3360 [AC_DEFINE(HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION)],,
3361 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3366 ###############################################################################
3370 ###############################################################################
3373 with_xpm_req=unspecified
3375 [ --with-xpm Include support for XPM files in some demos.
3376 (Not needed if Pixbuf is used.)],
3377 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
3379 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
3381 if test "$with_xpm" = yes; then
3382 AC_CHECK_X_HEADER(X11/xpm.h,
3385 XPM_LIBS="-lXpm $XPM_LIBS"],,
3386 [#include <X11/Xlib.h>])
3387 elif test "$with_xpm" != no; then
3388 echo "error: must be yes or no: --with-xpm=$with_xpm"
3392 # See comment near $motif_requires_xpm, above.
3393 # Need to do this here, after both Motif and XPM have been checked for.
3395 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
3396 if test "$motif_requires_xpm" = yes ; then
3397 MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
3401 if test "$XPM_LIBS" = "" ; then
3406 ###############################################################################
3410 ###############################################################################
3413 with_jpeg_req=unspecified
3416 [ --with-jpeg Include support for the JPEG library.],
3417 [with_jpeg="$withval"; with_jpeg_req="$withval"],
3420 HANDLE_X_PATH_ARG(with_jpeg, --with-jpeg, JPEG)
3422 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
3423 echo "error: must be yes or no: --with-jpeg=$with_jpeg"
3427 if test "$with_jpeg" = yes; then
3430 AC_CHECK_X_HEADER(jpeglib.h, [have_jpeg=yes])
3432 if test "$have_jpeg" = yes; then
3433 # we have the header, now check for the library
3436 AC_CHECK_X_LIB(jpeg, jpeg_start_compress,
3440 AC_DEFINE(HAVE_JPEGLIB)])
3445 ###############################################################################
3449 ###############################################################################
3451 have_xutf8drawstring=no
3452 AC_CHECK_X_LIB(X11, Xutf8DrawString,
3453 [have_xutf8drawstring=yes],
3454 [true], -lX11 -lXext -lm)
3455 if test "$have_xutf8drawstring" = yes ; then
3456 AC_DEFINE(HAVE_XUTF8DRAWSTRING)
3461 with_xft_req=unspecified
3464 [ --with-xft Include support for the X Freetype library.],
3465 [with_xft="$withval"; with_xft_req="$withval"],
3468 HANDLE_X_PATH_ARG(with_xft, --with-xft, Xft)
3470 if test "$with_xft" != yes -a "$with_xft" != no ; then
3471 echo "error: must be yes or no: --with-xft=$with_xft"
3475 if test "$with_xft" = yes; then
3479 pkg_check_version xft 2.1.0
3482 if test "$have_xft" = yes; then
3483 AC_CACHE_CHECK([for Xft includes], ac_cv_xft_config_cflags,
3484 [ac_cv_xft_config_cflags=`$pkg_config --cflags $pkgs`])
3485 AC_CACHE_CHECK([for Xft libs], ac_cv_xft_config_libs,
3486 [ac_cv_xft_config_libs=`$pkg_config --libs $pkgs`])
3489 ac_xft_config_cflags=$ac_cv_xft_config_cflags
3490 ac_xft_config_libs=$ac_cv_xft_config_libs
3492 if test "$have_xft" = yes; then
3494 # we appear to have Xft; check for headers/libs to be sure.
3496 ac_save_xft_CPPFLAGS="$CPPFLAGS"
3497 CPPFLAGS="$CPPFLAGS $ac_xft_config_cflags"
3500 AC_CHECK_X_HEADER(X11/Xft/Xft.h, [have_xft=yes])
3502 CPPFLAGS="$ac_save_xft_CPPFLAGS"
3505 if test "$have_xft" = yes; then
3506 # we have the headers, now check for the libraries
3510 AC_MSG_RESULT(checking for Xft usability...)
3511 AC_CHECK_X_LIB(c, XftDrawStringUtf8, [have_xft=yes],,
3512 $ac_xft_config_libs -lX11 -lXext -lm)
3515 if test "$have_xft" = no; then
3516 AC_MSG_RESULT(checking for Xft usability... no)
3520 if test "$have_xft" = yes; then
3521 INCLUDES="$INCLUDES $ac_xft_config_cflags"
3522 XFT_LIBS="$ac_xft_config_libs"
3528 XFT_SRCS='$(UTILS_SRC)/xft.c'
3529 XFT_OBJS='$(UTILS_BIN)/xft.o'
3533 ###############################################################################
3535 # Check for pty support: this allows 'phosphor' and 'apple2'
3536 # to run curses-based programs, or be used as terminal windows.
3538 ###############################################################################
3541 AC_CHECK_HEADERS(pty.h util.h)
3542 AC_CHECK_X_LIB(util, forkpty,
3545 AC_DEFINE(HAVE_FORKPTY)])
3547 if test "$ac_have_forkpty" != yes ; then
3548 # we don't need (or have) -lutil on MacOS 10.4.2...
3549 AC_CHECK_X_LIB(c, forkpty,
3551 AC_DEFINE(HAVE_FORKPTY)])
3554 ###############################################################################
3556 # Check for the XSHM server extension.
3558 ###############################################################################
3561 with_xshm_req=unspecified
3562 AC_ARG_WITH(xshm-ext,
3563 [ --with-xshm-ext Include support for the Shared Memory extension.],
3564 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
3566 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
3568 if test "$with_xshm" = yes; then
3570 # first check for Xshm.h.
3571 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes],,
3572 [#include <X11/Xlib.h>])
3574 # if that succeeded, then check for sys/ipc.h.
3575 if test "$have_xshm" = yes; then
3577 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
3580 # if that succeeded, then check for sys/shm.h.
3581 if test "$have_xshm" = yes; then
3583 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
3586 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
3587 # to exist, but the library code to not exist. And even better, the library
3588 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
3589 # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
3590 # that's not quite right, but close enough.)
3594 if [ `uname -v` -eq 3 ]; then
3596 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
3597 [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
3598 [true], -lX11 -lXext -lm)
3603 # if that succeeded, then we've really got it.
3604 if test "$have_xshm" = yes; then
3605 AC_DEFINE(HAVE_XSHM_EXTENSION)
3608 elif test "$with_xshm" != no; then
3609 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
3614 ###############################################################################
3616 # Check for the DOUBLE-BUFFER server extension.
3618 ###############################################################################
3621 with_xdbe_req=unspecified
3622 AC_ARG_WITH(xdbe-ext,
3623 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER extension.],
3624 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
3626 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
3628 if test "$with_xdbe" = yes; then
3630 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes],,
3631 [#include <X11/Xlib.h>])
3632 if test "$have_xdbe" = yes; then
3633 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
3636 elif test "$with_xdbe" != no; then
3637 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
3642 ###############################################################################
3644 # Check for the SGI XReadDisplay server extension.
3646 # Note: this has to be down here, rather than up with the other server
3647 # extension tests, so that the output of `configure --help' is in the
3648 # right order. Arrgh!
3650 ###############################################################################
3653 with_readdisplay_req=unspecified
3654 AC_ARG_WITH(readdisplay,
3655 [ --with-readdisplay Include support for the XReadDisplay extension.],
3656 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
3657 [with_readdisplay=yes])
3659 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
3661 if test "$with_readdisplay" = yes; then
3662 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
3663 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION),,
3664 [#include <X11/Xlib.h>])
3665 elif test "$with_readdisplay" != no; then
3666 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
3671 ###############################################################################
3673 # Check for a directory full of images to use as the default value
3674 # of the "imageDirectory" preference.
3676 ###############################################################################
3679 with_imagedir_req=unspecified
3681 AC_ARG_WITH(image-directory,
3682 [ --with-image-directory Arg is the default directory from which some demos
3683 will choose random images to display.],
3684 [with_imagedir="$withval"; with_imagedir_req="$withval"],
3685 [with_imagedir=yes])
3686 # no HANDLE_X_PATH_ARG for this one
3688 case "$with_imagedir" in
3691 AC_MSG_CHECKING([for image directory $with_imagedir])
3692 if test -d "$with_imagedir" ; then
3702 #### Could use some more defaults here...
3704 "/usr/share/backgrounds/images/" \
3705 "/usr/share/wallpapers/" \
3706 "/Library/Desktop Pictures/" \
3708 if test -z "$with_imagedir"; then
3709 AC_MSG_CHECKING([for image directory $dd])
3710 if test -d "$dd" ; then
3725 echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req"
3729 ac_cv_imagedir="$with_imagedir"
3731 DEFAULT_IMAGES_P='True'
3732 DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir"
3734 if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then
3735 DEFAULT_IMAGES_P='False'
3739 ###############################################################################
3741 # Pick a text file to use as the default of the "textFile" preference.
3742 # Any old file will do, but preferably one that will make interesting
3743 # shapes when displayed by "starwars" and "fontglide".
3745 ###############################################################################
3748 with_textfile_req=unspecified
3750 AC_ARG_WITH(text-file,
3751 [ --with-text-file=FILE By default, some demos may display this file.],
3752 [with_textfile="$withval"; with_textfile_req="$withval"],
3753 [with_textfile=yes])
3754 # no HANDLE_X_PATH_ARG for this one
3756 case "$with_textfile" in
3759 AC_MSG_CHECKING([for text file $with_textfile])
3760 if test -f "$with_textfile" ; then
3770 #### Could use some more defaults here...
3772 "/usr/X11R6/lib/X11/doc/README" \
3773 "/usr/share/doc/xserver-common/copyright" \
3774 "/usr/share/doc/xserver-xorg-core/copyright" \
3775 "/usr/X11R6/README" \
3776 "/usr/share/doc/libX11*/COPYING" \
3777 "/usr/X11/share/X11/doc/README*" \
3778 "/usr/share/doc/debian/debian-manifesto" \
3780 if test -z "$with_textfile"; then
3781 AC_MSG_CHECKING([for text file $f])
3782 f=`/bin/ls $f 2>&- | head -1`
3783 if test -f "$f" ; then
3798 echo "error: must be an absolute path: --with-text-file=$with_textfile_req"
3802 ac_cv_textfile="$with_textfile"
3804 DEFAULT_TEXT_FILE="$ac_cv_textfile"
3807 ###############################################################################
3809 # Check the browser to see help URL
3811 ###############################################################################
3814 with_browser_req=unspecified
3816 AC_ARG_WITH(browser,
3817 [ --with-browser=BROWSER Specify the web browser used to show the help URL.],
3818 [with_browser="$withval"; with_browser_req="$withval"],
3820 # no HANDLE_X_PATH_ARG for this one
3822 case "$with_browser" in
3826 WITH_BROWSER=$with_browser
3827 gnome_open_program=$with_browser
3828 AC_MSG_CHECKING([for browser $with_browser])
3829 with_browser_fullpath=`which $with_browser 2>/dev/null`
3830 case $with_browser_fullpath in
3837 # Only warning: we don't want to install all packages for the
3838 # dependency of the browser in building stage...
3839 echo "WARNING: browser not found: --with-browser=$with_browser"
3844 ac_cv_browser="$with_browser"
3846 ###############################################################################
3848 # Check whether it's ok to install some hacks as setuid (e.g., "sonar")
3849 # This should be safe, but let's give people the option.
3851 ###############################################################################
3853 setuid_hacks_default=no
3854 setuid_hacks="$setuid_hacks_default"
3855 AC_ARG_WITH(setuid-hacks,
3856 [ --with-setuid-hacks Allow some demos to be installed `setuid root'
3857 (which is needed in order to ping other hosts.)
3859 [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"])
3861 HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks)
3863 if test "$setuid_hacks" = yes; then
3865 elif test "$setuid_hacks" != no; then
3866 echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
3871 ###############################################################################
3873 # Check for --with-record-animation
3875 ###############################################################################
3877 record_anim_default=no
3878 record_anim="$record_anim_default"
3879 AC_ARG_WITH(record-animation,
3880 [ --with-record-animation Include code for generating MP4 videos.
3882 [record_anim="$withval"], [record_anim="$record_anim_default"])
3884 HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation)
3886 if test "$record_anim" = yes; then
3888 elif test "$record_anim" != no; then
3889 echo "error: must be yes or no: --with-record-animation=$record_anim"
3893 if test "$record_anim" = yes; then
3894 if test "$have_gdk_pixbuf" != yes; then
3895 AC_MSG_ERROR(--with-record-animation requires GDK-Pixbuf)
3897 AC_MSG_RESULT(enabling --with-record-animation)
3898 AC_DEFINE(HAVE_RECORD_ANIM)
3899 ANIM_OBJS='$(ANIM_OBJS)'
3900 ANIM_LIBS='$(ANIM_LIBS)'
3904 ###############################################################################
3906 # Done testing. Now, set up the various -I and -L variables,
3907 # and decide which GUI program to build by default.
3909 ###############################################################################
3916 if test \! -z "$includedir" ; then
3917 INCLUDES="$INCLUDES -I$includedir"
3920 if test \! -z "$libdir" ; then
3921 LDFLAGS="$LDFLAGS -L$libdir"
3925 PREFERRED_DEMO_PROGRAM=''
3927 if test "$have_motif" = yes; then
3928 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
3929 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3931 if test "$have_gtk" = yes; then
3932 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
3933 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3937 if test "$have_kerberos" = yes; then
3938 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
3939 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
3941 if test "$have_pam" = yes; then
3942 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
3943 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
3944 INSTALL_PAM="install-pam"
3946 if test "$enable_pam_check_account_type" = yes; then
3947 COMMENT_PAM_CHECK_ACCOUNT=""
3949 COMMENT_PAM_CHECK_ACCOUNT="#"
3951 if test "$have_passwd_helper" = yes; then
3952 PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
3953 PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
3955 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
3956 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
3959 if test "$enable_locking" = yes; then
3960 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
3961 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
3963 LOCK_SRCS='$(NOLOCK_SRCS_1)'
3964 LOCK_OBJS='$(NOLOCK_OBJS_1)'
3967 if test "$ac_macosx" = yes; then
3968 EXES_OSX='$(EXES_OSX)'
3969 SCRIPTS_OSX='$(SCRIPTS_OSX)'
3970 MEN_OSX='$(MEN_OSX)'
3978 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
3980 if test "$need_setuid" = yes; then
3986 if test "$setuid_hacks" = yes; then
3993 if test "$have_gl" = yes; then
3994 GL_EXES='$(GL_EXES)'
3995 SUID_EXES='$(SUID_EXES)'
3996 RETIRED_GL_EXES='$(RETIRED_GL_EXES)'
3997 GL_UTIL_EXES='$(GL_UTIL_EXES)'
4004 if test "$have_gle" = yes; then
4005 GLE_EXES='$(GLE_EXES)'
4011 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
4012 JPEG_EXES='$(JPEG_EXES)'
4016 # Another substitution in the XScreenSaver.ad.in file:
4018 if test "$gnome_open_program" != ''; then
4022 elif test "$gnome_url_show_program" != ''; then
4033 # Set PO_DATADIR to something sensible.
4035 AC_MSG_CHECKING([for locale directory])
4036 if test -n "$GTK_DATADIR" ; then
4037 PO_DATADIR="$GTK_DATADIR"
4038 elif test "$have_gtk" = yes; then
4039 PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
4040 PO_DATADIR="$PO_DATADIR/share"
4043 if test -z "$PO_DATADIR" ; then
4045 # #### Total fucking kludge --
4046 # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
4047 # but of course we need to expand all the nested variables to do that...
4049 dd=`eval eval eval eval eval eval eval eval eval eval eval echo $datadir`
4050 PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'`
4053 AC_MSG_RESULT($PO_DATADIR/locale)
4056 # canonicalize slashes.
4057 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
4059 # gcc 3.0 likes to issue this warning for every file:
4061 # cc1: warning: changing search order for system directory "/usr/local/include"
4062 # cc1: warning: as it has already been specified as a non-system directory
4064 # Yay. We can only avoid that by deleting "-I${prefix}/include" from the list.
4065 # Which *should* be totally redundant, and thus an ok thing to delete?
4067 INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
4070 ###############################################################################
4072 # Perform substitutions and write Makefiles.
4074 ###############################################################################
4078 AC_SUBST(PREFERRED_DEMO_PROGRAM)
4079 AC_SUBST(ALL_DEMO_PROGRAMS)
4080 AC_SUBST(SAVER_LIBS)
4081 AC_SUBST(MOTIF_LIBS)
4090 AC_SUBST(XDPMS_LIBS)
4091 AC_SUBST(XINERAMA_LIBS)
4092 AC_SUBST(PASSWD_LIBS)
4093 AC_SUBST(INSTALL_SETUID)
4094 AC_SUBST(SETUID_HACKS)
4095 AC_SUBST(INSTALL_DIRS)
4096 AC_SUBST(NEED_SETUID)
4097 AC_SUBST(INSTALL_PAM)
4098 AC_SUBST(HAVE_PAM_FAIL_DELAY)
4099 AC_SUBST(COMMENT_PAM_CHECK_ACCOUNT)
4100 AC_SUBST(NEW_LOGIN_COMMAND)
4101 AC_SUBST(NEW_LOGIN_COMMAND_P)
4102 AC_SUBST(DEFAULT_IMAGES_P)
4103 AC_SUBST(DEFAULT_IMAGE_DIRECTORY)
4104 AC_SUBST(DEFAULT_TEXT_FILE)
4105 AC_SUBST(WITH_BROWSER)
4106 AC_SUBST(COMMENT_DEMO_GLADE2_GTK_2_22_HEAD)
4107 AC_SUBST(COMMENT_DEMO_GLADE2_GTK_2_22_TAIL)
4112 AC_SUBST(SCRIPTS_OSX)
4115 AC_SUBST(PASSWD_SRCS)
4116 AC_SUBST(PASSWD_OBJS)
4123 AC_SUBST(SAVER_GL_SRCS)
4124 AC_SUBST(SAVER_GL_OBJS)
4125 AC_SUBST(SAVER_GL_LIBS)
4130 AC_SUBST(RETIRED_GL_EXES)
4132 AC_SUBST(GL_UTIL_EXES)
4136 AC_SUBST(GLE_KLUDGE)
4137 AC_SUBST(JWZGLES_OBJS)
4142 AC_SUBST(HACKDIR_FULL)
4143 AC_SUBST(GTK_DATADIR)
4144 AC_SUBST(PO_DATADIR)
4145 AC_SUBST(HACK_CONF_DIR)
4146 AC_SUBST(GTK_EXTRA_OBJS)
4150 APPDEFAULTS=$ac_x_app_defaults
4151 AC_SUBST(APPDEFAULTS)
4154 AC_SUBST(DEPEND_FLAGS)
4155 AC_SUBST(DEPEND_DEFINES)
4161 driver/xscreensaver.pam
4162 driver/xscreensaver-demo.glade2
4166 driver/XScreenSaver.ad)
4168 ###############################################################################
4170 # Print some warnings at the end.
4172 ###############################################################################
4174 warn_prefix_1=" Warning:"
4175 warn_prefix_2=" Note:"
4176 warn_prefix="$warn_prefix_1"
4179 warnsep=' #################################################################'
4182 if test "$warning" = no ; then
4183 echo '' ; echo "$warnsep" ; echo ''
4190 if test "$warning" = long ; then echo '' ; fi
4193 echo "$warn_prefix $rest"
4200 if test "$was" != no ; then echo '' ; fi
4202 echo "$warn_prefix $rest"
4212 warn_prefix="$warn_prefix_2"
4214 warn_prefix="$warn_prefix_1"
4218 warn_prefix="$warn_prefix_2"
4220 warn_prefix="$warn_prefix_1"
4224 # ac_prog_cc_no_pthread normally only happens on AIX, because according
4225 # to AX_PTHREAD, AIX needs CC=xlc_r or CC=cc_r to do threads.
4226 # If CC is specified, it takes precedence over --with-pthread.
4227 if test "$ac_prog_cc_no_pthread" ; then
4228 warnL "You requested $ac_original_cc for the C compiler, but it doesn't"
4229 warn2 "support POSIX threads."
4231 warn2 "If you have multiple CPU cores, try CC=$PTHREAD_CC."
4232 elif test "$with_pthread_req" = yes -a "$have_pthread" = no ; then
4233 warn 'POSIX threads were requested, but were not found.'
4236 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
4237 warn 'The SGI saver extension was requested, but was not found.'
4240 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
4241 warn 'The XIdle extension was requested, but was not found.'
4244 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
4245 warn 'The XSHM extension was requested, but was not found.'
4248 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
4249 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
4252 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
4253 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
4256 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
4257 warn 'The DPMS extension was requested, but was not found.'
4260 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
4261 warn 'The Xinerama extension was requested, but was not found.'
4264 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
4265 warn 'The XF86VMODE extension was requested, but was not found.'
4268 if test "$with_randr_req" = yes -a "$have_randr" = no ; then
4269 warn 'The RANDR extension was requested, but was not found.'
4272 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
4273 warn "Checking of /proc/interrupts was requested, but it's bogus."
4276 if test "$pkg_config" = false ; then
4277 warnL 'The "pkg-config" program was not found. Without that,'
4278 warn2 "detection of the various GTK libraries won't work."
4280 pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
4281 if test "x$pkgerr" != "x" ; then
4282 warnL 'The "pkg-config" program produces errors. This often causes'
4283 warn2 "detection of the various GTK libraries to malfunction."
4284 warn2 "The errors are:"
4286 echo "$pkgerr" | sed 's/^/ > /g'
4290 if test "$gtk_halfassed" != no ; then
4291 warnL "GTK version $gtk_halfassed was found, but at least one supporting"
4292 warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used."
4293 warn2 "Perhaps some of the development packages are not installed?"
4294 if test "$have_gtk" = yes ; then
4295 v="$ac_gtk_version_string"
4296 warn2 "GTK $v is also installed, so it will be used instead."
4297 warn2 "Please read the above output and the \`config.log' file"
4298 warn2 "for more details."
4303 warn2 'Though the Motif front-end to xscreensaver is still'
4304 warn2 'maintained, it is no longer being updated with new'
4305 warn2 'features: all new development on the xscreensaver-demo'
4306 warn2 'program is happening in the GTK version, and not in the'
4307 warn2 'Motif version. It is recommended that you build against'
4308 warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
4311 if test "$have_motif" = no -a "$have_gtk" = no; then
4313 if test "$with_motif" = yes; then
4314 warnL "Neither the GTK nor Motif libraries were found; the"
4315 warn2 "\`xscreensaver-demo' program requires one of these."
4319 warnL "The GTK libraries do not seem to be available; the"
4320 warn2 "\`xscreensaver-demo' program requires them."
4322 # warn2 'You can use Motif or Lesstif instead of GTK (use the'
4323 # warn2 "\`--with-motif' option) but that is NOT recommended."
4327 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
4328 warnL "Use of Motif was requested, but it wasn't found;"
4329 warn2 "Gtk will be used instead."
4331 elif test "$jurassic_gtk" = yes ; then
4335 v="$ac_gtk_version_string"
4336 if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
4337 warnL "Use of Gtk was requested, but its version number is unknown;"
4338 elif test "$with_gtk_req" = yes ; then
4339 warnL "Use of Gtk was requested, but it is version $v;"
4341 warnL "Gtk was found on this system, but it is version $v;"
4344 warn2 "Gtk $pref_gtk or newer is required."
4346 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
4347 warnL "Use of Gtk was requested, but it wasn't found."
4351 if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then
4352 warn "GTK is being used, but the GDK-Pixbuf library and/or"
4353 warn2 "headers were not found. That can't be good. Please"
4354 warn2 "install the GDK-Pixbuf development kit and re-configure."
4357 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
4359 preferred_lesstif=0.92
4361 if test "$lesstif_version" = unknown; then
4362 warnL "Unable to determine the LessTif version number!"
4363 warn2 "Make sure you are using version $preferred_lesstif or newer."
4364 warn2 "See <http://www.lesstif.org/>."
4366 elif test \! $lesstif_version -gt 82; then
4367 warnL "LessTif version $lesstif_version_string is being used."
4368 warn2 "LessTif versions 0.82 and earlier are too buggy to"
4369 warn2 "use with XScreenSaver; it is strongly recommended"
4370 warn2 "that you upgrade to at least version $preferred_lesstif!"
4371 warn2 "See <http://www.lesstif.org/>."
4376 if test "$have_motif" = yes -a "$have_gtk" = no ; then
4377 warn 'Motif is being used, and GTK is not.'
4383 if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
4384 warnL 'Use of XPM was requested, but it was not found.'
4387 if test "$with_gdk_pixbuf_req" = yes -a "$have_gdk_pixbuf" = no; then
4388 warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
4391 if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \
4392 test "$have_gdk_pixbuf" = no -a "$have_xpm" = no ; then
4394 if test "$with_gdk_pixbuf_req" = yes ; then
4396 elif test "$with_gdk_pixbuf_req" = no ; then
4397 warnL 'The GDK-Pixbuf library is not being used.'
4399 warnL 'The GDK-Pixbuf library was not found.'
4402 if test "$with_xpm_req" = yes -o "$have_xpm" = yes ; then
4404 elif test "$with_xpm_req" = no ; then
4405 warnL 'The XPM library is not being used.'
4407 warnL 'The XPM library was not found.'
4410 if test "$have_gdk_pixbuf" = no -a "$have_xpm" = yes ; then
4411 warn2 'The XPM library is being used instead.'
4414 if test "$gdk_pixbuf_halfassed" = yes ; then
4416 warn2 'More specifically, we found the headers, but not the'
4417 warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
4418 warn2 "system, or something else went wrong. The \`config.log'"
4419 warn2 'file might contain some clues.'
4423 warn2 'Some of the demos will not use images as much as they could.'
4424 warn2 'You should consider installing GDK-Pixbuf and re-running'
4425 warn2 'configure. (GDK-Pixbuf is recommended over XPM, as it'
4426 warn2 'provides support for more image formats.)'
4430 if test "$have_jpeg" = no ; then
4431 if test "$with_jpeg_req" = yes ; then
4432 warnL 'Use of libjpeg was requested, but it was not found.'
4433 elif test "$with_jpeg_req" = no ; then
4434 noteL 'The JPEG library is not being used.'
4436 noteL 'The JPEG library was not found.'
4439 if test "$jpeg_halfassed" = yes ; then
4441 warn2 'More specifically, we found the headers, but not the'
4442 warn2 'library; so either JPEG is half-installed on this'
4443 warn2 "system, or something else went wrong. The \`config.log'"
4444 warn2 'file might contain some clues.'
4448 if test "$have_gdk_pixbuf" = no ; then
4449 warn2 "This means that it won't be possible for the image-manipulating"
4450 warn2 "display modes to load files from disk; and it also means that"
4451 warn2 "the \`webcollage' program will be much slower."
4453 warn2 "This means the \`webcollage' program will be much slower."
4458 if test "$have_xft" = no ; then
4459 if test "$with_xft_req" = yes ; then
4460 warnL "Use of libXft was requested, but it was not found."
4461 elif test "$with_xft_req" = no ; then
4462 noteL 'The Xft library is not being used.'
4464 noteL "The Xft library was not found."
4467 if test "$xft_halfassed" = yes ; then
4469 warn2 'More specifically, we found the headers, but not the'
4470 warn2 'libraries; so either Xft is half-installed on this'
4471 warn2 "system, or something else went wrong. The \`config.log'"
4472 warn2 'file might contain some clues.'
4476 warn2 "This means that fonts won't be anti-aliased."
4480 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
4481 preferred_mesagl=3.4
4482 mgv="$ac_mesagl_version_string"
4483 pgl="$preferred_mesagl"
4485 if test "$ac_mesagl_version" = unknown; then
4487 # warnL "Unable to determine the MesaGL version number!"
4488 # warn2 "Make sure you are using version $preferred_mesagl or newer."
4490 elif test \! "$ac_mesagl_version" -gt 2006; then
4491 warnL "MesaGL version number is $mgv --"
4492 warn2 "MesaGL 2.6 and earlier have a security bug. It is strongly"
4493 warn2 "recommended that you upgrade to at least version $preferred_mesagl."
4495 elif test \! "$ac_mesagl_version" -gt 3003; then
4496 warnL "MesaGL version number is $mgv --"
4497 warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
4498 warn2 "that you upgrade to $pgl or newer."
4502 if test "$have_gl" = no ; then
4503 if test "$with_gl_req" = yes ; then
4504 warnL 'Use of GL was requested, but it was not found.'
4505 elif test "$with_gl_req" = no ; then
4506 noteL 'The OpenGL 3D library is not being used.'
4508 noteL 'The OpenGL 3D library was not found.'
4511 if test "$gl_halfassed" = yes ; then
4513 warn2 'More specifically, we found the headers, but not the'
4514 warn2 'libraries; so either GL is half-installed on this'
4515 warn2 "system, or something else went wrong. The \`config.log'"
4516 warn2 'file might contain some clues.'
4520 warn2 'Those demos which use 3D will not be built or installed.'
4521 warn2 'You might want to consider installing OpenGL and'
4522 warn2 're-running configure.'
4527 if test "$have_gl" = yes -a "$have_gle" = no ; then
4529 # nobody cares about this; don't print the warning unless it was
4530 # requested and not found, or halfway-found.
4531 if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
4533 if test "$with_gle_req" = yes ; then
4534 noteL 'Use of the GLE (GL Extrusion) library was requested, but'
4535 warn2 'it was not found (though the OpenGL library was found, and'
4536 warn2 'is being used.)'
4537 elif test "$with_gle_req" = no ; then
4538 noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
4539 warn2 'library is not.'
4541 noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
4542 warn2 'library was not.'
4545 if test "$gle_halfassed" = yes ; then
4547 warn2 'More specifically, we found the headers, but not the'
4548 warn2 'libraries; so either GLE is half-installed on this'
4549 warn2 "system, or something else went wrong. The \`config.log'"
4550 warn2 'file might contain some clues.'
4554 warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
4555 warn2 'will not be built or installed. You might want to consider'
4556 warn2 'installing GLE and re-running configure. You can find the'
4557 warn2 'GLE library at <http://www.linas.org/gle/>'
4563 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
4564 warn 'Use of XReadDisplay was requested, but it was not found.'
4567 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
4568 warn 'Use of Kerberos was requested, but it was not found.'
4571 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
4572 warn 'Use of PAM was requested, but it was not found.'
4575 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
4576 warn 'Use of shadow passwords was requested, but they were not found.'
4579 if test "$ac_macosx" = yes ; then
4580 if test "$enable_locking" = yes ; then
4581 warn "You have specified --enable-locking on MacOS X."
4582 warn2 "THIS DOES NOT WORK! Don't do this!"
4587 # You are in a twisty maze of namespaces and syntaxes, all alike.
4588 # Fuck the skull of Unix.
4590 bindir=`eval eval eval eval eval eval eval echo $bindir`
4591 HACKDIR=`eval eval eval eval eval eval eval echo $HACKDIR`
4592 HACK_CONF_DIR=`eval eval eval eval eval eval eval echo $HACK_CONF_DIR`
4594 # canonicalize slashes.
4595 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
4596 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
4597 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
4600 # Sanity check the hackdir
4601 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
4602 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
4604 AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
4605 There will be an executable installed with that name, so
4606 that can't be the name of a directory as well. Please
4607 re-configure with a different directory name.])
4614 # Now let's warn if there's a previous RPM version already installed.
4615 # But don't bother with this test if we are currently *building* an RPM.
4617 if test -z "$RPM_PACKAGE_VERSION" ; then
4619 rpmnames="xscreensaver xscreensaver-base xscreensaver-extras"
4623 rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \
4624 sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \
4628 if test \! -z "$rpmv" ; then
4629 rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
4630 rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
4633 warnL "There is already an installed RPM of xscreensaver $rpmv"
4634 warn2 'on this system. You might want to remove it ("rpm -ve")'
4635 warn2 'before running "make install" in this directory.'
4637 warn2 "Alternately, you could build this version of xscreensaver"
4638 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
4639 warn2 'file is included. Try "rpmbuild -v -ba xscreensaver.spec".'
4640 warn2 "See the RPM documentation for more info."
4643 if test "$rpmbdir" = "$rpmhdir" ; then
4644 warn2 "The RPM version was installed in $rpmbdir/."
4647 warn2 "The RPM version was installed in $rpmbdir/,"
4648 warn2 "with demos in $rpmhdir/."
4653 # Also warn if there's a Debian package installed.
4655 debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
4657 for dpkg in $debnames ; do
4658 if test -z "$debv"; then
4659 debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
4663 if test \! -z "$debv" ; then
4664 debbdir=`dpkg -L $debnames 2>/dev/null | \
4665 sed -n 's@^\(.*/bin/\)xscreensaver$@\1@p'`
4666 debhdir=`dpkg -L $debnames 2>/dev/null | \
4667 sed -n 's@^\(.*/\)popsquares$@\1@p'`
4668 if test -z "$debbdir" ; then debbdir='???'; fi
4669 if test -z "$debhdir" ; then debhdir='???'; fi
4672 warnL "There is already an installed dpkg of xscreensaver"
4673 warn2 "version \"$debv\" on this system."
4675 warn2 "The dpkg was installed in $debbdir,"
4676 warn2 "with demos in $debhdir."
4680 if test "${bindir}" = "${HACKDIR}" ; then
4684 if test "$do_dir_warning" = yes; then
4688 echo ' When you run "make install", the "xscreensaver",'
4689 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
4690 echo " will be installed in ${bindir}/."
4692 echo " The various graphics demos (200+ different executables) will"
4693 echo " be installed in ${HACKDIR}/."
4695 echo " If you would prefer the demos to be installed elsewhere,"
4696 echo " you should re-run configure with the --with-hackdir=DIR"
4697 echo " option. For more information, run \`./configure --help'."
4701 if test "$warning" != no; then
4702 echo '' ; echo "$warnsep" ; echo ''
4705 if test "$do_dir_warning" = no; then
4706 if test "$warning" = no; then
4709 echo "User programs will be installed in ${bindir}/"
4710 echo "Screen savers will be installed in ${HACKDIR}/"
4711 echo "Configuration dialogs will be installed in ${HACK_CONF_DIR}/"
4712 echo "System-wide default settings will be installed in ${APPDEFAULTS}/"