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

Annotation of /eggdrop1.9/aclocal.m4

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


Revision 1.53 - (hide annotations) (download)
Tue Aug 21 00:21:17 2001 UTC (20 years, 2 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 fabian 1.4 dnl aclocal.m4
2     dnl macros autoconf uses when building configure from configure.in
3     dnl
4 ite 1.53 dnl $Id: aclocal.m4,v 1.52 2001/08/19 02:24:40 drummer Exp $
5 fabian 1.13 dnl
6    
7    
8     dnl EGG_MSG_CONFIGURE_START()
9 fabian 1.4 dnl
10 fabian 1.1 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 fabian 1.13
18    
19     dnl EGG_MSG_CONFIGURE_END()
20 fabian 1.4 dnl
21 fabian 1.1 AC_DEFUN(EGG_MSG_CONFIGURE_END, [dnl
22     AC_MSG_RESULT()
23     AC_MSG_RESULT(Configure is done.)
24     AC_MSG_RESULT()
25 fabian 1.10 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 fabian 1.1 if test -f "./$EGGEXEC"
29     then
30 fabian 1.10 AC_MSG_RESULT([After that, type 'make clean' and then 'make' to create the bot.])
31 fabian 1.1 else
32 fabian 1.10 AC_MSG_RESULT([After that, type 'make' to create the bot.])
33 fabian 1.1 fi
34     AC_MSG_RESULT()
35     ])dnl
36 fabian 1.13
37    
38     dnl EGG_CHECK_CC()
39 fabian 1.4 dnl
40 fabian 1.13 dnl FIXME: make a better test
41 guppy 1.41 dnl
42 fabian 1.1 AC_DEFUN(EGG_CHECK_CC, [dnl
43 guppy 1.41 if test "${cross_compiling-x}" = "x"
44 fabian 1.1 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 fabian 1.13
56    
57 fabian 1.28 dnl EGG_CHECK_CCPIPE()
58 fabian 1.27 dnl
59 fabian 1.28 dnl Checks whether the compiler supports the `-pipe' flag, which
60     dnl speeds up the compilation.
61     AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
62 fabian 1.27 if test -z "$no_pipe"
63     then
64     if test -n "$GCC"
65     then
66 guppy 1.41 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
67 fabian 1.27 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 guppy 1.41 if test "$egg_cv_var_ccpipe" = "yes"
73     then
74 fabian 1.27 CC="$CC -pipe"
75     fi
76     fi
77     fi
78     ])dnl
79    
80    
81 fabian 1.13 dnl EGG_PROG_STRIP()
82 fabian 1.4 dnl
83 fabian 1.2 AC_DEFUN(EGG_PROG_STRIP, [dnl
84 guppy 1.41 AC_CHECK_PROG(STRIP, strip, strip)
85     if test "${STRIP-x}" = "x"
86 fabian 1.1 then
87     STRIP=touch
88     fi
89     ])dnl
90 fabian 1.13
91    
92     dnl EGG_PROG_AWK()
93 fabian 1.4 dnl
94 fabian 1.1 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 guppy 1.41 if test "${AWK-x}" = "x"
98 fabian 1.1 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 fabian 1.13
110    
111     dnl EGG_PROG_BASENAME()
112 fabian 1.4 dnl
113 fabian 1.1 AC_DEFUN(EGG_PROG_BASENAME, [dnl
114     # basename is needed for Tcl library and header checks
115     AC_CHECK_PROG(BASENAME, basename, basename)
116 guppy 1.41 if test "${BASENAME-x}" = "x"
117 fabian 1.1 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 fabian 1.13
129    
130     dnl EGG_CHECK_OS()
131 fabian 1.4 dnl
132 guppy 1.41 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 fabian 1.1 AC_DEFUN(EGG_CHECK_OS, [dnl
137     LINUX=no
138     IRIX=no
139     SUNOS=no
140     HPUX=no
141 guppy 1.41 MOD_CC="$CC"
142     MOD_LD="$CC"
143     MOD_STRIP="$STRIP"
144     SHLIB_CC="$CC"
145     SHLIB_LD="$CC"
146     SHLIB_STRIP="$STRIP"
147 fabian 1.1 NEED_DL=1
148     DEFAULT_MAKE=debug
149 fabian 1.20 MOD_EXT=so
150 fabian 1.1
151 guppy 1.41 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 fabian 1.1
154 guppy 1.41 case "$egg_cv_var_system_type" in
155 fabian 1.1 BSD/OS)
156 guppy 1.41 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
157 fabian 1.14 2)
158     NEED_DL=0
159     DEFAULT_MAKE=static
160     ;;
161     3)
162     MOD_CC=shlicc
163     MOD_LD=shlicc
164 guppy 1.41 MOD_STRIP="$STRIP -d"
165 fabian 1.14 SHLIB_LD="shlicc -r"
166     SHLIB_STRIP=touch
167     AC_DEFINE(MODULES_OK)dnl
168     ;;
169     *)
170     CFLAGS="$CFLAGS -Wall"
171 guppy 1.41 MOD_LD="$CC"
172     MOD_STRIP="$STRIP -d"
173     SHLIB_CC="$CC -export-dynamic -fPIC"
174     SHLIB_LD="$CC -shared -nostartfiles"
175 fabian 1.14 AC_DEFINE(MODULES_OK)dnl
176     ;;
177     esac
178 guppy 1.41 ;;
179 fabian 1.1 CYGWIN*)
180 guppy 1.41 case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
181     1.*)
182 guppy 1.40 NEED_DL=0
183 guppy 1.41 SHLIB_LD="$CC -shared"
184 guppy 1.44 AC_PROG_CC_WIN32
185     CC="$CC $WIN32FLAGS"
186 guppy 1.41 MOD_CC="$CC"
187     MOD_LD="$CC"
188     AC_MSG_CHECKING(for /usr/lib/binmode.o)
189 guppy 1.42 if test -r /usr/lib/binmode.o
190 guppy 1.41 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 fabian 1.20 MOD_EXT=dll
198     AC_DEFINE(MODULES_OK)dnl
199     ;;
200     *)
201     NEED_DL=0
202     DEFAULT_MAKE=static
203 guppy 1.41 AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
204 fabian 1.20 ;;
205     esac
206 guppy 1.41 ;;
207 fabian 1.1 HP-UX)
208     HPUX=yes
209 guppy 1.41 MOD_LD="$CC -fPIC -shared"
210     SHLIB_CC="$CC -fPIC"
211 fabian 1.1 SHLIB_LD="ld -b"
212     NEED_DL=0
213     AC_DEFINE(MODULES_OK)dnl
214     AC_DEFINE(HPUX_HACKS)dnl
215 guppy 1.41 if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
216 fabian 1.1 then
217     AC_DEFINE(HPUX10_HACKS)dnl
218     fi
219 guppy 1.41 ;;
220 fabian 1.17 dell)
221     AC_MSG_RESULT(Dell SVR4)
222     SHLIB_STRIP=touch
223     NEED_DL=0
224 guppy 1.41 MOD_LD="$CC -lelf -lucb"
225     ;;
226 guppy 1.33 IRIX)
227 fabian 1.28 SHLIB_LD="ld -n32 -shared -rdata_shared"
228 fabian 1.1 IRIX=yes
229 fabian 1.28 SHLIB_STRIP=touch
230 fabian 1.1 NEED_DL=0
231     DEFAULT_MAKE=static
232 guppy 1.41 ;;
233 fabian 1.11 Ultrix)
234     NEED_DL=0
235     SHLIB_STRIP=touch
236 fabian 1.28 DEFAULT_MAKE=static
237 fabian 1.21 SHELL=/bin/sh5
238 guppy 1.41 ;;
239 fabian 1.23 SINIX*)
240     NEED_DL=0
241     SHLIB_STRIP=touch
242 fabian 1.28 DEFAULT_MAKE=static
243 fabian 1.23 SHLIB_CC="cc -G"
244 guppy 1.41 ;;
245 fabian 1.11 BeOS)
246     NEED_DL=0
247     SHLIB_STRIP=strip
248 fabian 1.28 DEFAULT_MAKE=static
249 guppy 1.41 ;;
250 fabian 1.1 Linux)
251     LINUX=yes
252     CFLAGS="$CFLAGS -Wall"
253 guppy 1.41 MOD_LD="$CC"
254     SHLIB_CC="$CC -fPIC"
255     SHLIB_LD="$CC -shared -nostartfiles"
256 fabian 1.1 AC_DEFINE(MODULES_OK)dnl
257 guppy 1.41 ;;
258 fabian 1.1 Lynx)
259 guppy 1.41 NEED_DL=0
260 fabian 1.28 DEFAULT_MAKE=static
261 guppy 1.43 SHLIB_STRIP=strip
262     ;;
263     QNX)
264     NEED_DL=0
265     DEFAULT_MAKE=static
266     SHLIB_LD="ld -shared"
267 fabian 1.28 SHLIB_STRIP=strip
268 guppy 1.41 ;;
269 fabian 1.1 OSF1)
270 guppy 1.41 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
271 fabian 1.1 V*)
272 guppy 1.41 # FIXME: we should check this in a seperate test
273     # Digital OSF uses an ancient version of gawk
274     if test "$AWK" = "gawk"
275 fabian 1.1 then
276     AWK=awk
277     fi
278     MOD_CC=cc
279     MOD_LD=cc
280     SHLIB_CC=cc
281 fabian 1.19 SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
282 fabian 1.1 SHLIB_STRIP=touch
283     AC_DEFINE(MODULES_OK)dnl
284 guppy 1.41 ;;
285 fabian 1.1 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 guppy 1.41 ;;
290 fabian 1.1 1.*)
291 guppy 1.41 SHLIB_CC="$CC -fpic"
292 fabian 1.1 SHLIB_LD="ld -shared"
293     AC_DEFINE(MODULES_OK)dnl
294     AC_DEFINE(OSF1_HACKS)dnl
295 guppy 1.41 ;;
296 fabian 1.1 *)
297     NEED_DL=0
298     DEFAULT_MAKE=static
299 guppy 1.41 ;;
300 fabian 1.1 esac
301     AC_DEFINE(STOP_UAC)dnl
302 guppy 1.41 ;;
303 fabian 1.1 SunOS)
304 guppy 1.41 if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5"
305 fabian 1.1 then
306 guppy 1.41 # Solaris
307 guppy 1.32 if test -n "$GCC"
308 guppy 1.41 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 guppy 1.32 fi
315 fabian 1.1 else
316 guppy 1.41 # SunOS 4
317 fabian 1.1 SUNOS=yes
318     SHLIB_LD=ld
319 guppy 1.41 SHLIB_CC="$CC -PIC"
320 fabian 1.1 AC_DEFINE(DLOPEN_1)dnl
321     fi
322     AC_DEFINE(MODULES_OK)dnl
323 guppy 1.41 ;;
324 fabian 1.1 *BSD)
325 guppy 1.41 # FreeBSD/OpenBSD/NetBSD
326     SHLIB_CC="$CC -fPIC"
327 fabian 1.1 SHLIB_LD="ld -Bshareable -x"
328     AC_DEFINE(MODULES_OK)dnl
329 guppy 1.41 ;;
330 fabian 1.1 *)
331 guppy 1.41 AC_MSG_CHECKING(if system is Mach based)
332     if test -r /mach
333 fabian 1.1 then
334 guppy 1.41 AC_MSG_RESULT(yes)
335 fabian 1.1 NEED_DL=0
336     DEFAULT_MAKE=static
337     AC_DEFINE(BORGCUBES)dnl
338     else
339 guppy 1.41 AC_MSG_RESULT(no)
340     AC_MSG_CHECKING(if system is QNX)
341     if test -r /cmds
342 fabian 1.1 then
343 guppy 1.41 AC_MSG_RESULT(yes)
344 fabian 1.1 SHLIB_STRIP=touch
345     NEED_DL=0
346     DEFAULT_MAKE=static
347     else
348 guppy 1.41 AC_MSG_RESULT(no)
349 fabian 1.1 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 guppy 1.41 ;;
356 fabian 1.1 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 fabian 1.20 AC_SUBST(MOD_EXT)dnl
365 guppy 1.41 AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl
366 fabian 1.1 ])dnl
367 fabian 1.13
368    
369     dnl EGG_CHECK_LIBS()
370 fabian 1.4 dnl
371 fabian 1.1 AC_DEFUN(EGG_CHECK_LIBS, [dnl
372 guppy 1.41 # FIXME: this needs to be fixed so that it works on IRIX
373 fabian 1.1 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 fabian 1.22 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
382 fabian 1.1 # This is needed for Tcl libraries compiled with thread support
383 guppy 1.41 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 fabian 1.1 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 fabian 1.13
409    
410     dnl EGG_CHECK_FUNC_VSPRINTF()
411 fabian 1.4 dnl
412 fabian 1.1 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
413     AC_CHECK_FUNCS(vsprintf)
414 guppy 1.41 if test "$ac_cv_func_vsprintf" = "no"
415 fabian 1.1 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 poptix 1.37 fi
425     ])dnl
426 fabian 1.13
427 guppy 1.41
428 fabian 1.13 dnl EGG_HEADER_STDC()
429 fabian 1.4 dnl
430 fabian 1.1 AC_DEFUN(EGG_HEADER_STDC, [dnl
431 guppy 1.41 if test "$ac_cv_header_stdc" = "no"
432 fabian 1.1 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 fabian 1.13
443 guppy 1.41
444 guppy 1.35 dnl EGG_CHECK_LIBSAFE_SSCANF()
445     dnl
446     AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
447 guppy 1.41 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 guppy 1.35 ])
463 guppy 1.41 if test "$egg_cv_var_libsafe_sscanf" = "yes"
464     then
465 guppy 1.35 AC_DEFINE(LIBSAFE_HACKS)dnl
466     fi
467     ])dnl
468 fabian 1.13
469 guppy 1.41
470 fabian 1.13 dnl EGG_CYGWIN()
471 fabian 1.4 dnl
472 fabian 1.28 dnl Check for Cygwin support.
473 fabian 1.1 AC_DEFUN(EGG_CYGWIN, [dnl
474     AC_CYGWIN
475 guppy 1.41 if test "$ac_cv_cygwin" = "yes"
476 fabian 1.1 then
477     AC_DEFINE(CYGWIN_HACKS)dnl
478     fi
479     ])dnl
480 fabian 1.13
481    
482     dnl EGG_EXEEXT()
483 fabian 1.4 dnl
484 fabian 1.28 dnl Test for executable suffix and define eggdrop's executable name
485     dnl accordingly.
486 fabian 1.1 AC_DEFUN(EGG_EXEEXT, [dnl
487     EGGEXEC=eggdrop
488     AC_EXEEXT
489 guppy 1.41 if test ! "${EXEEXT-x}" = "x"
490 fabian 1.1 then
491 guppy 1.41 EGGEXEC="eggdrop$EXEEXT"
492 fabian 1.1 fi
493     AC_SUBST(EGGEXEC)dnl
494     ])dnl
495 fabian 1.13
496    
497     dnl EGG_TCL_ARG_WITH()
498 fabian 1.4 dnl
499 fabian 1.1 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
500     # oohh new configure --variables for those with multiple tcl libs
501 guppy 1.41 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 fabian 1.1
504 fabian 1.3 WARN=0
505 fabian 1.1 # Make sure either both or neither $tcllibname and $tclincname are set
506 guppy 1.41 if test ! "${tcllibname-x}" = "x"
507 fabian 1.1 then
508 guppy 1.41 if test "${tclincname-x}" = "x"
509 fabian 1.1 then
510 fabian 1.3 WARN=1
511 fabian 1.1 tcllibname=""
512     TCLLIB=""
513     TCLINC=""
514     fi
515     else
516 guppy 1.41 if test ! "${tclincname-x}" = "x"
517 fabian 1.1 then
518 fabian 1.3 WARN=1
519     tclincname=""
520     TCLLIB=""
521     TCLINC=""
522     fi
523     fi
524 guppy 1.41 if test "$WARN" = 1
525 fabian 1.3 then
526     cat << 'EOF' >&2
527 fabian 1.1 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 fabian 1.13
536    
537     dnl EGG_TCL_ENV()
538 fabian 1.4 dnl
539 fabian 1.1 AC_DEFUN(EGG_TCL_ENV, [dnl
540 fabian 1.3 WARN=0
541 fabian 1.1 # Make sure either both or neither $TCLLIB and $TCLINC are set
542 guppy 1.41 if test ! "${TCLLIB-x}" = "x"
543 fabian 1.1 then
544 guppy 1.41 if test "${TCLINC-x}" = "x"
545 fabian 1.1 then
546 fabian 1.3 WARN=1
547     WVAR1=TCLLIB
548     WVAR2=TCLINC
549 fabian 1.1 TCLLIB=""
550     fi
551     else
552 guppy 1.41 if test ! "${TCLINC-x}" = "x"
553 fabian 1.1 then
554 fabian 1.3 WARN=1
555     WVAR1=TCLINC
556     WVAR2=TCLLIB
557     TCLINC=""
558     fi
559     fi
560 guppy 1.41 if test "$WARN" = 1
561 fabian 1.3 then
562 fabian 1.5 cat << EOF >&2
563 fabian 1.1 configure: warning:
564    
565 guppy 1.41 Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
566 fabian 1.1 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 fabian 1.13
573    
574     dnl EGG_TCL_WITH_TCLLIB()
575 fabian 1.4 dnl
576 fabian 1.1 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
577     # Look for Tcl library: if $tcllibname is set, check there first
578 guppy 1.41 if test ! "${tcllibname-x}" = "x"
579 fabian 1.1 then
580     if test -f "$tcllibname" && test -r "$tcllibname"
581     then
582 fabian 1.3 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
583 fabian 1.1 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 fabian 1.13
604    
605     dnl EGG_TCL_WITH_TCLINC()
606 fabian 1.4 dnl
607 fabian 1.1 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
608     # Look for Tcl header: if $tclincname is set, check there first
609 guppy 1.41 if test ! "${tclincname-x}" = "x"
610 fabian 1.1 then
611     if test -f "$tclincname" && test -r "$tclincname"
612     then
613 fabian 1.3 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
614 fabian 1.1 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 fabian 1.13
633    
634     dnl EGG_TCL_FIND_LIBRARY()
635 fabian 1.4 dnl
636 fabian 1.1 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
637     # Look for Tcl library: if $TCLLIB is set, check there first
638 guppy 1.41 if test "${TCLLIBFN-x}" = "x"
639 fabian 1.1 then
640 guppy 1.41 if test ! "${TCLLIB-x}" = "x"
641 fabian 1.1 then
642 guppy 1.41 if test -d "$TCLLIB"
643 fabian 1.1 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 guppy 1.41 TCLLIBFN="$tcllibfns$tcllibext"
651     TCLLIBEXT="$tcllibext"
652     TCLLIBFNS="$tcllibfns"
653 fabian 1.1 break 2
654     fi
655     done
656     done
657     fi
658 guppy 1.41 if test "${TCLLIBFN-x}" = "x"
659 fabian 1.1 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 fabian 1.13
677    
678     dnl EGG_TCL_FIND_HEADER()
679 fabian 1.4 dnl
680 fabian 1.1 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
681     # Look for Tcl header: if $TCLINC is set, check there first
682 guppy 1.41 if test "${TCLINCFN-x}" = "x"
683 fabian 1.1 then
684 guppy 1.41 if test ! "${TCLINC-x}" = "x"
685 fabian 1.1 then
686 guppy 1.41 if test -d "$TCLINC"
687 fabian 1.1 then
688     for tclheaderfn in $tclheadernames
689     do
690     if test -r "$TCLINC/$tclheaderfn"
691     then
692 guppy 1.41 TCLINCFN="$tclheaderfn"
693 fabian 1.3 break
694 fabian 1.1 fi
695     done
696     fi
697 guppy 1.41 if test "${TCLINCFN-x}" = "x"
698 fabian 1.1 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 fabian 1.13
716    
717     dnl EGG_TCL_CHECK_LIBRARY()
718 fabian 1.4 dnl
719 fabian 1.1 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 guppy 1.41 if test ! "${TCLLIBFN-x}" = "x"
724 fabian 1.1 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 guppy 1.41 TCLLIB="$tcllibpath"
737     TCLLIBFN="$tcllibfns$tcllibext"
738     TCLLIBEXT="$tcllibext"
739     TCLLIBFNS="$tcllibfns"
740 fabian 1.1 break 3
741     fi
742     done
743     done
744     done
745     fi
746    
747     # Show if $TCLLIBFN wasn't found
748 guppy 1.41 if test "${TCLLIBFN-x}" = "x"
749 fabian 1.1 then
750     AC_MSG_RESULT(not found)
751     fi
752     AC_SUBST(TCLLIB)dnl
753     AC_SUBST(TCLLIBFN)dnl
754     ])dnl
755 fabian 1.13
756    
757     dnl EGG_TCL_CHECK_HEADER()
758 fabian 1.4 dnl
759 fabian 1.1 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 guppy 1.41 if test ! "${TCLINCFN-x}" = "x"
764 fabian 1.1 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 guppy 1.41 TCLINC="$tclheaderpath"
775     TCLINCFN="$tclheaderfn"
776 fabian 1.1 break 2
777     fi
778     done
779     done
780     # FreeBSD hack ...
781 guppy 1.41 if test "${TCLINCFN-x}" = "x"
782 fabian 1.1 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 guppy 1.41 TCLINC="$tclheaderpath/$tcllibfns"
793     TCLINCFN="$tclheaderfn"
794 fabian 1.1 break 3
795     fi
796     done
797     done
798     done
799     fi
800     fi
801    
802     # Show if $TCLINCFN wasn't found
803 guppy 1.41 if test "${TCLINCFN-x}" = "x"
804 fabian 1.1 then
805     AC_MSG_RESULT(not found)
806     fi
807     AC_SUBST(TCLINC)dnl
808     AC_SUBST(TCLINCFN)dnl
809     ])dnl
810 fabian 1.13
811    
812 fabian 1.28 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 guppy 1.41 egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
832     if test ! "$egg_tcl_id" = ":::"
833     then
834 fabian 1.28 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 guppy 1.41 if test "$egg_tcl_cached" = "yes"
840     then
841     if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
842     then
843 fabian 1.28 egg_tcl_changed=no
844     else
845     egg_cv_var_tcl_id="$egg_tcl_id"
846     fi
847     fi
848     fi
849 guppy 1.41 if test "$egg_tcl_changed" = "yes"
850     then
851 fabian 1.28 AC_MSG_RESULT(yes)
852     else
853     AC_MSG_RESULT(no)
854     fi
855     ])
856    
857    
858 fabian 1.13 dnl EGG_TCL_CHECK_VERSION()
859 fabian 1.4 dnl
860 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
861     # Both TCLLIBFN & TCLINCFN must be set, or we bail
862 fabian 1.12 TCL_FOUND=0
863 guppy 1.41 if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
864 fabian 1.1 then
865     TCL_FOUND=1
866    
867     # Check Tcl's version
868 guppy 1.41 if test "$egg_tcl_changed" = "yes"
869     then
870 fabian 1.28 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
871     fi
872 fabian 1.1 AC_MSG_CHECKING(for Tcl version)
873 guppy 1.41 AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
874 fabian 1.25 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
875     ])
876 fabian 1.1
877 guppy 1.41 if test ! "${egg_cv_var_tcl_version-x}" = "x"
878 fabian 1.1 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 guppy 1.41 if test "$egg_tcl_changed" = "yes"
887     then
888 fabian 1.28 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
889     fi
890 fabian 1.1 AC_MSG_CHECKING(for Tcl patch level)
891 guppy 1.41 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
892 fabian 1.1 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
893 fabian 1.25 ])
894 fabian 1.1
895 guppy 1.41 if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
896 fabian 1.1 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 guppy 1.41 if test "$TCL_FOUND" = 0
906 fabian 1.1 then
907     cat << 'EOF' >&2
908     configure: error:
909    
910     I can't find Tcl on this system.
911    
912 fabian 1.28 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 fabian 1.1
918 fabian 1.28 Read the README file if you don't know what Tcl is or how to get it
919     and install it.
920 fabian 1.1
921     EOF
922     exit 1
923     fi
924     ])dnl
925 fabian 1.13
926    
927     dnl EGG_TCL_CHECK_PRE70()
928 fabian 1.4 dnl
929 fabian 1.1 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 guppy 1.41 if test "$TCL_VER_PRE70" = "yes"
933 fabian 1.1 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 fabian 1.13
947    
948     dnl EGG_TCL_CHECK_PRE75()
949 fabian 1.4 dnl
950 fabian 1.1 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 guppy 1.41 if test "$TCL_VER_PRE75" = "yes"
954 fabian 1.1 then
955     AC_DEFINE(HAVE_PRE7_5_TCL)dnl
956     fi
957     ])dnl
958 fabian 1.13
959    
960     dnl EGG_TCL_TESTLIBS()
961 fabian 1.4 dnl
962 fabian 1.1 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
963 guppy 1.41 # Set variables for Tcl library tests
964     TCL_TEST_LIB="$TCLLIBFNS"
965 guppy 1.42 TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
966 guppy 1.41
967     if test ! "${ac_cv_lib_pthread-x}" = "x"
968 guppy 1.39 then
969 guppy 1.41 TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
970 fabian 1.1 fi
971     ])dnl
972 fabian 1.13
973    
974     dnl EGG_TCL_CHECK_FREE()
975 fabian 1.4 dnl
976 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
977 guppy 1.41 if test "$egg_tcl_changed" = "yes"
978     then
979 fabian 1.28 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
980     fi
981 fabian 1.1
982 guppy 1.41 # 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 fabian 1.1
985 guppy 1.41 if test "$egg_cv_var_tcl_free" = "yes"
986 fabian 1.1 then
987     AC_DEFINE(HAVE_TCL_FREE)dnl
988     fi
989     ])dnl
990 fabian 1.13
991    
992 guppy 1.30 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 guppy 1.41 enable_tcl_threads="$enableval",
999 guppy 1.30 enable_tcl_threads=yes)
1000     ])dnl
1001    
1002    
1003 fabian 1.13 dnl EGG_TCL_CHECK_THREADS()
1004 fabian 1.4 dnl
1005 fabian 1.1 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1006 guppy 1.41 if test "$egg_tcl_changed" = "yes"
1007     then
1008 guppy 1.30 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1009 fabian 1.28 fi
1010 fabian 1.1
1011 guppy 1.41 # 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 fabian 1.1
1014 guppy 1.41 if test "$egg_cv_var_tcl_threaded" = "yes"
1015 fabian 1.1 then
1016 guppy 1.41 if test "$enable_tcl_threads" = "no"
1017 guppy 1.30 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 fabian 1.1
1030 guppy 1.41 # 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 fabian 1.1 fi
1035     fi
1036     ])dnl
1037 fabian 1.13
1038    
1039     dnl EGG_TCL_LIB_REQS()
1040 fabian 1.4 dnl
1041 fabian 1.1 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1042 guppy 1.50 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 guppy 1.41 if test ! "$TCLLIBEXT" = ".a"
1048 fabian 1.1 then
1049     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1050 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1051 fabian 1.1 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 guppy 1.41 if test "$TCL_VER_PRE74" = "no"
1070 fabian 1.1 then
1071    
1072     # Was the --with-tcllib option given ?
1073 guppy 1.41 if test ! "${tcllibname-x}" = "x"
1074 fabian 1.1 then
1075     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1076 fabian 1.22 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1077 fabian 1.1 else
1078     TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1079 fabian 1.22 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1080 fabian 1.1 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 fabian 1.25 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1091 fabian 1.1 fi
1092 guppy 1.50 fi
1093 fabian 1.1 fi
1094     AC_SUBST(TCL_REQS)dnl
1095     AC_SUBST(TCL_LIBS)dnl
1096     ])dnl
1097 fabian 1.13
1098    
1099     dnl EGG_FUNC_DLOPEN()
1100 fabian 1.4 dnl
1101 fabian 1.1 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1102 guppy 1.41 if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1103 fabian 1.1 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 fabian 1.13
1149    
1150 guppy 1.31 dnl EGG_SUBST_MOD_UPDIR()
1151     dnl
1152     dnl Since module's Makefiles aren't generated by configure, some
1153 guppy 1.41 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 guppy 1.31 dnl (which don't need a "../" pre-pended).
1156     AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1157     case "$srcdir" in
1158 guppy 1.41 [[\\/]]* | ?:[[\\/]]*)
1159     MOD_UPDIR=""
1160     ;;
1161     *)
1162     MOD_UPDIR="../"
1163     ;;
1164 guppy 1.31 esac
1165     AC_SUBST(MOD_UPDIR)dnl
1166     ])dnl
1167 guppy 1.41
1168 fabian 1.13
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 guppy 1.41 egg_replace_file="$1"
1178 fabian 1.13 echo "creating $1"
1179     $2
1180 guppy 1.41 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1181 fabian 1.13 then
1182     echo "$1 is unchanged"
1183     else
1184 guppy 1.41 mv conftest.out $egg_replace_file
1185 fabian 1.13 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 guppy 1.41 cat > conftest.out << EGGEOF
1195 fabian 1.13 /* Ignore me but do not erase me. I am a kludge. */
1196    
1197 guppy 1.41 #include "$egg_tclinc/$egg_tclincfn"
1198     EGGEOF], [
1199     egg_tclinc="$TCLINC"
1200     egg_tclincfn="$TCLINCFN"])dnl
1201 fabian 1.13 ])dnl
1202    
1203    
1204     dnl EGG_CATCH_MAKEFILE_REBUILD()
1205     dnl
1206     AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1207     AC_OUTPUT_COMMANDS([
1208 guppy 1.41 if test -f .modules
1209     then
1210     $ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile
1211 fabian 1.13 fi])
1212 fabian 1.15 ])dnl
1213 guppy 1.41
1214 fabian 1.15
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 fabian 1.1 ])dnl
1226 guppy 1.44
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 drummer 1.45
1266    
1267     dnl EGG_ENABLE_IPV6()
1268     dnl
1269     AC_DEFUN(EGG_ENABLE_IPV6, [dnl
1270 drummer 1.47 AC_MSG_CHECKING(whether you enabled IPv6 support)
1271 drummer 1.45 AC_ARG_ENABLE(ipv6,
1272     [ --enable-ipv6 Enable IPV6 support.
1273     --disable-ipv6 Disable IPV6 support. ],
1274 drummer 1.47 [ ac_cv_ipv6=$enableval
1275     AC_MSG_RESULT($ac_cv_ipv6)
1276     ], [
1277 drummer 1.49 if test "x$egg_cv_ipv6_supported" = "xyes"; then
1278     ac_cv_ipv6='yes'
1279     else
1280     ac_cv_ipv6='no'
1281     fi
1282 drummer 1.47 AC_MSG_RESULT((default) $ac_cv_ipv6)
1283     ])
1284 drummer 1.45 if test "$ac_cv_ipv6" = "yes" ; then
1285     AC_DEFINE(IPV6)
1286     fi
1287     ])dnl
1288    
1289    
1290 drummer 1.46 dnl EGG_TYPE_SOCKLEN_T
1291 drummer 1.45 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 drummer 1.46
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 drummer 1.47
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 drummer 1.48 #include <fcntl.h>
1342 drummer 1.47 #include <sys/socket.h>
1343     #include <sys/types.h>
1344 drummer 1.52 #include <netinet/in.h>
1345 drummer 1.47 #include <unistd.h>
1346 drummer 1.48 #include <errno.h>
1347     #include <stdio.h>
1348 drummer 1.47
1349     int main()
1350     {
1351 drummer 1.52 struct sockaddr_in6 sin6;
1352 drummer 1.47 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 ite 1.53 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