/[cvs]/eggdrop1.9/aclocal.m4
ViewVC logotype

Contents of /eggdrop1.9/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.53 - (show annotations) (download)
Tue Aug 21 00:21:17 2001 UTC (17 years, 9 months ago) by ite
Branch: MAIN
Changes since 1.52: +591 -24 lines
Gettext phase 2:
* Replced dummy _() define with the real one and added language domain binding
  code.
* added gettext's related m4 macros to aclocal
* added misc/config.guess and misc/config.sub system detection scripts
* added the po subdirectory containing:
  - eggdrop.pot: the template translation file.
  - POTFILES.in: a list of the source files containing _("") macros
  - update.pl: a small perl script to generate eggdrop.pot from the sources
    and to update existing translation files (*.po)
  - ChangeLog: list of changes in that directory.
* added VERSION and VERSION_NUM (replacing EGG_VERSION and EGG_VERSION_NUM)
  defines for versioning information. The version (+patch excepted) now changes
  by just editing an entry in top of configure.in.
* removed EGG_VERSION_MAX and EGGDROP_VERSION_MIN C macros that wheren't used
  anywhere.
* Modified bootstrap script
* added and and modified .cvsignore files

1 dnl aclocal.m4
2 dnl macros autoconf uses when building configure from configure.in
3 dnl
4 dnl $Id: aclocal.m4,v 1.52 2001/08/19 02:24:40 drummer Exp $
5 dnl
6
7
8 dnl EGG_MSG_CONFIGURE_START()
9 dnl
10 AC_DEFUN(EGG_MSG_CONFIGURE_START, [dnl
11 AC_MSG_RESULT()
12 AC_MSG_RESULT(This is eggdrop's GNU configure script.)
13 AC_MSG_RESULT(It's going to run a bunch of strange tests to hopefully)
14 AC_MSG_RESULT(make your compile work without much twiddling.)
15 AC_MSG_RESULT()
16 ])dnl
17
18
19 dnl EGG_MSG_CONFIGURE_END()
20 dnl
21 AC_DEFUN(EGG_MSG_CONFIGURE_END, [dnl
22 AC_MSG_RESULT()
23 AC_MSG_RESULT(Configure is done.)
24 AC_MSG_RESULT()
25 AC_MSG_RESULT(Type 'make config' to configure the modules. Or 'make iconfig' to)
26 AC_MSG_RESULT(interactively choose which modules to compile.)
27 AC_MSG_RESULT()
28 if test -f "./$EGGEXEC"
29 then
30 AC_MSG_RESULT([After that, type 'make clean' and then 'make' to create the bot.])
31 else
32 AC_MSG_RESULT([After that, type 'make' to create the bot.])
33 fi
34 AC_MSG_RESULT()
35 ])dnl
36
37
38 dnl EGG_CHECK_CC()
39 dnl
40 dnl FIXME: make a better test
41 dnl
42 AC_DEFUN(EGG_CHECK_CC, [dnl
43 if test "${cross_compiling-x}" = "x"
44 then
45 cat << 'EOF' >&2
46 configure: error:
47
48 This system does not appear to have a working C compiler.
49 A working C compiler is required to compile eggdrop.
50
51 EOF
52 exit 1
53 fi
54 ])dnl
55
56
57 dnl EGG_CHECK_CCPIPE()
58 dnl
59 dnl Checks whether the compiler supports the `-pipe' flag, which
60 dnl speeds up the compilation.
61 AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
62 if test -z "$no_pipe"
63 then
64 if test -n "$GCC"
65 then
66 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
67 ac_old_CC="$CC"
68 CC="$CC -pipe"
69 AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")
70 CC="$ac_old_CC"
71 ])
72 if test "$egg_cv_var_ccpipe" = "yes"
73 then
74 CC="$CC -pipe"
75 fi
76 fi
77 fi
78 ])dnl
79
80
81 dnl EGG_PROG_STRIP()
82 dnl
83 AC_DEFUN(EGG_PROG_STRIP, [dnl
84 AC_CHECK_PROG(STRIP, strip, strip)
85 if test "${STRIP-x}" = "x"
86 then
87 STRIP=touch
88 fi
89 ])dnl
90
91
92 dnl EGG_PROG_AWK()
93 dnl
94 AC_DEFUN(EGG_PROG_AWK, [dnl
95 # awk is needed for Tcl library and header checks, and eggdrop version subst
96 AC_PROG_AWK
97 if test "${AWK-x}" = "x"
98 then
99 cat << 'EOF' >&2
100 configure: error:
101
102 This system seems to lack a working 'awk' command.
103 A working 'awk' command is required to compile eggdrop.
104
105 EOF
106 exit 1
107 fi
108 ])dnl
109
110
111 dnl EGG_PROG_BASENAME()
112 dnl
113 AC_DEFUN(EGG_PROG_BASENAME, [dnl
114 # basename is needed for Tcl library and header checks
115 AC_CHECK_PROG(BASENAME, basename, basename)
116 if test "${BASENAME-x}" = "x"
117 then
118 cat << 'EOF' >&2
119 configure: error:
120
121 This system seems to lack a working 'basename' command.
122 A working 'basename' command is required to compile eggdrop.
123
124 EOF
125 exit 1
126 fi
127 ])dnl
128
129
130 dnl EGG_CHECK_OS()
131 dnl
132 dnl FIXME/NOTICE:
133 dnl This function is obsolete. Any NEW code/checks should be written
134 dnl as individual tests that will be checked on ALL operating systems.
135 dnl
136 AC_DEFUN(EGG_CHECK_OS, [dnl
137 LINUX=no
138 IRIX=no
139 SUNOS=no
140 HPUX=no
141 MOD_CC="$CC"
142 MOD_LD="$CC"
143 MOD_STRIP="$STRIP"
144 SHLIB_CC="$CC"
145 SHLIB_LD="$CC"
146 SHLIB_STRIP="$STRIP"
147 NEED_DL=1
148 DEFAULT_MAKE=debug
149 MOD_EXT=so
150
151 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
152 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
153
154 case "$egg_cv_var_system_type" in
155 BSD/OS)
156 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
157 2)
158 NEED_DL=0
159 DEFAULT_MAKE=static
160 ;;
161 3)
162 MOD_CC=shlicc
163 MOD_LD=shlicc
164 MOD_STRIP="$STRIP -d"
165 SHLIB_LD="shlicc -r"
166 SHLIB_STRIP=touch
167 AC_DEFINE(MODULES_OK)dnl
168 ;;
169 *)
170 CFLAGS="$CFLAGS -Wall"
171 MOD_LD="$CC"
172 MOD_STRIP="$STRIP -d"
173 SHLIB_CC="$CC -export-dynamic -fPIC"
174 SHLIB_LD="$CC -shared -nostartfiles"
175 AC_DEFINE(MODULES_OK)dnl
176 ;;
177 esac
178 ;;
179 CYGWIN*)
180 case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
181 1.*)
182 NEED_DL=0
183 SHLIB_LD="$CC -shared"
184 AC_PROG_CC_WIN32
185 CC="$CC $WIN32FLAGS"
186 MOD_CC="$CC"
187 MOD_LD="$CC"
188 AC_MSG_CHECKING(for /usr/lib/binmode.o)
189 if test -r /usr/lib/binmode.o
190 then
191 AC_MSG_RESULT(yes)
192 LIBS="$LIBS /usr/lib/binmode.o"
193 else
194 AC_MSG_RESULT(no)
195 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
196 fi
197 MOD_EXT=dll
198 AC_DEFINE(MODULES_OK)dnl
199 ;;
200 *)
201 NEED_DL=0
202 DEFAULT_MAKE=static
203 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
204 ;;
205 esac
206 ;;
207 HP-UX)
208 HPUX=yes
209 MOD_LD="$CC -fPIC -shared"
210 SHLIB_CC="$CC -fPIC"
211 SHLIB_LD="ld -b"
212 NEED_DL=0
213 AC_DEFINE(MODULES_OK)dnl
214 AC_DEFINE(HPUX_HACKS)dnl
215 if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
216 then
217 AC_DEFINE(HPUX10_HACKS)dnl
218 fi
219 ;;
220 dell)
221 AC_MSG_RESULT(Dell SVR4)
222 SHLIB_STRIP=touch
223 NEED_DL=0
224 MOD_LD="$CC -lelf -lucb"
225 ;;
226 IRIX)
227 SHLIB_LD="ld -n32 -shared -rdata_shared"
228 IRIX=yes
229 SHLIB_STRIP=touch
230 NEED_DL=0
231 DEFAULT_MAKE=static
232 ;;
233 Ultrix)
234 NEED_DL=0
235 SHLIB_STRIP=touch
236 DEFAULT_MAKE=static
237 SHELL=/bin/sh5
238 ;;
239 SINIX*)
240 NEED_DL=0
241 SHLIB_STRIP=touch
242 DEFAULT_MAKE=static
243 SHLIB_CC="cc -G"
244 ;;
245 BeOS)
246 NEED_DL=0
247 SHLIB_STRIP=strip
248 DEFAULT_MAKE=static
249 ;;
250 Linux)
251 LINUX=yes
252 CFLAGS="$CFLAGS -Wall"
253 MOD_LD="$CC"
254 SHLIB_CC="$CC -fPIC"
255 SHLIB_LD="$CC -shared -nostartfiles"
256 AC_DEFINE(MODULES_OK)dnl
257 ;;
258 Lynx)
259 NEED_DL=0
260 DEFAULT_MAKE=static
261 SHLIB_STRIP=strip
262 ;;
263 QNX)
264 NEED_DL=0
265 DEFAULT_MAKE=static
266 SHLIB_LD="ld -shared"
267 SHLIB_STRIP=strip
268 ;;
269 OSF1)
270 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
271 V*)
272 # FIXME: we should check this in a seperate test
273 # Digital OSF uses an ancient version of gawk
274 if test "$AWK" = "gawk"
275 then
276 AWK=awk
277 fi
278 MOD_CC=cc
279 MOD_LD=cc
280 SHLIB_CC=cc
281 SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
282 SHLIB_STRIP=touch
283 AC_DEFINE(MODULES_OK)dnl
284 ;;
285 1.0|1.1|1.2)
286 SHLIB_LD="ld -R -export $@:"
287 AC_DEFINE(MODULES_OK)dnl
288 AC_DEFINE(OSF1_HACKS)dnl
289 ;;
290 1.*)
291 SHLIB_CC="$CC -fpic"
292 SHLIB_LD="ld -shared"
293 AC_DEFINE(MODULES_OK)dnl
294 AC_DEFINE(OSF1_HACKS)dnl
295 ;;
296 *)
297 NEED_DL=0
298 DEFAULT_MAKE=static
299 ;;
300 esac
301 AC_DEFINE(STOP_UAC)dnl
302 ;;
303 SunOS)
304 if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5"
305 then
306 # Solaris
307 if test -n "$GCC"
308 then
309 SHLIB_CC="$CC -fPIC"
310 SHLIB_LD="$CC"
311 else
312 SHLIB_CC="$CC -KPIC"
313 SHLIB_LD="$CC -G -z text"
314 fi
315 else
316 # SunOS 4
317 SUNOS=yes
318 SHLIB_LD=ld
319 SHLIB_CC="$CC -PIC"
320 AC_DEFINE(DLOPEN_1)dnl
321 fi
322 AC_DEFINE(MODULES_OK)dnl
323 ;;
324 *BSD)
325 # FreeBSD/OpenBSD/NetBSD
326 SHLIB_CC="$CC -fPIC"
327 SHLIB_LD="ld -Bshareable -x"
328 AC_DEFINE(MODULES_OK)dnl
329 ;;
330 *)
331 AC_MSG_CHECKING(if system is Mach based)
332 if test -r /mach
333 then
334 AC_MSG_RESULT(yes)
335 NEED_DL=0
336 DEFAULT_MAKE=static
337 AC_DEFINE(BORGCUBES)dnl
338 else
339 AC_MSG_RESULT(no)
340 AC_MSG_CHECKING(if system is QNX)
341 if test -r /cmds
342 then
343 AC_MSG_RESULT(yes)
344 SHLIB_STRIP=touch
345 NEED_DL=0
346 DEFAULT_MAKE=static
347 else
348 AC_MSG_RESULT(no)
349 AC_MSG_RESULT(Something unknown!)
350 AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
351 NEED_DL=0
352 DEFAULT_MAKE=static
353 fi
354 fi
355 ;;
356 esac
357 AC_SUBST(MOD_LD)dnl
358 AC_SUBST(MOD_CC)dnl
359 AC_SUBST(MOD_STRIP)dnl
360 AC_SUBST(SHLIB_LD)dnl
361 AC_SUBST(SHLIB_CC)dnl
362 AC_SUBST(SHLIB_STRIP)dnl
363 AC_SUBST(DEFAULT_MAKE)dnl
364 AC_SUBST(MOD_EXT)dnl
365 AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl
366 ])dnl
367
368
369 dnl EGG_CHECK_LIBS()
370 dnl
371 AC_DEFUN(EGG_CHECK_LIBS, [dnl
372 # FIXME: this needs to be fixed so that it works on IRIX
373 if test "$IRIX" = "yes"
374 then
375 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
376 else
377 AC_CHECK_LIB(socket, socket)
378 AC_CHECK_LIB(nsl, connect)
379 AC_CHECK_LIB(dns, gethostbyname)
380 AC_CHECK_LIB(dl, dlopen)
381 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
382 # This is needed for Tcl libraries compiled with thread support
383 AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
384 ac_cv_lib_pthread_pthread_mutex_init=yes
385 ac_cv_lib_pthread="-lpthread"], [dnl
386 AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
387 ac_cv_lib_pthread_pthread_mutex_init=yes
388 ac_cv_lib_pthread="-lpthread"], [dnl
389 AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
390 ac_cv_lib_pthread_pthread_mutex_init=yes
391 ac_cv_lib_pthread="-lpthreads"], [dnl
392 AC_CHECK_FUNC(pthread_mutex_init, [dnl
393 ac_cv_lib_pthread_pthread_mutex_init=yes
394 ac_cv_lib_pthread=""],
395 ac_cv_lib_pthread_pthread_mutex_init=no)])])])
396 if test "$SUNOS" = "yes"
397 then
398 # For suns without yp or something like that
399 AC_CHECK_LIB(dl, main)
400 else
401 if test "$HPUX" = "yes"
402 then
403 AC_CHECK_LIB(dld, shl_load)
404 fi
405 fi
406 fi
407 ])dnl
408
409
410 dnl EGG_CHECK_FUNC_VSPRINTF()
411 dnl
412 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
413 AC_CHECK_FUNCS(vsprintf)
414 if test "$ac_cv_func_vsprintf" = "no"
415 then
416 cat << 'EOF' >&2
417 configure: error:
418
419 Your system does not have the sprintf/vsprintf libraries.
420 These are required to compile almost anything. Sorry.
421
422 EOF
423 exit 1
424 fi
425 ])dnl
426
427
428 dnl EGG_HEADER_STDC()
429 dnl
430 AC_DEFUN(EGG_HEADER_STDC, [dnl
431 if test "$ac_cv_header_stdc" = "no"
432 then
433 cat << 'EOF' >&2
434 configure: error:
435
436 Your system must support ANSI C Header files.
437
438 EOF
439 exit 1
440 fi
441 ])dnl
442
443
444 dnl EGG_CHECK_LIBSAFE_SSCANF()
445 dnl
446 AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
447 AC_CACHE_CHECK(for broken libsafe sscanf, egg_cv_var_libsafe_sscanf, [dnl
448 AC_TRY_RUN([
449 #include <stdio.h>
450
451 int main()
452 {
453 char *src = "0x001,guppyism\n";
454 char dst[10];
455 int idx;
456 if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
457 exit(1);
458 return 0;
459 }
460 ], egg_cv_var_libsafe_sscanf="no", egg_cv_var_libsafe_sscanf="yes",
461 egg_cv_var_libsafe_sscanf="no")
462 ])
463 if test "$egg_cv_var_libsafe_sscanf" = "yes"
464 then
465 AC_DEFINE(LIBSAFE_HACKS)dnl
466 fi
467 ])dnl
468
469
470 dnl EGG_CYGWIN()
471 dnl
472 dnl Check for Cygwin support.
473 AC_DEFUN(EGG_CYGWIN, [dnl
474 AC_CYGWIN
475 if test "$ac_cv_cygwin" = "yes"
476 then
477 AC_DEFINE(CYGWIN_HACKS)dnl
478 fi
479 ])dnl
480
481
482 dnl EGG_EXEEXT()
483 dnl
484 dnl Test for executable suffix and define eggdrop's executable name
485 dnl accordingly.
486 AC_DEFUN(EGG_EXEEXT, [dnl
487 EGGEXEC=eggdrop
488 AC_EXEEXT
489 if test ! "${EXEEXT-x}" = "x"
490 then
491 EGGEXEC="eggdrop$EXEEXT"
492 fi
493 AC_SUBST(EGGEXEC)dnl
494 ])dnl
495
496
497 dnl EGG_TCL_ARG_WITH()
498 dnl
499 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
500 # oohh new configure --variables for those with multiple tcl libs
501 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname="$withval")
502 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname="$withval")
503
504 WARN=0
505 # Make sure either both or neither $tcllibname and $tclincname are set
506 if test ! "${tcllibname-x}" = "x"
507 then
508 if test "${tclincname-x}" = "x"
509 then
510 WARN=1
511 tcllibname=""
512 TCLLIB=""
513 TCLINC=""
514 fi
515 else
516 if test ! "${tclincname-x}" = "x"
517 then
518 WARN=1
519 tclincname=""
520 TCLLIB=""
521 TCLINC=""
522 fi
523 fi
524 if test "$WARN" = 1
525 then
526 cat << 'EOF' >&2
527 configure: warning:
528
529 You must specify both --with-tcllib and --with-tclinc for them to work.
530 configure will now attempt to autodetect both the Tcl library and header...
531
532 EOF
533 fi
534 ])dnl
535
536
537 dnl EGG_TCL_ENV()
538 dnl
539 AC_DEFUN(EGG_TCL_ENV, [dnl
540 WARN=0
541 # Make sure either both or neither $TCLLIB and $TCLINC are set
542 if test ! "${TCLLIB-x}" = "x"
543 then
544 if test "${TCLINC-x}" = "x"
545 then
546 WARN=1
547 WVAR1=TCLLIB
548 WVAR2=TCLINC
549 TCLLIB=""
550 fi
551 else
552 if test ! "${TCLINC-x}" = "x"
553 then
554 WARN=1
555 WVAR1=TCLINC
556 WVAR2=TCLLIB
557 TCLINC=""
558 fi
559 fi
560 if test "$WARN" = 1
561 then
562 cat << EOF >&2
563 configure: warning:
564
565 Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
566 Please set both TCLLIB and TCLINC correctly if you wish to use them.
567 configure will now attempt to autodetect both the Tcl library and header...
568
569 EOF
570 fi
571 ])dnl
572
573
574 dnl EGG_TCL_WITH_TCLLIB()
575 dnl
576 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
577 # Look for Tcl library: if $tcllibname is set, check there first
578 if test ! "${tcllibname-x}" = "x"
579 then
580 if test -f "$tcllibname" && test -r "$tcllibname"
581 then
582 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
583 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
584 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
585 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
586 else
587 cat << EOF >&2
588 configure: warning:
589
590 The file '$tcllibname' given to option --with-tcllib is not valid.
591 configure will now attempt to autodetect both the Tcl library and header...
592
593 EOF
594 tcllibname=""
595 tclincname=""
596 TCLLIB=""
597 TCLLIBFN=""
598 TCLINC=""
599 TCLINCFN=""
600 fi
601 fi
602 ])dnl
603
604
605 dnl EGG_TCL_WITH_TCLINC()
606 dnl
607 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
608 # Look for Tcl header: if $tclincname is set, check there first
609 if test ! "${tclincname-x}" = "x"
610 then
611 if test -f "$tclincname" && test -r "$tclincname"
612 then
613 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
614 TCLINCFN=`$BASENAME $tclincname`
615 else
616 cat << EOF >&2
617 configure: warning:
618
619 The file '$tclincname' given to option --with-tclinc is not valid.
620 configure will now attempt to autodetect both the Tcl library and header...
621
622 EOF
623 tcllibname=""
624 tclincname=""
625 TCLLIB=""
626 TCLLIBFN=""
627 TCLINC=""
628 TCLINCFN=""
629 fi
630 fi
631 ])dnl
632
633
634 dnl EGG_TCL_FIND_LIBRARY()
635 dnl
636 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
637 # Look for Tcl library: if $TCLLIB is set, check there first
638 if test "${TCLLIBFN-x}" = "x"
639 then
640 if test ! "${TCLLIB-x}" = "x"
641 then
642 if test -d "$TCLLIB"
643 then
644 for tcllibfns in $tcllibnames
645 do
646 for tcllibext in $tcllibextensions
647 do
648 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
649 then
650 TCLLIBFN="$tcllibfns$tcllibext"
651 TCLLIBEXT="$tcllibext"
652 TCLLIBFNS="$tcllibfns"
653 break 2
654 fi
655 done
656 done
657 fi
658 if test "${TCLLIBFN-x}" = "x"
659 then
660 cat << 'EOF' >&2
661 configure: warning:
662
663 Environment variable TCLLIB was set, but incorrect.
664 Please set both TCLLIB and TCLINC correctly if you wish to use them.
665 configure will now attempt to autodetect both the Tcl library and header...
666
667 EOF
668 TCLLIB=""
669 TCLLIBFN=""
670 TCLINC=""
671 TCLINCFN=""
672 fi
673 fi
674 fi
675 ])dnl
676
677
678 dnl EGG_TCL_FIND_HEADER()
679 dnl
680 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
681 # Look for Tcl header: if $TCLINC is set, check there first
682 if test "${TCLINCFN-x}" = "x"
683 then
684 if test ! "${TCLINC-x}" = "x"
685 then
686 if test -d "$TCLINC"
687 then
688 for tclheaderfn in $tclheadernames
689 do
690 if test -r "$TCLINC/$tclheaderfn"
691 then
692 TCLINCFN="$tclheaderfn"
693 break
694 fi
695 done
696 fi
697 if test "${TCLINCFN-x}" = "x"
698 then
699 cat << 'EOF' >&2
700 configure: warning:
701
702 Environment variable TCLINC was set, but incorrect.
703 Please set both TCLLIB and TCLINC correctly if you wish to use them.
704 configure will now attempt to autodetect both the Tcl library and header...
705
706 EOF
707 TCLLIB=""
708 TCLLIBFN=""
709 TCLINC=""
710 TCLINCFN=""
711 fi
712 fi
713 fi
714 ])dnl
715
716
717 dnl EGG_TCL_CHECK_LIBRARY()
718 dnl
719 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
720 AC_MSG_CHECKING(for Tcl library)
721
722 # Attempt autodetect for $TCLLIBFN if it's not set
723 if test ! "${TCLLIBFN-x}" = "x"
724 then
725 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
726 else
727 for tcllibfns in $tcllibnames
728 do
729 for tcllibext in $tcllibextensions
730 do
731 for tcllibpath in $tcllibpaths
732 do
733 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
734 then
735 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
736 TCLLIB="$tcllibpath"
737 TCLLIBFN="$tcllibfns$tcllibext"
738 TCLLIBEXT="$tcllibext"
739 TCLLIBFNS="$tcllibfns"
740 break 3
741 fi
742 done
743 done
744 done
745 fi
746
747 # Show if $TCLLIBFN wasn't found
748 if test "${TCLLIBFN-x}" = "x"
749 then
750 AC_MSG_RESULT(not found)
751 fi
752 AC_SUBST(TCLLIB)dnl
753 AC_SUBST(TCLLIBFN)dnl
754 ])dnl
755
756
757 dnl EGG_TCL_CHECK_HEADER()
758 dnl
759 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
760 AC_MSG_CHECKING(for Tcl header)
761
762 # Attempt autodetect for $TCLINCFN if it's not set
763 if test ! "${TCLINCFN-x}" = "x"
764 then
765 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
766 else
767 for tclheaderpath in $tclheaderpaths
768 do
769 for tclheaderfn in $tclheadernames
770 do
771 if test -r "$tclheaderpath/$tclheaderfn"
772 then
773 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
774 TCLINC="$tclheaderpath"
775 TCLINCFN="$tclheaderfn"
776 break 2
777 fi
778 done
779 done
780 # FreeBSD hack ...
781 if test "${TCLINCFN-x}" = "x"
782 then
783 for tcllibfns in $tcllibnames
784 do
785 for tclheaderpath in $tclheaderpaths
786 do
787 for tclheaderfn in $tclheadernames
788 do
789 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
790 then
791 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
792 TCLINC="$tclheaderpath/$tcllibfns"
793 TCLINCFN="$tclheaderfn"
794 break 3
795 fi
796 done
797 done
798 done
799 fi
800 fi
801
802 # Show if $TCLINCFN wasn't found
803 if test "${TCLINCFN-x}" = "x"
804 then
805 AC_MSG_RESULT(not found)
806 fi
807 AC_SUBST(TCLINC)dnl
808 AC_SUBST(TCLINCFN)dnl
809 ])dnl
810
811
812 dnl EGG_CACHE_UNSET(CACHE-ID)
813 dnl
814 dnl Unsets a certain cache item. Typically called before using
815 dnl the AC_CACHE_*() macros.
816 AC_DEFUN(EGG_CACHE_UNSET, [dnl
817 unset $1
818 ])
819
820
821 dnl EGG_TCL_DETECT_CHANGE()
822 dnl
823 dnl Detect whether the tcl system has changed since our last
824 dnl configure run. Set egg_tcl_changed accordingly.
825 dnl
826 dnl Tcl related feature and version checks should re-run their
827 dnl checks as soon as egg_tcl_changed is set to "yes".
828 AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
829 AC_MSG_CHECKING(whether the tcl system has changed)
830 egg_tcl_changed=yes
831 egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
832 if test ! "$egg_tcl_id" = ":::"
833 then
834 egg_tcl_cached=yes
835 AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
836 egg_cv_var_tcl_id="$egg_tcl_id"
837 egg_tcl_cached=no
838 ])
839 if test "$egg_tcl_cached" = "yes"
840 then
841 if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
842 then
843 egg_tcl_changed=no
844 else
845 egg_cv_var_tcl_id="$egg_tcl_id"
846 fi
847 fi
848 fi
849 if test "$egg_tcl_changed" = "yes"
850 then
851 AC_MSG_RESULT(yes)
852 else
853 AC_MSG_RESULT(no)
854 fi
855 ])
856
857
858 dnl EGG_TCL_CHECK_VERSION()
859 dnl
860 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
861 # Both TCLLIBFN & TCLINCFN must be set, or we bail
862 TCL_FOUND=0
863 if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
864 then
865 TCL_FOUND=1
866
867 # Check Tcl's version
868 if test "$egg_tcl_changed" = "yes"
869 then
870 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
871 fi
872 AC_MSG_CHECKING(for Tcl version)
873 AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
874 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
875 ])
876
877 if test ! "${egg_cv_var_tcl_version-x}" = "x"
878 then
879 AC_MSG_RESULT($egg_cv_var_tcl_version)
880 else
881 AC_MSG_RESULT(not found)
882 TCL_FOUND=0
883 fi
884
885 # Check Tcl's patch level (if avaliable)
886 if test "$egg_tcl_changed" = "yes"
887 then
888 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
889 fi
890 AC_MSG_CHECKING(for Tcl patch level)
891 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
892 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
893 ])
894
895 if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
896 then
897 AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
898 else
899 egg_cv_var_tcl_patch_level="unknown"
900 AC_MSG_RESULT(unknown)
901 fi
902 fi
903
904 # Check if we found Tcl's version
905 if test "$TCL_FOUND" = 0
906 then
907 cat << 'EOF' >&2
908 configure: error:
909
910 I can't find Tcl on this system.
911
912 Eggdrop requires Tcl to compile. If you already have Tcl installed
913 on this system, and I just wasn't looking in the right place for it,
914 set the environment variables TCLLIB and TCLINC so I will know where
915 to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
916 run 'configure' again.
917
918 Read the README file if you don't know what Tcl is or how to get it
919 and install it.
920
921 EOF
922 exit 1
923 fi
924 ])dnl
925
926
927 dnl EGG_TCL_CHECK_PRE70()
928 dnl
929 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
930 # Is this version of Tcl too old for us to use ?
931 TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
932 if test "$TCL_VER_PRE70" = "yes"
933 then
934 cat << EOF >&2
935 configure: error:
936
937 Your Tcl version is much too old for eggdrop to use.
938 I suggest you download and complie a more recent version.
939 The most reliable current version is $tclrecommendver and
940 can be downloaded from $tclrecommendsite
941
942 EOF
943 exit 1
944 fi
945 ])dnl
946
947
948 dnl EGG_TCL_CHECK_PRE75()
949 dnl
950 AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
951 # Are we using a pre 7.5 Tcl version ?
952 TCL_VER_PRE75=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 5)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
953 if test "$TCL_VER_PRE75" = "yes"
954 then
955 AC_DEFINE(HAVE_PRE7_5_TCL)dnl
956 fi
957 ])dnl
958
959
960 dnl EGG_TCL_TESTLIBS()
961 dnl
962 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
963 # Set variables for Tcl library tests
964 TCL_TEST_LIB="$TCLLIBFNS"
965 TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
966
967 if test ! "${ac_cv_lib_pthread-x}" = "x"
968 then
969 TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
970 fi
971 ])dnl
972
973
974 dnl EGG_TCL_CHECK_FREE()
975 dnl
976 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
977 if test "$egg_tcl_changed" = "yes"
978 then
979 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
980 fi
981
982 # Check for Tcl_Free()
983 AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS)
984
985 if test "$egg_cv_var_tcl_free" = "yes"
986 then
987 AC_DEFINE(HAVE_TCL_FREE)dnl
988 fi
989 ])dnl
990
991
992 dnl EGG_TCL_ENABLE_THREADS()
993 dnl
994 AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl
995 AC_ARG_ENABLE(tcl-threads,
996 [ --disable-tcl-threads Disable threaded tcl support if detected. (Ignore this
997 option unless you know what you are doing)],
998 enable_tcl_threads="$enableval",
999 enable_tcl_threads=yes)
1000 ])dnl
1001
1002
1003 dnl EGG_TCL_CHECK_THREADS()
1004 dnl
1005 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1006 if test "$egg_tcl_changed" = "yes"
1007 then
1008 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1009 fi
1010
1011 # Check for TclpFinalizeThreadData()
1012 AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS)
1013
1014 if test "$egg_cv_var_tcl_threaded" = "yes"
1015 then
1016 if test "$enable_tcl_threads" = "no"
1017 then
1018
1019 cat << 'EOF' >&2
1020 configure: warning:
1021
1022 You have disabled threads support on a system with a threaded Tcl library.
1023 Tcl features that rely on scheduled events may not function properly.
1024
1025 EOF
1026 else
1027 AC_DEFINE(HAVE_TCL_THREADS)dnl
1028 fi
1029
1030 # Add pthread library to $LIBS if we need it
1031 if test ! "${ac_cv_lib_pthread-x}" = "x"
1032 then
1033 LIBS="$ac_cv_lib_pthread $LIBS"
1034 fi
1035 fi
1036 ])dnl
1037
1038
1039 dnl EGG_TCL_LIB_REQS()
1040 dnl
1041 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1042 if test "$ac_cv_cygwin" = "yes"
1043 then
1044 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1045 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1046 else
1047 if test ! "$TCLLIBEXT" = ".a"
1048 then
1049 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1050 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1051 else
1052
1053 # Set default make as static for unshared Tcl library
1054 if test ! "$DEFAULT_MAKE" = "static"
1055 then
1056 cat << 'EOF' >&2
1057 configure: warning:
1058
1059 Your Tcl library is not a shared lib.
1060 configure will now set default make type to static...
1061
1062 EOF
1063 DEFAULT_MAKE=static
1064 AC_SUBST(DEFAULT_MAKE)dnl
1065 fi
1066
1067 # Are we using a pre 7.4 Tcl version ?
1068 TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
1069 if test "$TCL_VER_PRE74" = "no"
1070 then
1071
1072 # Was the --with-tcllib option given ?
1073 if test ! "${tcllibname-x}" = "x"
1074 then
1075 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1076 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1077 else
1078 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1079 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1080 fi
1081 else
1082 cat << EOF >&2
1083 configure: warning:
1084
1085 Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1086 There are known problems, but we will attempt to work around them.
1087
1088 EOF
1089 TCL_REQS="libtcle.a"
1090 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1091 fi
1092 fi
1093 fi
1094 AC_SUBST(TCL_REQS)dnl
1095 AC_SUBST(TCL_LIBS)dnl
1096 ])dnl
1097
1098
1099 dnl EGG_FUNC_DLOPEN()
1100 dnl
1101 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1102 if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1103 then
1104 if test "$LINUX" = "yes"
1105 then
1106 cat << 'EOF' >&2
1107 configure: warning:
1108
1109 Since you are on a Linux system, this has a known problem...
1110 I know a kludge for it,
1111 EOF
1112
1113 if test -r "/lib/libdl.so.1"
1114 then
1115 cat << 'EOF' >&2
1116 and you seem to have it, so we'll do that...
1117
1118 EOF
1119 AC_DEFINE(HAVE_DLOPEN)dnl
1120 LIBS="/lib/libdl.so.1 $LIBS"
1121 else
1122 cat << 'EOF' >&2
1123 which you DON'T seem to have... doh!
1124 perhaps you may still have the stuff lying around somewhere
1125 if you work out where it is, add it to your XLIBS= lines
1126 and #define HAVE_DLOPEN in config.h
1127
1128 we'll proceed on anyway, but you probably won't be able
1129 to 'make eggdrop' but you might be able to make the
1130 static bot (I'll default your make to this version).
1131
1132 EOF
1133 DEFAULT_MAKE=static
1134 fi
1135 else
1136 cat << 'EOF' >&2
1137 configure: warning:
1138
1139 You don't seem to have libdl anywhere I can find it, this will
1140 prevent you from doing dynamic modules, I'll set your default
1141 make to static linking.
1142
1143 EOF
1144 DEFAULT_MAKE=static
1145 fi
1146 fi
1147 ])dnl
1148
1149
1150 dnl EGG_SUBST_MOD_UPDIR()
1151 dnl
1152 dnl Since module's Makefiles aren't generated by configure, some
1153 dnl paths in src/mod/Makefile.in take care of them. For correct
1154 dnl path "calculation", we need to keep absolute paths in mind
1155 dnl (which don't need a "../" pre-pended).
1156 AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1157 case "$srcdir" in
1158 [[\\/]]* | ?:[[\\/]]*)
1159 MOD_UPDIR=""
1160 ;;
1161 *)
1162 MOD_UPDIR="../"
1163 ;;
1164 esac
1165 AC_SUBST(MOD_UPDIR)dnl
1166 ])dnl
1167
1168
1169 dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1170 dnl
1171 dnl Replace FILE-NAME if the newly created contents differs from the existing
1172 dnl file contents. Otherwise leave the file allone. This avoids needless
1173 dnl recompiles.
1174 dnl
1175 define(EGG_REPLACE_IF_CHANGED, [dnl
1176 AC_OUTPUT_COMMANDS([
1177 egg_replace_file="$1"
1178 echo "creating $1"
1179 $2
1180 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1181 then
1182 echo "$1 is unchanged"
1183 else
1184 mv conftest.out $egg_replace_file
1185 fi
1186 rm -f conftest.out], [$3])dnl
1187 ])dnl
1188
1189
1190 dnl EGG_TCL_LUSH()
1191 dnl
1192 AC_DEFUN(EGG_TCL_LUSH, [dnl
1193 EGG_REPLACE_IF_CHANGED(lush.h, [
1194 cat > conftest.out << EGGEOF
1195 /* Ignore me but do not erase me. I am a kludge. */
1196
1197 #include "$egg_tclinc/$egg_tclincfn"
1198 EGGEOF], [
1199 egg_tclinc="$TCLINC"
1200 egg_tclincfn="$TCLINCFN"])dnl
1201 ])dnl
1202
1203
1204 dnl EGG_CATCH_MAKEFILE_REBUILD()
1205 dnl
1206 AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1207 AC_OUTPUT_COMMANDS([
1208 if test -f .modules
1209 then
1210 $ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile
1211 fi])
1212 ])dnl
1213
1214
1215 dnl EGG_SAVE_PARAMETERS()
1216 dnl
1217 AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1218 dnl Normally, we shouldn't use this level as it's not intended for this
1219 dnl type of code, but there's no other way to run it before the main
1220 dnl parameter loop in configure.
1221 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
1222 egg_ac_parameters="[$]*"
1223 AC_DIVERT_POP()dnl to NORMAL
1224 AC_SUBST(egg_ac_parameters)dnl
1225 ])dnl
1226
1227 AC_DEFUN([AC_PROG_CC_WIN32], [
1228 AC_MSG_CHECKING([how to access the Win32 API])
1229 WIN32FLAGS=
1230 AC_TRY_COMPILE(,[
1231 #ifndef WIN32
1232 # ifndef _WIN32
1233 # error WIN32 or _WIN32 not defined
1234 # endif
1235 #endif], [
1236 dnl found windows.h with the current config.
1237 AC_MSG_RESULT([present by default])
1238 ], [
1239 dnl try -mwin32
1240 ac_compile_save="$ac_compile"
1241 dnl we change CC so config.log looks correct
1242 save_CC="$CC"
1243 ac_compile="$ac_compile -mwin32"
1244 CC="$CC -mwin32"
1245 AC_TRY_COMPILE(,[
1246 #ifndef WIN32
1247 # ifndef _WIN32
1248 # error WIN32 or _WIN32 not defined
1249 # endif
1250 #endif], [
1251 dnl found windows.h using -mwin32
1252 AC_MSG_RESULT([found via -mwin32])
1253 ac_compile="$ac_compile_save"
1254 CC="$save_CC"
1255 WIN32FLAGS="-mwin32"
1256 ], [
1257 ac_compile="$ac_compile_save"
1258 CC="$save_CC"
1259 AC_MSG_RESULT([not found])
1260 ])
1261 ])
1262
1263 ])
1264 dnl
1265
1266
1267 dnl EGG_ENABLE_IPV6()
1268 dnl
1269 AC_DEFUN(EGG_ENABLE_IPV6, [dnl
1270 AC_MSG_CHECKING(whether you enabled IPv6 support)
1271 AC_ARG_ENABLE(ipv6,
1272 [ --enable-ipv6 Enable IPV6 support.
1273 --disable-ipv6 Disable IPV6 support. ],
1274 [ ac_cv_ipv6=$enableval
1275 AC_MSG_RESULT($ac_cv_ipv6)
1276 ], [
1277 if test "x$egg_cv_ipv6_supported" = "xyes"; then
1278 ac_cv_ipv6='yes'
1279 else
1280 ac_cv_ipv6='no'
1281 fi
1282 AC_MSG_RESULT((default) $ac_cv_ipv6)
1283 ])
1284 if test "$ac_cv_ipv6" = "yes" ; then
1285 AC_DEFINE(IPV6)
1286 fi
1287 ])dnl
1288
1289
1290 dnl EGG_TYPE_SOCKLEN_T
1291 dnl
1292 AC_DEFUN(EGG_TYPE_SOCKLEN_T, [dnl
1293 AC_CACHE_CHECK(for socklen_t, egg_cv_var_socklen_t, [
1294 AC_TRY_COMPILE([#include <sys/param.h>
1295 #include <sys/socket.h>
1296 #include <sys/types.h>
1297 ], [
1298 socklen_t x;
1299 x = 0;
1300 ], egg_cv_var_socklen_t="yes", egg_cv_var_socklen_t="no")
1301 ])
1302 if test "$egg_cv_var_socklen_t" = "no"
1303 then
1304 AC_DEFINE(socklen_t, unsigned)dnl
1305 fi
1306 ])dnl
1307
1308
1309 dnl EGG_INADDR_LOOPBACK
1310 dnl
1311 AC_DEFUN(EGG_INADDR_LOOPBACK, [dnl
1312 AC_MSG_CHECKING(for INADDR_LOOPBACK)
1313 AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
1314 AC_TRY_COMPILE([
1315 #include <sys/socket.h>
1316 #include <netinet/in.h>
1317 #include <arpa/inet.h>
1318 ],[
1319 INADDR_LOOPBACK;
1320 ],
1321 adns_cv_decl_inaddrloopback=yes,
1322 adns_cv_decl_inaddrloopback=no)])
1323 if test "$adns_cv_decl_inaddrloopback" = yes; then
1324 AC_MSG_RESULT(found)
1325 else
1326 AC_MSG_RESULT([not in standard headers, urgh...])
1327 AC_CHECK_HEADER(rpc/types.h,[
1328 AC_DEFINE(HAVEUSE_RPCTYPES_H)
1329 ],[
1330 AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
1331 ])
1332 fi
1333 ])dnl
1334
1335 dnl EGG_IPV6_SUPPORTED
1336 dnl
1337 AC_DEFUN(EGG_IPV6_SUPPORTED, [dnl
1338 AC_MSG_CHECKING(for kernel IPv6 support)
1339 AC_CACHE_VAL(egg_cv_ipv6_supported,[
1340 AC_TRY_RUN_NATIVE([
1341 #include <fcntl.h>
1342 #include <sys/socket.h>
1343 #include <sys/types.h>
1344 #include <netinet/in.h>
1345 #include <unistd.h>
1346 #include <errno.h>
1347 #include <stdio.h>
1348
1349 int main()
1350 {
1351 struct sockaddr_in6 sin6;
1352 int s = socket(AF_INET6, SOCK_STREAM, 0);
1353 if (s != -1)
1354 close(s);
1355 return s == -1;
1356 }
1357 ], egg_cv_ipv6_supported=yes, egg_cv_ipv6_supported=no)])
1358 if test "$egg_cv_ipv6_supported" = yes; then
1359 AC_MSG_RESULT(yes)
1360 else
1361 AC_MSG_RESULT(no)
1362 fi
1363 ])dnl
1364
1365 dnl EGG_DEFINE_VERSION_NUM
1366 dnl
1367 AC_DEFUN(EGG_DEFINE_VERSION_NUM, [dnl
1368 egg_version_num=`echo $VERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d00", [$]1, [$]2, [$]3)}'`
1369 AC_DEFINE_UNQUOTED(VERSION_NUM, $egg_version_num)
1370 ])dnl
1371
1372 dnl EGG_GNU_GETTEXT
1373 dnl
1374 AC_DEFUN(EGG_GNU_GETTEXT, [dnl
1375 AC_MSG_CHECKING(for avaible translations)
1376 ALL_LINGUAS=""
1377 cd po
1378 for LOC in `ls *.po 2> /dev/null`; do
1379 ALL_LINGUAS="$ALL_LINGUAS `echo $LOC | awk 'BEGIN {FS = "."} {printf("%s", [$]1)}'`"
1380 done
1381 cd ..
1382 AC_MSG_RESULT($ALL_LINGUAS)
1383
1384 AM_GNU_GETTEXT
1385 ])dnl
1386
1387 #serial AM1
1388
1389 dnl From Bruno Haible.
1390
1391 AC_DEFUN([AM_LANGINFO_CODESET],
1392 [
1393 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1394 [AC_TRY_LINK([#include <langinfo.h>],
1395 [char* cs = nl_langinfo(CODESET);],
1396 am_cv_langinfo_codeset=yes,
1397 am_cv_langinfo_codeset=no)
1398 ])
1399 if test $am_cv_langinfo_codeset = yes; then
1400 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1401 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1402 fi
1403 ])
1404 # Macro to add for using GNU gettext.
1405 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1406 #
1407 # This file can be copied and used freely without restrictions. It can
1408 # be used in projects which are not available under the GNU General Public
1409 # License but which still want to provide support for the GNU gettext
1410 # functionality.
1411 # Please note that the actual code of GNU gettext is covered by the GNU
1412 # General Public License and is *not* in the public domain.
1413
1414 # serial 10
1415
1416 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1417 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1418 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1419 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1420 dnl AM-DISABLE-SHARED). Otherwise, a static library
1421 dnl $(top_builddir)/intl/libintl.a will be created.
1422 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1423 dnl implementations (in libc or libintl) without the ngettext() function
1424 dnl will be ignored.
1425 dnl LIBDIR is used to find the intl libraries. If empty,
1426 dnl the value `$(top_builddir)/intl/' is used.
1427 dnl
1428 dnl The result of the configuration is one of three cases:
1429 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1430 dnl and used.
1431 dnl Catalog format: GNU --> install in $(datadir)
1432 dnl Catalog extension: .mo after installation, .gmo in source tree
1433 dnl 2) GNU gettext has been found in the system's C library.
1434 dnl Catalog format: GNU --> install in $(datadir)
1435 dnl Catalog extension: .mo after installation, .gmo in source tree
1436 dnl 3) No internationalization, always use English msgid.
1437 dnl Catalog format: none
1438 dnl Catalog extension: none
1439 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1440 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1441 dnl but we keep it in order not to force irrelevant filename changes on the
1442 dnl maintainers.
1443 dnl
1444 AC_DEFUN([AM_WITH_NLS],
1445 [AC_MSG_CHECKING([whether NLS is requested])
1446 dnl Default is enabled NLS
1447 AC_ARG_ENABLE(nls,
1448 [ --disable-nls do not use Native Language Support],
1449 USE_NLS=$enableval, USE_NLS=yes)
1450 AC_MSG_RESULT($USE_NLS)
1451 AC_SUBST(USE_NLS)
1452
1453 BUILD_INCLUDED_LIBINTL=no
1454 USE_INCLUDED_LIBINTL=no
1455 INTLLIBS=
1456
1457 dnl If we use NLS figure out what method
1458 if test "$USE_NLS" = "yes"; then
1459 AC_DEFINE(ENABLE_NLS, 1,
1460 [Define to 1 if translation of program messages to the user's native language
1461 is requested.])
1462 AC_MSG_CHECKING([whether included gettext is requested])
1463 AC_ARG_WITH(included-gettext,
1464 [ --with-included-gettext use the GNU gettext library included here],
1465 nls_cv_force_use_gnu_gettext=$withval,
1466 nls_cv_force_use_gnu_gettext=no)
1467 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1468
1469 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1470 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1471 dnl User does not insist on using GNU NLS library. Figure out what
1472 dnl to use. If GNU gettext is available we use this. Else we have
1473 dnl to fall back to GNU NLS library.
1474 CATOBJEXT=NONE
1475
1476 dnl Add a version number to the cache macros.
1477 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1478 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1479
1480 AC_CHECK_HEADER(libintl.h,
1481 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1482 [AC_TRY_LINK([#include <libintl.h>
1483 extern int _nl_msg_cat_cntr;],
1484 [bindtextdomain ("", "");
1485 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1486 gt_cv_func_gnugettext_libc=yes,
1487 gt_cv_func_gnugettext_libc=no)])
1488
1489 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1490 AC_CACHE_CHECK([for GNU gettext in libintl],
1491 gt_cv_func_gnugettext_libintl,
1492 [gt_save_LIBS="$LIBS"
1493 LIBS="$LIBS -lintl $LIBICONV"
1494 AC_TRY_LINK([#include <libintl.h>
1495 extern int _nl_msg_cat_cntr;],
1496 [bindtextdomain ("", "");
1497 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1498 gt_cv_func_gnugettext_libintl=yes,
1499 gt_cv_func_gnugettext_libintl=no)
1500 LIBS="$gt_save_LIBS"])
1501 fi
1502
1503 dnl If an already present or preinstalled GNU gettext() is found,
1504 dnl use it. But if this macro is used in GNU gettext, and GNU
1505 dnl gettext is already preinstalled in libintl, we update this
1506 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1507 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1508 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1509 && test "$PACKAGE" != gettext; }; then
1510 AC_DEFINE(HAVE_GETTEXT, 1,
1511 [Define if the GNU gettext() function is already present or preinstalled.])
1512
1513 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1514 dnl If iconv() is in a separate libiconv library, then anyone
1515 dnl linking with libintl{.a,.so} also needs to link with
1516 dnl libiconv.
1517 INTLLIBS="-lintl $LIBICONV"
1518 fi
1519
1520 gt_save_LIBS="$LIBS"
1521 LIBS="$LIBS $INTLLIBS"
1522 AC_CHECK_FUNCS(dcgettext)
1523 LIBS="$gt_save_LIBS"
1524
1525 dnl Search for GNU msgfmt in the PATH.
1526 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1527 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1528 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1529
1530 dnl Search for GNU xgettext in the PATH.
1531 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1532 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1533
1534 CATOBJEXT=.gmo
1535 fi
1536 ])
1537
1538 if test "$CATOBJEXT" = "NONE"; then
1539 dnl GNU gettext is not found in the C library.
1540 dnl Fall back on GNU gettext library.
1541 nls_cv_use_gnu_gettext=yes
1542 fi
1543 fi
1544
1545 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1546 dnl Mark actions used to generate GNU NLS library.
1547 INTLOBJS="\$(GETTOBJS)"
1548 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1549 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1550 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1551 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1552 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1553 AC_SUBST(MSGFMT)
1554 BUILD_INCLUDED_LIBINTL=yes
1555 USE_INCLUDED_LIBINTL=yes
1556 CATOBJEXT=.gmo
1557 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1558 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1559 fi
1560
1561 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1562 dnl Test whether we really found GNU msgfmt.
1563 if test "$GMSGFMT" != ":"; then
1564 dnl If it is no GNU msgfmt we define it as : so that the
1565 dnl Makefiles still can work.
1566 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1567 : ;
1568 else
1569 AC_MSG_RESULT(
1570 [found msgfmt program is not GNU msgfmt; ignore it])
1571 GMSGFMT=":"
1572 fi
1573 fi
1574
1575 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1576 dnl Test whether we really found GNU xgettext.
1577 if test "$XGETTEXT" != ":"; then
1578 dnl If it is no GNU xgettext we define it as : so that the
1579 dnl Makefiles still can work.
1580 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1581 : ;
1582 else
1583 AC_MSG_RESULT(
1584 [found xgettext program is not GNU xgettext; ignore it])
1585 XGETTEXT=":"
1586 fi
1587 fi
1588
1589 dnl We need to process the po/ directory.
1590 POSUB=po
1591 fi
1592 AC_OUTPUT_COMMANDS(
1593 [for ac_file in $CONFIG_FILES; do
1594 # Support "outfile[:infile[:infile...]]"
1595 case "$ac_file" in
1596 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1597 esac
1598 # PO directories have a Makefile.in generated from Makefile.in.in.
1599 case "$ac_file" in */Makefile.in)
1600 # Adjust a relative srcdir.
1601 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1602 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1603 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1604 # In autoconf-2.13 it is called $ac_given_srcdir.
1605 # In autoconf-2.50 it is called $srcdir.
1606 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1607 case "$ac_given_srcdir" in
1608 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1609 /*) top_srcdir="$ac_given_srcdir" ;;
1610 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1611 esac
1612 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1613 rm -f "$ac_dir/POTFILES"
1614 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1615 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1616 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1617 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1618 fi
1619 ;;
1620 esac
1621 done])
1622
1623
1624 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1625 dnl to 'yes' because some of the testsuite requires it.
1626 if test "$PACKAGE" = gettext; then
1627 BUILD_INCLUDED_LIBINTL=yes
1628 fi
1629
1630 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1631 dnl because plural.y uses bison specific features. It requires at least
1632 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1633 dnl compile.
1634 dnl bison is only needed for the maintainer (who touches plural.y). But in
1635 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1636 dnl the rule in general Makefile. Now, some people carelessly touch the
1637 dnl files or have a broken "make" program, hence the plural.c rule will
1638 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1639 dnl present or too old.
1640 AC_CHECK_PROGS([INTLBISON], [bison])
1641 if test -z "$INTLBISON"; then
1642 ac_verc_fail=yes
1643 else
1644 dnl Found it, now check the version.
1645 AC_MSG_CHECKING([version of bison])
1646 changequote(<<,>>)dnl
1647 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1648 case $ac_prog_version in
1649 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1650 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1651 changequote([,])dnl
1652 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1653 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1654 esac
1655 AC_MSG_RESULT([$ac_prog_version])
1656 fi
1657 if test $ac_verc_fail = yes; then
1658 INTLBISON=:
1659 fi
1660
1661 dnl These rules are solely for the distribution goal. While doing this
1662 dnl we only have to keep exactly one list of the available catalogs
1663 dnl in configure.in.
1664 for lang in $ALL_LINGUAS; do
1665 GMOFILES="$GMOFILES $lang.gmo"
1666 POFILES="$POFILES $lang.po"
1667 done
1668
1669 dnl Make all variables we use known to autoconf.
1670 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1671 AC_SUBST(USE_INCLUDED_LIBINTL)
1672 AC_SUBST(CATALOGS)
1673 AC_SUBST(CATOBJEXT)
1674 AC_SUBST(GMOFILES)
1675 AC_SUBST(INTLLIBS)
1676 AC_SUBST(INTLOBJS)
1677 AC_SUBST(POFILES)
1678 AC_SUBST(POSUB)
1679
1680 dnl For backward compatibility. Some configure.ins may be using this.
1681 nls_cv_header_intl=
1682 nls_cv_header_libgt=
1683
1684 dnl For backward compatibility. Some Makefiles may be using this.
1685 DATADIRNAME=share
1686 AC_SUBST(DATADIRNAME)
1687
1688 dnl For backward compatibility. Some Makefiles may be using this.
1689 INSTOBJEXT=.mo
1690 AC_SUBST(INSTOBJEXT)
1691
1692 dnl For backward compatibility. Some Makefiles may be using this.
1693 GENCAT=gencat
1694 AC_SUBST(GENCAT)
1695 ])
1696
1697 dnl Usage: Just like AM_WITH_NLS, which see.
1698 AC_DEFUN([AM_GNU_GETTEXT],
1699 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1700 AC_REQUIRE([AC_PROG_CC])dnl
1701 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1702 AC_REQUIRE([AC_PROG_RANLIB])dnl
1703 AC_REQUIRE([AC_ISC_POSIX])dnl
1704 AC_REQUIRE([AC_HEADER_STDC])dnl
1705 AC_REQUIRE([AC_C_CONST])dnl
1706 AC_REQUIRE([AC_C_INLINE])dnl
1707 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1708 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1709 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1710 AC_REQUIRE([AC_FUNC_MMAP])dnl
1711 AC_REQUIRE([jm_GLIBC21])dnl
1712
1713 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1714 stdlib.h string.h unistd.h sys/param.h])
1715 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1716 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1717 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1718
1719 AM_ICONV
1720 AM_LANGINFO_CODESET
1721 AM_LC_MESSAGES
1722 AM_WITH_NLS([$1],[$2],[$3])
1723
1724 if test "x$CATOBJEXT" != "x"; then
1725 if test "x$ALL_LINGUAS" = "x"; then
1726 LINGUAS=
1727 else
1728 AC_MSG_CHECKING(for catalogs to be installed)
1729 NEW_LINGUAS=
1730 for presentlang in $ALL_LINGUAS; do
1731 useit=no
1732 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1733 # Use the presentlang catalog if desiredlang is
1734 # a. equal to presentlang, or
1735 # b. a variant of presentlang (because in this case,
1736 # presentlang can be used as a fallback for messages
1737 # which are not translated in the desiredlang catalog).
1738 case "$desiredlang" in
1739 "$presentlang"*) useit=yes;;
1740 esac
1741 done
1742 if test $useit = yes; then
1743 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1744 fi
1745 done
1746 LINGUAS=$NEW_LINGUAS
1747 AC_MSG_RESULT($LINGUAS)
1748 fi
1749
1750 dnl Construct list of names of catalog files to be constructed.
1751 if test -n "$LINGUAS"; then
1752 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1753 fi
1754 fi
1755
1756 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1757 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1758 dnl Try to locate is.
1759 MKINSTALLDIRS=
1760 if test -n "$ac_aux_dir"; then
1761 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1762 fi
1763 if test -z "$MKINSTALLDIRS"; then
1764 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1765 fi
1766 AC_SUBST(MKINSTALLDIRS)
1767
1768 dnl Enable libtool support if the surrounding package wishes it.
1769 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1770 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1771 ])
1772 #serial 2
1773
1774 # Test for the GNU C Library, version 2.1 or newer.
1775 # From Bruno Haible.
1776
1777 AC_DEFUN([jm_GLIBC21],
1778 [
1779 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1780 ac_cv_gnu_library_2_1,
1781 [AC_EGREP_CPP([Lucky GNU user],
1782 [
1783 #include <features.h>
1784 #ifdef __GNU_LIBRARY__
1785 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1786 Lucky GNU user
1787 #endif
1788 #endif
1789 ],
1790 ac_cv_gnu_library_2_1=yes,
1791 ac_cv_gnu_library_2_1=no)
1792 ]
1793 )
1794 AC_SUBST(GLIBC21)
1795 GLIBC21="$ac_cv_gnu_library_2_1"
1796 ]
1797 )
1798 #serial AM2
1799
1800 dnl From Bruno Haible.
1801
1802 AC_DEFUN([AM_ICONV],
1803 [
1804 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1805 dnl those with the standalone portable GNU libiconv installed).
1806
1807 AC_ARG_WITH([libiconv-prefix],
1808 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1809 for dir in `echo "$withval" | tr : ' '`; do
1810 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1811 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1812 done
1813 ])
1814
1815 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1816 am_cv_func_iconv="no, consider installing GNU libiconv"
1817 am_cv_lib_iconv=no
1818 AC_TRY_LINK([#include <stdlib.h>
1819 #include <iconv.h>],
1820 [iconv_t cd = iconv_open("","");
1821 iconv(cd,NULL,NULL,NULL,NULL);
1822 iconv_close(cd);],
1823 am_cv_func_iconv=yes)
1824 if test "$am_cv_func_iconv" != yes; then
1825 am_save_LIBS="$LIBS"
1826 LIBS="$LIBS -liconv"
1827 AC_TRY_LINK([#include <stdlib.h>
1828 #include <iconv.h>],
1829 [iconv_t cd = iconv_open("","");
1830 iconv(cd,NULL,NULL,NULL,NULL);
1831 iconv_close(cd);],
1832 am_cv_lib_iconv=yes
1833 am_cv_func_iconv=yes)
1834 LIBS="$am_save_LIBS"
1835 fi
1836 ])
1837 if test "$am_cv_func_iconv" = yes; then
1838 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1839 AC_MSG_CHECKING([for iconv declaration])
1840 AC_CACHE_VAL(am_cv_proto_iconv, [
1841 AC_TRY_COMPILE([
1842 #include <stdlib.h>
1843 #include <iconv.h>
1844 extern
1845 #ifdef __cplusplus
1846 "C"
1847 #endif
1848 #if defined(__STDC__) || defined(__cplusplus)
1849 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1850 #else
1851 size_t iconv();
1852 #endif
1853 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1854 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
1855 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1856 AC_MSG_RESULT([$]{ac_t:-
1857 }[$]am_cv_proto_iconv)
1858 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1859 [Define as const if the declaration of iconv() needs const.])
1860 fi
1861 LIBICONV=
1862 if test "$am_cv_lib_iconv" = yes; then
1863 LIBICONV="-liconv"
1864 fi
1865 AC_SUBST(LIBICONV)
1866 ])
1867 #serial 1
1868 # This test replaces the one in autoconf.
1869 # Currently this macro should have the same name as the autoconf macro
1870 # because gettext's gettext.m4 (distributed in the automake package)
1871 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1872 # give these diagnostics:
1873 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1874 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1875
1876 undefine([AC_ISC_POSIX])
1877
1878 AC_DEFUN([AC_ISC_POSIX],
1879 [
1880 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1881 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1882 ]
1883 )
1884 # Check whether LC_MESSAGES is available in <locale.h>.
1885 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1886 #
1887 # This file can be copied and used freely without restrictions. It can
1888 # be used in projects which are not available under the GNU General Public
1889 # License but which still want to provide support for the GNU gettext
1890 # functionality.
1891 # Please note that the actual code of GNU gettext is covered by the GNU
1892 # General Public License and is *not* in the public domain.
1893
1894 # serial 2
1895
1896 AC_DEFUN([AM_LC_MESSAGES],
1897 [if test $ac_cv_header_locale_h = yes; then
1898 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1899 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1900 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1901 if test $am_cv_val_LC_MESSAGES = yes; then
1902 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1903 [Define if your <locale.h> file defines LC_MESSAGES.])
1904 fi
1905 fi])
1906 # Search path for a program which passes the given test.
1907 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1908 #
1909 # This file can be copied and used freely without restrictions. It can
1910 # be used in projects which are not available under the GNU General Public
1911 # License but which still want to provide support for the GNU gettext
1912 # functionality.
1913 # Please note that the actual code of GNU gettext is covered by the GNU
1914 # General Public License and is *not* in the public domain.
1915
1916 # serial 2
1917
1918 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1919 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1920 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1921 [# Extract the first word of "$2", so it can be a program name with args.
1922 set dummy $2; ac_word=[$]2
1923 AC_MSG_CHECKING([for $ac_word])
1924 AC_CACHE_VAL(ac_cv_path_$1,
1925 [case "[$]$1" in
1926 /*)
1927 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1928 ;;
1929 *)
1930 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1931 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1932 test -z "$ac_dir" && ac_dir=.
1933 if test -f $ac_dir/$ac_word; then
1934 if [$3]; then
1935 ac_cv_path_$1="$ac_dir/$ac_word"
1936 break
1937 fi
1938 fi
1939 done
1940 IFS="$ac_save_ifs"
1941 dnl If no 4th arg is given, leave the cache variable unset,
1942 dnl so AC_PATH_PROGS will keep looking.
1943 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1944 ])dnl
1945 ;;
1946 esac])dnl
1947 $1="$ac_cv_path_$1"
1948 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1949 AC_MSG_RESULT([$]$1)
1950 else
1951 AC_MSG_RESULT(no)
1952 fi
1953 AC_SUBST($1)dnl
1954 ])

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23