]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/xscreensaver/xscreensaver-4.16/configure.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / xscreensaver / xscreensaver-4.16 / configure.patch
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
3 @@ -24,781 +24,11 @@
4    fi
5  done
6  
7 -###############################################################################
8 -#
9 -#       Function to figure out how to run the compiler.
10 -#
11 -###############################################################################
12 -
13 -AC_DEFUN(AC_PROG_CC_ANSI,
14 - [AC_PROG_CC
15 -
16 -  if test -z "$GCC"; then
17 -    AC_MSG_CHECKING(how to request ANSI compilation)
18 -    case "$host" in
19 -      *-hpux* )
20 -        AC_MSG_RESULT(HPUX: adding -Ae)
21 -        CC="$CC -Ae"
22 -      ;;
23 -      *-aix* )
24 -        AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
25 -        CC="$CC -qlanglvl=ansi -qhalt=e"
26 -      ;;
27 -
28 -      *-dec-* )
29 -        AC_MSG_RESULT(DEC: adding -std1 -ieee)
30 -        CC="$CC -std1"
31 -      ;;
32 -
33 -      *)
34 -        AC_MSG_RESULT(no idea)
35 -      ;;
36 -    esac
37 -  fi
38 -
39 -  OBJCC="$CC"
40 -
41 -  AC_MSG_CHECKING([whether the compiler works on ANSI C])
42 -  AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
43 -     AC_MSG_RESULT(yes),
44 -     AC_MSG_RESULT(no)
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.))
47 -
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?
54 -  else
55 -    case "$host" in
56 -      *-irix5* |*-irix6.[0-3]* )
57 -        AC_MSG_RESULT(Turning on SGI compiler warnings.)
58 -        CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
59 -      ;;
60 -#     *-dec-osf* )
61 -#       if test -z "$GCC"; then
62 -#         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
63 -#         CC="$CC -migrate -w0 -verbose -warnprotos"
64 -#       fi
65 -#     ;;
66 -    esac
67 -  fi
68 -])
69 -
70 -
71 -###############################################################################
72 -#
73 -#       Functions to figure out how to disable // comments in ANSI C code.
74 -#
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!)
79 -#
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
85 -#       have another.
86 -#
87 -#       So, I give up, let's just use -pedantic.
88 -#
89 -###############################################################################
90 -
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
98 -     else
99 -       ac_cv_gcc_accepts_std=yes
100 -     fi])
101 -   ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
102 -  fi
103 -])
104 -
105 -AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
106 - [if test -n "$GCC"; then
107 -   AC_GCC_ACCEPTS_STD
108 -   AC_MSG_RESULT(Disabling C++ comments in ANSI C code.)
109 -   #
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.
117 -   #
118 -   if test "$ac_gcc_accepts_std" = yes ; then
119 -     #
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.)
123 -     #
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.)
127 -     #
128 -     CC="$CC -std=c89 -U__STRICT_ANSI__"
129 -   else
130 -     # The old way:
131 -     CC="$CC -Wp,-lang-c89"
132 -   fi
133 -  fi
134 -])
135 -
136 -
137 -###############################################################################
138 -#
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.)
141 -#
142 -###############################################################################
143 -
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
151 -     else
152 -       ac_cv_gcc_accepts_no_cpp_precomp=yes
153 -     fi])
154 -   ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
155 -  fi
156 -])
157 -
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"
164 -   fi
165 -  fi
166 -])
167 -
168 -
169 -###############################################################################
170 -#
171 -#       Function to figure out how to create directory trees.
172 -#
173 -###############################################################################
174 -
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
179 -     rm -rf conftestdir
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
185 -       fi
186 -       cd .. 2>/dev/null
187 -       rm -rf conftestdir
188 -     fi
189 -    ])
190 -
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
195 -       rm -rf conftestdir
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
201 -         fi
202 -         cd .. 2>/dev/null
203 -         rm -rf conftestdir
204 -       fi
205 -      ])
206 -  fi
207 -
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'
212 -  else
213 -    # any other ideas?
214 -    INSTALL_DIRS='${INSTALL} -d'
215 -  fi
216 -])
217 -
218 -
219 -###############################################################################
220 -#
221 -#       Function to check whether gettimeofday() exists, and how to call it.
222 -#      This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
223 -#
224 -###############################################################################
225 -
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)
248 -  else
249 -    AC_MSG_RESULT(unknown)
250 -  fi
251 -])
252 -
253 -
254 -###############################################################################
255 -#
256 -#       Function to find perl5 (defines PERL and PERL_VERSION.)
257 -#
258 -###############################################################################
259 -
260 -# M4 sucks!!  perl sucks too!!
261 -changequote(X,Y)
262 -perl_version_cmd='print $]'
263 -changequote([,])
264 -
265 -AC_DEFUN(AC_PROG_PERL,
266 - [AC_PATH_PROGS(PERL, [perl5 perl],,)
267 -  if test -z "$PERL" ; then
268 -    PERL_VERSION=0
269 -  else
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
273 -  fi
274 - ])
275 -
276 -
277 -###############################################################################
278 -#
279 -#       Function to demand "bc".  Losers.
280 -#
281 -###############################################################################
282 -
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
287 -    AC_MSG_RESULT(yes)
288 -  else
289 -    AC_MSG_RESULT(no)
290 -    echo ''
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.])
294 -  fi
295 - ])
296 -
297 -###############################################################################
298 -#
299 -#       Functions to check how to do ICMP PING requests.
300 -#
301 -###############################################################################
302 -
303 -AC_DEFUN(AC_CHECK_ICMP,
304 - [AC_CACHE_CHECK([for struct icmp], ac_cv_have_icmp,
305 -  [AC_TRY_COMPILE([#include <stdlib.h>
306 -                   #include <stdio.h>
307 -                   #include <math.h>
308 -                   #include <unistd.h>
309 -                   #include <limits.h>
310 -                   #include <signal.h>
311 -                   #include <fcntl.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>],
324 -                  [struct icmp i;
325 -                   struct sockaddr s;
326 -                   struct sockaddr_in si;
327 -                   struct ip ip;
328 -                   i.icmp_type = ICMP_ECHO;
329 -                   i.icmp_code = 0;
330 -                   i.icmp_cksum = 0;
331 -                   i.icmp_id = 0;
332 -                   i.icmp_seq = 0;
333 -                   si.sin_family = AF_INET;
334 -                   #if defined(__DECC) || defined(_IP_VHL)
335 -                   ip.ip_vhl = 0;
336 -                   #else
337 -                   ip.ip_hl = 0;
338 -                   #endif
339 -                   ],
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)
344 - fi])
345 -
346 -AC_DEFUN(AC_CHECK_ICMPHDR,
347 - [AC_CACHE_CHECK([for struct icmphdr], ac_cv_have_icmphdr,
348 -  [AC_TRY_COMPILE([#include <stdlib.h>
349 -                   #include <stdio.h>
350 -                   #include <math.h>
351 -                   #include <unistd.h>
352 -                   #include <limits.h>
353 -                   #include <signal.h>
354 -                   #include <fcntl.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>],
367 -                  [struct icmphdr i;
368 -                   struct sockaddr s;
369 -                   struct sockaddr_in si;
370 -                   struct ip ip;
371 -                   i.type = ICMP_ECHO;
372 -                   i.code = 0;
373 -                   i.checksum = 0;
374 -                   i.un.echo.id = 0;
375 -                   i.un.echo.sequence = 0;
376 -                   si.sin_family = AF_INET;
377 -                   ip.ip_hl = 0;],
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)
382 - fi])
383 -
384 -
385 -###############################################################################
386 -#
387 -#       Functions to check for various X11 crap.
388 -#
389 -###############################################################################
390 -
391 -# Try and find the app-defaults directory.
392 -# It sucks that autoconf doesn't do this already...
393 -#
394 -AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
395 -  rm -fr conftestdir
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'
400 -acfindx:
401 -       @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
402 -EOF
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`
406 -    fi
407 -    cd .. 2>/dev/null
408 -    rm -fr conftestdir
409 -  fi])
410 -
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.
414 -  for ac_dir in                                 \
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             \
422 -                                                \
423 -    /usr/lib/X11/app-defaults                   \
424 -    /usr/lib/X11R6/app-defaults                 \
425 -    /usr/lib/X11R5/app-defaults                 \
426 -    /usr/lib/X11R4/app-defaults                 \
427 -                                                \
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           \
432 -                                                \
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       \
440 -                                                \
441 -    /usr/X386/lib/X11/app-defaults              \
442 -    /usr/x386/lib/X11/app-defaults              \
443 -    /usr/XFree86/lib/X11/app-defaults           \
444 -                                                \
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               \
452 -                                                \
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     \
457 -                                                \
458 -    /X11R6/lib/app-defaults                     \
459 -    /X11R5/lib/app-defaults                     \
460 -    /X11R4/lib/app-defaults                     \
461 -    ; \
462 -  do
463 -    if test -d "$ac_dir"; then
464 -      ac_x_app_defaults=$ac_dir
465 -      break
466 -    fi
467 -  done
468 -])
469 -
470 -AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
471 -  [AC_REQUIRE_CPP()
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
476 -      fi
477 -      if test x"$ac_x_app_defaults" = x; then
478 -        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
479 -      else
480 -        # Record where we found app-defaults for the cache.
481 -        ac_cv_x_app_defaults="$ac_x_app_defaults"
482 -      fi])
483 -    eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
484 -
485 -
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*])
494 -  fi])
495 -
496 -
497 -# Random special-cases for X on certain pathological OSes.
498 -# You know who you are.
499 -#
500 -AC_DEFUN(AC_X_RANDOM_PATHS,
501 - [case "$host" in
502 -    *-hpux*)
503 -
504 -      # The following arcana was gleaned from conversations with
505 -      # Eric Schwartz <erics@col.hp.com>:
506 -      #
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.
514 -      #
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.
519 -      #
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/.)
523 -      #
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.)
526 -      #
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
530 -      # of X.
531 -      #
532 -      # Question I still don't know the answer to: (do you?)
533 -      #
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?
542 -      #
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
546 -        then
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"
551 -           fi
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"
556 -           fi
557 -           # since at least one of the pair exists, go no farther.
558 -           break
559 -        fi
560 -      done
561 -
562 -      # Now find Motif.  Thanks for not making xmkmf find this by
563 -      # default, you losers.
564 -      #
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"
574 -      fi
575 -
576 -      # Now let's check for the pseudo-standard locations for OpenGL and XPM.
577 -      #
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"
585 -      fi
586 -
587 -
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"
591 -      fi
592 -
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...
598 -      #
599 -      if test \! -x /usr/local/bin/xscreensaver ; then
600 -        ac_default_prefix=/opt/xscreensaver
601 -      fi
602 -
603 -    ;;
604 -    *-solaris*)
605 -
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)"
611 -      #
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"
615 -
616 -        # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
617 -        AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
618 -      fi
619 -
620 -    ;;
621 -    *-darwin*)
622 -
623 -      # On MacOS X (10.x with "fink"), many things are under /sw/.
624 -      #
625 -      if test -d /sw/include ; then
626 -        X_CFLAGS="-I/sw/include $X_CFLAGS"
627 -        X_LIBS="-L/sw/lib $X_LIBS"
628 -      fi
629 -    ;;
630 -  esac])
631 -
632 -
633 -
634 -###############################################################################
635 -#
636 -#       Some utility functions to make checking for X things easier.
637 -#
638 -###############################################################################
639 -
640 -# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
641 -#
642 -AC_DEFUN(AC_CHECK_X_HEADER, [
643 -  ac_save_CPPFLAGS="$CPPFLAGS"
644 -  if test \! -z "$includedir" ; then 
645 -    CPPFLAGS="$CPPFLAGS -I$includedir"
646 -  fi
647 -  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
648 -  AC_CHECK_HEADER([$1],[$2],[$3],[$4])
649 -  CPPFLAGS="$ac_save_CPPFLAGS"])
650 -
651 -# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
652 -#
653 -AC_DEFUN(AC_EGREP_X_HEADER, [
654 -  ac_save_CPPFLAGS="$CPPFLAGS"
655 -  if test \! -z "$includedir" ; then 
656 -    CPPFLAGS="$CPPFLAGS -I$includedir"
657 -  fi
658 -  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
659 -  AC_EGREP_HEADER([$1], [$2], [$3], [$4])
660 -  CPPFLAGS="$ac_save_CPPFLAGS"])
661 -
662 -# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
663 -#
664 -AC_DEFUN(AC_TRY_X_COMPILE, [
665 -  ac_save_CPPFLAGS="$CPPFLAGS"
666 -  if test \! -z "$includedir" ; then 
667 -    CPPFLAGS="$CPPFLAGS -I$includedir"
668 -  fi
669 -  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
670 -  AC_TRY_COMPILE([$1], [$2], [$3], [$4])
671 -  CPPFLAGS="$ac_save_CPPFLAGS"])
672 -
673 -
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.
676 -#
677 -AC_DEFUN(AC_CHECK_X_LIB, [
678 -  ac_save_CPPFLAGS="$CPPFLAGS"
679 -  ac_save_LDFLAGS="$LDFLAGS"
680 -#  ac_save_LIBS="$LIBS"
681 -
682 -  if test \! -z "$includedir" ; then 
683 -    CPPFLAGS="$CPPFLAGS -I$includedir"
684 -  fi
685 -  # note: $X_CFLAGS includes $x_includes
686 -  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
687 -
688 -  if test \! -z "$libdir" ; then
689 -    LDFLAGS="$LDFLAGS -L$libdir"
690 -  fi
691 -  # note: $X_LIBS includes $x_libraries
692 -  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
693 -
694 -  AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
695 -  CPPFLAGS="$ac_save_CPPFLAGS"
696 -  LDFLAGS="$ac_save_LDFLAGS"
697 -#  LIBS="$ac_save_LIBS"
698 -  ])
699 -
700 -# Like AC_TRY_RUN, but it uses the already-computed -I directories.
701 -# (But not the -L directories!)
702 -#
703 -AC_DEFUN(AC_TRY_X_RUN, [
704 -  ac_save_CPPFLAGS="$CPPFLAGS"
705 -  if test \! -z "$includedir" ; then 
706 -    CPPFLAGS="$CPPFLAGS -I$includedir"
707 -  fi
708 -  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
709 -  AC_TRY_RUN([$1], [$2], [$3], [$4])
710 -  CPPFLAGS="$ac_save_CPPFLAGS"])
711 -
712 -
713 -
714 -# Usage: HANDLE_X_PATH_ARG([variable_name],
715 -#                          [--command-line-option],
716 -#                          [descriptive string])
717 -#
718 -# All of the --with options take three forms:
719 -#
720 -#   --with-foo (or --with-foo=yes)
721 -#   --without-foo (or --with-foo=no)
722 -#   --with-foo=/DIR
723 -#
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
727 -# as appropriate.
728 -#
729 -AC_DEFUN(HANDLE_X_PATH_ARG, [
730 -   case "$[$1]" in
731 -    yes) ;;
732 -    no)  ;;
733 -
734 -    /*)
735 -     AC_MSG_CHECKING([for [$3] headers])
736 -     d=$[$1]/include
737 -     if test -d $d; then
738 -       X_CFLAGS="-I$d $X_CFLAGS"
739 -       AC_MSG_RESULT($d)
740 -     else
741 -       AC_MSG_RESULT(not found ($d: no such directory))
742 -     fi
743 -
744 -     AC_MSG_CHECKING([for [$3] libs])
745 -     d=$[$1]/lib
746 -     if test -d $d; then
747 -       X_LIBS="-L$d $X_LIBS"
748 -       AC_MSG_RESULT($d)
749 -     else
750 -       AC_MSG_RESULT(not found ($d: no such directory))
751 -     fi
752 -
753 -     # replace the directory string with "yes".
754 -     [$1]_req="yes"
755 -     [$1]=$[$1]_req
756 -     ;;
757 -
758 -    *)
759 -     echo ""
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."
763 -     exit 1
764 -     ;;
765 -   esac
766 -  ])
767 -
768 -
769 -
770 -###############################################################################
771 -###############################################################################
772 -#
773 -#       End of function definitions.  Now start actually executing stuff.
774 -#
775 -###############################################################################
776 -###############################################################################
777 -
778  # random compiler setup
779  AC_CANONICAL_HOST
780 -AC_PROG_CC_ANSI
781 -AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
782 +AC_PROG_CC
783 +#AC_PROG_CC_ANSI
784 +#AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
785  AC_NO_OBJECTIVE_C
786  AC_PROG_CPP
787  AC_C_CONST
788 @@ -870,8 +100,8 @@
789  
790  AC_PROG_INTLTOOL
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)
797  
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"
799 @@ -898,7 +128,7 @@
800    XMU_SRCS=''
801    XMU_OBJS=''
802    XMU_LIBS='-lXmu'
803 -  AC_DEFINE(HAVE_XMU)
804 +  AC_DEFINE(HAVE_XMU, 1, [ Define this if you have the Xmu library. ])
805  fi
806  
807  
808 @@ -1059,7 +289,7 @@
809  if test "$with_sgi" = yes; then
810    AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
811                      [have_sgi=yes
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>])
815  
816  elif test "$with_sgi" != no; then
817 @@ -1111,7 +341,7 @@
818      fi
819  
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. ])
823    fi
824  
825    fi
826 @@ -1139,7 +369,7 @@
827  if test "$with_xidle" = yes; then
828    AC_CHECK_X_HEADER(X11/extensions/xidle.h,
829                      [have_xidle=yes
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"
835 @@ -1177,7 +407,7 @@
836  
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. ])
841    fi
842  
843  elif test "$with_sgivc" != no; then
844 @@ -1225,7 +455,7 @@
845  
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. ])
850    fi
851  
852  elif test "$with_dpms" != no; then
853 @@ -1272,7 +502,7 @@
854  
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.])
859    fi
860  
861  elif test "$with_xinerama" != no; then
862 @@ -1312,7 +542,7 @@
863  
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() ])
868    fi
869  
870  elif test "$with_xf86vmode" != no; then
871 @@ -1365,11 +595,11 @@
872  
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() ])
877    fi
878  
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() ])
882    fi
883  
884    # pull in the lib, if we haven't already
885 @@ -1431,7 +661,7 @@
886  
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 ])
891    fi
892  
893  elif test "$with_randr" != no; then
894 @@ -1454,7 +684,7 @@
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 ])
900    fi
901  fi
902  
903 @@ -1467,7 +697,7 @@
904  
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"
910                     AC_MSG_RESULT(yes)],
911                    [AC_MSG_RESULT(no)])
912 @@ -1499,7 +729,7 @@
913     have_proc_interrupts=$ac_cv_have_proc_interrupts
914  
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 ])
918    fi
919  
920  elif test "$with_proc_interrupts" != no; then
921 @@ -1523,7 +753,7 @@
922  if test "$enable_locking" = yes; then
923    true
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. ] )
927  else
928    echo "error: must be yes or no: --enable-locking=$enable_locking"
929    exit 1
930 @@ -1535,7 +765,7 @@
931    if test "$enable_locking" = yes; then
932      AC_MSG_RESULT(locking disabled: it doesn't work on MacOS X)
933      enable_locking=no
934 -    AC_DEFINE(NO_LOCKING)
935 +    AC_DEFINE(NO_LOCKING, 1, [ Define this to remove the option of locking the screen at all. ])
936    fi
937  fi
938  
939 @@ -1614,7 +844,7 @@
940                                     [ac_cv_pam=no])])
941    if test "$ac_cv_pam" = yes ; then
942      have_pam=yes
943 -    AC_DEFINE(HAVE_PAM)
944 +    AC_DEFINE(HAVE_PAM, 1, [ Define this option if you have PAM ])
945      PASSWD_LIBS="${PASSWD_LIBS} -lpam"
946  
947      # libpam typically requires dlopen and dlsym.  On FreeBSD,
948 @@ -1648,7 +878,7 @@
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)
955      else
956        AC_MSG_RESULT(unknown)
957 @@ -1685,7 +915,7 @@
958  
959    if test "$ac_cv_kerberos" = yes ; then
960      have_kerberos=yes
961 -    AC_DEFINE(HAVE_KERBEROS)
962 +    AC_DEFINE(HAVE_KERBEROS, 1, [ Define this if you have Kerberos ])
963    fi
964  
965    if test "$ac_cv_kerberos5" = yes ; then
966 @@ -1705,8 +935,8 @@
967                     [have_kerberos=no])
968      if test "$have_kerberos" = yes ; then
969        have_kerberos5=yes
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 ])
974      else
975        have_kerberos5=no
976        AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
977 @@ -1943,13 +1173,13 @@
978  
979  
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 ])
992  fi
993  
994  
995 @@ -1983,7 +1213,7 @@
996  case "$with_passwd_helper" in
997    ""|no) : ;;
998    /*)
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;;
1002    *)
1003      echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
1004 @@ -2017,7 +1247,7 @@
1005    have_motif=no
1006    AC_CHECK_X_HEADER(Xm/Xm.h,
1007                      [have_motif=yes
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>
1012                       #include <stdio.h>
1013 @@ -2026,7 +1256,7 @@
1014  
1015  
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>
1020                       #include <stdio.h>
1021                       #include <X11/Intrinsic.h>])
1022 @@ -2171,7 +1401,7 @@
1023  
1024      if test "$have_gtk" = yes; then
1025        have_gtk2=yes
1026 -      AC_DEFINE(HAVE_GTK2)
1027 +      AC_DEFINE(HAVE_GTK2, 1, [ Define this if you have GTK2 ])
1028      else
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
1033            pkgs="$old_pkgs"
1034          else
1035 -          AC_DEFINE(HAVE_CRAPPLET)
1036 +          AC_DEFINE(HAVE_CRAPPLET, 1, [ Define this if you have the configuration appliet ])
1037          fi
1038        fi
1039      fi
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 ])
1046      fi
1047  
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)
1056    fi
1057  
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 ])
1064  
1065      if test "$have_gtk2" = yes; then
1066        GTK_EXTRA_OBJS=""
1067 @@ -2533,7 +1763,7 @@
1068                     [have_xml=yes
1069                      xml_halfassed=no
1070                      XML_LIBS="$ac_xml_config_libs"
1071 -                    AC_DEFINE(HAVE_XML)],
1072 +                    AC_DEFINE(HAVE_XML,1,[ Define this if you have libxml ])],
1073                     [true],
1074                     $ac_xml_config_libs)
1075    fi
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 ])
1085      fi
1086    fi
1087  
1088 @@ -2773,9 +2003,9 @@
1089        gl_halfassed=yes
1090      else
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 ])
1097        fi
1098      fi
1099    fi
1100 @@ -2868,7 +2098,7 @@
1101  
1102      # Check for OpenGL 1.1 features.
1103      #
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)
1107    fi
1108  
1109 @@ -2951,9 +2181,9 @@
1110    fi
1111  
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 ])
1118      fi
1119    fi
1120  
1121 @@ -2983,7 +2213,7 @@
1122  if test "$with_xpm" = yes; then
1123    AC_CHECK_X_HEADER(X11/xpm.h,
1124                     [have_xpm=yes
1125 -                    AC_DEFINE(HAVE_XPM)
1126 +                    AC_DEFINE(HAVE_XPM, 1, [ Define this if you have XPM ])
1127                      XPM_LIBS="-lXpm"],,
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 ])
1136    else
1137      have_gdk_pixbuf2=no
1138    fi
1139 @@ -3236,7 +2466,7 @@
1140                     [have_jpeg=yes
1141                      jpeg_halfassed=no
1142                      JPEG_LIBS="-ljpeg"
1143 -                    AC_DEFINE(HAVE_JPEGLIB)])
1144 +                    AC_DEFINE(HAVE_JPEGLIB, 1, [ Define this if you have libjpeg ])])
1145    fi
1146  fi
1147  
1148 @@ -3251,7 +2481,7 @@
1149  AC_CHECK_HEADERS(pty.h util.h)
1150  AC_CHECK_X_LIB(util, forkpty,
1151                 [PTY_LIBS="-lutil"
1152 -                AC_DEFINE(HAVE_FORKPTY)])
1153 +                AC_DEFINE(HAVE_FORKPTY, 1, [ Define this if you have forkpty() ])])
1154  
1155  
1156  ###############################################################################
1157 @@ -3305,7 +2535,7 @@
1158  
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 ])
1163    fi
1164  
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 ])    
1172    fi
1173  
1174  elif test "$with_xdbe" != no; then
1175 @@ -3363,7 +2593,7 @@
1176  
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
1186  unset fortune_tmp
1187  
1188 -AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program")
1189 +AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program", [ define your fortune program ])
1190  
1191  
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
1195 @@ -0,0 +1,759 @@
1196 +###############################################################################
1197 +#
1198 +#       Function to figure out how to run the compiler.
1199 +#
1200 +###############################################################################
1201 +
1202 +AC_DEFUN(AC_PROG_CC_ANSI,
1203 + [AC_PROG_CC
1204 +
1205 +  if test -z "$GCC"; then
1206 +    AC_MSG_CHECKING(how to request ANSI compilation)
1207 +    case "$host" in
1208 +      *-hpux* )
1209 +        AC_MSG_RESULT(HPUX: adding -Ae)
1210 +        CC="$CC -Ae"
1211 +      ;;
1212 +      *-aix* )
1213 +        AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
1214 +        CC="$CC -qlanglvl=ansi -qhalt=e"
1215 +      ;;
1216 +
1217 +      *-dec-* )
1218 +        AC_MSG_RESULT(DEC: adding -std1 -ieee)
1219 +        CC="$CC -std1"
1220 +      ;;
1221 +
1222 +      *)
1223 +        AC_MSG_RESULT(no idea)
1224 +      ;;
1225 +    esac
1226 +  fi
1227 +
1228 +  OBJCC="$CC"
1229 +
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),
1233 +     AC_MSG_RESULT(no)
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.))
1236 +
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?
1243 +  else
1244 +    case "$host" in
1245 +      *-irix5* |*-irix6.[0-3]* )
1246 +        AC_MSG_RESULT(Turning on SGI compiler warnings.)
1247 +        CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
1248 +      ;;
1249 +#     *-dec-osf* )
1250 +#       if test -z "$GCC"; then
1251 +#         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
1252 +#         CC="$CC -migrate -w0 -verbose -warnprotos"
1253 +#       fi
1254 +#     ;;
1255 +    esac
1256 +  fi
1257 +])
1258 +
1259 +###############################################################################
1260 +#
1261 +#       Functions to figure out how to disable // comments in ANSI C code.
1262 +#
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!)
1267 +#
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
1273 +#       have another.
1274 +#
1275 +#       So, I give up, let's just use -pedantic.
1276 +#
1277 +###############################################################################
1278 +
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
1286 +     else
1287 +       ac_cv_gcc_accepts_std=yes
1288 +     fi])
1289 +   ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
1290 +  fi
1291 +])
1292 +
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.)
1297 +   #
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.
1305 +   #
1306 +   if test "$ac_gcc_accepts_std" = yes ; then
1307 +     #
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.)
1311 +     #
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.)
1315 +     #
1316 +     CC="$CC -std=c89 -U__STRICT_ANSI__"
1317 +   else
1318 +     # The old way:
1319 +     CC="$CC -Wp,-lang-c89"
1320 +   fi
1321 +  fi
1322 +])
1323 +
1324 +
1325 +###############################################################################
1326 +#
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.)
1329 +#
1330 +###############################################################################
1331 +
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
1339 +     else
1340 +       ac_cv_gcc_accepts_no_cpp_precomp=yes
1341 +     fi])
1342 +   ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
1343 +  fi
1344 +])
1345 +
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"
1352 +   fi
1353 +  fi
1354 +])
1355 +
1356 +
1357 +###############################################################################
1358 +#
1359 +#       Function to figure out how to create directory trees.
1360 +#
1361 +###############################################################################
1362 +
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
1373 +       fi
1374 +       cd .. 2>/dev/null
1375 +       rm -rf conftestdir
1376 +     fi
1377 +    ])
1378 +
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
1389 +         fi
1390 +         cd .. 2>/dev/null
1391 +         rm -rf conftestdir
1392 +       fi
1393 +      ])
1394 +  fi
1395 +
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'
1400 +  else
1401 +    # any other ideas?
1402 +    INSTALL_DIRS='${INSTALL} -d'
1403 +  fi
1404 +])
1405 +
1406 +
1407 +###############################################################################
1408 +#
1409 +#       Function to check whether gettimeofday() exists, and how to call it.
1410 +#      This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
1411 +#
1412 +###############################################################################
1413 +
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)
1436 +  else
1437 +    AC_MSG_RESULT(unknown)
1438 +  fi
1439 +])
1440 +
1441 +
1442 +###############################################################################
1443 +#
1444 +#       Function to find perl5 (defines PERL and PERL_VERSION.)
1445 +#
1446 +###############################################################################
1447 +
1448 +# M4 sucks!!  perl sucks too!!
1449 +changequote(X,Y)
1450 +perl_version_cmd='print $]'
1451 +changequote([,])
1452 +
1453 +AC_DEFUN(AC_PROG_PERL,
1454 + [AC_PATH_PROGS(PERL, [perl5 perl],,)
1455 +  if test -z "$PERL" ; then
1456 +    PERL_VERSION=0
1457 +  else
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
1461 +  fi
1462 + ])
1463 +
1464 +
1465 +###############################################################################
1466 +#
1467 +#       Function to demand "bc".  Losers.
1468 +#
1469 +###############################################################################
1470 +
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)
1476 +  else
1477 +    AC_MSG_RESULT(no)
1478 +    echo ''
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.])
1482 +  fi
1483 + ])
1484 +
1485 +###############################################################################
1486 +#
1487 +#       Functions to check how to do ICMP PING requests.
1488 +#
1489 +###############################################################################
1490 +
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>
1495 +                   #include <math.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>],
1512 +                  [struct icmp i;
1513 +                   struct sockaddr s;
1514 +                   struct sockaddr_in si;
1515 +                   struct ip ip;
1516 +                   i.icmp_type = ICMP_ECHO;
1517 +                   i.icmp_code = 0;
1518 +                   i.icmp_cksum = 0;
1519 +                   i.icmp_id = 0;
1520 +                   i.icmp_seq = 0;
1521 +                   si.sin_family = AF_INET;
1522 +                   #if defined(__DECC) || defined(_IP_VHL)
1523 +                   ip.ip_vhl = 0;
1524 +                   #else
1525 +                   ip.ip_hl = 0;
1526 +                   #endif
1527 +                   ],
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. ])
1532 + fi])
1533 +
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>
1538 +                   #include <math.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;
1558 +                   struct ip ip;
1559 +                   i.type = ICMP_ECHO;
1560 +                   i.code = 0;
1561 +                   i.checksum = 0;
1562 +                   i.un.echo.id = 0;
1563 +                   i.un.echo.sequence = 0;
1564 +                   si.sin_family = AF_INET;
1565 +                   ip.ip_hl = 0;],
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. ])
1570 + fi])
1571 +
1572 +
1573 +###############################################################################
1574 +#
1575 +#       Functions to check for various X11 crap.
1576 +#
1577 +###############################################################################
1578 +
1579 +# Try and find the app-defaults directory.
1580 +# It sucks that autoconf doesn't do this already...
1581 +#
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'
1588 +acfindx:
1589 +       @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
1590 +EOF
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`
1594 +    fi
1595 +    cd .. 2>/dev/null
1596 +    rm -fr conftestdir
1597 +  fi])
1598 +
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.
1602 +  for ac_dir in                                 \
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             \
1610 +                                                \
1611 +    /usr/lib/X11/app-defaults                   \
1612 +    /usr/lib/X11R6/app-defaults                 \
1613 +    /usr/lib/X11R5/app-defaults                 \
1614 +    /usr/lib/X11R4/app-defaults                 \
1615 +                                                \
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           \
1620 +                                                \
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       \
1628 +                                                \
1629 +    /usr/X386/lib/X11/app-defaults              \
1630 +    /usr/x386/lib/X11/app-defaults              \
1631 +    /usr/XFree86/lib/X11/app-defaults           \
1632 +                                                \
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               \
1640 +                                                \
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     \
1645 +                                                \
1646 +    /X11R6/lib/app-defaults                     \
1647 +    /X11R5/lib/app-defaults                     \
1648 +    /X11R4/lib/app-defaults                     \
1649 +    ; \
1650 +  do
1651 +    if test -d "$ac_dir"; then
1652 +      ac_x_app_defaults=$ac_dir
1653 +      break
1654 +    fi
1655 +  done
1656 +])
1657 +
1658 +AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
1659 +  [AC_REQUIRE_CPP()
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
1664 +      fi
1665 +      if test x"$ac_x_app_defaults" = x; then
1666 +        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
1667 +      else
1668 +        # Record where we found app-defaults for the cache.
1669 +        ac_cv_x_app_defaults="$ac_x_app_defaults"
1670 +      fi])
1671 +    eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
1672 +
1673 +
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. ])
1682 +  fi])
1683 +
1684 +
1685 +# Random special-cases for X on certain pathological OSes.
1686 +# You know who you are.
1687 +#
1688 +AC_DEFUN(AC_X_RANDOM_PATHS,
1689 + [case "$host" in
1690 +    *-hpux*)
1691 +
1692 +      # The following arcana was gleaned from conversations with
1693 +      # Eric Schwartz <erics@col.hp.com>:
1694 +      #
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.
1702 +      #
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.
1707 +      #
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/.)
1711 +      #
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.)
1714 +      #
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
1718 +      # of X.
1719 +      #
1720 +      # Question I still don't know the answer to: (do you?)
1721 +      #
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?
1730 +      #
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
1734 +        then
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"
1739 +           fi
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"
1744 +           fi
1745 +           # since at least one of the pair exists, go no farther.
1746 +           break
1747 +        fi
1748 +      done
1749 +
1750 +      # Now find Motif.  Thanks for not making xmkmf find this by
1751 +      # default, you losers.
1752 +      #
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"
1762 +      fi
1763 +
1764 +      # Now let's check for the pseudo-standard locations for OpenGL and XPM.
1765 +      #
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"
1773 +      fi
1774 +
1775 +
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"
1779 +      fi
1780 +
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...
1786 +      #
1787 +      if test \! -x /usr/local/bin/xscreensaver ; then
1788 +        ac_default_prefix=/opt/xscreensaver
1789 +      fi
1790 +
1791 +    ;;
1792 +    *-solaris*)
1793 +
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)"
1799 +      #
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"
1803 +
1804 +        # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
1805 +        AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
1806 +      fi
1807 +
1808 +    ;;
1809 +    *-darwin*)
1810 +
1811 +      # On MacOS X (10.x with "fink"), many things are under /sw/.
1812 +      #
1813 +      if test -d /sw/include ; then
1814 +        X_CFLAGS="-I/sw/include $X_CFLAGS"
1815 +        X_LIBS="-L/sw/lib $X_LIBS"
1816 +      fi
1817 +    ;;
1818 +  esac])
1819 +
1820 +
1821 +
1822 +###############################################################################
1823 +#
1824 +#       Some utility functions to make checking for X things easier.
1825 +#
1826 +###############################################################################
1827 +
1828 +# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
1829 +#
1830 +AC_DEFUN(AC_CHECK_X_HEADER, [
1831 +  ac_save_CPPFLAGS="$CPPFLAGS"
1832 +  if test \! -z "$includedir" ; then 
1833 +    CPPFLAGS="$CPPFLAGS -I$includedir"
1834 +  fi
1835 +  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1836 +  AC_CHECK_HEADER([$1],[$2],[$3],[$4])
1837 +  CPPFLAGS="$ac_save_CPPFLAGS"])
1838 +
1839 +# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
1840 +#
1841 +AC_DEFUN(AC_EGREP_X_HEADER, [
1842 +  ac_save_CPPFLAGS="$CPPFLAGS"
1843 +  if test \! -z "$includedir" ; then 
1844 +    CPPFLAGS="$CPPFLAGS -I$includedir"
1845 +  fi
1846 +  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1847 +  AC_EGREP_HEADER([$1], [$2], [$3], [$4])
1848 +  CPPFLAGS="$ac_save_CPPFLAGS"])
1849 +
1850 +# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
1851 +#
1852 +AC_DEFUN(AC_TRY_X_COMPILE, [
1853 +  ac_save_CPPFLAGS="$CPPFLAGS"
1854 +  if test \! -z "$includedir" ; then 
1855 +    CPPFLAGS="$CPPFLAGS -I$includedir"
1856 +  fi
1857 +  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1858 +  AC_TRY_COMPILE([$1], [$2], [$3], [$4])
1859 +  CPPFLAGS="$ac_save_CPPFLAGS"])
1860 +
1861 +
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.
1864 +#
1865 +AC_DEFUN(AC_CHECK_X_LIB, [
1866 +  ac_save_CPPFLAGS="$CPPFLAGS"
1867 +  ac_save_LDFLAGS="$LDFLAGS"
1868 +#  ac_save_LIBS="$LIBS"
1869 +
1870 +  if test \! -z "$includedir" ; then 
1871 +    CPPFLAGS="$CPPFLAGS -I$includedir"
1872 +  fi
1873 +  # note: $X_CFLAGS includes $x_includes
1874 +  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1875 +
1876 +  if test \! -z "$libdir" ; then
1877 +    LDFLAGS="$LDFLAGS -L$libdir"
1878 +  fi
1879 +  # note: $X_LIBS includes $x_libraries
1880 +  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
1881 +
1882 +  AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
1883 +  CPPFLAGS="$ac_save_CPPFLAGS"
1884 +  LDFLAGS="$ac_save_LDFLAGS"
1885 +#  LIBS="$ac_save_LIBS"
1886 +  ])
1887 +
1888 +# Like AC_TRY_RUN, but it uses the already-computed -I directories.
1889 +# (But not the -L directories!)
1890 +#
1891 +AC_DEFUN(AC_TRY_X_RUN, [
1892 +  ac_save_CPPFLAGS="$CPPFLAGS"
1893 +  if test \! -z "$includedir" ; then 
1894 +    CPPFLAGS="$CPPFLAGS -I$includedir"
1895 +  fi
1896 +  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1897 +  AC_TRY_RUN([$1], [$2], [$3], [$4])
1898 +  CPPFLAGS="$ac_save_CPPFLAGS"])
1899 +
1900 +
1901 +
1902 +# Usage: HANDLE_X_PATH_ARG([variable_name],
1903 +#                          [--command-line-option],
1904 +#                          [descriptive string])
1905 +#
1906 +# All of the --with options take three forms:
1907 +#
1908 +#   --with-foo (or --with-foo=yes)
1909 +#   --without-foo (or --with-foo=no)
1910 +#   --with-foo=/DIR
1911 +#
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
1915 +# as appropriate.
1916 +#
1917 +AC_DEFUN(HANDLE_X_PATH_ARG, [
1918 +   case "$[$1]" in
1919 +    yes) ;;
1920 +    no)  ;;
1921 +
1922 +    /*)
1923 +     AC_MSG_CHECKING([for [$3] headers])
1924 +     d=$[$1]/include
1925 +     if test -d $d; then
1926 +       X_CFLAGS="-I$d $X_CFLAGS"
1927 +       AC_MSG_RESULT($d)
1928 +     else
1929 +       AC_MSG_RESULT(not found ($d: no such directory))
1930 +     fi
1931 +
1932 +     AC_MSG_CHECKING([for [$3] libs])
1933 +     d=$[$1]/lib
1934 +     if test -d $d; then
1935 +       X_LIBS="-L$d $X_LIBS"
1936 +       AC_MSG_RESULT($d)
1937 +     else
1938 +       AC_MSG_RESULT(not found ($d: no such directory))
1939 +     fi
1940 +
1941 +     # replace the directory string with "yes".
1942 +     [$1]_req="yes"
1943 +     [$1]=$[$1]_req
1944 +     ;;
1945 +
1946 +    *)
1947 +     echo ""
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."
1951 +     exit 1
1952 +     ;;
1953 +   esac
1954 +  ])