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.
811 /usr/X11/lib/app-defaults \
812 /usr/X11R6/lib/app-defaults \
813 /usr/X11R6/lib/X11/app-defaults \
814 /usr/X11R5/lib/app-defaults \
815 /usr/X11R5/lib/X11/app-defaults \
816 /usr/X11R4/lib/app-defaults \
817 /usr/X11R4/lib/X11/app-defaults \
819 /usr/lib/X11/app-defaults \
820 /usr/lib/X11R6/app-defaults \
821 /usr/lib/X11R5/app-defaults \
822 /usr/lib/X11R4/app-defaults \
824 /etc/X11/app-defaults \
826 /usr/local/X11/lib/app-defaults \
827 /usr/local/X11R6/lib/app-defaults \
828 /usr/local/X11R5/lib/app-defaults \
829 /usr/local/X11R4/lib/app-defaults \
831 /usr/local/lib/X11/app-defaults \
832 /usr/local/lib/X11R6/app-defaults \
833 /usr/local/lib/X11R6/X11/app-defaults \
834 /usr/local/lib/X11R5/app-defaults \
835 /usr/local/lib/X11R5/X11/app-defaults \
836 /usr/local/lib/X11R4/app-defaults \
837 /usr/local/lib/X11R4/X11/app-defaults \
839 /usr/X386/lib/X11/app-defaults \
840 /usr/x386/lib/X11/app-defaults \
841 /usr/XFree86/lib/X11/app-defaults \
843 /usr/lib/X11/app-defaults \
844 /usr/local/lib/X11/app-defaults \
845 /usr/unsupported/lib/X11/app-defaults \
846 /usr/athena/lib/X11/app-defaults \
847 /usr/local/x11r5/lib/X11/app-defaults \
848 /usr/lpp/Xamples/lib/X11/app-defaults \
849 /lib/usr/lib/X11/app-defaults \
851 /usr/openwin/lib/app-defaults \
852 /usr/openwin/lib/X11/app-defaults \
853 /usr/openwin/share/lib/app-defaults \
854 /usr/openwin/share/lib/X11/app-defaults \
856 /X11R6/lib/app-defaults \
857 /X11R5/lib/app-defaults \
858 /X11R4/lib/app-defaults \
861 if test -d "$ac_dir"; then
862 ac_x_app_defaults=$ac_dir
868 AC_DEFUN([AC_PATH_X_APP_DEFAULTS],
870 AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
871 [# skip this, it's always wrong these days.
872 # AC_PATH_X_APP_DEFAULTS_XMKMF
873 if test x"$ac_x_app_defaults" = x; then
874 true AC_PATH_X_APP_DEFAULTS_DIRECT
876 if test x"$ac_x_app_defaults" = x; then
877 /bin/echo -n 'fallback: '
878 ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
880 # Record where we found app-defaults for the cache.
881 ac_cv_x_app_defaults="$ac_x_app_defaults"
883 eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
886 AC_DEFUN([AC_XPOINTER],
887 [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
888 [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
889 [XPointer foo = (XPointer) 0;],
890 [ac_cv_xpointer=yes],
891 [ac_cv_xpointer=no])])
892 if test "$ac_cv_xpointer" != yes; then
893 AC_DEFINE(XPointer,[char*])
897 # Random special-cases for X on certain pathological OSes.
898 # You know who you are.
900 AC_DEFUN([AC_X_RANDOM_PATHS],
904 # The following arcana was gleaned from conversations with
905 # Eric Schwartz <erics@col.hp.com>:
907 # On HPUX 10.x, the parts of X that HP considers "standard" live in
908 # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
909 # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
910 # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
911 # Also, there are symlinks from /usr/include/ and /usr/lib/ into
912 # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
913 # you don't need any -I or -L arguments.
915 # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
916 # are the same division as 10.x. However, there are no symlinks to
917 # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
918 # arguments are always necessary.
920 # However, X11R6 was available on HPUX 9.x as a patch: if that
921 # patch was installed, then all of X11R6 went in to
922 # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
924 # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
925 # whether R5 was available as a patch; R6 undoubtedly was not.)
927 # So. We try and use the highest numbered pair of
928 # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
929 # that are available. We do not mix and match different versions
932 # Question I still don't know the answer to: (do you?)
934 # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
935 # /usr/contrib/X11R6/ could be installed as a patch, what was in
936 # that contrib directory? Did it contain so-called "standard"
937 # X11R6, or did it include Xaw and Xmu as well? If the former,
938 # where did one find Xaw and Xmu on 9.x R6 systems? Would this
939 # be a situation where one had to reach into the R5 headers and
940 # libs to find Xmu? That is, must both R6 and R5 directories
941 # be on the -I and -L lists in that case?
943 for version in X11R6 X11R5 X11R4 ; do
944 # if either pair of directories exists...
945 if test -d /usr/include/$version || test -d /usr/contrib/$version/include
947 # if contrib exists, use it...
948 if test -d /usr/contrib/$version/include ; then
949 X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
950 X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
952 # if the "standard" one exists, use it.
953 if test -d /usr/include/$version ; then
954 X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
955 X_LIBS="$X_LIBS -L/usr/lib/$version"
957 # since at least one of the pair exists, go no farther.
962 # Now find Motif. Thanks for not making xmkmf find this by
963 # default, you losers.
965 if test -d /usr/include/Motif2.1 ; then
966 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
967 X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
968 elif test -d /usr/include/Motif1.2 ; then
969 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
970 X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
971 elif test -d /usr/include/Motif1.1 ; then
972 X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
973 X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
976 # Now let's check for the pseudo-standard locations for OpenGL and XPM.
978 if test -d /opt/graphics/OpenGL/include ; then
979 # HP-UX 10.20 puts it here
980 X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
981 X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
982 elif test -d /opt/Mesa/lib ; then
983 X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
984 X_LIBS="-L/opt/Mesa/lib $X_LIBS"
988 if test -d /opt/xpm/lib/X11 ; then
989 X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
990 X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
993 # On HPUX, default to installing in /opt/xscreensaver/ instead of
994 # in /usr/local/, unless there is already an xscreensaver in
995 # /usr/local/bin/. This can be overridden with the --prefix arg
996 # to configure. I'm not sure this is the right thing to do, but
997 # Richard Lloyd says so...
999 if test \! -x /usr/local/bin/xscreensaver ; then
1000 ac_default_prefix=/opt/xscreensaver
1006 # Thanks for not making xmkmf find this by default, pinheads.
1007 # And thanks for moving things around again, too. Is this
1008 # really the standard location now? What happened to the
1009 # joke that this kind of thing went in /opt?
1010 # cthomp says "answer: CDE (Common Disorganized Environment)"
1012 if test -f /usr/dt/include/Xm/Xm.h ; then
1013 X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
1014 MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
1016 # Some versions of Slowlaris Motif require -lgen. But not all. Why?
1017 AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
1023 # On MacOS X (10.x with "fink"), many things are under /sw/.
1025 if test -d /sw/include ; then
1026 X_CFLAGS="-I/sw/include $X_CFLAGS"
1027 X_LIBS="-L/sw/lib $X_LIBS"
1032 AC_DEFUN([AC_CHECK_GETIFADDRS],
1033 [AC_CACHE_CHECK([for getifaddrs], ac_cv_have_getifaddrs,
1034 [AC_TRY_COMPILE([#include <stdlib.h>
1036 #include <arpa/inet.h>
1037 #include <ifaddrs.h>],
1038 [struct ifaddrs *ifa;
1041 ifa->ifa_addr->sa_family = 0;],
1042 [ac_cv_have_getifaddrs=yes],
1043 [ac_cv_have_getifaddrs=no])])
1044 if test "$ac_cv_have_getifaddrs" = yes ; then
1045 AC_DEFINE(HAVE_GETIFADDRS)
1049 ###############################################################################
1051 # Some utility functions to make checking for X things easier.
1053 ###############################################################################
1055 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
1057 AC_DEFUN([AC_CHECK_X_HEADER], [
1058 ac_save_CPPFLAGS="$CPPFLAGS"
1059 if test \! -z "$includedir" ; then
1060 CPPFLAGS="$CPPFLAGS -I$includedir"
1062 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1063 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1064 AC_CHECK_HEADER([$1],[$2],[$3],[$4])
1065 CPPFLAGS="$ac_save_CPPFLAGS"])
1067 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
1069 AC_DEFUN([AC_EGREP_X_HEADER], [
1070 ac_save_CPPFLAGS="$CPPFLAGS"
1071 if test \! -z "$includedir" ; then
1072 CPPFLAGS="$CPPFLAGS -I$includedir"
1074 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1075 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1076 AC_EGREP_HEADER([$1], [$2], [$3], [$4])
1077 CPPFLAGS="$ac_save_CPPFLAGS"])
1079 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
1081 AC_DEFUN([AC_TRY_X_COMPILE], [
1082 ac_save_CPPFLAGS="$CPPFLAGS"
1083 if test \! -z "$includedir" ; then
1084 CPPFLAGS="$CPPFLAGS -I$includedir"
1086 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1087 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1088 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
1089 CPPFLAGS="$ac_save_CPPFLAGS"])
1092 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
1093 # Use this sparingly; it probably doesn't work very well on X programs.
1095 AC_DEFUN([AC_CHECK_X_LIB], [
1096 ac_save_CPPFLAGS="$CPPFLAGS"
1097 ac_save_LDFLAGS="$LDFLAGS"
1098 # ac_save_LIBS="$LIBS"
1100 if test \! -z "$includedir" ; then
1101 CPPFLAGS="$CPPFLAGS -I$includedir"
1103 # note: $X_CFLAGS includes $x_includes
1104 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1106 if test \! -z "$libdir" ; then
1107 LDFLAGS="$LDFLAGS -L$libdir"
1109 # note: $X_LIBS includes $x_libraries
1110 LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
1112 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1113 LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
1114 AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
1115 CPPFLAGS="$ac_save_CPPFLAGS"
1116 LDFLAGS="$ac_save_LDFLAGS"
1117 # LIBS="$ac_save_LIBS"
1120 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
1121 # (But not the -L directories!)
1123 AC_DEFUN([AC_TRY_X_RUN], [
1124 ac_save_CPPFLAGS="$CPPFLAGS"
1125 if test \! -z "$includedir" ; then
1126 CPPFLAGS="$CPPFLAGS -I$includedir"
1128 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1129 CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
1130 AC_TRY_RUN([$1], [$2], [$3], [$4])
1131 CPPFLAGS="$ac_save_CPPFLAGS"])
1135 # Usage: HANDLE_X_PATH_ARG([variable_name],
1136 # [--command-line-option],
1137 # [descriptive string])
1139 # All of the --with options take three forms:
1141 # --with-foo (or --with-foo=yes)
1142 # --without-foo (or --with-foo=no)
1145 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
1146 # a directory (string beginning with a slash) it checks to see whether
1147 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
1150 AC_DEFUN([HANDLE_X_PATH_ARG], [
1156 AC_MSG_CHECKING([for [$3] headers])
1159 X_CFLAGS="-I$d $X_CFLAGS"
1162 AC_MSG_RESULT(not found ($d: no such directory))
1165 AC_MSG_CHECKING([for [$3] libs])
1168 X_LIBS="-L$d $X_LIBS"
1171 AC_MSG_RESULT(not found ($d: no such directory))
1174 # replace the directory string with "yes".
1181 echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
1182 echo " If it is a directory, then \`DIR/include' will be added to"
1183 echo " the -I list, and \`DIR/lib' will be added to the -L list."
1191 ###############################################################################
1192 ###############################################################################
1194 # End of function definitions. Now start actually executing stuff.
1196 ###############################################################################
1197 ###############################################################################
1199 # WTF! autoconf emits this *way* too late. Do it earlier.
1200 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1201 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1204 # random compiler setup
1209 AC_PROG_CC_PTHREAD # Needs ac_original_cc.
1212 AC_NO_LONG_STRING_WARNINGS
1213 AC_NO_MISPLACED_DECLARATIONS
1215 AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
1222 # stuff for Makefiles
1224 AC_PROG_INSTALL_DIRS
1227 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1228 # That's wrong: it should be set to '${INSTALL}', so that one can
1229 # implement the "install-strip" target properly (strip executables,
1230 # but do not try to strip scripts.)
1232 INSTALL_SCRIPT='${INSTALL}'
1236 AC_CHECK_HEADERS(unistd.h)
1244 AC_GETTIMEOFDAY_ARGS
1246 AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
1247 AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
1248 AC_CHECK_FUNCS(setlocale)
1249 AC_CHECK_FUNCS(getaddrinfo)
1250 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,, [[#include <sys/socket.h>]])
1254 AC_CHECK_HEADERS(crypt.h sys/select.h)
1257 if test -z "$PERL" ; then
1258 # don't let it be blank...
1264 if test "$have_x" != yes; then
1265 AC_MSG_ERROR(Couldn't find X11 headers/libs. Try `$0 --help'.)
1268 AC_PATH_X_APP_DEFAULTS
1272 AC_MSG_CHECKING(whether this is MacOS X)
1279 AC_MSG_RESULT($ac_macosx)
1282 ###############################################################################
1286 ###############################################################################
1289 GETTEXT_PACKAGE=xscreensaver
1290 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
1291 [This is the name of the gettext package to use.])
1292 AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE",
1293 [This is the same as GETTEXT_PACKAGE, but for the glade
1295 AC_SUBST(GETTEXT_PACKAGE)
1297 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"
1299 MKINSTALLDIRS="$INSTALL_DIRS"
1302 ###############################################################################
1304 # Check for -lXmu (some fucked up vendors don't ship it...)
1306 ###############################################################################
1309 AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes],,
1310 [#include <stdlib.h>
1312 #include <X11/Intrinsic.h>])
1313 if test "$have_xmu" = no ; then
1314 XMU_SRCS='$(UTILS_SRC)/xmu.c'
1315 XMU_OBJS='$(UTILS_BIN)/xmu.o'
1325 ###############################################################################
1327 # Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
1328 # See comp.windows.x FAQ question 124. The right fix is to
1329 # get OpenWindows 3.0 patches 100512-02 and 100573-03.
1331 ###############################################################################
1333 if test "$have_xmu" = yes ; then
1336 AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
1337 ac_cv_sunos_xmu_bug,
1338 [ac_save_LDFLAGS="$LDFLAGS"
1339 if test \! -z "$x_libraries" ; then
1340 LDFLAGS="$LDFLAGS -L$x_libraries"
1342 # Note: this trick never works! (Generally.)
1343 # We're only getting away with using AC_TRY_LINK
1344 # with X libraries because we know it's SunOS.
1345 LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
1347 [ac_cv_sunos_xmu_bug=no],
1348 [ac_cv_sunos_xmu_bug=yes])
1349 LDFLAGS="$ac_save_LDFLAGS"])
1350 if test "$ac_cv_sunos_xmu_bug" = yes ; then
1351 AC_CACHE_CHECK([whether the compiler understands -static],
1353 [ac_save_LDFLAGS="$LDFLAGS"
1354 LDFLAGS="$LDFLAGS -static"
1355 AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
1356 LDFLAGS="$ac_save_LDFLAGS"])
1357 if test "$ac_cv_ld_static" = yes ; then
1358 LDFLAGS="$LDFLAGS -static"
1360 LDFLAGS="$LDFLAGS -Bstatic"
1368 ###############################################################################
1370 # Handle the --with-hackdir option
1372 ###############################################################################
1375 with_hackdir_req=unspecified
1376 AC_ARG_WITH(hackdir,[
1378 Installation options:
1379 --with-hackdir=DIR Where to install the hundreds of demo executables.
1380 Default: `PREFIX/libexec/xscreensaver/'],
1381 [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes])
1383 if test x"$with_hackdir" = xyes; then
1384 HACKDIR='${libexecdir}/xscreensaver'
1385 elif test x"$with_hackdir" = xno; then
1388 HACKDIR=$with_hackdir
1391 # canonicalize slashes.
1392 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
1394 # Expand HACKDIR as HACKDIR_FULL
1395 HACKDIR_FULL=`eval eval eval eval eval eval eval eval eval echo $HACKDIR`
1397 # This option used to be called --enable-subdir; make sure that is no longer
1398 # used, since configure brain-damagedly ignores unknown --enable options.
1401 AC_ARG_ENABLE(subdir,,[obsolete_enable=yes])
1402 if test -n "$obsolete_enable"; then
1403 echo "error: the --enable-subdir option has been replaced with"
1404 echo " the new --with-hackdir option; see \`configure --help'"
1405 echo " for more information."
1410 ###############################################################################
1412 # Handle the --with-configdir option
1413 # Help for --with-x-app-defaults option added.
1415 ###############################################################################
1418 with_configdir_req=unspecified
1419 AC_ARG_WITH(configdir,
1420 [ --with-configdir=DIR Where to install the data files that describe each
1421 of the display modes to the GUI.
1422 Default: `PREFIX/share/xscreensaver/config/'
1423 --with-x-app-defaults=DIR
1424 Where to install xscreensaver configuration file.
1426 [with_configdir="$withval"; with_configdir_req="$withval"],
1427 [with_configdir=yes])
1429 if test x"$with_configdir" = xyes; then
1430 HACK_CONF_DIR='${datadir}/xscreensaver/config'
1431 elif test x"$with_configdir" = xno; then
1432 echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
1435 # there must be a better way than this...
1436 if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
1438 HACK_CONF_DIR=$with_configdir
1441 HACK_CONF_DIR="\${exec_prefix}$with_configdir"
1448 ###############################################################################
1450 # Check for the SGI SCREEN_SAVER server extension.
1452 ###############################################################################
1455 #with_sgi_req=unspecified
1456 #AC_ARG_WITH(sgi-ext,
1457 #[Except where noted, all of the --with options below can also take a
1458 #directory argument: for example, `--with-motif=/opt/Motif'. That would
1459 #cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
1460 #to be added to the -L list, assuming those directories exist.
1462 #By default, support for each of these options will be built in, if the
1463 #relevant library routines exist. At run time, they will then be used
1464 #only if the X server being used supports them. Each --with option has
1465 #a corresponding --without option, to override building support for them
1468 #Screen blanking and idle-detection options:
1470 # --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.],
1471 # [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
1473 #HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
1475 #if test "$with_sgi" = yes; then
1476 # AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
1478 # AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
1479 # [#include <X11/Xlib.h>])
1481 #elif test "$with_sgi" != no; then
1482 # echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
1487 ###############################################################################
1489 # Check for the XIDLE server extension.
1491 ###############################################################################
1494 #with_xidle_req=unspecified
1495 #AC_ARG_WITH(xidle-ext,
1496 #[ --with-xidle-ext Include support for the XIDLE extension.],
1497 # [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
1499 #HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
1501 #if test "$with_xidle" = yes; then
1502 # AC_CHECK_X_HEADER(X11/extensions/xidle.h,
1504 # AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
1505 # [#include <X11/Xlib.h>])
1506 #elif test "$with_xidle" != no; then
1507 # echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
1512 ###############################################################################
1514 # Check for the SGI-VIDEO-CONTROL server extension.
1516 ###############################################################################
1519 #with_sgivc_req=unspecified
1520 #AC_ARG_WITH(sgivc-ext,
1521 #[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.],
1522 # [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
1524 #HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
1526 #if test "$with_sgivc" = yes; then
1528 # # first check for XSGIvc.h
1529 # AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],,
1530 # [#include <X11/Xlib.h>])
1532 # # if that succeeded, then check for the -lXsgivc
1533 # if test "$have_sgivc" = yes; then
1535 # AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
1536 # [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true],
1540 # # if that succeeded, then we've really got it.
1541 # if test "$have_sgivc" = yes; then
1542 # AC_DEFINE(HAVE_SGI_VC_EXTENSION)
1545 #elif test "$with_sgivc" != no; then
1546 # echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
1551 ###############################################################################
1553 # Check for the DPMS server extension.
1555 ###############################################################################
1558 with_dpms_req=unspecified
1559 AC_ARG_WITH(dpms-ext,
1560 [ --with-dpms-ext Include support for the DPMS extension.],
1561 [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
1563 HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
1565 if test "$with_dpms" = yes; then
1567 # first check for dpms.h
1568 AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
1569 [#include <X11/Xlib.h>
1570 #include <X11/Xmd.h>])
1572 # if that succeeded, then check for the DPMS code in the libraries
1573 if test "$have_dpms" = yes; then
1575 # first look in -lXext (this is where it is with XFree86 4.0)
1577 AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11)
1579 # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
1580 if test "$have_dpms" = no; then
1581 AC_CHECK_X_LIB(Xdpms, DPMSInfo,
1582 [have_dpms=yes; XDPMS_LIBS="-lXdpms"], [true],
1588 # if that succeeded, then we've really got it.
1589 if test "$have_dpms" = yes; then
1590 AC_DEFINE(HAVE_DPMS_EXTENSION)
1593 elif test "$with_dpms" != no; then
1594 echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
1599 ###############################################################################
1601 # Check for the XINERAMA server extension.
1603 ###############################################################################
1606 with_xinerama_req=unspecified
1607 AC_ARG_WITH(xinerama-ext,
1608 [ --with-xinerama-ext Include support for the XINERAMA extension.],
1609 [with_xinerama="$withval"; with_xinerama_req="$withval"],[with_xinerama=yes])
1611 HANDLE_X_PATH_ARG(with_xinerama, --with-xinerama-ext, XINERAMA)
1613 if test "$with_xinerama" = yes; then
1615 # first check for Xinerama.h
1616 AC_CHECK_X_HEADER(X11/extensions/Xinerama.h, [have_xinerama=yes],,
1617 [#include <X11/Xlib.h>])
1619 # if that succeeded, then check for the XINERAMA code in the libraries
1620 if test "$have_xinerama" = yes; then
1622 # first look in -lXext
1624 AC_CHECK_X_LIB(Xext, XineramaQueryScreens, [have_xinerama=yes], [true],
1627 # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
1628 if test "$have_xinerama" = no; then
1629 AC_CHECK_X_LIB(Xinerama, XineramaQueryScreens,
1630 [have_xinerama=yes; XINERAMA_LIBS="-lXinerama"],
1631 [true], -lXext -lX11)
1635 # if that succeeded, then we've really got it.
1636 if test "$have_xinerama" = yes; then
1637 AC_DEFINE(HAVE_XINERAMA)
1640 elif test "$with_xinerama" != no; then
1641 echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
1646 ###############################################################################
1648 # Check for the XINPUT server extension.
1650 ###############################################################################
1653 with_xinput_req=unspecified
1654 AC_ARG_WITH(xinput-ext,
1655 [ --with-xinput-ext Include support for the XInput extension.],
1656 [with_xinput="$withval"; with_xinput_req="$withval"], [with_xinput=yes])
1658 HANDLE_X_PATH_ARG(with_xinput, --with-xinput-ext, XINPUT)
1660 if test "$with_xinput" = yes; then
1662 # first check for Xinput.h
1663 AC_CHECK_X_HEADER(X11/extensions/XInput.h, [have_xinput=yes],,
1664 [#include <X11/Xlib.h>])
1666 # if that succeeded, then check for libXi
1667 if test "$have_xinput" = yes; then
1669 AC_CHECK_X_LIB(Xi, XListInputDevices,
1670 [have_xinput=yes; SAVER_LIBS="$SAVER_LIBS -lXi"],
1671 [true], -lXext -lX11)
1674 # if that succeeded, then we've really got it.
1675 if test "$have_xinput" = yes; then
1676 AC_DEFINE(HAVE_XINPUT)
1679 elif test "$with_xinput" != no; then
1680 echo "error: must be yes or no: --with-xinput-ext=$with_xinput"
1685 ###############################################################################
1687 # Check for the XF86VMODE server extension (for virtual screens.)
1689 ###############################################################################
1692 with_xf86vmode_req=unspecified
1693 AC_ARG_WITH(xf86vmode-ext,
1694 [ --with-xf86vmode-ext Include support for XFree86 virtual screens.],
1695 [with_xf86vmode="$withval"; with_xf86vmode_req="$withval"],
1696 [with_xf86vmode=yes])
1698 HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1702 if test "$with_xf86vmode" = yes; then
1704 # first check for xf86vmode.h
1705 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes],,
1706 [#include <X11/Xlib.h>])
1708 # if that succeeded, then check for the -lXxf86vm
1709 if test "$have_xf86vmode" = yes; then
1711 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1712 [have_xf86vmode=yes;
1713 VIDMODE_LIBS="-lXxf86vm";
1714 SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS"],
1715 [true], -lXext -lX11)
1718 # if that succeeded, then we've really got it.
1719 if test "$have_xf86vmode" = yes; then
1720 AC_DEFINE(HAVE_XF86VMODE)
1723 elif test "$with_xf86vmode" != no; then
1724 echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
1729 ###############################################################################
1731 # Check for the XF86VMODE server extension (for gamma fading.)
1733 ###############################################################################
1736 have_xf86gamma_ramp=no
1737 with_xf86gamma_req=unspecified
1738 AC_ARG_WITH(xf86gamma-ext,
1739 [ --with-xf86gamma-ext Include support for XFree86 gamma fading.],
1740 [with_xf86gamma="$withval"; with_xf86gamma_req="$withval"],
1741 [with_xf86gamma=yes])
1743 HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma)
1745 if test "$with_xf86gamma" = yes; then
1747 # first check for xf86vmode.h, if we haven't already
1748 if test "$have_xf86vmode" = yes; then
1751 AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes],,
1752 [#include <X11/Xlib.h>])
1755 # if that succeeded, then check for the -lXxf86vm
1756 if test "$have_xf86gamma" = yes; then
1758 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma,
1759 [have_xf86gamma=yes],
1760 [true], -lXext -lX11)
1763 # check for the Ramp versions of the functions too.
1764 if test "$have_xf86gamma" = yes; then
1765 have_xf86gamma_ramp=no
1766 AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp,
1767 [have_xf86gamma_ramp=yes],
1768 [true], -lXext -lX11)
1771 # if those tests succeeded, then we've really got the functions.
1772 if test "$have_xf86gamma" = yes; then
1773 AC_DEFINE(HAVE_XF86VMODE_GAMMA)
1776 if test "$have_xf86gamma_ramp" = yes; then
1777 AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP)
1780 # pull in the lib, if we haven't already
1781 if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
1782 SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
1785 elif test "$with_xf86gamma" != no; then
1786 echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
1791 ###############################################################################
1793 # Check for the RANDR (Resize and Rotate) server extension.
1795 # We need this to detect when the resolution of the desktop
1796 # has changed out from under us (this is a newer, different
1797 # mechanism than the XF86VMODE virtual viewports.)
1799 ###############################################################################
1802 with_randr_req=unspecified
1803 AC_ARG_WITH(randr-ext,
1804 [ --with-randr-ext Include support for the X Resize+Rotate extension.],
1805 [with_randr="$withval"; with_randr_req="$withval"],[with_randr=yes])
1807 HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR)
1809 if test "$with_randr" = yes; then
1811 # first check for Xrandr.h
1812 AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],,
1813 [#include <X11/Xlib.h>])
1815 # if that succeeded, then check for the XRR code in the libraries
1816 if test "$have_randr" = yes; then
1818 # RANDR probably needs -lXrender
1820 AC_CHECK_X_LIB(Xrender, XRenderSetSubpixelOrder,
1821 [xrender_libs="-lXrender"], [true], -lXext -lX11)
1823 # first look for RANDR in -lXext
1825 AC_CHECK_X_LIB(Xext, XRRGetScreenInfo,
1826 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"],
1827 [true], $xrender_libs -lXext -lX11)
1829 # if that failed, look in -lXrandr
1830 if test "$have_randr" = no; then
1831 AC_CHECK_X_LIB(Xrandr, XRRGetScreenInfo,
1832 [have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"],
1833 [true], $xrender_libs -lXext -lX11)
1837 # if that succeeded, then we've really got it.
1838 if test "$have_randr" = yes; then
1839 AC_DEFINE(HAVE_RANDR)
1841 # Now check for version 1.2 in the same libs.
1842 # Try to compile, since on MacOS 10.5.7, headers are older than libs!
1843 AC_CACHE_CHECK([for XRRGetScreenResources], ac_cv_randr_12,
1845 AC_TRY_X_COMPILE([#include <stdlib.h>
1846 #include <X11/Xlib.h>
1847 #include <X11/extensions/Xrandr.h>],
1848 [XRRScreenResources *res =
1849 XRRGetScreenResources (0, 0);],
1850 [ac_cv_randr_12=yes],
1851 [ac_cv_randr_12=no])])
1852 if test "$ac_cv_randr_12" = yes ; then
1853 AC_DEFINE(HAVE_RANDR_12)
1855 # AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)],
1856 # [true], $SAVER_LIBS)
1860 elif test "$with_randr" != no; then
1861 echo "error: must be yes or no: --with-randr-ext=$with_randr"
1866 ###############################################################################
1868 # Check for XF86MiscSetGrabKeysState (but only bother if we are already
1869 # using other XF86 stuff.)
1871 ###############################################################################
1873 have_xf86miscsetgrabkeysstate=no
1874 if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
1875 AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
1876 [have_xf86miscsetgrabkeysstate=yes],
1877 [true], -lXext -lX11)
1878 if test "$have_xf86miscsetgrabkeysstate" = yes ; then
1879 SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
1880 AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
1885 ###############################################################################
1887 # Check for HP XHPDisableReset and XHPEnableReset.
1889 ###############################################################################
1891 AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
1892 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1893 [AC_DEFINE(HAVE_XHPDISABLERESET)
1894 SAVER_LIBS="-lXhp11 $SAVER_LIBS"
1895 AC_MSG_RESULT(yes)],
1896 [AC_MSG_RESULT(no)])
1899 ###############################################################################
1901 # Check for /proc/interrupts.
1903 ###############################################################################
1905 have_proc_interrupts=no
1906 with_proc_interrupts_req=unspecified
1907 AC_ARG_WITH(proc-interrupts,
1908 [ --with-proc-interrupts Include support for consulting the /proc/interrupts
1909 file to notice keyboard activity.],
1910 [with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"],
1911 [with_proc_interrupts=yes])
1913 if test "$with_proc_interrupts" = yes; then
1915 # Note that we may be building in an environment (e.g. Debian buildd chroot)
1916 # without a proper /proc filesystem. If /proc/interrupts exists, then we'll
1917 # check that it has the bits we need, but otherwise we'll just go on faith.
1919 have_proc_interrupts=yes
1921 if test -f /proc/interrupts; then
1922 AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1923 ac_cv_have_proc_interrupts,
1924 [ac_cv_have_proc_interrupts=no
1925 if grep 'keyboard\|i8042' /proc/interrupts >/dev/null 2>&1 ; then
1926 ac_cv_have_proc_interrupts=yes
1929 have_proc_interrupts=$ac_cv_have_proc_interrupts
1932 if test "$have_proc_interrupts" = yes; then
1933 AC_DEFINE(HAVE_PROC_INTERRUPTS)
1936 elif test "$with_proc_interrupts" != no; then
1937 echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
1942 ###############################################################################
1944 # The --enable-locking option
1946 ###############################################################################
1948 AC_ARG_ENABLE(locking,[Screen locking options:
1949 --enable-locking Compile in support for locking the display.
1950 --disable-locking Do not allow locking at all.],
1951 [enable_locking="$enableval"],
1952 [if test "$ac_macosx" = yes; then
1953 # We can't lock on MacOS X, so default to not compiling in support for it.
1954 # But allow --enable-locking to override that, so I can debug Linux locking
1960 if test "$enable_locking" = yes; then
1962 elif test "$enable_locking" = no; then
1963 AC_DEFINE(NO_LOCKING)
1965 echo "error: must be yes or no: --enable-locking=$enable_locking"
1970 ###############################################################################
1972 # Whether to allow root password to unblank.
1974 ###############################################################################
1975 AC_ARG_ENABLE(root-passwd, [
1976 --enable-root-passwd Allow root passwd to unlock screen.
1977 --disable-root-passwd Do not allow that.],
1978 [enable_root_passwd="$enableval"],[enable_root_passwd=yes])
1979 if test "$enable_root_passwd" = yes; then
1980 AC_DEFINE(ALLOW_ROOT_PASSWD)
1982 elif test "$enable_root_passwd" != no; then
1983 echo "error: must be yes or no: --enable-root-passwd=$enable_root_passwd"
1987 ###############################################################################
1991 ###############################################################################
1995 # Solaris systems tend to come with PAM misconfigured.
1996 # Don't build it by default, even if the headers exist.
2000 # Default to building PAM support on all other systems, if it exists.
2001 with_pam_default=yes
2006 with_pam_req=unspecified
2009 [ --with-pam Include support for PAM (Pluggable Auth Modules.)],
2010 [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default])
2012 AC_ARG_WITH([pam_service_name],
2013 AC_HELP_STRING([--with-pam-service-name],
2014 [NAME arg is the name of the PAM service that
2015 xscreensaver will authenticate as.]),
2016 [pam_service_name="$withval"],[pam_service_name="xscreensaver"])
2018 AC_ARG_ENABLE(pam-check-account-type,
2019 [AC_HELP_STRING([--enable-pam-check-account-type],
2020 [Whether PAM should check the result of account
2021 modules when authenticating. Only do this if you
2022 have account configured properly on your system.])],
2023 [enable_pam_check_account_type="$enableval"],[enable_pam_check_account_type=no])
2024 if test "$enable_pam_check_account_type" = yes ; then
2025 AC_DEFINE(PAM_CHECK_ACCOUNT_TYPE)
2027 elif test "$enable_pam_check_account_type" != no ; then
2028 echo "error: must be yes or no: --enable-pam-check-account-type=$enable_pam_check_account_type"
2032 HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
2034 if test "$enable_locking" = yes -a "$with_pam" = yes; then
2035 AC_CACHE_CHECK([for PAM], ac_cv_pam,
2036 [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
2039 if test "$ac_cv_pam" = yes ; then
2042 AC_DEFINE_UNQUOTED(PAM_SERVICE_NAME,"$pam_service_name")
2044 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
2046 # libpam typically requires dlopen and dlsym. On FreeBSD,
2047 # those are in libc. On Linux and Solaris, they're in libdl.
2048 AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
2050 # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
2052 AC_CHECK_LIB(c, sigtimedwait,
2054 AC_DEFINE(HAVE_SIGTIMEDWAIT)])
2055 if test "$have_timedwait" = no ; then
2056 AC_CHECK_LIB(rt, sigtimedwait, [have_timedwait=yes
2057 AC_DEFINE(HAVE_SIGTIMEDWAIT)
2058 PASSWD_LIBS="${PASSWD_LIBS} -lrt"])
2061 AC_MSG_CHECKING(how to call pam_strerror)
2062 AC_CACHE_VAL(ac_cv_pam_strerror_args,
2063 [AC_TRY_X_COMPILE([#include <stdio.h>
2065 #include <security/pam_appl.h>],
2066 [pam_handle_t *pamh = 0;
2067 char *s = pam_strerror(pamh, PAM_SUCCESS);],
2068 [ac_pam_strerror_args=2],
2069 [AC_TRY_X_COMPILE([#include <stdio.h>
2071 #include <security/pam_appl.h>],
2073 pam_strerror(PAM_SUCCESS);],
2074 [ac_pam_strerror_args=1],
2075 [ac_pam_strerror_args=0])])
2076 ac_cv_pam_strerror_args=$ac_pam_strerror_args])
2077 ac_pam_strerror_args=$ac_cv_pam_strerror_args
2078 if test "$ac_pam_strerror_args" = 1 ; then
2079 AC_MSG_RESULT(one argument)
2080 elif test "$ac_pam_strerror_args" = 2 ; then
2081 AC_DEFINE(PAM_STRERROR_TWO_ARGS)
2082 AC_MSG_RESULT(two arguments)
2084 AC_MSG_RESULT(unknown)
2087 # Check pam_fail_delay
2088 AC_MSG_CHECKING(pam_fail_delay in -lpam)
2089 AC_CACHE_VAL(ac_cv_pam_fail_delay,
2090 [ac_save_LDFLAGS="$LDFLAGS"
2092 AC_TRY_LINK([#include <security/pam_appl.h>],
2093 [pam_handle_t *pamh = 0;
2094 unsigned int usec = 1;
2095 int status = pam_fail_delay (pamh, usec);],
2096 [ac_pam_fail_delay=yes],
2097 [ac_pam_fail_delay=no])
2098 ac_cv_pam_fail_delay=$ac_pam_fail_delay,
2099 LDFLAGS=$ac_save_LDFLAGS])
2101 if test "$ac_pam_fail_delay" = yes ; then
2103 AC_DEFINE(HAVE_PAM_FAIL_DELAY)
2112 ###############################################################################
2114 # Check for Kerberos.
2116 ###############################################################################
2120 with_kerberos_req=unspecified
2122 AC_ARG_WITH(kerberos,
2123 [ --with-kerberos Include support for Kerberos authentication.],
2124 [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
2126 HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
2128 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
2129 AC_CACHE_CHECK([for Kerberos 4], ac_cv_kerberos,
2130 [AC_TRY_X_COMPILE([#include <krb.h>],,
2131 [ac_cv_kerberos=yes],
2132 [ac_cv_kerberos=no])])
2133 AC_CACHE_CHECK([for Kerberos 5], ac_cv_kerberos5,
2134 [AC_TRY_X_COMPILE([#include <kerberosIV/krb.h>],,
2135 [ac_cv_kerberos5=yes],
2136 [ac_cv_kerberos5=no])])
2138 if test "$ac_cv_kerberos" = yes ; then
2140 AC_DEFINE(HAVE_KERBEROS)
2143 if test "$ac_cv_kerberos5" = yes ; then
2145 # Andrew Snare <ajs@pigpond.com> wrote:
2147 # You were assuming that if kerberosV (krb5) was found, then kerberosIV
2148 # (krb4) was also available. This turns out not to be the case with
2149 # mit-krb-1.2.7; apparently backwards-compatibility with KerberosIV
2152 # So, disable kerberosV support if libkrb4 can't be found.
2153 # This is not the best solution, but it makes the compile not fail.
2155 AC_CHECK_X_LIB(krb4, krb_get_tf_realm,
2156 [have_kerberos=yes],
2158 if test "$have_kerberos" = yes ; then
2160 AC_DEFINE(HAVE_KERBEROS)
2161 AC_DEFINE(HAVE_KERBEROS5)
2164 AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
2169 if test "$have_kerberos5" = yes ; then
2170 # from Matt Knopp <mhat@infocalypse.netlag.com>
2171 # (who got it from amu@mit.edu)
2173 PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
2175 # jwz: MacOS X uses -lkrb5, but not -lcrypt
2176 AC_CHECK_X_LIB(crypt, crypt, [PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2178 elif test "$have_kerberos" = yes ; then
2179 # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
2180 PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
2183 if test "$have_kerberos" = yes ; then
2184 AC_CHECK_FUNC(res_search,,
2185 AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv",
2186 AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos])
2192 ###############################################################################
2194 # Check for the nine billion variants of shadow passwords...
2196 ###############################################################################
2201 with_shadow_req=unspecified
2204 [ --with-shadow Include support for shadow password authentication.],
2205 [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
2207 HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
2209 if test "$enable_locking" = no ; then
2215 ###############################################################################
2217 # Check for Sun "adjunct" passwords.
2219 ###############################################################################
2221 if test "$with_shadow" = yes ; then
2222 AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
2223 [AC_TRY_X_COMPILE([#include <stdlib.h>
2225 #include <sys/types.h>
2226 #include <sys/label.h>
2227 #include <sys/audit.h>
2228 #include <pwdadj.h>],
2229 [struct passwd_adjunct *p = getpwanam("nobody");
2230 const char *pw = p->pwa_passwd;],
2231 [ac_cv_sun_adjunct=yes],
2232 [ac_cv_sun_adjunct=no])])
2233 if test "$ac_cv_sun_adjunct" = yes; then
2234 have_shadow_adjunct=yes
2241 ###############################################################################
2243 # Check for DEC and SCO so-called "enhanced" security.
2245 ###############################################################################
2247 if test "$with_shadow" = yes ; then
2248 AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
2249 [AC_TRY_X_COMPILE([#include <stdlib.h>
2251 #include <sys/types.h>
2253 #include <sys/security.h>
2255 [struct pr_passwd *p;
2257 set_auth_parameters(0, 0);
2258 check_auth_parameters();
2259 p = getprpwnam("nobody");
2260 pw = p->ufld.fd_encrypt;],
2261 [ac_cv_enhanced_passwd=yes],
2262 [ac_cv_enhanced_passwd=no])])
2263 if test $ac_cv_enhanced_passwd = yes; then
2264 have_shadow_enhanced=yes
2268 # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
2269 # (I'm told it needs -lcurses too, but I don't understand why.)
2270 # But on DEC, it's in -lsecurity.
2272 AC_CHECK_LIB(prot, getprpwnam,
2273 [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
2274 [AC_CHECK_LIB(security, getprpwnam,
2275 [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
2280 ###############################################################################
2282 # Check for HP's entry in the "Not Invented Here" Sweepstakes.
2284 ###############################################################################
2286 if test "$with_shadow" = yes ; then
2287 AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
2288 [AC_TRY_X_COMPILE([#include <stdlib.h>
2290 #include <sys/types.h>
2292 #include <hpsecurity.h>
2294 [struct s_passwd *p = getspwnam("nobody");
2295 const char *pw = p->pw_passwd;],
2296 [ac_cv_hpux_passwd=yes],
2297 [ac_cv_hpux_passwd=no])])
2298 if test "$ac_cv_hpux_passwd" = yes; then
2299 have_shadow_hpux=yes
2303 # on HPUX, bigcrypt is in -lsec
2304 AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
2309 ###############################################################################
2311 # Check for FreeBSD-style shadow passwords.
2313 # On FreeBSD, getpwnam() and friends work just like on non-shadow-
2314 # password systems -- except you only get stuff in the pw_passwd field
2315 # if the running program is setuid. So, guess that we've got this
2316 # lossage to contend with if /etc/master.passwd exists, and default to
2317 # a setuid installation.
2319 ###############################################################################
2321 if test "$with_shadow" = yes ; then
2322 AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
2323 [if test -f /etc/master.passwd ; then
2324 ac_cv_master_passwd=yes
2326 ac_cv_master_passwd=no
2328 if test "$ac_cv_master_passwd" = yes; then
2334 ###############################################################################
2336 # Check for traditional (ha!) shadow passwords.
2338 ###############################################################################
2340 if test "$with_shadow" = yes ; then
2341 AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
2342 [AC_TRY_X_COMPILE([#include <stdlib.h>
2344 #include <sys/types.h>
2346 #include <shadow.h>],
2347 [struct spwd *p = getspnam("nobody");
2348 const char *pw = p->sp_pwdp;],
2350 [ac_cv_shadow=no])])
2351 if test "$ac_cv_shadow" = yes; then
2355 # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
2357 AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
2358 if test "$have_getspnam" = no ; then
2359 AC_CHECK_LIB(gen, getspnam,
2360 [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
2366 ###############################################################################
2368 # Check for other libraries needed for non-shadow passwords.
2370 ###############################################################################
2372 if test "$enable_locking" = yes ; then
2374 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
2376 AC_CHECK_LIB(c, crypt, [have_crypt=yes])
2377 if test "$have_crypt" = no ; then
2378 AC_CHECK_LIB(crypt, crypt,
2379 [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
2384 # Most of the above shadow mechanisms will have set need_setuid to yes,
2385 # if they were found. But, on some systems, we need setuid even when
2386 # using plain old vanilla passwords.
2388 if test "$enable_locking" = yes ; then
2390 *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
2397 if test "$have_shadow_adjunct" = yes ; then
2398 AC_DEFINE(HAVE_ADJUNCT_PASSWD)
2399 elif test "$have_shadow_enhanced" = yes ; then
2400 AC_DEFINE(HAVE_ENHANCED_PASSWD)
2401 elif test "$have_shadow_hpux" = yes ; then
2402 AC_DEFINE(HAVE_HPUX_PASSWD)
2403 elif test "$have_shadow" = yes ; then
2404 AC_DEFINE(HAVE_SHADOW_PASSWD)
2408 ###############################################################################
2410 # Check for external password helper
2411 # On SuSE, instead of having xscreensaver be a setuid program, they
2412 # fork an external program that takes the password on stdin, and
2413 # returns true if that password is a valid one. Then only that
2414 # smaller program needs to be setuid.
2416 # (Note that this external program is not a GUI: the GUI is still
2417 # all in xscreensaver itself; the external program just does auth.)
2419 ###############################################################################
2421 have_passwd_helper=no
2422 with_passwd_helper_req=unspecified
2424 AC_ARG_WITH(passwd-helper,
2425 [ --with-passwd-helper Include support for an external password
2426 verification helper program.],
2427 [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no])
2428 # no HANDLE_X_PATH_ARG for this one
2430 if test "$enable_locking" = no ; then
2431 with_passwd_helper_req=no
2432 with_passwd_helper=no
2435 case "$with_passwd_helper" in
2438 AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
2439 have_passwd_helper=yes;;
2441 echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
2446 ###############################################################################
2448 # Check for a login manager for a "New Login" button on the lock dialog.
2449 # Usually this will be "/usr/bin/gdmflexiserver".
2451 ###############################################################################
2453 with_login_manager_req=unspecified
2454 default_login_manager_1='gdmflexiserver -ls'
2455 default_login_manager_2='kdmctl reserve'
2457 AC_ARG_WITH(login-manager,
2458 [ --with-login-manager Put a "New Login" button on the unlock dialog that
2459 runs a login manager like gdmflexiserver or kdmctl.],
2460 [with_login_manager="$withval"; with_login_manager_req="$withval"],
2461 [with_login_manager=yes])
2462 # no HANDLE_X_PATH_ARG for this one
2464 if test "$enable_locking" = no ; then
2465 with_login_manager_req=no
2466 with_login_manager=no
2469 case "$with_login_manager_req" in
2471 with_login_manager=""
2475 # Try both defaults, use the one that exists.
2477 set dummy $default_login_manager_1 ; login_manager_tmp=$2
2478 unset ac_cv_path_login_manager_tmp # don't cache
2479 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2480 if test ! -z "$login_manager_tmp" ; then
2481 with_login_manager="$default_login_manager_1"
2483 set dummy $default_login_manager_2 ; login_manager_tmp=$2
2484 unset ac_cv_path_login_manager_tmp # don't cache
2485 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2486 if test ! -z "$login_manager_tmp" ; then
2487 with_login_manager="$default_login_manager_2"
2489 with_login_manager=""
2495 # absolute path specified on cmd line
2496 set dummy $with_login_manager_req ; login_manager_tmp=$2
2497 AC_MSG_CHECKING([for $login_manager_tmp])
2498 if test -x "$login_manager_tmp" ; then
2502 with_login_manager=""
2507 # relative path specified on cmd line
2508 set dummy $with_login_manager_req ; login_manager_tmp=$2
2509 unset ac_cv_path_login_manager_tmp # don't cache
2510 AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
2511 if test -z "$login_manager_tmp" ; then
2512 with_login_manager=""
2514 with_login_manager="$login_manager_tmp"
2518 ac_cv_login_manager_program="$with_login_manager"
2520 NEW_LOGIN_COMMAND_P=''
2521 NEW_LOGIN_COMMAND="$ac_cv_login_manager_program"
2523 AC_MSG_CHECKING(for login manager)
2524 if test -z "$NEW_LOGIN_COMMAND" ; then
2525 NEW_LOGIN_COMMAND="$default_login_manager_1"
2526 NEW_LOGIN_COMMAND_P='! '
2527 AC_MSG_RESULT($NEW_LOGIN_COMMAND (disabled))
2529 AC_MSG_RESULT($NEW_LOGIN_COMMAND)
2533 ###############################################################################
2535 # Check for -lgtk (and Gnome stuff)
2537 ###############################################################################
2540 with_gtk_req=unspecified
2542 User interface options:
2544 --with-gtk Use the Gtk toolkit for the user interface.],
2545 [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
2547 # if --with-gtk=/directory/ was specified, remember that directory so that
2548 # we can also look for the `gtk-config' program in that directory.
2558 HANDLE_X_PATH_ARG(with_gtk, --with-gtk, Gtk)
2560 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
2561 echo "error: must be yes or no: --with-gtk=$with_gtk"
2566 parse_gtk_version_string() {
2569 maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
2570 min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
2572 ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
2573 if test -z "$ac_gtk_version"; then
2574 ac_gtk_version=unknown
2575 ac_gtk_version_string=unknown
2579 # Find pkg-config... (need this for both gtk and gdk_pixbuf.)
2580 # if the user specified --with-gtk=/foo/ then look there.
2583 if test ! -z "$gtk_dir"; then
2584 # canonicalize slashes.
2585 foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
2586 gtk_path="$foo:$gtk_path"
2589 AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
2591 if test -z "$pkg_config" ; then
2592 AC_MSG_WARN([pkg-config not found!])
2597 # Utility function for running pkg-config-based tests...
2600 pkg_check_version() {
2601 if test "$ok" = yes ; then
2604 AC_MSG_CHECKING(for $req)
2605 if $pkg_config --exists "$req" ; then
2606 vers=`$pkg_config --modversion "$req"`
2607 if $pkg_config --exists "$req >= $min" ; then
2608 AC_MSG_RESULT($vers)
2612 AC_MSG_RESULT($vers (wanted >= $min))
2627 have_gtk_2_22_or_higher=no
2628 COMMENT_DEMO_GLADE2_GTK_2_22_HEAD=""
2629 COMMENT_DEMO_GLADE2_GTK_2_22_TAIL=""
2631 if test "$with_gtk" = yes; then
2635 pkg_check_version gtk+-2.0 2.0.1 ; ac_gtk_version_string="$vers"
2636 pkg_check_version gmodule-2.0 2.0.0
2637 pkg_check_version libxml-2.0 2.4.6
2638 pkg_check_version libglade-2.0 1.99.0
2639 pkg_check_version gdk-pixbuf-2.0 2.0.0
2640 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
2643 if test "$have_gtk" = no; then
2644 if test -n "$ac_gtk_version_string" ; then
2645 gtk_halfassed="$ac_gtk_version_string"
2646 gtk_halfassed_lib="$req"
2650 if test "$have_gtk" = yes; then
2651 parse_gtk_version_string
2655 if test "$have_gtk" = yes; then
2656 AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
2657 [ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
2658 AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
2659 [ac_cv_gtk_config_libs=`$pkg_config --libs $pkgs`])
2662 ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
2663 ac_gtk_config_libs=$ac_cv_gtk_config_libs
2667 if test "$have_gtk" = yes; then
2668 GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
2669 GTK_DATADIR="$GTK_DATADIR/share"
2672 if test "$have_gtk" = yes; then
2673 INCLUDES="$INCLUDES $ac_gtk_config_cflags"
2674 GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
2676 AC_DEFINE(HAVE_GTK2)
2680 if test "$have_gtk" = yes; then
2682 pkg_check_version gtk+-2.0 2.22
2683 have_gtk_2_22_or_higher="$ok"
2684 if test "$have_gtk_2_22_or_higher" = yes; then
2685 COMMENT_DEMO_GLADE2_GTK_2_22_HEAD="<!-- comment>"
2686 COMMENT_DEMO_GLADE2_GTK_2_22_TAIL="</comment -->"
2692 # Check for the various Gnome help and URL loading programs.
2694 WITH_BROWSER=gnome-open
2695 if test "$have_gtk" = yes; then
2696 AC_CHECK_PROGS(gnome_open_program, gnome-open)
2697 AC_CHECK_PROGS(gnome_url_show_program, gnome-url-show)
2701 ###############################################################################
2705 ###############################################################################
2708 with_motif_req=unspecified
2709 AC_ARG_WITH(motif,[ --with-motif Use the Motif toolkit for the user interface
2710 (no longer supported.)],
2711 [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
2713 HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
2715 if test "$with_motif" != yes -a "$with_motif" != no ; then
2716 echo "error: must be yes or no: --with-motif=$with_motif"
2720 if test "$with_motif" = yes; then
2722 AC_CHECK_X_HEADER(Xm/Xm.h,
2724 AC_DEFINE(HAVE_MOTIF)
2725 MOTIF_LIBS="$MOTIF_LIBS -lXm"],,
2726 [#include <stdlib.h>
2728 #include <X11/Intrinsic.h>])
2732 if test "$have_motif" = yes; then
2733 AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)],,
2734 [#include <stdlib.h>
2736 #include <X11/Intrinsic.h>])
2740 ###############################################################################
2742 # Checking whether Motif is really Lesstif.
2744 ###############################################################################
2747 if test "$have_motif" = yes ; then
2748 AC_CACHE_CHECK([whether Motif is really LessTif],
2750 [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
2751 [long vers = LesstifVersion;],
2752 [ac_cv_have_lesstif=yes],
2753 [ac_cv_have_lesstif=no])])
2754 have_lesstif=$ac_cv_have_lesstif
2758 lesstif_version=unknown
2759 lesstif_version_string=unknown
2761 if test "$have_lesstif" = yes ; then
2763 echo unknown > conftest-lt
2764 AC_CACHE_CHECK([LessTif version number],
2765 ac_cv_lesstif_version_string,
2766 [AC_TRY_X_RUN([#include <stdio.h>
2769 FILE *f = fopen("conftest-lt", "w");
2771 fprintf(f, "%d %d.%d\n", LesstifVersion,
2772 LESSTIF_VERSION, LESSTIF_REVISION);
2776 [ltv=`cat conftest-lt`
2777 ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
2778 ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`],
2779 [ac_cv_lesstif_version=unknown
2780 ac_cv_lesstif_version_string=unknown],
2781 [ac_cv_lesstif_version=unknown
2782 ac_cv_lesstif_version_string=unknown])])
2784 lesstif_version=$ac_cv_lesstif_version
2785 lesstif_version_string=$ac_cv_lesstif_version_string
2790 if test "$have_motif" = yes ; then
2792 echo unknown > conftest-mt
2793 AC_CACHE_CHECK([Motif version number],
2794 ac_cv_motif_version_string,
2795 [AC_TRY_X_RUN([#include <stdio.h>
2798 FILE *f = fopen("conftest-mt", "w");
2800 fprintf(f, "%d %d.%d\n", XmVersion,
2801 XmVERSION, XmREVISION);
2805 [mtv=`cat conftest-mt`
2806 ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
2807 ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`],
2808 [ac_cv_motif_version=unknown
2809 ac_cv_motif_version_string=unknown],
2810 [ac_cv_motif_version=unknown
2811 ac_cv_motif_version_string=unknown])])
2813 motif_version=$ac_cv_motif_version
2814 motif_version_string=$ac_cv_motif_version_string
2819 ###############################################################################
2821 # Checking whether Motif requires -lXpm.
2823 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
2824 # The deal is, Motif 2.x requires XPM -- but it's a compilation option
2825 # of the library whether to build the XPM code into libXm, or whether
2826 # to rely on an external libXm. So the only way to tell whether XPM is
2827 # a link-time requirement is to examine libXm.a, which is very
2828 # difficult to do in an autoconf script. So... if it's Motif 2.x, we
2829 # always link against XPM if the XPM lib exists (and this will be a
2830 # no-op if libXm happens to already have the XPM code in it.)
2832 ###############################################################################
2834 motif_requires_xpm=no
2835 if test "$have_motif" = yes ; then
2836 AC_MSG_CHECKING(whether Motif requires XPM)
2837 if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
2839 motif_requires_xpm=yes
2840 AC_MSG_RESULT(maybe)
2847 ###############################################################################
2849 # Checking whether Motif requires -lXp.
2851 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
2852 # Extension". Why this extension isn't in -lXext with all the others,
2855 ###############################################################################
2858 if test "$have_motif" = yes ; then
2860 AC_CHECK_X_LIB(Xp, XpQueryExtension,
2861 [have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"],
2862 [true], -lX11 -lXext -lm)
2866 ###############################################################################
2868 # Checking whether Motif requires -lXintl (for _Xsetlocale.)
2870 ###############################################################################
2873 if test "$have_motif" = yes ; then
2874 AC_CHECK_X_LIB(Xintl, _Xsetlocale, [have_xintl=yes], [have_xintl=no],
2876 if test "$have_xintl" = yes; then
2877 MOTIF_LIBS="$MOTIF_LIBS -lXintl"
2882 ###############################################################################
2884 # Check for -lGL or -lMesaGL.
2886 ###############################################################################
2890 with_gl_req=unspecified
2895 --with-gl Build those demos which depend on OpenGL.],
2896 [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
2898 HANDLE_X_PATH_ARG(with_gl, --with-gl, GL)
2900 ac_mesagl_version=unknown
2901 ac_mesagl_version_string=unknown
2903 if test "$with_gl" = yes; then
2904 AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
2905 if test "$have_gl" = yes ; then
2906 AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no,
2907 [#include <GL/gl.h>])
2910 # If we have the headers, try and figure out which vendor it's from.
2912 if test "$have_gl" = yes ; then
2914 # We need to know whether it's MesaGL so that we know which libraries
2917 AC_CACHE_CHECK([whether GL is really MesaGL], ac_cv_have_mesa_gl,
2918 [ac_cv_have_mesa_gl=no
2919 if test "$ac_macosx" = no; then
2920 # WTF! MacOS 10.5.0 ships the Mesa GL headers!
2921 # It's not really Mesa, is it?
2922 AC_EGREP_X_HEADER(Mesa|MESA, GL/glx.h, [ac_cv_have_mesa_gl=yes])
2924 ac_have_mesa_gl=$ac_cv_have_mesa_gl
2929 if test "$ac_macosx" = yes; then
2931 # Without these, every link against libGL gets a bunch of useless
2934 osx_crud="-bind_at_load -multiply_defined suppress"
2935 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2936 GL_LIBS="$GL_LIBS $osx_crud"
2939 # New lossage in 10.5.0: without this, we get:
2940 # ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
2942 osx_crud="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
2943 osx_crud="-Wl,-dylib_file,${osx_crud}:${osx_crud}"
2945 AC_MSG_RESULT(adding "$osx_crud" to GL_LIBS)
2946 GL_LIBS="$GL_LIBS $osx_crud"
2949 # New lossage in 10.6.8: we can't allow -L/opt/local/lib to be in the
2950 # link line, or at runtime XQueryExtension gets a segv due to some kind
2951 # of library version skew. Libs must come from /usr/X11/lib even if
2952 # $prefix and/or $exec_prefix are set to /opt/local/.
2954 AC_MSG_RESULT(omitting "$libdir" from LDFLAGS)
2960 # Some versions of MesaGL are compiled to require -lpthread.
2961 # So if the Mesa headers exist, and -lpthread exists, then always
2962 # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
2964 # Oftentimes, AX_PTHREAD will bring in -lpthread as well; but that ends
2965 # up before -l(Mesa)GL, instead of after where it would belong.
2967 if test "$ac_have_mesa_gl" = yes; then
2968 AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],)
2972 # If we have Mesa headers, check to see if we can link against -lMesaGL.
2973 # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
2974 # Else, warn that GL is busted. (We have the headers, but no libs.)
2977 if test "$ac_have_mesa_gl" = yes ; then
2978 AC_CHECK_X_LIB(MesaGL, glXCreateContext,
2980 GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS"],
2981 [], -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2984 if test "$gl_lib_1" = "" ; then
2985 AC_CHECK_X_LIB(GL, glXCreateContext,
2987 GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS"],
2988 [], -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2991 if test "$gl_lib_1" = "" ; then
2992 # we have headers, but no libs -- bail.
2997 # linking works -- we can build the GL hacks.
2999 if test "$ac_have_mesa_gl" = yes ; then
3000 AC_DEFINE(HAVE_MESA_GL)
3006 # Now that we know we have GL headers and libs, do some more GL testing.
3009 if test "$have_gl" = yes ; then
3010 # If it's MesaGL, we'd like to issue a warning if the version number
3011 # is less than or equal to 2.6, because that version had a security bug.
3013 if test "$ac_have_mesa_gl" = yes; then
3015 AC_CACHE_CHECK([MesaGL version number], ac_cv_mesagl_version_string,
3016 [cat > conftest.$ac_ext <<EOF
3017 #line __oline__ "configure"
3018 #include "confdefs.h"
3020 #ifndef MESA_MAJOR_VERSION
3021 # include <GL/xmesa.h>
3022 # ifdef XMESA_MAJOR_VERSION
3023 /* Around Mesa 3.2, they took out the Mesa version number, so instead,
3024 we have to check the XMesa version number (the number of the X protocol
3025 support, which seems to be the same as the Mesa version number.)
3027 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
3028 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
3030 /* Oh great. Some time after 3.4, they took out the xmesa.h header file,
3031 so we have no way of telling what version of Mesa this is at all.
3032 So, we'll guess that the osmesa version (the "offscreen protocol")
3033 is less than or equal to the real mesa version number. Except that
3034 if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
3035 Mesa 3.4. And Mesa 3.3 had xmesa.h. What a complete load of shit!
3037 # include <GL/osmesa.h>
3038 # define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
3039 # define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
3040 # if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
3041 # undef MESA_MINOR_VERSION
3042 # define MESA_MINOR_VERSION 4 or newer, probably?
3046 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
3049 ac_save_CPPFLAGS="$CPPFLAGS"
3050 if test \! -z "$includedir" ; then
3051 CPPFLAGS="$CPPFLAGS -I$includedir"
3053 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3055 mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | grep configure:`
3059 mglv=`echo "$mglv" | sed -n \
3060 's/^configure: *\([0-9][0-9]*\) *\([0-9].*\)$/\1.\2/p'`
3063 rm -f conftest.$ac_ext
3065 CPPFLAGS="$ac_save_CPPFLAGS"
3067 if test "$mglv" = ""; then
3068 ac_mesagl_version=unknown
3069 ac_mesagl_version_string=unknown
3071 ac_mesagl_version_string="$mglv"
3074 maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
3075 min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
3077 ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
3078 if test -z "$ac_mesagl_version"; then
3079 ac_mesagl_version=unknown
3080 ac_mesagl_version_string=unknown
3083 ac_cv_mesagl_version=$ac_mesagl_version
3084 ac_cv_mesagl_version_string=$ac_mesagl_version_string
3086 ac_mesagl_version=$ac_cv_mesagl_version
3087 ac_mesagl_version_string=$ac_cv_mesagl_version_string
3091 # Check for OpenGL 1.1 features.
3093 AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
3094 [true], $GL_LIBS -lX11 -lXext -lm)
3097 elif test "$with_gl" != no; then
3098 echo "error: must be yes or no: --with-gl=$with_gl"
3103 ###############################################################################
3107 ###############################################################################
3110 with_gle_req=unspecified
3113 [ --with-gle Build those demos which depend on GLE
3114 (the OpenGL "extrusion" library.)],
3115 [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes])
3117 HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE)
3121 if test "$have_gl" = no ; then
3123 elif test "$with_gle" = yes; then
3125 AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no,
3126 [#include <GL/gl.h>])
3127 if test "$have_gle3" = yes ; then
3130 AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no,
3131 [#include <GL/gl.h>])
3132 if test "$have_gle" = yes ; then
3133 AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no,
3134 [#include <GL/gl.h>])
3138 if test "$have_gle" = yes ; then
3141 AC_CHECK_X_LIB(gle, gleCreateGC,
3142 [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"],
3143 [], $GL_LIBS -lX11 -lXext -lm)
3145 if test "$have_gle" = yes ; then
3149 # sometimes the libmatrix stuff is included in libgle. look there first.
3151 # I don't get it. For some reason, this test passes on SGI, as if
3152 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
3153 # Yet the link is succeeding. Why???
3155 # AC_CHECK_X_LIB(gle, uview_direction_d,
3156 # [have_gle=yes; gle_halfassed=no],
3157 # [], $GL_LIBS -lX11 -lXext -lm)
3159 # As of GLE 3 this is in libgle, and has changed name to uview_direction!
3161 if test "$have_gle3" = yes ; then
3162 AC_CHECK_X_LIB(gle, uview_direction,
3163 [have_gle=yes; gle_halfassed=no],
3164 [], $GL_LIBS -lX11 -lXext -lm)
3166 # if it wasn't in libgle, then look in libmatrix.
3167 if test "$have_gle" = no ; then
3168 AC_CHECK_X_LIB(matrix, uview_direction_d,
3169 [have_gle=yes; gle_halfassed=no;
3170 GLE_LIBS="$GLE_LIBS -lmatrix"],
3171 [], $GL_LIBS -lX11 -lXext -lm)
3175 if test "$have_gle" = yes ; then
3177 if test "$have_gle3" = yes ; then
3178 AC_DEFINE(HAVE_GLE3)
3182 elif test "$with_gle" != no; then
3183 echo "error: must be yes or no: --with-gle=$with_gle"
3189 ###############################################################################
3191 # Handle --with-gles
3193 ###############################################################################
3195 with_gles_req=unspecified
3197 [ --with-gles Target OpenGL ES 1.x API instead of OpenGL 1.3.],
3198 [with_gles="$withval"; with_gles_req="$withval"],[with_gles=no])
3200 HANDLE_X_PATH_ARG(with_gles, --with-gles, JWZGLES)
3202 if test "$with_gles" = yes; then
3204 AC_DEFINE(HAVE_JWZGLES)
3205 JWZGLES_OBJS="jwzgles.o"
3206 AC_MSG_RESULT(using OpenGL ES compatiblity shim)
3207 elif test "$with_gles" != no; then
3208 echo "error: must be yes or no: --with-gles=$with_xpm"
3212 ###############################################################################
3214 # Check for -lgdk_pixbuf.
3215 # These tests are for gdk_pixbuf usage of the hacks,
3216 # not xscreensaver-demo (thus we have to test again to get
3217 # the libraries right: don't want to pull in all of GTK
3220 ###############################################################################
3223 with_gdk_pixbuf_req=unspecified
3225 [ --with-pixbuf Include support for the GDK-Pixbuf library in some
3226 demos, which will make it possible for them to read
3227 GIF, JPEG, and PNG files as well.],
3228 [with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"],
3229 [with_gdk_pixbuf=yes])
3231 # if --with-pixbuf=/directory/ was specified, remember that directory so that
3232 # we can also look for the `gdk-pixbuf-config' program in that directory.
3233 case "$with_gdk_pixbuf" in
3235 gdk_pixbuf_dir="$with_gdk_pixbuf"
3242 HANDLE_X_PATH_ARG(with_gdk_pixbuf, --with-pixbuf, GDK_PIXBUF)
3244 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
3245 echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
3249 if test "$with_gdk_pixbuf" = yes; then
3255 pkg_check_version gdk-pixbuf-2.0 2.0.0
3256 pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
3257 have_gdk_pixbuf="$ok"
3259 if test "$have_gdk_pixbuf" = yes; then
3260 AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
3261 [ac_cv_gdk_pixbuf_config_cflags=`$pkg_config --cflags $pkgs`])
3262 AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
3263 [ac_cv_gdk_pixbuf_config_libs=`$pkg_config --libs $pkgs`])
3266 ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
3267 ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
3270 if test "$have_gdk_pixbuf" = yes; then
3272 # we appear to have pixbuf; check for headers/libs to be sure.
3274 ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
3275 CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
3279 # check for header A...
3280 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf.h, [have_gdk_pixbuf=yes])
3282 # if that worked, check for header B...
3283 if test "$have_gdk_pixbuf" = yes; then
3285 gdk_pixbuf_halfassed=yes
3286 AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf-xlib.h,
3287 [have_gdk_pixbuf=yes
3288 gdk_pixbuf_halfassed=no])
3290 # yay, it has a new name in Gtk 2.x...
3291 if test "$have_gdk_pixbuf" = no; then
3293 gdk_pixbuf_halfassed=yes
3294 AC_CHECK_X_HEADER(gdk-pixbuf-xlib/gdk-pixbuf-xlib.h,
3295 [have_gdk_pixbuf=yes
3296 gdk_pixbuf_halfassed=no])
3299 CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
3302 if test "$have_gdk_pixbuf" = yes; then
3303 # we have the headers, now check for the libraries
3305 gdk_pixbuf_halfassed=yes
3307 AC_MSG_RESULT(checking for gdk_pixbuf usability...)
3310 AC_CHECK_X_LIB(c, gdk_pixbuf_new_from_file, [have_gdk_pixbuf=yes],,
3311 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3313 if test "$have_gdk_pixbuf" = yes; then
3315 AC_CHECK_X_LIB(c, gdk_pixbuf_xlib_init,
3316 [have_gdk_pixbuf=yes
3317 gdk_pixbuf_halfassed=no],,
3318 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3322 if test "$have_gdk_pixbuf" = yes; then
3323 INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
3324 XPM_LIBS="$ac_gdk_pixbuf_config_libs"
3325 AC_DEFINE(HAVE_GDK_PIXBUF)
3327 AC_MSG_RESULT(checking for gdk_pixbuf usability... no)
3330 if test "$have_gdk_pixbuf" = yes; then
3331 AC_CHECK_X_LIB(c, gdk_pixbuf_apply_embedded_orientation,
3332 [AC_DEFINE(HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION)],,
3333 $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
3338 ###############################################################################
3342 ###############################################################################
3345 with_xpm_req=unspecified
3347 [ --with-xpm Include support for XPM files in some demos.
3348 (Not needed if Pixbuf is used.)],
3349 [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
3351 HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
3353 if test "$with_xpm" = yes; then
3354 AC_CHECK_X_HEADER(X11/xpm.h,
3357 XPM_LIBS="-lXpm $XPM_LIBS"],,
3358 [#include <X11/Xlib.h>])
3359 elif test "$with_xpm" != no; then
3360 echo "error: must be yes or no: --with-xpm=$with_xpm"
3364 # See comment near $motif_requires_xpm, above.
3365 # Need to do this here, after both Motif and XPM have been checked for.
3367 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
3368 if test "$motif_requires_xpm" = yes ; then
3369 MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
3373 if test "$XPM_LIBS" = "" ; then
3378 ###############################################################################
3382 ###############################################################################
3385 with_jpeg_req=unspecified
3388 [ --with-jpeg Include support for the JPEG library.],
3389 [with_jpeg="$withval"; with_jpeg_req="$withval"],
3392 HANDLE_X_PATH_ARG(with_jpeg, --with-jpeg, JPEG)
3394 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
3395 echo "error: must be yes or no: --with-jpeg=$with_jpeg"
3399 if test "$with_jpeg" = yes; then
3402 AC_CHECK_X_HEADER(jpeglib.h, [have_jpeg=yes])
3404 if test "$have_jpeg" = yes; then
3405 # we have the header, now check for the library
3408 AC_CHECK_X_LIB(jpeg, jpeg_start_compress,
3412 AC_DEFINE(HAVE_JPEGLIB)])
3417 ###############################################################################
3421 ###############################################################################
3423 have_xutf8drawstring=no
3424 AC_CHECK_X_LIB(X11, Xutf8DrawString,
3425 [have_xutf8drawstring=yes],
3426 [true], -lX11 -lXext -lm)
3427 if test "$have_xutf8drawstring" = yes ; then
3428 AC_DEFINE(HAVE_XUTF8DRAWSTRING)
3433 with_xft_req=unspecified
3436 [ --with-xft Include support for the X Freetype library.],
3437 [with_xft="$withval"; with_xft_req="$withval"],
3440 HANDLE_X_PATH_ARG(with_xft, --with-xft, Xft)
3442 if test "$with_xft" != yes -a "$with_xft" != no ; then
3443 echo "error: must be yes or no: --with-xft=$with_xft"
3447 if test "$with_xft" = yes; then
3451 pkg_check_version xft 2.1.0
3454 if test "$have_xft" = yes; then
3455 AC_CACHE_CHECK([for Xft includes], ac_cv_xft_config_cflags,
3456 [ac_cv_xft_config_cflags=`$pkg_config --cflags $pkgs`])
3457 AC_CACHE_CHECK([for Xft libs], ac_cv_xft_config_libs,
3458 [ac_cv_xft_config_libs=`$pkg_config --libs $pkgs`])
3461 ac_xft_config_cflags=$ac_cv_xft_config_cflags
3462 ac_xft_config_libs=$ac_cv_xft_config_libs
3464 if test "$have_xft" = yes; then
3466 # we appear to have Xft; check for headers/libs to be sure.
3468 ac_save_xft_CPPFLAGS="$CPPFLAGS"
3469 CPPFLAGS="$CPPFLAGS $ac_xft_config_cflags"
3472 AC_CHECK_X_HEADER(X11/Xft/Xft.h, [have_xft=yes])
3474 CPPFLAGS="$ac_save_xft_CPPFLAGS"
3477 if test "$have_xft" = yes; then
3478 # we have the headers, now check for the libraries
3482 AC_MSG_RESULT(checking for Xft usability...)
3483 AC_CHECK_X_LIB(c, XftDrawStringUtf8, [have_xft=yes],,
3484 $ac_xft_config_libs -lX11 -lXext -lm)
3487 if test "$have_xft" = no; then
3488 AC_MSG_RESULT(checking for Xft usability... no)
3492 if test "$have_xft" = yes; then
3493 INCLUDES="$INCLUDES $ac_xft_config_cflags"
3494 XFT_LIBS="$ac_xft_config_libs"
3500 XFT_SRCS='$(UTILS_SRC)/xft.c'
3501 XFT_OBJS='$(UTILS_BIN)/xft.o'
3505 ###############################################################################
3507 # Check for pty support: this allows 'phosphor' and 'apple2'
3508 # to run curses-based programs, or be used as terminal windows.
3510 ###############################################################################
3513 AC_CHECK_HEADERS(pty.h util.h)
3514 AC_CHECK_X_LIB(util, forkpty,
3517 AC_DEFINE(HAVE_FORKPTY)])
3519 if test "$ac_have_forkpty" != yes ; then
3520 # we don't need (or have) -lutil on MacOS 10.4.2...
3521 AC_CHECK_X_LIB(c, forkpty,
3523 AC_DEFINE(HAVE_FORKPTY)])
3526 ###############################################################################
3528 # Check for the XSHM server extension.
3530 ###############################################################################
3533 with_xshm_req=unspecified
3534 AC_ARG_WITH(xshm-ext,
3535 [ --with-xshm-ext Include support for the Shared Memory extension.],
3536 [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
3538 HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
3540 if test "$with_xshm" = yes; then
3542 # first check for Xshm.h.
3543 AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes],,
3544 [#include <X11/Xlib.h>])
3546 # if that succeeded, then check for sys/ipc.h.
3547 if test "$have_xshm" = yes; then
3549 AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
3552 # if that succeeded, then check for sys/shm.h.
3553 if test "$have_xshm" = yes; then
3555 AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
3558 # AIX is pathological, as usual: apparently it's normal for the Xshm headers
3559 # to exist, but the library code to not exist. And even better, the library
3560 # code is in its own library: libXextSam.a. So, if we're on AIX, and that
3561 # lib doesn't exist, give up. (This lib gets added to X_EXTRA_LIBS, and
3562 # that's not quite right, but close enough.)
3566 if [ `uname -v` -eq 3 ]; then
3568 AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
3569 [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
3570 [true], -lX11 -lXext -lm)
3575 # if that succeeded, then we've really got it.
3576 if test "$have_xshm" = yes; then
3577 AC_DEFINE(HAVE_XSHM_EXTENSION)
3580 elif test "$with_xshm" != no; then
3581 echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
3586 ###############################################################################
3588 # Check for the DOUBLE-BUFFER server extension.
3590 ###############################################################################
3593 with_xdbe_req=unspecified
3594 AC_ARG_WITH(xdbe-ext,
3595 [ --with-xdbe-ext Include support for the DOUBLE-BUFFER extension.],
3596 [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
3598 HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
3600 if test "$with_xdbe" = yes; then
3602 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes],,
3603 [#include <X11/Xlib.h>])
3604 if test "$have_xdbe" = yes; then
3605 AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
3608 elif test "$with_xdbe" != no; then
3609 echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
3614 ###############################################################################
3616 # Check for the SGI XReadDisplay server extension.
3618 # Note: this has to be down here, rather than up with the other server
3619 # extension tests, so that the output of `configure --help' is in the
3620 # right order. Arrgh!
3622 ###############################################################################
3625 with_readdisplay_req=unspecified
3626 AC_ARG_WITH(readdisplay,
3627 [ --with-readdisplay Include support for the XReadDisplay extension.],
3628 [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
3629 [with_readdisplay=yes])
3631 HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
3633 if test "$with_readdisplay" = yes; then
3634 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
3635 AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION),,
3636 [#include <X11/Xlib.h>])
3637 elif test "$with_readdisplay" != no; then
3638 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
3643 ###############################################################################
3645 # Check for a directory full of images to use as the default value
3646 # of the "imageDirectory" preference.
3648 ###############################################################################
3651 with_imagedir_req=unspecified
3653 AC_ARG_WITH(image-directory,
3654 [ --with-image-directory Arg is the default directory from which some demos
3655 will choose random images to display.],
3656 [with_imagedir="$withval"; with_imagedir_req="$withval"],
3657 [with_imagedir=yes])
3658 # no HANDLE_X_PATH_ARG for this one
3660 case "$with_imagedir" in
3663 AC_MSG_CHECKING([for image directory $with_imagedir])
3664 if test -d "$with_imagedir" ; then
3674 #### Could use some more defaults here...
3676 "/usr/share/backgrounds/images/" \
3677 "/usr/share/wallpapers/" \
3678 "/Library/Desktop Pictures/" \
3680 if test -z "$with_imagedir"; then
3681 AC_MSG_CHECKING([for image directory $dd])
3682 if test -d "$dd" ; then
3697 echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req"
3701 ac_cv_imagedir="$with_imagedir"
3703 DEFAULT_IMAGES_P='True'
3704 DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir"
3706 if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then
3707 DEFAULT_IMAGES_P='False'
3711 ###############################################################################
3713 # Pick a text file to use as the default of the "textFile" preference.
3714 # Any old file will do, but preferably one that will make interesting
3715 # shapes when displayed by "starwars" and "fontglide".
3717 ###############################################################################
3720 with_textfile_req=unspecified
3722 AC_ARG_WITH(text-file,
3723 [ --with-text-file=FILE By default, some demos may display this file.],
3724 [with_textfile="$withval"; with_textfile_req="$withval"],
3725 [with_textfile=yes])
3726 # no HANDLE_X_PATH_ARG for this one
3728 case "$with_textfile" in
3731 AC_MSG_CHECKING([for text file $with_textfile])
3732 if test -f "$with_textfile" ; then
3742 #### Could use some more defaults here...
3744 "/usr/X11R6/lib/X11/doc/README" \
3745 "/usr/share/doc/xserver-common/copyright" \
3746 "/usr/share/doc/xserver-xorg-core/copyright" \
3747 "/usr/X11R6/README" \
3748 "/usr/share/doc/libX11*/COPYING" \
3749 "/usr/X11/share/X11/doc/README*" \
3750 "/usr/share/doc/debian/debian-manifesto" \
3752 if test -z "$with_textfile"; then
3753 AC_MSG_CHECKING([for text file $f])
3754 f=`/bin/ls $f 2>&- | head -1`
3755 if test -f "$f" ; then
3770 echo "error: must be an absolute path: --with-text-file=$with_textfile_req"
3774 ac_cv_textfile="$with_textfile"
3776 DEFAULT_TEXT_FILE="$ac_cv_textfile"
3779 ###############################################################################
3781 # Check the browser to see help URL
3783 ###############################################################################
3786 with_browser_req=unspecified
3788 AC_ARG_WITH(browser,
3789 [ --with-browser=BROWSER Specify the web browser used to show the help URL.],
3790 [with_browser="$withval"; with_browser_req="$withval"],
3792 # no HANDLE_X_PATH_ARG for this one
3794 case "$with_browser" in
3798 WITH_BROWSER=$with_browser
3799 gnome_open_program=$with_browser
3800 AC_MSG_CHECKING([for browser $with_browser])
3801 with_browser_fullpath=`which $with_browser 2>/dev/null`
3802 case $with_browser_fullpath in
3809 # Only warning: we don't want to install all packages for the
3810 # dependency of the browser in building stage...
3811 echo "WARNING: browser not found: --with-browser=$with_browser"
3816 ac_cv_browser="$with_browser"
3818 ###############################################################################
3820 # Check whether it's ok to install some hacks as setuid (e.g., "sonar")
3821 # This should be safe, but let's give people the option.
3823 ###############################################################################
3825 setuid_hacks_default=no
3826 setuid_hacks="$setuid_hacks_default"
3827 AC_ARG_WITH(setuid-hacks,
3828 [ --with-setuid-hacks Allow some demos to be installed `setuid root'
3829 (which is needed in order to ping other hosts.)
3831 [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"])
3833 HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks)
3835 if test "$setuid_hacks" = yes; then
3837 elif test "$setuid_hacks" != no; then
3838 echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
3843 ###############################################################################
3845 # Check for --with-record-animation
3847 ###############################################################################
3849 record_anim_default=no
3850 record_anim="$record_anim_default"
3851 AC_ARG_WITH(record-animation,
3852 [ --with-record-animation Include code for generating MP4 videos.
3854 [record_anim="$withval"], [record_anim="$record_anim_default"])
3856 HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation)
3858 if test "$record_anim" = yes; then
3860 elif test "$record_anim" != no; then
3861 echo "error: must be yes or no: --with-record-animation=$record_anim"
3865 if test "$record_anim" = yes; then
3866 if test "$have_gdk_pixbuf" != yes; then
3867 AC_MSG_ERROR(--with-record-animation requires GDK-Pixbuf)
3869 AC_MSG_RESULT(enabling --with-record-animation)
3870 AC_DEFINE(HAVE_RECORD_ANIM)
3871 ANIM_OBJS='$(ANIM_OBJS)'
3872 ANIM_LIBS='$(ANIM_LIBS)'
3876 ###############################################################################
3878 # Done testing. Now, set up the various -I and -L variables,
3879 # and decide which GUI program to build by default.
3881 ###############################################################################
3888 if test \! -z "$includedir" ; then
3889 INCLUDES="$INCLUDES -I$includedir"
3892 if test \! -z "$libdir" ; then
3893 LDFLAGS="$LDFLAGS -L$libdir"
3897 PREFERRED_DEMO_PROGRAM=''
3899 if test "$have_motif" = yes; then
3900 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
3901 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3903 if test "$have_gtk" = yes; then
3904 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
3905 ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
3909 if test "$have_kerberos" = yes; then
3910 PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
3911 PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
3913 if test "$have_pam" = yes; then
3914 PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
3915 PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
3916 INSTALL_PAM="install-pam"
3918 if test "$enable_pam_check_account_type" = yes; then
3919 COMMENT_PAM_CHECK_ACCOUNT=""
3921 COMMENT_PAM_CHECK_ACCOUNT="#"
3923 if test "$have_passwd_helper" = yes; then
3924 PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
3925 PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
3927 PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
3928 PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
3931 if test "$enable_locking" = yes; then
3932 LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
3933 LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
3935 LOCK_SRCS='$(NOLOCK_SRCS_1)'
3936 LOCK_OBJS='$(NOLOCK_OBJS_1)'
3939 if test "$ac_macosx" = yes; then
3940 EXES_OSX='$(EXES_OSX)'
3941 SCRIPTS_OSX='$(SCRIPTS_OSX)'
3942 MEN_OSX='$(MEN_OSX)'
3950 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
3952 if test "$need_setuid" = yes; then
3958 if test "$setuid_hacks" = yes; then
3965 if test "$have_gl" = yes; then
3966 GL_EXES='$(GL_EXES)'
3967 SUID_EXES='$(SUID_EXES)'
3968 RETIRED_GL_EXES='$(RETIRED_GL_EXES)'
3969 GL_UTIL_EXES='$(GL_UTIL_EXES)'
3976 if test "$have_gle" = yes; then
3977 GLE_EXES='$(GLE_EXES)'
3983 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
3984 JPEG_EXES='$(JPEG_EXES)'
3988 # Another substitution in the XScreenSaver.ad.in file:
3990 if test "$gnome_open_program" != ''; then
3994 elif test "$gnome_url_show_program" != ''; then
4005 # Set PO_DATADIR to something sensible.
4007 AC_MSG_CHECKING([for locale directory])
4008 if test -n "$GTK_DATADIR" ; then
4009 PO_DATADIR="$GTK_DATADIR"
4010 elif test "$have_gtk" = yes; then
4011 PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
4012 PO_DATADIR="$PO_DATADIR/share"
4015 if test -z "$PO_DATADIR" ; then
4017 # #### Total fucking kludge --
4018 # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
4019 # but of course we need to expand all the nested variables to do that...
4021 dd=`eval eval eval eval eval eval eval eval eval eval eval echo $datadir`
4022 PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'`
4025 AC_MSG_RESULT($PO_DATADIR/locale)
4028 # canonicalize slashes.
4029 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
4031 # gcc 3.0 likes to issue this warning for every file:
4033 # cc1: warning: changing search order for system directory "/usr/local/include"
4034 # cc1: warning: as it has already been specified as a non-system directory
4036 # Yay. We can only avoid that by deleting "-I${prefix}/include" from the list.
4037 # Which *should* be totally redundant, and thus an ok thing to delete?
4039 INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
4042 ###############################################################################
4044 # Perform substitutions and write Makefiles.
4046 ###############################################################################
4050 AC_SUBST(PREFERRED_DEMO_PROGRAM)
4051 AC_SUBST(ALL_DEMO_PROGRAMS)
4052 AC_SUBST(SAVER_LIBS)
4053 AC_SUBST(MOTIF_LIBS)
4062 AC_SUBST(XDPMS_LIBS)
4063 AC_SUBST(XINERAMA_LIBS)
4064 AC_SUBST(PASSWD_LIBS)
4065 AC_SUBST(INSTALL_SETUID)
4066 AC_SUBST(SETUID_HACKS)
4067 AC_SUBST(INSTALL_DIRS)
4068 AC_SUBST(NEED_SETUID)
4069 AC_SUBST(INSTALL_PAM)
4070 AC_SUBST(HAVE_PAM_FAIL_DELAY)
4071 AC_SUBST(COMMENT_PAM_CHECK_ACCOUNT)
4072 AC_SUBST(NEW_LOGIN_COMMAND)
4073 AC_SUBST(NEW_LOGIN_COMMAND_P)
4074 AC_SUBST(DEFAULT_IMAGES_P)
4075 AC_SUBST(DEFAULT_IMAGE_DIRECTORY)
4076 AC_SUBST(DEFAULT_TEXT_FILE)
4077 AC_SUBST(WITH_BROWSER)
4078 AC_SUBST(COMMENT_DEMO_GLADE2_GTK_2_22_HEAD)
4079 AC_SUBST(COMMENT_DEMO_GLADE2_GTK_2_22_TAIL)
4084 AC_SUBST(SCRIPTS_OSX)
4087 AC_SUBST(PASSWD_SRCS)
4088 AC_SUBST(PASSWD_OBJS)
4095 AC_SUBST(SAVER_GL_SRCS)
4096 AC_SUBST(SAVER_GL_OBJS)
4097 AC_SUBST(SAVER_GL_LIBS)
4102 AC_SUBST(RETIRED_GL_EXES)
4104 AC_SUBST(GL_UTIL_EXES)
4108 AC_SUBST(GLE_KLUDGE)
4109 AC_SUBST(JWZGLES_OBJS)
4114 AC_SUBST(HACKDIR_FULL)
4115 AC_SUBST(GTK_DATADIR)
4116 AC_SUBST(PO_DATADIR)
4117 AC_SUBST(HACK_CONF_DIR)
4118 AC_SUBST(GTK_EXTRA_OBJS)
4122 APPDEFAULTS=$ac_x_app_defaults
4123 AC_SUBST(APPDEFAULTS)
4126 AC_SUBST(DEPEND_FLAGS)
4127 AC_SUBST(DEPEND_DEFINES)
4133 driver/xscreensaver.pam
4134 driver/xscreensaver-demo.glade2
4138 driver/XScreenSaver.ad)
4140 ###############################################################################
4142 # Print some warnings at the end.
4144 ###############################################################################
4146 warn_prefix_1=" Warning:"
4147 warn_prefix_2=" Note:"
4148 warn_prefix="$warn_prefix_1"
4151 warnsep=' #################################################################'
4154 if test "$warning" = no ; then
4155 echo '' ; echo "$warnsep" ; echo ''
4162 if test "$warning" = long ; then echo '' ; fi
4165 echo "$warn_prefix $rest"
4172 if test "$was" != no ; then echo '' ; fi
4174 echo "$warn_prefix $rest"
4184 warn_prefix="$warn_prefix_2"
4186 warn_prefix="$warn_prefix_1"
4190 warn_prefix="$warn_prefix_2"
4192 warn_prefix="$warn_prefix_1"
4196 # ac_prog_cc_no_pthread normally only happens on AIX, because according
4197 # to AX_PTHREAD, AIX needs CC=xlc_r or CC=cc_r to do threads.
4198 # If CC is specified, it takes precedence over --with-pthread.
4199 if test "$ac_prog_cc_no_pthread" ; then
4200 warnL "You requested $ac_original_cc for the C compiler, but it doesn't"
4201 warn2 "support POSIX threads."
4203 warn2 "If you have multiple CPU cores, try CC=$PTHREAD_CC."
4204 elif test "$with_pthread_req" = yes -a "$have_pthread" = no ; then
4205 warn 'POSIX threads were requested, but were not found.'
4208 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
4209 warn 'The SGI saver extension was requested, but was not found.'
4212 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
4213 warn 'The XIdle extension was requested, but was not found.'
4216 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
4217 warn 'The XSHM extension was requested, but was not found.'
4220 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
4221 warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
4224 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
4225 warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
4228 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
4229 warn 'The DPMS extension was requested, but was not found.'
4232 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
4233 warn 'The Xinerama extension was requested, but was not found.'
4236 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
4237 warn 'The XF86VMODE extension was requested, but was not found.'
4240 if test "$with_randr_req" = yes -a "$have_randr" = no ; then
4241 warn 'The RANDR extension was requested, but was not found.'
4244 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
4245 warn "Checking of /proc/interrupts was requested, but it's bogus."
4248 if test "$pkg_config" = false ; then
4249 warnL 'The "pkg-config" program was not found. Without that,'
4250 warn2 "detection of the various GTK libraries won't work."
4252 pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
4253 if test "x$pkgerr" != "x" ; then
4254 warnL 'The "pkg-config" program produces errors. This often causes'
4255 warn2 "detection of the various GTK libraries to malfunction."
4256 warn2 "The errors are:"
4258 echo "$pkgerr" | sed 's/^/ > /g'
4262 if test "$gtk_halfassed" != no ; then
4263 warnL "GTK version $gtk_halfassed was found, but at least one supporting"
4264 warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used."
4265 warn2 "Perhaps some of the development packages are not installed?"
4266 if test "$have_gtk" = yes ; then
4267 v="$ac_gtk_version_string"
4268 warn2 "GTK $v is also installed, so it will be used instead."
4269 warn2 "Please read the above output and the \`config.log' file"
4270 warn2 "for more details."
4275 warn2 'Though the Motif front-end to xscreensaver is still'
4276 warn2 'maintained, it is no longer being updated with new'
4277 warn2 'features: all new development on the xscreensaver-demo'
4278 warn2 'program is happening in the GTK version, and not in the'
4279 warn2 'Motif version. It is recommended that you build against'
4280 warn2 'GTK instead of Motif. See <http://www.gtk.org/>.'
4283 if test "$have_motif" = no -a "$have_gtk" = no; then
4285 if test "$with_motif" = yes; then
4286 warnL "Neither the GTK nor Motif libraries were found; the"
4287 warn2 "\`xscreensaver-demo' program requires one of these."
4291 warnL "The GTK libraries do not seem to be available; the"
4292 warn2 "\`xscreensaver-demo' program requires them."
4294 # warn2 'You can use Motif or Lesstif instead of GTK (use the'
4295 # warn2 "\`--with-motif' option) but that is NOT recommended."
4299 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
4300 warnL "Use of Motif was requested, but it wasn't found;"
4301 warn2 "Gtk will be used instead."
4303 elif test "$jurassic_gtk" = yes ; then
4307 v="$ac_gtk_version_string"
4308 if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
4309 warnL "Use of Gtk was requested, but its version number is unknown;"
4310 elif test "$with_gtk_req" = yes ; then
4311 warnL "Use of Gtk was requested, but it is version $v;"
4313 warnL "Gtk was found on this system, but it is version $v;"
4316 warn2 "Gtk $pref_gtk or newer is required."
4318 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
4319 warnL "Use of Gtk was requested, but it wasn't found."
4323 if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then
4324 warn "GTK is being used, but the GDK-Pixbuf library and/or"
4325 warn2 "headers were not found. That can't be good. Please"
4326 warn2 "install the GDK-Pixbuf development kit and re-configure."
4329 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
4331 preferred_lesstif=0.92
4333 if test "$lesstif_version" = unknown; then
4334 warnL "Unable to determine the LessTif version number!"
4335 warn2 "Make sure you are using version $preferred_lesstif or newer."
4336 warn2 "See <http://www.lesstif.org/>."
4338 elif test \! $lesstif_version -gt 82; then
4339 warnL "LessTif version $lesstif_version_string is being used."
4340 warn2 "LessTif versions 0.82 and earlier are too buggy to"
4341 warn2 "use with XScreenSaver; it is strongly recommended"
4342 warn2 "that you upgrade to at least version $preferred_lesstif!"
4343 warn2 "See <http://www.lesstif.org/>."
4348 if test "$have_motif" = yes -a "$have_gtk" = no ; then
4349 warn 'Motif is being used, and GTK is not.'
4355 if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
4356 warnL 'Use of XPM was requested, but it was not found.'
4359 if test "$with_gdk_pixbuf_req" = yes -a "$have_gdk_pixbuf" = no; then
4360 warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
4363 if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \
4364 test "$have_gdk_pixbuf" = no -a "$have_xpm" = no ; then
4366 if test "$with_gdk_pixbuf_req" = yes ; then
4368 elif test "$with_gdk_pixbuf_req" = no ; then
4369 warnL 'The GDK-Pixbuf library is not being used.'
4371 warnL 'The GDK-Pixbuf library was not found.'
4374 if test "$with_xpm_req" = yes -o "$have_xpm" = yes ; then
4376 elif test "$with_xpm_req" = no ; then
4377 warnL 'The XPM library is not being used.'
4379 warnL 'The XPM library was not found.'
4382 if test "$have_gdk_pixbuf" = no -a "$have_xpm" = yes ; then
4383 warn2 'The XPM library is being used instead.'
4386 if test "$gdk_pixbuf_halfassed" = yes ; then
4388 warn2 'More specifically, we found the headers, but not the'
4389 warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
4390 warn2 "system, or something else went wrong. The \`config.log'"
4391 warn2 'file might contain some clues.'
4395 warn2 'Some of the demos will not use images as much as they could.'
4396 warn2 'You should consider installing GDK-Pixbuf and re-running'
4397 warn2 'configure. (GDK-Pixbuf is recommended over XPM, as it'
4398 warn2 'provides support for more image formats.)'
4402 if test "$have_jpeg" = no ; then
4403 if test "$with_jpeg_req" = yes ; then
4404 warnL 'Use of libjpeg was requested, but it was not found.'
4405 elif test "$with_jpeg_req" = no ; then
4406 noteL 'The JPEG library is not being used.'
4408 noteL 'The JPEG library was not found.'
4411 if test "$jpeg_halfassed" = yes ; then
4413 warn2 'More specifically, we found the headers, but not the'
4414 warn2 'library; so either JPEG is half-installed on this'
4415 warn2 "system, or something else went wrong. The \`config.log'"
4416 warn2 'file might contain some clues.'
4420 if test "$have_gdk_pixbuf" = no ; then
4421 warn2 "This means that it won't be possible for the image-manipulating"
4422 warn2 "display modes to load files from disk; and it also means that"
4423 warn2 "the \`webcollage' program will be much slower."
4425 warn2 "This means the \`webcollage' program will be much slower."
4430 if test "$have_xft" = no ; then
4431 if test "$with_xft_req" = yes ; then
4432 warnL "Use of libXft was requested, but it was not found."
4433 elif test "$with_xft_req" = no ; then
4434 noteL 'The Xft library is not being used.'
4436 noteL "The Xft library was not found."
4439 if test "$xft_halfassed" = yes ; then
4441 warn2 'More specifically, we found the headers, but not the'
4442 warn2 'libraries; so either Xft is half-installed on this'
4443 warn2 "system, or something else went wrong. The \`config.log'"
4444 warn2 'file might contain some clues.'
4448 warn2 "This means that fonts won't be anti-aliased."
4452 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
4453 preferred_mesagl=3.4
4454 mgv="$ac_mesagl_version_string"
4455 pgl="$preferred_mesagl"
4457 if test "$ac_mesagl_version" = unknown; then
4459 # warnL "Unable to determine the MesaGL version number!"
4460 # warn2 "Make sure you are using version $preferred_mesagl or newer."
4462 elif test \! "$ac_mesagl_version" -gt 2006; then
4463 warnL "MesaGL version number is $mgv --"
4464 warn2 "MesaGL 2.6 and earlier have a security bug. It is strongly"
4465 warn2 "recommended that you upgrade to at least version $preferred_mesagl."
4467 elif test \! "$ac_mesagl_version" -gt 3003; then
4468 warnL "MesaGL version number is $mgv --"
4469 warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
4470 warn2 "that you upgrade to $pgl or newer."
4474 if test "$have_gl" = no ; then
4475 if test "$with_gl_req" = yes ; then
4476 warnL 'Use of GL was requested, but it was not found.'
4477 elif test "$with_gl_req" = no ; then
4478 noteL 'The OpenGL 3D library is not being used.'
4480 noteL 'The OpenGL 3D library was not found.'
4483 if test "$gl_halfassed" = yes ; then
4485 warn2 'More specifically, we found the headers, but not the'
4486 warn2 'libraries; so either GL is half-installed on this'
4487 warn2 "system, or something else went wrong. The \`config.log'"
4488 warn2 'file might contain some clues.'
4492 warn2 'Those demos which use 3D will not be built or installed.'
4493 warn2 'You might want to consider installing OpenGL and'
4494 warn2 're-running configure.'
4499 if test "$have_gl" = yes -a "$have_gle" = no ; then
4501 # nobody cares about this; don't print the warning unless it was
4502 # requested and not found, or halfway-found.
4503 if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
4505 if test "$with_gle_req" = yes ; then
4506 noteL 'Use of the GLE (GL Extrusion) library was requested, but'
4507 warn2 'it was not found (though the OpenGL library was found, and'
4508 warn2 'is being used.)'
4509 elif test "$with_gle_req" = no ; then
4510 noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
4511 warn2 'library is not.'
4513 noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
4514 warn2 'library was not.'
4517 if test "$gle_halfassed" = yes ; then
4519 warn2 'More specifically, we found the headers, but not the'
4520 warn2 'libraries; so either GLE is half-installed on this'
4521 warn2 "system, or something else went wrong. The \`config.log'"
4522 warn2 'file might contain some clues.'
4526 warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
4527 warn2 'will not be built or installed. You might want to consider'
4528 warn2 'installing GLE and re-running configure. You can find the'
4529 warn2 'GLE library at <http://www.linas.org/gle/>'
4535 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
4536 warn 'Use of XReadDisplay was requested, but it was not found.'
4539 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
4540 warn 'Use of Kerberos was requested, but it was not found.'
4543 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
4544 warn 'Use of PAM was requested, but it was not found.'
4547 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
4548 warn 'Use of shadow passwords was requested, but they were not found.'
4551 if test "$ac_macosx" = yes ; then
4552 if test "$enable_locking" = yes ; then
4553 warn "You have specified --enable-locking on MacOS X."
4554 warn2 "THIS DOES NOT WORK! Don't do this!"
4559 # You are in a twisty maze of namespaces and syntaxes, all alike.
4560 # Fuck the skull of Unix.
4562 bindir=`eval eval eval eval eval eval eval echo $bindir`
4563 HACKDIR=`eval eval eval eval eval eval eval echo $HACKDIR`
4564 HACK_CONF_DIR=`eval eval eval eval eval eval eval echo $HACK_CONF_DIR`
4566 # canonicalize slashes.
4567 bindir=`echo "${bindir}" | sed 's@/$@@;s@//*@/@g'`
4568 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
4569 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
4572 # Sanity check the hackdir
4573 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
4574 if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
4576 AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
4577 There will be an executable installed with that name, so
4578 that can't be the name of a directory as well. Please
4579 re-configure with a different directory name.])
4586 # Now let's warn if there's a previous RPM version already installed.
4587 # But don't bother with this test if we are currently *building* an RPM.
4589 if test -z "$RPM_PACKAGE_VERSION" ; then
4591 rpmnames="xscreensaver xscreensaver-base xscreensaver-extras"
4595 rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \
4596 sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \
4600 if test \! -z "$rpmv" ; then
4601 rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
4602 rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
4605 warnL "There is already an installed RPM of xscreensaver $rpmv"
4606 warn2 'on this system. You might want to remove it ("rpm -ve")'
4607 warn2 'before running "make install" in this directory.'
4609 warn2 "Alternately, you could build this version of xscreensaver"
4610 warn2 'as an RPM, and then install that. An "xscreensaver.spec"'
4611 warn2 'file is included. Try "rpmbuild -v -ba xscreensaver.spec".'
4612 warn2 "See the RPM documentation for more info."
4615 if test "$rpmbdir" = "$rpmhdir" ; then
4616 warn2 "The RPM version was installed in $rpmbdir/."
4619 warn2 "The RPM version was installed in $rpmbdir/,"
4620 warn2 "with demos in $rpmhdir/."
4625 # Also warn if there's a Debian package installed.
4627 debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
4629 for dpkg in $debnames ; do
4630 if test -z "$debv"; then
4631 debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
4635 if test \! -z "$debv" ; then
4636 debbdir=`dpkg -L $debnames 2>/dev/null | \
4637 sed -n 's@^\(.*/bin/\)xscreensaver$@\1@p'`
4638 debhdir=`dpkg -L $debnames 2>/dev/null | \
4639 sed -n 's@^\(.*/\)popsquares$@\1@p'`
4640 if test -z "$debbdir" ; then debbdir='???'; fi
4641 if test -z "$debhdir" ; then debhdir='???'; fi
4644 warnL "There is already an installed dpkg of xscreensaver"
4645 warn2 "version \"$debv\" on this system."
4647 warn2 "The dpkg was installed in $debbdir,"
4648 warn2 "with demos in $debhdir."
4652 if test "${bindir}" = "${HACKDIR}" ; then
4656 if test "$do_dir_warning" = yes; then
4660 echo ' When you run "make install", the "xscreensaver",'
4661 echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
4662 echo " will be installed in ${bindir}/."
4664 echo " The various graphics demos (200+ different executables) will"
4665 echo " be installed in ${HACKDIR}/."
4667 echo " If you would prefer the demos to be installed elsewhere,"
4668 echo " you should re-run configure with the --with-hackdir=DIR"
4669 echo " option. For more information, run \`./configure --help'."
4673 if test "$warning" != no; then
4674 echo '' ; echo "$warnsep" ; echo ''
4677 if test "$do_dir_warning" = no; then
4678 if test "$warning" = no; then
4681 echo "User programs will be installed in ${bindir}/"
4682 echo "Screen savers will be installed in ${HACKDIR}/"
4683 echo "Configuration dialogs will be installed in ${HACK_CONF_DIR}/"
4684 echo "System-wide default settings will be installed in ${APPDEFAULTS}/"