1 --- xscreensaver-4.16/configure.in 2004-05-11 18:43:13.000000000 -0700
2 +++ xscreensaver-4.16.new/configure.in 2004-08-06 13:31:20.547673720 -0700
7 -###############################################################################
9 -# Function to figure out how to run the compiler.
11 -###############################################################################
13 -AC_DEFUN(AC_PROG_CC_ANSI,
16 - if test -z "$GCC"; then
17 - AC_MSG_CHECKING(how to request ANSI compilation)
20 - AC_MSG_RESULT(HPUX: adding -Ae)
24 - AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
25 - CC="$CC -qlanglvl=ansi -qhalt=e"
29 - AC_MSG_RESULT(DEC: adding -std1 -ieee)
34 - AC_MSG_RESULT(no idea)
41 - AC_MSG_CHECKING([whether the compiler works on ANSI C])
42 - AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
45 - AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
46 - AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
48 - if test -n "$GCC"; then
49 - AC_MSG_RESULT(Turning on gcc compiler warnings.)
50 - CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs"
51 - OBJCC="$OBJCC -Wall"
52 - # supposedly gcc 3.4 will have "-Wdeclaration-after-statement"
53 - # and then perhaps we can do without -pedantic?
56 - *-irix5* |*-irix6.[0-3]* )
57 - AC_MSG_RESULT(Turning on SGI compiler warnings.)
58 - CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
61 -# if test -z "$GCC"; then
62 -# AC_MSG_RESULT(Turning on DEC C compiler warnings.)
63 -# CC="$CC -migrate -w0 -verbose -warnprotos"
71 -###############################################################################
73 -# Functions to figure out how to disable // comments in ANSI C code.
75 -# (With recent gcc, this is done with "-std=c89". With older gcc, this
76 -# is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
77 -# gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang.
78 -# so much for compatibility!)
80 -# UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
81 -# declarations preceed statements, without resorting to "-pedantic".
82 -# This means that there is no way to get gcc3 to issue warnings that
83 -# ensure that your code complies with the ANSI/ISO C89 standard, without
84 -# also drowning in totally useless warnings. Thank you master may I
87 -# So, I give up, let's just use -pedantic.
89 -###############################################################################
91 -AC_DEFUN(AC_GCC_ACCEPTS_STD,
92 - [if test -n "$GCC"; then
93 - AC_CACHE_CHECK([whether gcc accepts -std],
94 - ac_cv_gcc_accepts_std,
95 - [if ( ( gcc -E -std=c89 - </dev/null >/dev/null ) 2>&1 | \
96 - grep unrecognized >/dev/null ); then
97 - ac_cv_gcc_accepts_std=no
99 - ac_cv_gcc_accepts_std=yes
101 - ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
105 -AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
106 - [if test -n "$GCC"; then
108 - AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
110 - # The reason that // comments are banned from xscreensaver is that gcc is
111 - # basically the only compiler in the world that supports them in C code.
112 - # All other vendors support them only in their C++ compilers, not in their
113 - # ANSI C compilers. This means that it's a portability problem: every time
114 - # these comments have snuck into the xscreensaver source code, I've gotten
115 - # complaints about it the next day. So we turn off support for them in gcc
116 - # as well to prevent them from accidentially slipping in.
118 - if test "$ac_gcc_accepts_std" = yes ; then
120 - # -std=c89 defines __STRICT_ANSI__, which we don't want.
121 - # (That appears to be the only additional preprocessor symbol
122 - # it defines, in addition to the syntax changes it makes.)
124 - # -std=gnu89 is no good, because // comments were a GNU extension
125 - # before they were in the ANSI C 99 spec... (gcc 2.96 permits //
126 - # with -std=gnu89 but not with -std=c89.)
128 - CC="$CC -std=c89 -U__STRICT_ANSI__"
131 - CC="$CC -Wp,-lang-c89"
137 -###############################################################################
139 -# Function to figure out how to turn off Objective C on MacOS X.
140 -# (We have to do this to work around an Apple-specific gcc bug.)
142 -###############################################################################
144 -AC_DEFUN(AC_GCC_ACCEPTS_NO_CPP_PRECOMP,
145 - [if test -n "$GCC"; then
146 - AC_CACHE_CHECK([whether gcc accepts -no-cpp-precomp],
147 - ac_cv_gcc_accepts_no_cpp_precomp,
148 - [if ( ( gcc -E -no-cpp-precomp - </dev/null >/dev/null ) 2>&1 | \
149 - grep unrecognized >/dev/null ); then
150 - ac_cv_gcc_accepts_no_cpp_precomp=no
152 - ac_cv_gcc_accepts_no_cpp_precomp=yes
154 - ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
158 -AC_DEFUN(AC_NO_OBJECTIVE_C,
159 - [if test -n "$GCC"; then
160 - AC_GCC_ACCEPTS_NO_CPP_PRECOMP
161 - if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
162 - AC_MSG_RESULT(Disabling Objective C extensions in ANSI C code.)
163 - CC="$CC -no-cpp-precomp"
169 -###############################################################################
171 -# Function to figure out how to create directory trees.
173 -###############################################################################
175 -AC_DEFUN(AC_PROG_INSTALL_DIRS,
176 - [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories],
177 - ac_cv_install_d_creates_dirs,
178 - [ac_cv_install_d_creates_dirs=no
180 - if mkdir conftestdir; then
181 - cd conftestdir 2>/dev/null
182 - ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
183 - if test -d dir1/dir2/. ; then
184 - ac_cv_install_d_creates_dirs=yes
191 - if test "$ac_cv_install_d_creates_dirs" = no ; then
192 - AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories],
193 - ac_cv_mkdir_p_creates_dirs,
194 - [ac_cv_mkdir_p_creates_dirs=no
196 - if mkdir conftestdir; then
197 - cd conftestdir 2>/dev/null
198 - mkdir -p dir1/dir2 >/dev/null 2>&1
199 - if test -d dir1/dir2/. ; then
200 - ac_cv_mkdir_p_creates_dirs=yes
208 - if test "$ac_cv_install_d_creates_dirs" = yes ; then
209 - INSTALL_DIRS='${INSTALL} -d'
210 - elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
211 - INSTALL_DIRS='mkdir -p'
214 - INSTALL_DIRS='${INSTALL} -d'
219 -###############################################################################
221 -# Function to check whether gettimeofday() exists, and how to call it.
222 -# This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
224 -###############################################################################
226 -AC_DEFUN(AC_GETTIMEOFDAY_ARGS,
227 - [AC_MSG_CHECKING(how to call gettimeofday)
228 - AC_CACHE_VAL(ac_cv_gettimeofday_args,
229 - [AC_TRY_COMPILE([#include <stdlib.h>
230 - #include <sys/time.h>],
231 - [struct timeval tv; struct timezone tzp;
232 - gettimeofday(&tv, &tzp);],
233 - [ac_gettimeofday_args=2],
234 - [AC_TRY_COMPILE([#include <stdlib.h>
235 - #include <sys/time.h>],
236 - [struct timeval tv; gettimeofday(&tv);],
237 - [ac_gettimeofday_args=1],
238 - [ac_gettimeofday_args=0])])
239 - ac_cv_gettimeofday_args=$ac_gettimeofday_args])
240 - ac_gettimeofday_args=$ac_cv_gettimeofday_args
241 - if test "$ac_gettimeofday_args" = 1 ; then
242 - AC_DEFINE(HAVE_GETTIMEOFDAY)
243 - AC_MSG_RESULT(one argument)
244 - elif test "$ac_gettimeofday_args" = 2 ; then
245 - AC_DEFINE(HAVE_GETTIMEOFDAY)
246 - AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
247 - AC_MSG_RESULT(two arguments)
249 - AC_MSG_RESULT(unknown)
254 -###############################################################################
256 -# Function to find perl5 (defines PERL and PERL_VERSION.)
258 -###############################################################################
260 -# M4 sucks!! perl sucks too!!
262 -perl_version_cmd='print $]'
265 -AC_DEFUN(AC_PROG_PERL,
266 - [AC_PATH_PROGS(PERL, [perl5 perl],,)
267 - if test -z "$PERL" ; then
270 - AC_CACHE_CHECK([perl version], ac_cv_perl_version,
271 - [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
272 - PERL_VERSION=$ac_cv_perl_version
277 -###############################################################################
279 -# Function to demand "bc". Losers.
281 -###############################################################################
283 -AC_DEFUN(AC_DEMAND_BC,
284 - [ac_bc_result=`echo 6+9 | bc 2>/dev/null`
285 - AC_MSG_CHECKING([for bc])
286 - if test "$ac_bc_result" = "15" ; then
291 - AC_MSG_ERROR([Your system doesn't have \"bc\", which has been a standard
292 - part of Unix since the 1970s. Come back when your vendor
293 - has grown a clue.])
297 -###############################################################################
299 -# Functions to check how to do ICMP PING requests.
301 -###############################################################################
303 -AC_DEFUN(AC_CHECK_ICMP,
304 - [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
305 - [AC_TRY_COMPILE([#include <stdlib.h>
308 - #include <unistd.h>
309 - #include <limits.h>
310 - #include <signal.h>
312 - #include <sys/types.h>
313 - #include <sys/time.h>
314 - #include <sys/ipc.h>
315 - #include <sys/shm.h>
316 - #include <sys/socket.h>
317 - #include <netinet/in_systm.h>
318 - #include <netinet/in.h>
319 - #include <netinet/ip.h>
320 - #include <netinet/ip_icmp.h>
321 - #include <netinet/udp.h>
322 - #include <arpa/inet.h>
323 - #include <netdb.h>],
326 - struct sockaddr_in si;
328 - i.icmp_type = ICMP_ECHO;
333 - si.sin_family = AF_INET;
334 - #if defined(__DECC) || defined(_IP_VHL)
340 - [ac_cv_have_icmp=yes],
341 - [ac_cv_have_icmp=no])])
342 - if test "$ac_cv_have_icmp" = yes ; then
343 - AC_DEFINE(HAVE_ICMP)
346 -AC_DEFUN(AC_CHECK_ICMPHDR,
347 - [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
348 - [AC_TRY_COMPILE([#include <stdlib.h>
351 - #include <unistd.h>
352 - #include <limits.h>
353 - #include <signal.h>
355 - #include <sys/types.h>
356 - #include <sys/time.h>
357 - #include <sys/ipc.h>
358 - #include <sys/shm.h>
359 - #include <sys/socket.h>
360 - #include <netinet/in_systm.h>
361 - #include <netinet/in.h>
362 - #include <netinet/ip.h>
363 - #include <netinet/ip_icmp.h>
364 - #include <netinet/udp.h>
365 - #include <arpa/inet.h>
366 - #include <netdb.h>],
369 - struct sockaddr_in si;
371 - i.type = ICMP_ECHO;
375 - i.un.echo.sequence = 0;
376 - si.sin_family = AF_INET;
378 - [ac_cv_have_icmphdr=yes],
379 - [ac_cv_have_icmphdr=no])])
380 - if test "$ac_cv_have_icmphdr" = yes ; then
381 - AC_DEFINE(HAVE_ICMPHDR)
385 -###############################################################################
387 -# Functions to check for various X11 crap.
389 -###############################################################################
391 -# Try and find the app-defaults directory.
392 -# It sucks that autoconf doesn't do this already...
394 -AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
396 - if mkdir conftestdir; then
397 - cd conftestdir 2>/dev/null
398 - # Make sure to not put "make" in the Imakefile rules, since we grep it out.
399 - cat > Imakefile <<'EOF'
401 - @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
403 - if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
404 - # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
405 - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
411 -AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
412 - # Look for the directory under a standard set of common directories.
413 - # Check X11 before X11Rn because it's often a symlink to the current release.
415 - /usr/X11/lib/app-defaults \
416 - /usr/X11R6/lib/app-defaults \
417 - /usr/X11R6/lib/X11/app-defaults \
418 - /usr/X11R5/lib/app-defaults \
419 - /usr/X11R5/lib/X11/app-defaults \
420 - /usr/X11R4/lib/app-defaults \
421 - /usr/X11R4/lib/X11/app-defaults \
423 - /usr/lib/X11/app-defaults \
424 - /usr/lib/X11R6/app-defaults \
425 - /usr/lib/X11R5/app-defaults \
426 - /usr/lib/X11R4/app-defaults \
428 - /usr/local/X11/lib/app-defaults \
429 - /usr/local/X11R6/lib/app-defaults \
430 - /usr/local/X11R5/lib/app-defaults \
431 - /usr/local/X11R4/lib/app-defaults \
433 - /usr/local/lib/X11/app-defaults \
434 - /usr/local/lib/X11R6/app-defaults \
435 - /usr/local/lib/X11R6/X11/app-defaults \
436 - /usr/local/lib/X11R5/app-defaults \
437 - /usr/local/lib/X11R5/X11/app-defaults \
438 - /usr/local/lib/X11R4/app-defaults \
439 - /usr/local/lib/X11R4/X11/app-defaults \
441 - /usr/X386/lib/X11/app-defaults \
442 - /usr/x386/lib/X11/app-defaults \
443 - /usr/XFree86/lib/X11/app-defaults \
445 - /usr/lib/X11/app-defaults \
446 - /usr/local/lib/X11/app-defaults \
447 - /usr/unsupported/lib/X11/app-defaults \
448 - /usr/athena/lib/X11/app-defaults \
449 - /usr/local/x11r5/lib/X11/app-defaults \
450 - /usr/lpp/Xamples/lib/X11/app-defaults \
451 - /lib/usr/lib/X11/app-defaults \
453 - /usr/openwin/lib/app-defaults \
454 - /usr/openwin/lib/X11/app-defaults \
455 - /usr/openwin/share/lib/app-defaults \
456 - /usr/openwin/share/lib/X11/app-defaults \
458 - /X11R6/lib/app-defaults \
459 - /X11R5/lib/app-defaults \
460 - /X11R4/lib/app-defaults \
463 - if test -d "$ac_dir"; then
464 - ac_x_app_defaults=$ac_dir
470 -AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
472 - AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
473 - [AC_PATH_X_APP_DEFAULTS_XMKMF
474 - if test x"$ac_x_app_defaults" = x; then
475 - AC_PATH_X_APP_DEFAULTS_DIRECT
477 - if test x"$ac_x_app_defaults" = x; then
478 - ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
480 - # Record where we found app-defaults for the cache.
481 - ac_cv_x_app_defaults="$ac_x_app_defaults"
483 - eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
486 -AC_DEFUN(AC_XPOINTER,
487 - [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
488 - [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
489 - [XPointer foo = (XPointer) 0;],
490 - [ac_cv_xpointer=yes],
491 - [ac_cv_xpointer=no])])
492 - if test "$ac_cv_xpointer" != yes; then
493 - AC_DEFINE(XPointer,[char*])
497 -# Random special-cases for X on certain pathological OSes.
498 -# You know who you are.
500 -AC_DEFUN(AC_X_RANDOM_PATHS,
504 - # The following arcana was gleaned from conversations with
505 - # Eric Schwartz <erics@col.hp.com>:
507 - # On HPUX 10.x, the parts of X that HP considers "standard" live in
508 - # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
509 - # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
510 - # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
511 - # Also, there are symlinks from /usr/include/ and /usr/lib/ into
512 - # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
513 - # you don't need any -I or -L arguments.
515 - # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
516 - # are the same division as 10.x. However, there are no symlinks to
517 - # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
518 - # arguments are always necessary.
520 - # However, X11R6 was available on HPUX 9.x as a patch: if that
521 - # patch was installed, then all of X11R6 went in to
522 - # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
524 - # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
525 - # whether R5 was available as a patch; R6 undoubtedly was not.)
527 - # So. We try and use the highest numbered pair of
528 - # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
529 - # that are available. We do not mix and match different versions
532 - # Question I still don't know the answer to: (do you?)
534 - # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
535 - # /usr/contrib/X11R6/ could be installed as a patch, what was in
536 - # that contrib directory? Did it contain so-called "standard"
537 - # X11R6, or did it include Xaw and Xmu as well? If the former,
538 - # where did one find Xaw and Xmu on 9.x R6 systems? Would this
539 - # be a situation where one had to reach into the R5 headers and
540 - # libs to find Xmu? That is, must both R6 and R5 directories
541 - # be on the -I and -L lists in that case?
543 - for version in X11R6 X11R5 X11R4 ; do
544 - # if either pair of directories exists...
545 - if test -d /usr/include/$version || test -d /usr/contrib/$version/include
547 - # if contrib exists, use it...
548 - if test -d /usr/contrib/$version/include ; then
549 - X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
550 - X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
552 - # if the "standard" one exists, use it.
553 - if test -d /usr/include/$version ; then
554 - X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
555 - X_LIBS="$X_LIBS -L/usr/lib/$version"
557 - # since at least one of the pair exists, go no farther.
562 - # Now find Motif. Thanks for not making xmkmf find this by
563 - # default, you losers.
565 - if test -d /usr/include/Motif2.1 ; then
566 - X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
567 - X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
568 - elif test -d /usr/include/Motif1.2 ; then
569 - X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
570 - X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
571 - elif test -d /usr/include/Motif1.1 ; then
572 - X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
573 - X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
576 - # Now let's check for the pseudo-standard locations for OpenGL and XPM.
578 - if test -d /opt/graphics/OpenGL/include ; then
579 - # HP-UX 10.20 puts it here
580 - X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
581 - X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
582 - elif test -d /opt/Mesa/lib ; then
583 - X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
584 - X_LIBS="-L/opt/Mesa/lib $X_LIBS"
588 - if test -d /opt/xpm/lib/X11 ; then
589 - X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
590 - X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
593 - # On HPUX, default to installing in /opt/xscreensaver/ instead of
594 - # in /usr/local/, unless there is already an xscreensaver in
595 - # /usr/local/bin/. This can be overridden with the --prefix arg
596 - # to configure. I'm not sure this is the right thing to do, but
597 - # Richard Lloyd says so...
599 - if test \! -x /usr/local/bin/xscreensaver ; then
600 - ac_default_prefix=/opt/xscreensaver
606 - # Thanks for not making xmkmf find this by default, pinheads.
607 - # And thanks for moving things around again, too. Is this
608 - # really the standard location now? What happened to the
609 - # joke that this kind of thing went in /opt?
610 - # cthomp says "answer: CDE (Common Disorganized Environment)"
612 - if test -f /usr/dt/include/Xm/Xm.h ; then
613 - X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
614 - MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
616 - # Some versions of Slowlaris Motif require -lgen. But not all. Why?
617 - AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
623 - # On MacOS X (10.x with "fink"), many things are under /sw/.
625 - if test -d /sw/include ; then
626 - X_CFLAGS="-I/sw/include $X_CFLAGS"
627 - X_LIBS="-L/sw/lib $X_LIBS"
634 -###############################################################################
636 -# Some utility functions to make checking for X things easier.
638 -###############################################################################
640 -# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
642 -AC_DEFUN(AC_CHECK_X_HEADER, [
643 - ac_save_CPPFLAGS="$CPPFLAGS"
644 - if test \! -z "$includedir" ; then
645 - CPPFLAGS="$CPPFLAGS -I$includedir"
647 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
648 - AC_CHECK_HEADER([$1],[$2],[$3],[$4])
649 - CPPFLAGS="$ac_save_CPPFLAGS"])
651 -# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
653 -AC_DEFUN(AC_EGREP_X_HEADER, [
654 - ac_save_CPPFLAGS="$CPPFLAGS"
655 - if test \! -z "$includedir" ; then
656 - CPPFLAGS="$CPPFLAGS -I$includedir"
658 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
659 - AC_EGREP_HEADER([$1], [$2], [$3], [$4])
660 - CPPFLAGS="$ac_save_CPPFLAGS"])
662 -# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
664 -AC_DEFUN(AC_TRY_X_COMPILE, [
665 - ac_save_CPPFLAGS="$CPPFLAGS"
666 - if test \! -z "$includedir" ; then
667 - CPPFLAGS="$CPPFLAGS -I$includedir"
669 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
670 - AC_TRY_COMPILE([$1], [$2], [$3], [$4])
671 - CPPFLAGS="$ac_save_CPPFLAGS"])
674 -# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
675 -# Use this sparingly; it probably doesn't work very well on X programs.
677 -AC_DEFUN(AC_CHECK_X_LIB, [
678 - ac_save_CPPFLAGS="$CPPFLAGS"
679 - ac_save_LDFLAGS="$LDFLAGS"
680 -# ac_save_LIBS="$LIBS"
682 - if test \! -z "$includedir" ; then
683 - CPPFLAGS="$CPPFLAGS -I$includedir"
685 - # note: $X_CFLAGS includes $x_includes
686 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
688 - if test \! -z "$libdir" ; then
689 - LDFLAGS="$LDFLAGS -L$libdir"
691 - # note: $X_LIBS includes $x_libraries
692 - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
694 - AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
695 - CPPFLAGS="$ac_save_CPPFLAGS"
696 - LDFLAGS="$ac_save_LDFLAGS"
697 -# LIBS="$ac_save_LIBS"
700 -# Like AC_TRY_RUN, but it uses the already-computed -I directories.
701 -# (But not the -L directories!)
703 -AC_DEFUN(AC_TRY_X_RUN, [
704 - ac_save_CPPFLAGS="$CPPFLAGS"
705 - if test \! -z "$includedir" ; then
706 - CPPFLAGS="$CPPFLAGS -I$includedir"
708 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
709 - AC_TRY_RUN([$1], [$2], [$3], [$4])
710 - CPPFLAGS="$ac_save_CPPFLAGS"])
714 -# Usage: HANDLE_X_PATH_ARG([variable_name],
715 -# [--command-line-option],
716 -# [descriptive string])
718 -# All of the --with options take three forms:
720 -# --with-foo (or --with-foo=yes)
721 -# --without-foo (or --with-foo=no)
724 -# This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
725 -# a directory (string beginning with a slash) it checks to see whether
726 -# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
729 -AC_DEFUN(HANDLE_X_PATH_ARG, [
735 - AC_MSG_CHECKING([for [$3] headers])
737 - if test -d $d; then
738 - X_CFLAGS="-I$d $X_CFLAGS"
741 - AC_MSG_RESULT(not found ($d: no such directory))
744 - AC_MSG_CHECKING([for [$3] libs])
746 - if test -d $d; then
747 - X_LIBS="-L$d $X_LIBS"
750 - AC_MSG_RESULT(not found ($d: no such directory))
753 - # replace the directory string with "yes".
760 - echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
761 - echo " If it is a directory, then \`DIR/include' will be added to"
762 - echo " the -I list, and \`DIR/lib' will be added to the -L list."
770 -###############################################################################
771 -###############################################################################
773 -# End of function definitions. Now start actually executing stuff.
775 -###############################################################################
776 -###############################################################################
778 # random compiler setup
781 -AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
784 +#AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
791 GETTEXT_PACKAGE=xscreensaver
792 -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
793 -AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE")
794 +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[ This is the name of the gettext package to use. ])
795 +AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE", [ This is the same as GETTEXT_PACKAGE, but for the glade generated code ])
796 AC_SUBST(GETTEXT_PACKAGE)
798 ALL_LINGUAS="ca da de es et fi fr hu it ja ko nl no pl pt pt_BR ru sk sv vi wa zh_CN zh_TW"
803 - AC_DEFINE(HAVE_XMU)
804 + AC_DEFINE(HAVE_XMU, 1, [ Define this if you have the Xmu library. ])
809 if test "$with_sgi" = yes; then
810 AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
812 - AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
813 + AC_DEFINE(HAVE_SGI_SAVER_EXTENSION, 1, [ Define this if you have the SGI SCREEN_SAVER extension. ])],,
814 [#include <X11/Xlib.h>])
816 elif test "$with_sgi" != no; then
820 if test "$have_mit" = yes; then
821 - AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
822 + AC_DEFINE(HAVE_MIT_SAVER_EXTENSION, 1, [ Define this if you have the MIT-SCREEN-SAVER extension installed. ])
827 if test "$with_xidle" = yes; then
828 AC_CHECK_X_HEADER(X11/extensions/xidle.h,
830 - AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
831 + AC_DEFINE(HAVE_XIDLE_EXTENSION, 1, [ Define this if you have the XIDLE extension installed.])],,
832 [#include <X11/Xlib.h>])
833 elif test "$with_xidle" != no; then
834 echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
837 # if that succeeded, then we've really got it.
838 if test "$have_sgivc" = yes; then
839 - AC_DEFINE(HAVE_SGI_VC_EXTENSION)
840 + AC_DEFINE(HAVE_SGI_VC_EXTENSION, 1, [ Define this if you have the SGI-VIDEO-CONTROL extension. ])
843 elif test "$with_sgivc" != no; then
846 # if that succeeded, then we've really got it.
847 if test "$have_dpms" = yes; then
848 - AC_DEFINE(HAVE_DPMS_EXTENSION)
849 + AC_DEFINE(HAVE_DPMS_EXTENSION, 1, [ Define this if you have the XDPMS extension. ])
852 elif test "$with_dpms" != no; then
855 # if that succeeded, then we've really got it.
856 if test "$have_xinerama" = yes; then
857 - AC_DEFINE(HAVE_XINERAMA)
858 + AC_DEFINE(HAVE_XINERAMA, 1, [ Define this if you have the Xinerama extension.])
861 elif test "$with_xinerama" != no; then
864 # if that succeeded, then we've really got it.
865 if test "$have_xf86vmode" = yes; then
866 - AC_DEFINE(HAVE_XF86VMODE)
867 + AC_DEFINE(HAVE_XF86VMODE, 1, [ Define this if you have the functions XF86VidModeGetModeLine() and XF86VidModeGetViewPort() ])
870 elif test "$with_xf86vmode" != no; then
871 @@ -1365,11 +595,11 @@
873 # if those tests succeeded, then we've really got the functions.
874 if test "$have_xf86gamma" = yes; then
875 - AC_DEFINE(HAVE_XF86VMODE_GAMMA)
876 + AC_DEFINE(HAVE_XF86VMODE_GAMMA, 1, [ Define this if you have the functions XF86VidModeGetGamma() and XF86VidModeSetGamma() ])
879 if test "$have_xf86gamma_ramp" = yes; then
880 - AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP)
881 + AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP, 1, [ Define this if you have the functions XF86VidModeGetGammaRamp() and XF86VidModeSetGammaRamp() ])
884 # pull in the lib, if we haven't already
887 # if that succeeded, then we've really got it.
888 if test "$have_randr" = yes; then
889 - AC_DEFINE(HAVE_RANDR)
890 + AC_DEFINE(HAVE_RANDR, 1, [ Define this if you have the Resize and Rotate extension ])
893 elif test "$with_randr" != no; then
895 [true], -lXext -lX11)
896 if test "$have_xf86miscsetgrabkeysstate" = yes ; then
897 SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
898 - AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
899 + AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE, 1, [ Define this if you have the XF86MiscSetGrabKeysState function ])
905 AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
906 AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
907 - [AC_DEFINE(HAVE_XHPDISABLERESET)
908 + [AC_DEFINE(HAVE_XHPDISABLERESET, 1, [ Define this if you have the XHPDisableReset function ])
909 SAVER_LIBS="-lXhp11 $SAVER_LIBS"
913 have_proc_interrupts=$ac_cv_have_proc_interrupts
915 if test "$have_proc_interrupts" = yes; then
916 - AC_DEFINE(HAVE_PROC_INTERRUPTS)
917 + AC_DEFINE(HAVE_PROC_INTERRUPTS, 1, [ Define this if you have a Linux-like /proc/interrupts file ])
920 elif test "$with_proc_interrupts" != no; then
922 if test "$enable_locking" = yes; then
924 elif test "$enable_locking" = no; then
925 - AC_DEFINE(NO_LOCKING)
926 + AC_DEFINE(NO_LOCKING, 1, [Define this to remove the option of locking the screen at all. ] )
928 echo "error: must be yes or no: --enable-locking=$enable_locking"
931 if test "$enable_locking" = yes; then
932 AC_MSG_RESULT(locking disabled: it doesn't work on MacOS X)
934 - AC_DEFINE(NO_LOCKING)
935 + AC_DEFINE(NO_LOCKING, 1, [ Define this to remove the option of locking the screen at all. ])
941 if test "$ac_cv_pam" = yes ; then
943 - AC_DEFINE(HAVE_PAM)
944 + AC_DEFINE(HAVE_PAM, 1, [ Define this option if you have PAM ])
945 PASSWD_LIBS="${PASSWD_LIBS} -lpam"
947 # libpam typically requires dlopen and dlsym. On FreeBSD,
949 if test "$ac_pam_strerror_args" = 1 ; then
950 AC_MSG_RESULT(one argument)
951 elif test "$ac_pam_strerror_args" = 2 ; then
952 - AC_DEFINE(PAM_STRERROR_TWO_ARGS)
953 + AC_DEFINE(PAM_STRERROR_TWO_ARGS, 1, [ Define if you have PAM and pam_strerror() requires two arguments. ])
954 AC_MSG_RESULT(two arguments)
956 AC_MSG_RESULT(unknown)
959 if test "$ac_cv_kerberos" = yes ; then
961 - AC_DEFINE(HAVE_KERBEROS)
962 + AC_DEFINE(HAVE_KERBEROS, 1, [ Define this if you have Kerberos ])
965 if test "$ac_cv_kerberos5" = yes ; then
968 if test "$have_kerberos" = yes ; then
970 - AC_DEFINE(HAVE_KERBEROS)
971 - AC_DEFINE(HAVE_KERBEROS5)
972 + AC_DEFINE(HAVE_KERBEROS, 1, [ Define this if you have Kerberos ])
973 + AC_DEFINE(HAVE_KERBEROS5, 1, [ Define this if you have Kerberos 5 ])
976 AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
977 @@ -1943,13 +1173,13 @@
980 if test "$have_shadow_adjunct" = yes ; then
981 - AC_DEFINE(HAVE_ADJUNCT_PASSWD)
982 + AC_DEFINE(HAVE_ADJUNCT_PASSWD, 1, [ Define this if your system is Solaris with ``adjunct'' passwords ])
983 elif test "$have_shadow_enhanced" = yes ; then
984 - AC_DEFINE(HAVE_ENHANCED_PASSWD)
985 + AC_DEFINE(HAVE_ENHANCED_PASSWD, 1, [ Define this if your system is Digital or SCO Unix with so-called ``Enhanced Security'' ])
986 elif test "$have_shadow_hpux" = yes ; then
987 - AC_DEFINE(HAVE_HPUX_PASSWD)
988 + AC_DEFINE(HAVE_HPUX_PASSWD, 1, [ Define this if you are running HPUX with so-called ``Secure Passwords'' ])
989 elif test "$have_shadow" = yes ; then
990 - AC_DEFINE(HAVE_SHADOW_PASSWD)
991 + AC_DEFINE(HAVE_SHADOW_PASSWD 1, [ Define this if your system uses `shadow' passwords ])
995 @@ -1983,7 +1213,7 @@
996 case "$with_passwd_helper" in
999 - AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
1000 + AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper", [ Define a password helper to use ])
1001 have_passwd_helper=yes;;
1003 echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
1004 @@ -2017,7 +1247,7 @@
1006 AC_CHECK_X_HEADER(Xm/Xm.h,
1008 - AC_DEFINE(HAVE_MOTIF)
1009 + AC_DEFINE(HAVE_MOTIF, 1, [ Define this if you have motif ])
1010 MOTIF_LIBS="$MOTIF_LIBS -lXm"],,
1011 [#include <stdlib.h>
1013 @@ -2026,7 +1256,7 @@
1016 if test "$have_motif" = yes; then
1017 - AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)],,
1018 + AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX, 1, [ Define this if you have Motif ])],,
1019 [#include <stdlib.h>
1021 #include <X11/Intrinsic.h>])
1022 @@ -2171,7 +1401,7 @@
1024 if test "$have_gtk" = yes; then
1026 - AC_DEFINE(HAVE_GTK2)
1027 + AC_DEFINE(HAVE_GTK2, 1, [ Define this if you have GTK2 ])
1029 if test -n "$ac_gtk_version_string" ; then
1030 gtk2_halfassed="$ac_gtk_version_string"
1031 @@ -2205,7 +1435,7 @@
1032 if test "$have_gnome" = no; then
1035 - AC_DEFINE(HAVE_CRAPPLET)
1036 + AC_DEFINE(HAVE_CRAPPLET, 1, [ Define this if you have the configuration appliet ])
1040 @@ -2325,7 +1555,7 @@
1041 if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1042 ac_gtk_config_cflags=$ac_gnome_config_cflags
1043 ac_gtk_config_libs=$ac_gnome_config_libs
1044 - AC_DEFINE(HAVE_CRAPPLET)
1045 + AC_DEFINE(HAVE_CRAPPLET, 1, [ Define this if you have the configuration applet ])
1048 fi # end of {gnome,gtk}-config based tests
1049 @@ -2334,7 +1564,7 @@
1050 # check for this function that was not in libcapplet 1.2.
1051 # (only needed in Gnome/Gtk 1.x, not Gnome/Gtk 2.x)
1052 AC_CHECK_X_LIB(capplet, capplet_widget_changes_are_immediate,
1053 - [AC_DEFINE(HAVE_CRAPPLET_IMMEDIATE)], [true],
1054 + [AC_DEFINE(HAVE_CRAPPLET_IMMEDIATE, 1, [ Define this if capplet_widget_changes_are_immediate ])], [true],
1055 $ac_gnome_config_libs)
1058 @@ -2364,7 +1594,7 @@
1059 if test "$have_gtk" = yes; then
1060 INCLUDES="$INCLUDES $ac_gtk_config_cflags"
1061 GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
1062 - AC_DEFINE(HAVE_GTK)
1063 + AC_DEFINE(HAVE_GTK, 1, [ Define this if you have GTK ])
1065 if test "$have_gtk2" = yes; then
1067 @@ -2533,7 +1763,7 @@
1070 XML_LIBS="$ac_xml_config_libs"
1071 - AC_DEFINE(HAVE_XML)],
1072 + AC_DEFINE(HAVE_XML,1,[ Define this if you have libxml ])],
1074 $ac_xml_config_libs)
1076 @@ -2541,9 +1771,9 @@
1077 if test "$have_xml" = yes; then
1078 INCLUDES="$INCLUDES $ac_xml_config_cflags"
1079 GTK_LIBS="$GTK_LIBS $ac_xml_config_libs"
1080 - AC_DEFINE(HAVE_XML)
1081 + AC_DEFINE(HAVE_XML,1,[ Define this if you have libxml ])
1082 if test "$have_old_xml" = yes; then
1083 - AC_DEFINE(HAVE_OLD_XML_HEADERS)
1084 + AC_DEFINE(HAVE_OLD_XML_HEADERS, 1, [ Define this if you have libxml1 ])
1088 @@ -2773,9 +2003,9 @@
1091 # linking works -- we can build the GL hacks.
1092 - AC_DEFINE(HAVE_GL)
1093 + AC_DEFINE(HAVE_GL, 1, [ Define this if you have OpenGL ])
1094 if test "$ac_have_mesa_gl" = yes ; then
1095 - AC_DEFINE(HAVE_MESA_GL)
1096 + AC_DEFINE(HAVE_MESA_GL, 1, [ Define this if you have Mesa GL ])
1100 @@ -2868,7 +2098,7 @@
1102 # Check for OpenGL 1.1 features.
1104 - AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
1105 + AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE, 1, [ Define this if you have OpenGL 1.1 ])],
1106 [true], $GL_LIBS -lX11 -lXext -lm)
1109 @@ -2951,9 +2181,9 @@
1112 if test "$have_gle" = yes ; then
1113 - AC_DEFINE(HAVE_GLE)
1114 + AC_DEFINE(HAVE_GLE, 1, [ Define this if you have GLE ])
1115 if test "$have_gle3" = yes ; then
1116 - AC_DEFINE(HAVE_GLE3)
1117 + AC_DEFINE(HAVE_GLE3, 1, [ Define this if you have GLE3 ])
1121 @@ -2983,7 +2213,7 @@
1122 if test "$with_xpm" = yes; then
1123 AC_CHECK_X_HEADER(X11/xpm.h,
1125 - AC_DEFINE(HAVE_XPM)
1126 + AC_DEFINE(HAVE_XPM, 1, [ Define this if you have XPM ])
1128 [#include <X11/Xlib.h>])
1129 elif test "$with_xpm" != no; then
1130 @@ -3195,7 +2425,7 @@
1131 if test "$have_gdk_pixbuf" = yes; then
1132 INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
1133 XPM_LIBS="$ac_gdk_pixbuf_config_libs"
1134 - AC_DEFINE(HAVE_GDK_PIXBUF)
1135 + AC_DEFINE(HAVE_GDK_PIXBUF, 1, [ Define this if you have GDK ])
1139 @@ -3236,7 +2466,7 @@
1143 - AC_DEFINE(HAVE_JPEGLIB)])
1144 + AC_DEFINE(HAVE_JPEGLIB, 1, [ Define this if you have libjpeg ])])
1148 @@ -3251,7 +2481,7 @@
1149 AC_CHECK_HEADERS(pty.h util.h)
1150 AC_CHECK_X_LIB(util, forkpty,
1152 - AC_DEFINE(HAVE_FORKPTY)])
1153 + AC_DEFINE(HAVE_FORKPTY, 1, [ Define this if you have forkpty() ])])
1156 ###############################################################################
1157 @@ -3305,7 +2535,7 @@
1159 # if that succeeded, then we've really got it.
1160 if test "$have_xshm" = yes; then
1161 - AC_DEFINE(HAVE_XSHM_EXTENSION)
1162 + AC_DEFINE(HAVE_XSHM_EXTENSION, 1, [ Define this if you have XSHM ])
1165 elif test "$with_xshm" != no; then
1166 @@ -3333,7 +2563,7 @@
1167 AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes],,
1168 [#include <X11/Xlib.h>])
1169 if test "$have_xdbe" = yes; then
1170 - AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
1171 + AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION, 1. [ Define this if you have double buffering ])
1174 elif test "$with_xdbe" != no; then
1175 @@ -3363,7 +2593,7 @@
1177 if test "$with_readdisplay" = yes; then
1178 AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
1179 - AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION),,
1180 + AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION,1, [ Define this if you have readdisplay.h ]),,
1181 [#include <X11/Xlib.h>])
1182 elif test "$with_readdisplay" != no; then
1183 echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
1184 @@ -3462,7 +2692,7 @@
1185 unset ac_cv_path_fortune_tmp
1188 -AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program")
1189 +AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program", [ define your fortune program ])
1192 ###############################################################################
1193 --- xscreensaver-4.16/m4/macros.m4 1969-12-31 17:00:00.000000000 -0700
1194 +++ xscreensaver-4.16.new/m4/macros.m4 2004-08-06 13:25:10.605913416 -0700
1196 +###############################################################################
1198 +# Function to figure out how to run the compiler.
1200 +###############################################################################
1202 +AC_DEFUN(AC_PROG_CC_ANSI,
1205 + if test -z "$GCC"; then
1206 + AC_MSG_CHECKING(how to request ANSI compilation)
1209 + AC_MSG_RESULT(HPUX: adding -Ae)
1213 + AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
1214 + CC="$CC -qlanglvl=ansi -qhalt=e"
1218 + AC_MSG_RESULT(DEC: adding -std1 -ieee)
1223 + AC_MSG_RESULT(no idea)
1230 + AC_MSG_CHECKING([whether the compiler works on ANSI C])
1231 + AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
1232 + AC_MSG_RESULT(yes),
1234 + AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
1235 + AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
1237 + if test -n "$GCC"; then
1238 + AC_MSG_RESULT(Turning on gcc compiler warnings.)
1239 + CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs"
1240 + OBJCC="$OBJCC -Wall"
1241 + # supposedly gcc 3.4 will have "-Wdeclaration-after-statement"
1242 + # and then perhaps we can do without -pedantic?
1245 + *-irix5* |*-irix6.[0-3]* )
1246 + AC_MSG_RESULT(Turning on SGI compiler warnings.)
1247 + CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
1250 +# if test -z "$GCC"; then
1251 +# AC_MSG_RESULT(Turning on DEC C compiler warnings.)
1252 +# CC="$CC -migrate -w0 -verbose -warnprotos"
1259 +###############################################################################
1261 +# Functions to figure out how to disable // comments in ANSI C code.
1263 +# (With recent gcc, this is done with "-std=c89". With older gcc, this
1264 +# is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
1265 +# gcc. Old gcc doesn't support -std, and new gcc doesn't support -lang.
1266 +# so much for compatibility!)
1268 +# UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
1269 +# declarations preceed statements, without resorting to "-pedantic".
1270 +# This means that there is no way to get gcc3 to issue warnings that
1271 +# ensure that your code complies with the ANSI/ISO C89 standard, without
1272 +# also drowning in totally useless warnings. Thank you master may I
1275 +# So, I give up, let's just use -pedantic.
1277 +###############################################################################
1279 +AC_DEFUN(AC_GCC_ACCEPTS_STD,
1280 + [if test -n "$GCC"; then
1281 + AC_CACHE_CHECK([whether gcc accepts -std],
1282 + ac_cv_gcc_accepts_std,
1283 + [if ( ( gcc -E -std=c89 - </dev/null >/dev/null ) 2>&1 | \
1284 + grep unrecognized >/dev/null ); then
1285 + ac_cv_gcc_accepts_std=no
1287 + ac_cv_gcc_accepts_std=yes
1289 + ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
1293 +AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
1294 + [if test -n "$GCC"; then
1295 + AC_GCC_ACCEPTS_STD
1296 + AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
1298 + # The reason that // comments are banned from xscreensaver is that gcc is
1299 + # basically the only compiler in the world that supports them in C code.
1300 + # All other vendors support them only in their C++ compilers, not in their
1301 + # ANSI C compilers. This means that it's a portability problem: every time
1302 + # these comments have snuck into the xscreensaver source code, I've gotten
1303 + # complaints about it the next day. So we turn off support for them in gcc
1304 + # as well to prevent them from accidentially slipping in.
1306 + if test "$ac_gcc_accepts_std" = yes ; then
1308 + # -std=c89 defines __STRICT_ANSI__, which we don't want.
1309 + # (That appears to be the only additional preprocessor symbol
1310 + # it defines, in addition to the syntax changes it makes.)
1312 + # -std=gnu89 is no good, because // comments were a GNU extension
1313 + # before they were in the ANSI C 99 spec... (gcc 2.96 permits //
1314 + # with -std=gnu89 but not with -std=c89.)
1316 + CC="$CC -std=c89 -U__STRICT_ANSI__"
1319 + CC="$CC -Wp,-lang-c89"
1325 +###############################################################################
1327 +# Function to figure out how to turn off Objective C on MacOS X.
1328 +# (We have to do this to work around an Apple-specific gcc bug.)
1330 +###############################################################################
1332 +AC_DEFUN(AC_GCC_ACCEPTS_NO_CPP_PRECOMP,
1333 + [if test -n "$GCC"; then
1334 + AC_CACHE_CHECK([whether gcc accepts -no-cpp-precomp],
1335 + ac_cv_gcc_accepts_no_cpp_precomp,
1336 + [if ( ( gcc -E -no-cpp-precomp - </dev/null >/dev/null ) 2>&1 | \
1337 + grep unrecognized >/dev/null ); then
1338 + ac_cv_gcc_accepts_no_cpp_precomp=no
1340 + ac_cv_gcc_accepts_no_cpp_precomp=yes
1342 + ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
1346 +AC_DEFUN(AC_NO_OBJECTIVE_C,
1347 + [if test -n "$GCC"; then
1348 + AC_GCC_ACCEPTS_NO_CPP_PRECOMP
1349 + if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
1350 + AC_MSG_RESULT(Disabling Objective C extensions in ANSI C code.)
1351 + CC="$CC -no-cpp-precomp"
1357 +###############################################################################
1359 +# Function to figure out how to create directory trees.
1361 +###############################################################################
1363 +AC_DEFUN(AC_PROG_INSTALL_DIRS,
1364 + [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories],
1365 + ac_cv_install_d_creates_dirs,
1366 + [ac_cv_install_d_creates_dirs=no
1367 + rm -rf conftestdir
1368 + if mkdir conftestdir; then
1369 + cd conftestdir 2>/dev/null
1370 + ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
1371 + if test -d dir1/dir2/. ; then
1372 + ac_cv_install_d_creates_dirs=yes
1375 + rm -rf conftestdir
1379 + if test "$ac_cv_install_d_creates_dirs" = no ; then
1380 + AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories],
1381 + ac_cv_mkdir_p_creates_dirs,
1382 + [ac_cv_mkdir_p_creates_dirs=no
1383 + rm -rf conftestdir
1384 + if mkdir conftestdir; then
1385 + cd conftestdir 2>/dev/null
1386 + mkdir -p dir1/dir2 >/dev/null 2>&1
1387 + if test -d dir1/dir2/. ; then
1388 + ac_cv_mkdir_p_creates_dirs=yes
1391 + rm -rf conftestdir
1396 + if test "$ac_cv_install_d_creates_dirs" = yes ; then
1397 + INSTALL_DIRS='${INSTALL} -d'
1398 + elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
1399 + INSTALL_DIRS='mkdir -p'
1401 + # any other ideas?
1402 + INSTALL_DIRS='${INSTALL} -d'
1407 +###############################################################################
1409 +# Function to check whether gettimeofday() exists, and how to call it.
1410 +# This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
1412 +###############################################################################
1414 +AC_DEFUN(AC_GETTIMEOFDAY_ARGS,
1415 + [AC_MSG_CHECKING(how to call gettimeofday)
1416 + AC_CACHE_VAL(ac_cv_gettimeofday_args,
1417 + [AC_TRY_COMPILE([#include <stdlib.h>
1418 + #include <sys/time.h>],
1419 + [struct timeval tv; struct timezone tzp;
1420 + gettimeofday(&tv, &tzp);],
1421 + [ac_gettimeofday_args=2],
1422 + [AC_TRY_COMPILE([#include <stdlib.h>
1423 + #include <sys/time.h>],
1424 + [struct timeval tv; gettimeofday(&tv);],
1425 + [ac_gettimeofday_args=1],
1426 + [ac_gettimeofday_args=0])])
1427 + ac_cv_gettimeofday_args=$ac_gettimeofday_args])
1428 + ac_gettimeofday_args=$ac_cv_gettimeofday_args
1429 + if test "$ac_gettimeofday_args" = 1 ; then
1430 + AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [ Define if you have the gettimeofday function.])
1431 + AC_MSG_RESULT(one argument)
1432 + elif test "$ac_gettimeofday_args" = 2 ; then
1433 + AC_DEFINE(HAVE_GETTIMEOFDAY, 1[ Define if you have the gettimeofday function ])
1434 + AC_DEFINE(GETTIMEOFDAY_TWO_ARGS, 1, [ Define if gettimeofday requires two arguments.])
1435 + AC_MSG_RESULT(two arguments)
1437 + AC_MSG_RESULT(unknown)
1442 +###############################################################################
1444 +# Function to find perl5 (defines PERL and PERL_VERSION.)
1446 +###############################################################################
1448 +# M4 sucks!! perl sucks too!!
1450 +perl_version_cmd='print $]'
1453 +AC_DEFUN(AC_PROG_PERL,
1454 + [AC_PATH_PROGS(PERL, [perl5 perl],,)
1455 + if test -z "$PERL" ; then
1458 + AC_CACHE_CHECK([perl version], ac_cv_perl_version,
1459 + [ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`])
1460 + PERL_VERSION=$ac_cv_perl_version
1465 +###############################################################################
1467 +# Function to demand "bc". Losers.
1469 +###############################################################################
1471 +AC_DEFUN(AC_DEMAND_BC,
1472 + [ac_bc_result=`echo 6+9 | bc 2>/dev/null`
1473 + AC_MSG_CHECKING([for bc])
1474 + if test "$ac_bc_result" = "15" ; then
1475 + AC_MSG_RESULT(yes)
1479 + AC_MSG_ERROR([Your system doesn't have \"bc\", which has been a standard
1480 + part of Unix since the 1970s. Come back when your vendor
1481 + has grown a clue.])
1485 +###############################################################################
1487 +# Functions to check how to do ICMP PING requests.
1489 +###############################################################################
1491 +AC_DEFUN(AC_CHECK_ICMP,
1492 + [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
1493 + [AC_TRY_COMPILE([#include <stdlib.h>
1494 + #include <stdio.h>
1496 + #include <unistd.h>
1497 + #include <limits.h>
1498 + #include <signal.h>
1499 + #include <fcntl.h>
1500 + #include <sys/types.h>
1501 + #include <sys/time.h>
1502 + #include <sys/ipc.h>
1503 + #include <sys/shm.h>
1504 + #include <sys/socket.h>
1505 + #include <netinet/in_systm.h>
1506 + #include <netinet/in.h>
1507 + #include <netinet/ip.h>
1508 + #include <netinet/ip_icmp.h>
1509 + #include <netinet/udp.h>
1510 + #include <arpa/inet.h>
1511 + #include <netdb.h>],
1513 + struct sockaddr s;
1514 + struct sockaddr_in si;
1516 + i.icmp_type = ICMP_ECHO;
1521 + si.sin_family = AF_INET;
1522 + #if defined(__DECC) || defined(_IP_VHL)
1528 + [ac_cv_have_icmp=yes],
1529 + [ac_cv_have_icmp=no])])
1530 + if test "$ac_cv_have_icmp" = yes ; then
1531 + AC_DEFINE(HAVE_ICMP, 1 [ Define this if you do pings with a `struct icmp' and a `icmp_id' slot. ])
1534 +AC_DEFUN(AC_CHECK_ICMPHDR,
1535 + [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
1536 + [AC_TRY_COMPILE([#include <stdlib.h>
1537 + #include <stdio.h>
1539 + #include <unistd.h>
1540 + #include <limits.h>
1541 + #include <signal.h>
1542 + #include <fcntl.h>
1543 + #include <sys/types.h>
1544 + #include <sys/time.h>
1545 + #include <sys/ipc.h>
1546 + #include <sys/shm.h>
1547 + #include <sys/socket.h>
1548 + #include <netinet/in_systm.h>
1549 + #include <netinet/in.h>
1550 + #include <netinet/ip.h>
1551 + #include <netinet/ip_icmp.h>
1552 + #include <netinet/udp.h>
1553 + #include <arpa/inet.h>
1554 + #include <netdb.h>],
1555 + [struct icmphdr i;
1556 + struct sockaddr s;
1557 + struct sockaddr_in si;
1559 + i.type = ICMP_ECHO;
1563 + i.un.echo.sequence = 0;
1564 + si.sin_family = AF_INET;
1566 + [ac_cv_have_icmphdr=yes],
1567 + [ac_cv_have_icmphdr=no])])
1568 + if test "$ac_cv_have_icmphdr" = yes ; then
1569 + AC_DEFINE(HAVE_ICMPHDR, 1, [ Define this if you do pings with a `struct icmphdr' and a `un.echo.id' slot. ])
1573 +###############################################################################
1575 +# Functions to check for various X11 crap.
1577 +###############################################################################
1579 +# Try and find the app-defaults directory.
1580 +# It sucks that autoconf doesn't do this already...
1582 +AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
1583 + rm -fr conftestdir
1584 + if mkdir conftestdir; then
1585 + cd conftestdir 2>/dev/null
1586 + # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1587 + cat > Imakefile <<'EOF'
1589 + @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
1591 + if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
1592 + # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
1593 + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1596 + rm -fr conftestdir
1599 +AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[
1600 + # Look for the directory under a standard set of common directories.
1601 + # Check X11 before X11Rn because it's often a symlink to the current release.
1603 + /usr/X11/lib/app-defaults \
1604 + /usr/X11R6/lib/app-defaults \
1605 + /usr/X11R6/lib/X11/app-defaults \
1606 + /usr/X11R5/lib/app-defaults \
1607 + /usr/X11R5/lib/X11/app-defaults \
1608 + /usr/X11R4/lib/app-defaults \
1609 + /usr/X11R4/lib/X11/app-defaults \
1611 + /usr/lib/X11/app-defaults \
1612 + /usr/lib/X11R6/app-defaults \
1613 + /usr/lib/X11R5/app-defaults \
1614 + /usr/lib/X11R4/app-defaults \
1616 + /usr/local/X11/lib/app-defaults \
1617 + /usr/local/X11R6/lib/app-defaults \
1618 + /usr/local/X11R5/lib/app-defaults \
1619 + /usr/local/X11R4/lib/app-defaults \
1621 + /usr/local/lib/X11/app-defaults \
1622 + /usr/local/lib/X11R6/app-defaults \
1623 + /usr/local/lib/X11R6/X11/app-defaults \
1624 + /usr/local/lib/X11R5/app-defaults \
1625 + /usr/local/lib/X11R5/X11/app-defaults \
1626 + /usr/local/lib/X11R4/app-defaults \
1627 + /usr/local/lib/X11R4/X11/app-defaults \
1629 + /usr/X386/lib/X11/app-defaults \
1630 + /usr/x386/lib/X11/app-defaults \
1631 + /usr/XFree86/lib/X11/app-defaults \
1633 + /usr/lib/X11/app-defaults \
1634 + /usr/local/lib/X11/app-defaults \
1635 + /usr/unsupported/lib/X11/app-defaults \
1636 + /usr/athena/lib/X11/app-defaults \
1637 + /usr/local/x11r5/lib/X11/app-defaults \
1638 + /usr/lpp/Xamples/lib/X11/app-defaults \
1639 + /lib/usr/lib/X11/app-defaults \
1641 + /usr/openwin/lib/app-defaults \
1642 + /usr/openwin/lib/X11/app-defaults \
1643 + /usr/openwin/share/lib/app-defaults \
1644 + /usr/openwin/share/lib/X11/app-defaults \
1646 + /X11R6/lib/app-defaults \
1647 + /X11R5/lib/app-defaults \
1648 + /X11R4/lib/app-defaults \
1651 + if test -d "$ac_dir"; then
1652 + ac_x_app_defaults=$ac_dir
1658 +AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
1660 + AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
1661 + [AC_PATH_X_APP_DEFAULTS_XMKMF
1662 + if test x"$ac_x_app_defaults" = x; then
1663 + AC_PATH_X_APP_DEFAULTS_DIRECT
1665 + if test x"$ac_x_app_defaults" = x; then
1666 + ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
1668 + # Record where we found app-defaults for the cache.
1669 + ac_cv_x_app_defaults="$ac_x_app_defaults"
1671 + eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
1674 +AC_DEFUN(AC_XPOINTER,
1675 + [AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
1676 + [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
1677 + [XPointer foo = (XPointer) 0;],
1678 + [ac_cv_xpointer=yes],
1679 + [ac_cv_xpointer=no])])
1680 + if test "$ac_cv_xpointer" != yes; then
1681 + AC_DEFINE(XPointer,[char*], [ Define this to char* if you're using X11R4 or earlier. ])
1685 +# Random special-cases for X on certain pathological OSes.
1686 +# You know who you are.
1688 +AC_DEFUN(AC_X_RANDOM_PATHS,
1692 + # The following arcana was gleaned from conversations with
1693 + # Eric Schwartz <erics@col.hp.com>:
1695 + # On HPUX 10.x, the parts of X that HP considers "standard" live in
1696 + # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider
1697 + # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
1698 + # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
1699 + # Also, there are symlinks from /usr/include/ and /usr/lib/ into
1700 + # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
1701 + # you don't need any -I or -L arguments.
1703 + # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
1704 + # are the same division as 10.x. However, there are no symlinks to
1705 + # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
1706 + # arguments are always necessary.
1708 + # However, X11R6 was available on HPUX 9.x as a patch: if that
1709 + # patch was installed, then all of X11R6 went in to
1710 + # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
1712 + # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
1713 + # whether R5 was available as a patch; R6 undoubtedly was not.)
1715 + # So. We try and use the highest numbered pair of
1716 + # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
1717 + # that are available. We do not mix and match different versions
1720 + # Question I still don't know the answer to: (do you?)
1722 + # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
1723 + # /usr/contrib/X11R6/ could be installed as a patch, what was in
1724 + # that contrib directory? Did it contain so-called "standard"
1725 + # X11R6, or did it include Xaw and Xmu as well? If the former,
1726 + # where did one find Xaw and Xmu on 9.x R6 systems? Would this
1727 + # be a situation where one had to reach into the R5 headers and
1728 + # libs to find Xmu? That is, must both R6 and R5 directories
1729 + # be on the -I and -L lists in that case?
1731 + for version in X11R6 X11R5 X11R4 ; do
1732 + # if either pair of directories exists...
1733 + if test -d /usr/include/$version || test -d /usr/contrib/$version/include
1735 + # if contrib exists, use it...
1736 + if test -d /usr/contrib/$version/include ; then
1737 + X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
1738 + X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
1740 + # if the "standard" one exists, use it.
1741 + if test -d /usr/include/$version ; then
1742 + X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
1743 + X_LIBS="$X_LIBS -L/usr/lib/$version"
1745 + # since at least one of the pair exists, go no farther.
1750 + # Now find Motif. Thanks for not making xmkmf find this by
1751 + # default, you losers.
1753 + if test -d /usr/include/Motif2.1 ; then
1754 + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
1755 + X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
1756 + elif test -d /usr/include/Motif1.2 ; then
1757 + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
1758 + X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
1759 + elif test -d /usr/include/Motif1.1 ; then
1760 + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
1761 + X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
1764 + # Now let's check for the pseudo-standard locations for OpenGL and XPM.
1766 + if test -d /opt/graphics/OpenGL/include ; then
1767 + # HP-UX 10.20 puts it here
1768 + X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
1769 + X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
1770 + elif test -d /opt/Mesa/lib ; then
1771 + X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
1772 + X_LIBS="-L/opt/Mesa/lib $X_LIBS"
1776 + if test -d /opt/xpm/lib/X11 ; then
1777 + X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
1778 + X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
1781 + # On HPUX, default to installing in /opt/xscreensaver/ instead of
1782 + # in /usr/local/, unless there is already an xscreensaver in
1783 + # /usr/local/bin/. This can be overridden with the --prefix arg
1784 + # to configure. I'm not sure this is the right thing to do, but
1785 + # Richard Lloyd says so...
1787 + if test \! -x /usr/local/bin/xscreensaver ; then
1788 + ac_default_prefix=/opt/xscreensaver
1794 + # Thanks for not making xmkmf find this by default, pinheads.
1795 + # And thanks for moving things around again, too. Is this
1796 + # really the standard location now? What happened to the
1797 + # joke that this kind of thing went in /opt?
1798 + # cthomp says "answer: CDE (Common Disorganized Environment)"
1800 + if test -f /usr/dt/include/Xm/Xm.h ; then
1801 + X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
1802 + MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
1804 + # Some versions of Slowlaris Motif require -lgen. But not all. Why?
1805 + AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
1811 + # On MacOS X (10.x with "fink"), many things are under /sw/.
1813 + if test -d /sw/include ; then
1814 + X_CFLAGS="-I/sw/include $X_CFLAGS"
1815 + X_LIBS="-L/sw/lib $X_LIBS"
1822 +###############################################################################
1824 +# Some utility functions to make checking for X things easier.
1826 +###############################################################################
1828 +# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
1830 +AC_DEFUN(AC_CHECK_X_HEADER, [
1831 + ac_save_CPPFLAGS="$CPPFLAGS"
1832 + if test \! -z "$includedir" ; then
1833 + CPPFLAGS="$CPPFLAGS -I$includedir"
1835 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1836 + AC_CHECK_HEADER([$1],[$2],[$3],[$4])
1837 + CPPFLAGS="$ac_save_CPPFLAGS"])
1839 +# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
1841 +AC_DEFUN(AC_EGREP_X_HEADER, [
1842 + ac_save_CPPFLAGS="$CPPFLAGS"
1843 + if test \! -z "$includedir" ; then
1844 + CPPFLAGS="$CPPFLAGS -I$includedir"
1846 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1847 + AC_EGREP_HEADER([$1], [$2], [$3], [$4])
1848 + CPPFLAGS="$ac_save_CPPFLAGS"])
1850 +# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
1852 +AC_DEFUN(AC_TRY_X_COMPILE, [
1853 + ac_save_CPPFLAGS="$CPPFLAGS"
1854 + if test \! -z "$includedir" ; then
1855 + CPPFLAGS="$CPPFLAGS -I$includedir"
1857 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1858 + AC_TRY_COMPILE([$1], [$2], [$3], [$4])
1859 + CPPFLAGS="$ac_save_CPPFLAGS"])
1862 +# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
1863 +# Use this sparingly; it probably doesn't work very well on X programs.
1865 +AC_DEFUN(AC_CHECK_X_LIB, [
1866 + ac_save_CPPFLAGS="$CPPFLAGS"
1867 + ac_save_LDFLAGS="$LDFLAGS"
1868 +# ac_save_LIBS="$LIBS"
1870 + if test \! -z "$includedir" ; then
1871 + CPPFLAGS="$CPPFLAGS -I$includedir"
1873 + # note: $X_CFLAGS includes $x_includes
1874 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1876 + if test \! -z "$libdir" ; then
1877 + LDFLAGS="$LDFLAGS -L$libdir"
1879 + # note: $X_LIBS includes $x_libraries
1880 + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
1882 + AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
1883 + CPPFLAGS="$ac_save_CPPFLAGS"
1884 + LDFLAGS="$ac_save_LDFLAGS"
1885 +# LIBS="$ac_save_LIBS"
1888 +# Like AC_TRY_RUN, but it uses the already-computed -I directories.
1889 +# (But not the -L directories!)
1891 +AC_DEFUN(AC_TRY_X_RUN, [
1892 + ac_save_CPPFLAGS="$CPPFLAGS"
1893 + if test \! -z "$includedir" ; then
1894 + CPPFLAGS="$CPPFLAGS -I$includedir"
1896 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1897 + AC_TRY_RUN([$1], [$2], [$3], [$4])
1898 + CPPFLAGS="$ac_save_CPPFLAGS"])
1902 +# Usage: HANDLE_X_PATH_ARG([variable_name],
1903 +# [--command-line-option],
1904 +# [descriptive string])
1906 +# All of the --with options take three forms:
1908 +# --with-foo (or --with-foo=yes)
1909 +# --without-foo (or --with-foo=no)
1912 +# This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
1913 +# a directory (string beginning with a slash) it checks to see whether
1914 +# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
1917 +AC_DEFUN(HANDLE_X_PATH_ARG, [
1923 + AC_MSG_CHECKING([for [$3] headers])
1925 + if test -d $d; then
1926 + X_CFLAGS="-I$d $X_CFLAGS"
1929 + AC_MSG_RESULT(not found ($d: no such directory))
1932 + AC_MSG_CHECKING([for [$3] libs])
1934 + if test -d $d; then
1935 + X_LIBS="-L$d $X_LIBS"
1938 + AC_MSG_RESULT(not found ($d: no such directory))
1941 + # replace the directory string with "yes".
1948 + echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
1949 + echo " If it is a directory, then \`DIR/include' will be added to"
1950 + echo " the -I list, and \`DIR/lib' will be added to the -L list."