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

Contents of /eggdrop1.6/aclocal.m4

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


Revision 1.66 - (show annotations) (download)
Tue Apr 1 05:33:40 2003 UTC (18 years ago) by wcc
Branch: MAIN
CVS Tags: eggdrop_1_6_15
Changes since 1.65: +59 -4 lines
* Added the IPv6 patch to CVS. This is not 100% complete yet. Please test
  and improve! :P

1 dnl aclocal.m4
2 dnl macros autoconf uses when building configure from configure.in
3 dnl
4 dnl $Id: aclocal.m4,v 1.65 2003/03/05 04:32:24 wcc 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 type 'make iconfig'])
26 AC_MSG_RESULT(to interactively choose which modules to compile.)
27 AC_MSG_RESULT()
28 ])dnl
29
30
31 dnl EGG_CHECK_CC()
32 dnl
33 dnl FIXME: make a better test
34 dnl
35 AC_DEFUN(EGG_CHECK_CC, [dnl
36 if test "${cross_compiling-x}" = "x"
37 then
38 cat << 'EOF' >&2
39 configure: error:
40
41 This system does not appear to have a working C compiler.
42 A working C compiler is required to compile Eggdrop.
43
44 EOF
45 exit 1
46 fi
47 ])dnl
48
49 dnl EGG_IPV6_SUPPORTED()
50 dnl
51 AC_DEFUN(EGG_IPV6_SUPPORTED, [dnl
52 AC_MSG_CHECKING(for kernel IPv6 support)
53 AC_CACHE_VAL(egg_cv_ipv6_supported,[
54 AC_TRY_RUN([
55 #include <fcntl.h>
56 #include <sys/socket.h>
57 #include <sys/types.h>
58 #include <netinet/in.h>
59 #include <unistd.h>
60 #include <errno.h>
61 #include <stdio.h>
62
63 int main()
64 {
65 struct sockaddr_in6 sin6;
66 int s = socket(AF_INET6, SOCK_STREAM, 0);
67
68 if (s != -1)
69 close(s);
70 return (s == -1);
71 }
72 ], egg_cv_ipv6_supported=yes, egg_cv_ipv6_supported=no,
73 egg_cv_ipv6_supported=no)])
74 if test "$egg_cv_ipv6_supported" = "yes"
75 then
76 AC_MSG_RESULT(yes)
77 else
78 AC_MSG_RESULT(no)
79 fi
80 ])dnl
81
82 dnl EGG_IPV6_OPTIONS()
83 dnl
84 AC_DEFUN(EGG_IPV6_OPTIONS, [dnl
85 AC_MSG_CHECKING(whether or not you enabled IPv6 support)
86 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 enable IPv6 support],
87 [ ac_cv_ipv6="yes"
88 if test "$egg_cv_ipv6_supported" = "no"
89 then
90 ac_cv_ipv6="no"
91 fi
92 AC_MSG_RESULT($ac_cv_ipv6)
93 ],
94 [ ac_cv_ipv6="no"
95 AC_MSG_RESULT(no)
96 ])
97 if test "$ac_cv_ipv6" = "yes"
98 then
99 AC_DEFINE(HAVE_IPV6)
100 ENABLEIPV6="--enable-ipv6"
101 fi
102 AC_SUBST(ENABLEIPV6)
103 ])dnl
104
105 dnl EGG_CHECK_CCPIPE()
106 dnl
107 dnl Checks whether the compiler supports the `-pipe' flag, which
108 dnl speeds up the compilation.
109 AC_DEFUN(EGG_CHECK_CCPIPE, [dnl
110 if test -z "$no_pipe"
111 then
112 if test -n "$GCC"
113 then
114 AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
115 ac_old_CC="$CC"
116 CC="$CC -pipe"
117 AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")
118 CC="$ac_old_CC"
119 ])
120 if test "$egg_cv_var_ccpipe" = "yes"
121 then
122 CC="$CC -pipe"
123 fi
124 fi
125 fi
126 ])dnl
127
128
129 dnl EGG_PROG_STRIP()
130 dnl
131 AC_DEFUN(EGG_PROG_STRIP, [dnl
132 AC_CHECK_PROG(STRIP, strip, strip)
133 if test "${STRIP-x}" = "x"
134 then
135 STRIP=touch
136 fi
137 ])dnl
138
139
140 dnl EGG_PROG_AWK()
141 dnl
142 AC_DEFUN(EGG_PROG_AWK, [dnl
143 # awk is needed for Tcl library and header checks, and eggdrop version subst
144 AC_PROG_AWK
145 if test "${AWK-x}" = "x"
146 then
147 cat << 'EOF' >&2
148 configure: error:
149
150 This system seems to lack a working 'awk' command.
151 A working 'awk' command is required to compile Eggdrop.
152
153 EOF
154 exit 1
155 fi
156 ])dnl
157
158
159 dnl EGG_PROG_BASENAME()
160 dnl
161 AC_DEFUN(EGG_PROG_BASENAME, [dnl
162 # basename is needed for Tcl library and header checks
163 AC_CHECK_PROG(BASENAME, basename, basename)
164 if test "${BASENAME-x}" = "x"
165 then
166 cat << 'EOF' >&2
167 configure: error:
168
169 This system seems to lack a working 'basename' command.
170 A working 'basename' command is required to compile Eggdrop.
171
172 EOF
173 exit 1
174 fi
175 ])dnl
176
177
178 dnl EGG_DISABLE_CC_OPTIMIZATION()
179 dnl
180 dnl check if user requested to remove -O2 cflag
181 dnl would be usefull on some weird *nix
182 AC_DEFUN(EGG_DISABLE_CC_OPTIMIZATION, [dnl
183 AC_ARG_ENABLE(cc-optimization,
184 [ --disable-cc-optimization disable -O2 cflag],
185 CFLAGS=`echo $CFLAGS | sed 's/\-O2//'`)
186 ])dnl
187
188 dnl EGG_CHECK_OS()
189 dnl
190 dnl FIXME/NOTICE:
191 dnl This function is obsolete. Any NEW code/checks should be written
192 dnl as individual tests that will be checked on ALL operating systems.
193 dnl
194 AC_DEFUN(EGG_CHECK_OS, [dnl
195 LINUX=no
196 IRIX=no
197 SUNOS=no
198 HPUX=no
199 EGG_CYGWIN=no
200 MOD_CC="$CC"
201 MOD_LD="$CC"
202 MOD_STRIP="$STRIP"
203 SHLIB_CC="$CC"
204 SHLIB_LD="$CC"
205 SHLIB_STRIP="$STRIP"
206 NEED_DL=1
207 DEFAULT_MAKE=debug
208 MOD_EXT=so
209
210 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
211 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
212
213 case "$egg_cv_var_system_type" in
214 BSD/OS)
215 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
216 2)
217 NEED_DL=0
218 DEFAULT_MAKE=static
219 ;;
220 3)
221 MOD_CC=shlicc
222 MOD_LD=shlicc
223 MOD_STRIP="$STRIP -d"
224 SHLIB_LD="shlicc -r"
225 SHLIB_STRIP=touch
226 AC_DEFINE(MODULES_OK)dnl
227 ;;
228 *)
229 CFLAGS="$CFLAGS -Wall"
230 MOD_LD="$CC"
231 MOD_STRIP="$STRIP -d"
232 SHLIB_CC="$CC -export-dynamic -fPIC"
233 SHLIB_LD="$CC -shared -nostartfiles"
234 AC_DEFINE(MODULES_OK)dnl
235 ;;
236 esac
237 ;;
238 CYGWI*)
239 case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
240 1.*)
241 NEED_DL=0
242 SHLIB_LD="$CC -shared"
243 AC_PROG_CC_WIN32
244 CC="$CC $WIN32FLAGS"
245 MOD_CC="$CC"
246 MOD_LD="$CC"
247 AC_MSG_CHECKING(for /usr/lib/binmode.o)
248 if test -r /usr/lib/binmode.o
249 then
250 AC_MSG_RESULT(yes)
251 LIBS="$LIBS /usr/lib/binmode.o"
252 else
253 AC_MSG_RESULT(no)
254 AC_MSG_WARN(Make sure the directory Eggdrop is installed into is mounted in binary mode.)
255 fi
256 MOD_EXT=dll
257 AC_DEFINE(MODULES_OK)dnl
258 ;;
259 *)
260 NEED_DL=0
261 DEFAULT_MAKE=static
262 AC_MSG_WARN(Make sure the directory Eggdrop is installed into is mounted in binary mode.)
263 ;;
264 esac
265 EGG_CYGWIN=yes
266 AC_DEFINE(CYGWIN_HACKS)
267 ;;
268 HP-UX)
269 HPUX=yes
270 MOD_LD="$CC -fPIC -shared"
271 SHLIB_CC="$CC -fPIC"
272 SHLIB_LD="ld -b"
273 NEED_DL=0
274 AC_DEFINE(MODULES_OK)dnl
275 AC_DEFINE(HPUX_HACKS)dnl
276 if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
277 then
278 AC_DEFINE(HPUX10_HACKS)dnl
279 fi
280 ;;
281 dell)
282 AC_MSG_RESULT(Dell SVR4)
283 SHLIB_STRIP=touch
284 NEED_DL=0
285 MOD_LD="$CC -lelf -lucb"
286 ;;
287 IRIX)
288 SHLIB_LD="ld -n32 -shared -rdata_shared"
289 IRIX=yes
290 SHLIB_STRIP=touch
291 NEED_DL=0
292 DEFAULT_MAKE=static
293 ;;
294 Ultrix)
295 NEED_DL=0
296 SHLIB_STRIP=touch
297 DEFAULT_MAKE=static
298 SHELL=/bin/sh5
299 ;;
300 SINIX*)
301 NEED_DL=0
302 SHLIB_STRIP=touch
303 DEFAULT_MAKE=static
304 SHLIB_CC="cc -G"
305 ;;
306 BeOS)
307 NEED_DL=0
308 SHLIB_STRIP=strip
309 DEFAULT_MAKE=static
310 ;;
311 Linux)
312 LINUX=yes
313 CFLAGS="$CFLAGS -Wall"
314 MOD_LD="$CC"
315 SHLIB_CC="$CC -fPIC"
316 SHLIB_LD="$CC -shared -nostartfiles"
317 AC_DEFINE(MODULES_OK)dnl
318 ;;
319 Lynx)
320 NEED_DL=0
321 DEFAULT_MAKE=static
322 SHLIB_STRIP=strip
323 ;;
324 QNX)
325 NEED_DL=0
326 DEFAULT_MAKE=static
327 SHLIB_LD="ld -shared"
328 SHLIB_STRIP=strip
329 ;;
330 OSF1)
331 case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
332 V*)
333 # FIXME: we should check this in a separate test
334 # Digital OSF uses an ancient version of gawk
335 if test "$AWK" = "gawk"
336 then
337 AWK=awk
338 fi
339 MOD_CC=cc
340 MOD_LD=cc
341 SHLIB_CC=cc
342 SHLIB_LD="ld -shared -expect_unresolved \"'*'\""
343 SHLIB_STRIP=touch
344 AC_DEFINE(MODULES_OK)dnl
345 ;;
346 1.0|1.1|1.2)
347 SHLIB_LD="ld -R -export $@:"
348 AC_DEFINE(MODULES_OK)dnl
349 AC_DEFINE(OSF1_HACKS)dnl
350 ;;
351 1.*)
352 SHLIB_CC="$CC -fpic"
353 SHLIB_LD="ld -shared"
354 AC_DEFINE(MODULES_OK)dnl
355 AC_DEFINE(OSF1_HACKS)dnl
356 ;;
357 *)
358 NEED_DL=0
359 DEFAULT_MAKE=static
360 ;;
361 esac
362 AC_DEFINE(STOP_UAC)dnl
363 AC_DEFINE(BROKEN_SNPRINTF)dnl
364 ;;
365 SunOS)
366 if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5"
367 then
368 # Solaris
369 if test -n "$GCC"
370 then
371 SHLIB_CC="$CC -fPIC"
372 SHLIB_LD="$CC -shared"
373 else
374 SHLIB_CC="$CC -KPIC"
375 SHLIB_LD="$CC -G -z text"
376 fi
377 else
378 # SunOS 4
379 SUNOS=yes
380 SHLIB_LD=ld
381 SHLIB_CC="$CC -PIC"
382 AC_DEFINE(DLOPEN_1)dnl
383 fi
384 AC_DEFINE(MODULES_OK)dnl
385 ;;
386 *BSD)
387 # FreeBSD/OpenBSD/NetBSD
388 SHLIB_CC="$CC -fPIC"
389 SHLIB_LD="ld -Bshareable -x"
390 AC_DEFINE(MODULES_OK)dnl
391 ;;
392 *)
393 AC_MSG_CHECKING(if system is Mach based)
394 if test -r /mach
395 then
396 AC_MSG_RESULT(yes)
397 NEED_DL=0
398 DEFAULT_MAKE=static
399 AC_DEFINE(BORGCUBES)dnl
400 else
401 AC_MSG_RESULT(no)
402 AC_MSG_CHECKING(if system is QNX)
403 if test -r /cmds
404 then
405 AC_MSG_RESULT(yes)
406 SHLIB_STRIP=touch
407 NEED_DL=0
408 DEFAULT_MAKE=static
409 else
410 AC_MSG_RESULT(no)
411 AC_MSG_RESULT(Something unknown!)
412 AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
413 NEED_DL=0
414 DEFAULT_MAKE=static
415 fi
416 fi
417 ;;
418 esac
419 AC_SUBST(MOD_LD)dnl
420 AC_SUBST(MOD_CC)dnl
421 AC_SUBST(MOD_STRIP)dnl
422 AC_SUBST(SHLIB_LD)dnl
423 AC_SUBST(SHLIB_CC)dnl
424 AC_SUBST(SHLIB_STRIP)dnl
425 AC_SUBST(DEFAULT_MAKE)dnl
426 AC_SUBST(MOD_EXT)dnl
427 AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl
428 ])dnl
429
430
431 dnl EGG_CHECK_LIBS()
432 dnl
433 AC_DEFUN(EGG_CHECK_LIBS, [dnl
434 # FIXME: this needs to be fixed so that it works on IRIX
435 if test "$IRIX" = "yes"
436 then
437 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
438 else
439 AC_CHECK_LIB(socket, socket)
440 AC_CHECK_LIB(nsl, connect)
441 AC_CHECK_LIB(dns, gethostbyname)
442 AC_CHECK_LIB(dl, dlopen)
443 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
444 # This is needed for Tcl libraries compiled with thread support
445 AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
446 ac_cv_lib_pthread_pthread_mutex_init=yes
447 ac_cv_lib_pthread="-lpthread"], [dnl
448 AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
449 ac_cv_lib_pthread_pthread_mutex_init=yes
450 ac_cv_lib_pthread="-lpthread"], [dnl
451 AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
452 ac_cv_lib_pthread_pthread_mutex_init=yes
453 ac_cv_lib_pthread="-lpthreads"], [dnl
454 AC_CHECK_FUNC(pthread_mutex_init, [dnl
455 ac_cv_lib_pthread_pthread_mutex_init=yes
456 ac_cv_lib_pthread=""],
457 ac_cv_lib_pthread_pthread_mutex_init=no)])])])
458 if test "$SUNOS" = "yes"
459 then
460 # For suns without yp or something like that
461 AC_CHECK_LIB(dl, main)
462 else
463 if test "$HPUX" = "yes"
464 then
465 AC_CHECK_LIB(dld, shl_load)
466 fi
467 fi
468 fi
469 ])dnl
470
471
472 dnl EGG_CHECK_FUNC_VSPRINTF()
473 dnl
474 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
475 AC_CHECK_FUNCS(vsprintf)
476 if test "$ac_cv_func_vsprintf" = "no"
477 then
478 cat << 'EOF' >&2
479 configure: error:
480
481 Your system does not have the sprintf/vsprintf libraries.
482 These are required to compile almost anything. Sorry.
483
484 EOF
485 exit 1
486 fi
487 ])dnl
488
489
490 dnl EGG_HEADER_STDC()
491 dnl
492 AC_DEFUN(EGG_HEADER_STDC, [dnl
493 if test "$ac_cv_header_stdc" = "no"
494 then
495 cat << 'EOF' >&2
496 configure: error:
497
498 Your system must support ANSI C Header files.
499 These are required for the language support. Sorry.
500
501 EOF
502 exit 1
503 fi
504 ])dnl
505
506
507 dnl EGG_CHECK_LIBSAFE_SSCANF()
508 dnl
509 AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
510 AC_CACHE_CHECK(for broken libsafe sscanf, egg_cv_var_libsafe_sscanf, [dnl
511 AC_TRY_RUN([
512 #include <stdio.h>
513
514 int main()
515 {
516 char *src = "0x001,guppyism\n";
517 char dst[10];
518 int idx;
519
520 if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
521 exit(1);
522 return 0;
523 }
524 ], egg_cv_var_libsafe_sscanf="no", egg_cv_var_libsafe_sscanf="yes",
525 egg_cv_var_libsafe_sscanf="no")
526 ])
527 if test "$egg_cv_var_libsafe_sscanf" = "yes"
528 then
529 AC_DEFINE(LIBSAFE_HACKS)dnl
530 fi
531 ])dnl
532
533
534 dnl EGG_EXEEXT()
535 dnl
536 dnl Test for executable suffix and define Eggdrop's executable name
537 dnl accordingly.
538 AC_DEFUN(EGG_EXEEXT, [dnl
539 EGGEXEC=eggdrop
540 AC_EXEEXT
541 if test ! "${EXEEXT-x}" = "x"
542 then
543 EGGEXEC="eggdrop$EXEEXT"
544 fi
545 AC_SUBST(EGGEXEC)dnl
546 ])dnl
547
548
549 dnl EGG_TCL_ARG_WITH()
550 dnl
551 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
552 # oohh new configure --variables for those with multiple Tcl libs
553 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to Tcl library], tcllibname="$withval")
554 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to Tcl header], tclincname="$withval")
555
556 WARN=0
557 # Make sure either both or neither $tcllibname and $tclincname are set
558 if test ! "${tcllibname-x}" = "x"
559 then
560 if test "${tclincname-x}" = "x"
561 then
562 WARN=1
563 tcllibname=""
564 TCLLIB=""
565 TCLINC=""
566 fi
567 else
568 if test ! "${tclincname-x}" = "x"
569 then
570 WARN=1
571 tclincname=""
572 TCLLIB=""
573 TCLINC=""
574 fi
575 fi
576 if test "$WARN" = 1
577 then
578 cat << 'EOF' >&2
579 configure: warning:
580
581 You must specify both --with-tcllib and --with-tclinc for them to work.
582 configure will now attempt to autodetect both the Tcl library and header...
583
584 EOF
585 fi
586 ])dnl
587
588
589 dnl EGG_TCL_ENV()
590 dnl
591 AC_DEFUN(EGG_TCL_ENV, [dnl
592 WARN=0
593 # Make sure either both or neither $TCLLIB and $TCLINC are set
594 if test ! "${TCLLIB-x}" = "x"
595 then
596 if test "${TCLINC-x}" = "x"
597 then
598 WARN=1
599 WVAR1=TCLLIB
600 WVAR2=TCLINC
601 TCLLIB=""
602 fi
603 else
604 if test ! "${TCLINC-x}" = "x"
605 then
606 WARN=1
607 WVAR1=TCLINC
608 WVAR2=TCLLIB
609 TCLINC=""
610 fi
611 fi
612 if test "$WARN" = 1
613 then
614 cat << EOF >&2
615 configure: warning:
616
617 Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
618 Please set both TCLLIB and TCLINC correctly if you wish to use them.
619 configure will now attempt to autodetect both the Tcl library and header...
620
621 EOF
622 fi
623 ])dnl
624
625
626 dnl EGG_TCL_WITH_TCLLIB()
627 dnl
628 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
629 # Look for Tcl library: if $tcllibname is set, check there first
630 if test ! "${tcllibname-x}" = "x"
631 then
632 if test -f "$tcllibname" && test -r "$tcllibname"
633 then
634 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
635 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
636 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
637 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
638 else
639 cat << EOF >&2
640 configure: warning:
641
642 The file '$tcllibname' given to option --with-tcllib is not valid.
643 configure will now attempt to autodetect both the Tcl library and header...
644
645 EOF
646 tcllibname=""
647 tclincname=""
648 TCLLIB=""
649 TCLLIBFN=""
650 TCLINC=""
651 TCLINCFN=""
652 fi
653 fi
654 ])dnl
655
656
657 dnl EGG_TCL_WITH_TCLINC()
658 dnl
659 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
660 # Look for Tcl header: if $tclincname is set, check there first
661 if test ! "${tclincname-x}" = "x"
662 then
663 if test -f "$tclincname" && test -r "$tclincname"
664 then
665 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
666 TCLINCFN=`$BASENAME $tclincname`
667 else
668 cat << EOF >&2
669 configure: warning:
670
671 The file '$tclincname' given to option --with-tclinc is not valid.
672 configure will now attempt to autodetect both the Tcl library and header...
673
674 EOF
675 tcllibname=""
676 tclincname=""
677 TCLLIB=""
678 TCLLIBFN=""
679 TCLINC=""
680 TCLINCFN=""
681 fi
682 fi
683 ])dnl
684
685
686 dnl EGG_TCL_FIND_LIBRARY()
687 dnl
688 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
689 # Look for Tcl library: if $TCLLIB is set, check there first
690 if test "${TCLLIBFN-x}" = "x"
691 then
692 if test ! "${TCLLIB-x}" = "x"
693 then
694 if test -d "$TCLLIB"
695 then
696 for tcllibfns in $tcllibnames
697 do
698 for tcllibext in $tcllibextensions
699 do
700 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
701 then
702 TCLLIBFN="$tcllibfns$tcllibext"
703 TCLLIBEXT="$tcllibext"
704 TCLLIBFNS="$tcllibfns"
705 break 2
706 fi
707 done
708 done
709 fi
710 if test "${TCLLIBFN-x}" = "x"
711 then
712 cat << 'EOF' >&2
713 configure: warning:
714
715 Environment variable TCLLIB was set, but incorrect.
716 Please set both TCLLIB and TCLINC correctly if you wish to use them.
717 configure will now attempt to autodetect both the Tcl library and header...
718
719 EOF
720 TCLLIB=""
721 TCLLIBFN=""
722 TCLINC=""
723 TCLINCFN=""
724 fi
725 fi
726 fi
727 ])dnl
728
729
730 dnl EGG_TCL_FIND_HEADER()
731 dnl
732 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
733 # Look for Tcl header: if $TCLINC is set, check there first
734 if test "${TCLINCFN-x}" = "x"
735 then
736 if test ! "${TCLINC-x}" = "x"
737 then
738 if test -d "$TCLINC"
739 then
740 for tclheaderfn in $tclheadernames
741 do
742 if test -r "$TCLINC/$tclheaderfn"
743 then
744 TCLINCFN="$tclheaderfn"
745 break
746 fi
747 done
748 fi
749 if test "${TCLINCFN-x}" = "x"
750 then
751 cat << 'EOF' >&2
752 configure: warning:
753
754 Environment variable TCLINC was set, but incorrect.
755 Please set both TCLLIB and TCLINC correctly if you wish to use them.
756 configure will now attempt to autodetect both the Tcl library and header...
757
758 EOF
759 TCLLIB=""
760 TCLLIBFN=""
761 TCLINC=""
762 TCLINCFN=""
763 fi
764 fi
765 fi
766 ])dnl
767
768
769 dnl EGG_TCL_CHECK_LIBRARY()
770 dnl
771 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
772 AC_MSG_CHECKING(for Tcl library)
773
774 # Attempt autodetect for $TCLLIBFN if it's not set
775 if test ! "${TCLLIBFN-x}" = "x"
776 then
777 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
778 else
779 for tcllibfns in $tcllibnames
780 do
781 for tcllibext in $tcllibextensions
782 do
783 for tcllibpath in $tcllibpaths
784 do
785 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
786 then
787 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
788 TCLLIB="$tcllibpath"
789 TCLLIBFN="$tcllibfns$tcllibext"
790 TCLLIBEXT="$tcllibext"
791 TCLLIBFNS="$tcllibfns"
792 break 3
793 fi
794 done
795 done
796 done
797 fi
798
799 # Show if $TCLLIBFN wasn't found
800 if test "${TCLLIBFN-x}" = "x"
801 then
802 AC_MSG_RESULT(not found)
803 fi
804 AC_SUBST(TCLLIB)dnl
805 AC_SUBST(TCLLIBFN)dnl
806 ])dnl
807
808
809 dnl EGG_TCL_CHECK_HEADER()
810 dnl
811 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
812 AC_MSG_CHECKING(for Tcl header)
813
814 # Attempt autodetect for $TCLINCFN if it's not set
815 if test ! "${TCLINCFN-x}" = "x"
816 then
817 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
818 else
819 for tclheaderpath in $tclheaderpaths
820 do
821 for tclheaderfn in $tclheadernames
822 do
823 if test -r "$tclheaderpath/$tclheaderfn"
824 then
825 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
826 TCLINC="$tclheaderpath"
827 TCLINCFN="$tclheaderfn"
828 break 2
829 fi
830 done
831 done
832 # FreeBSD hack ...
833 if test "${TCLINCFN-x}" = "x"
834 then
835 for tcllibfns in $tcllibnames
836 do
837 for tclheaderpath in $tclheaderpaths
838 do
839 for tclheaderfn in $tclheadernames
840 do
841 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
842 then
843 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
844 TCLINC="$tclheaderpath/$tcllibfns"
845 TCLINCFN="$tclheaderfn"
846 break 3
847 fi
848 done
849 done
850 done
851 fi
852 fi
853
854 # Show if $TCLINCFN wasn't found
855 if test "${TCLINCFN-x}" = "x"
856 then
857 AC_MSG_RESULT(not found)
858 fi
859 AC_SUBST(TCLINC)dnl
860 AC_SUBST(TCLINCFN)dnl
861 ])dnl
862
863
864 dnl EGG_CACHE_UNSET(CACHE-ID)
865 dnl
866 dnl Unsets a certain cache item. Typically called before using
867 dnl the AC_CACHE_*() macros.
868 AC_DEFUN(EGG_CACHE_UNSET, [dnl
869 unset $1
870 ])
871
872
873 dnl EGG_TCL_DETECT_CHANGE()
874 dnl
875 dnl Detect whether the Tcl system has changed since our last
876 dnl configure run. Set egg_tcl_changed accordingly.
877 dnl
878 dnl Tcl related feature and version checks should re-run their
879 dnl checks as soon as egg_tcl_changed is set to "yes".
880 AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
881 AC_MSG_CHECKING(whether the Tcl system has changed)
882 egg_tcl_changed=yes
883 egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
884 if test ! "$egg_tcl_id" = ":::"
885 then
886 egg_tcl_cached=yes
887 AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
888 egg_cv_var_tcl_id="$egg_tcl_id"
889 egg_tcl_cached=no
890 ])
891 if test "$egg_tcl_cached" = "yes"
892 then
893 if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
894 then
895 egg_tcl_changed=no
896 else
897 egg_cv_var_tcl_id="$egg_tcl_id"
898 fi
899 fi
900 fi
901 if test "$egg_tcl_changed" = "yes"
902 then
903 AC_MSG_RESULT(yes)
904 else
905 AC_MSG_RESULT(no)
906 fi
907 ])
908
909
910 dnl EGG_TCL_CHECK_VERSION()
911 dnl
912 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
913 # Both TCLLIBFN & TCLINCFN must be set, or we bail
914 TCL_FOUND=0
915 if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
916 then
917 TCL_FOUND=1
918
919 # Check Tcl's version
920 if test "$egg_tcl_changed" = "yes"
921 then
922 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
923 fi
924 AC_MSG_CHECKING(for Tcl version)
925 AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
926 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
927 ])
928
929 if test ! "${egg_cv_var_tcl_version-x}" = "x"
930 then
931 AC_MSG_RESULT($egg_cv_var_tcl_version)
932 else
933 AC_MSG_RESULT(not found)
934 TCL_FOUND=0
935 fi
936
937 # Check Tcl's patch level (if available)
938 if test "$egg_tcl_changed" = "yes"
939 then
940 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
941 fi
942 AC_MSG_CHECKING(for Tcl patch level)
943 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
944 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
945 ])
946
947 if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
948 then
949 AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
950 else
951 egg_cv_var_tcl_patch_level="unknown"
952 AC_MSG_RESULT(unknown)
953 fi
954 fi
955
956 # Check if we found Tcl's version
957 if test "$TCL_FOUND" = 0
958 then
959 cat << 'EOF' >&2
960 configure: error:
961
962 I can't find Tcl on this system.
963
964 Eggdrop requires Tcl to compile. If you already have Tcl installed
965 on this system, and I just wasn't looking in the right place for it,
966 set the environment variables TCLLIB and TCLINC so I will know where
967 to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
968 run 'configure' again.
969
970 Read the README file if you don't know what Tcl is or how to get it
971 and install it.
972
973 EOF
974 exit 1
975 fi
976 ])dnl
977
978
979 dnl EGG_TCL_CHECK_PRE70()
980 dnl
981 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
982 # Is this version of Tcl too old for us to use ?
983 TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
984 if test "$TCL_VER_PRE70" = "yes"
985 then
986 cat << EOF >&2
987 configure: error:
988
989 Your Tcl version is much too old for Eggdrop to use.
990 I suggest you download and compile a more recent version.
991 The most reliable current version is $tclrecommendver and
992 can be downloaded from $tclrecommendsite
993
994 EOF
995 exit 1
996 fi
997 ])dnl
998
999
1000 dnl EGG_TCL_TESTLIBS()
1001 dnl
1002 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
1003 # Set variables for Tcl library tests
1004 TCL_TEST_LIB="$TCLLIBFNS"
1005 TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
1006
1007 if test ! "${ac_cv_lib_pthread-x}" = "x"
1008 then
1009 TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
1010 fi
1011 ])dnl
1012
1013
1014 dnl EGG_TCL_CHECK_FREE()
1015 dnl
1016 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
1017 if test "$egg_tcl_changed" = "yes"
1018 then
1019 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
1020 fi
1021
1022 # Check for Tcl_Free()
1023 AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS)
1024
1025 if test "$egg_cv_var_tcl_free" = "yes"
1026 then
1027 AC_DEFINE(HAVE_TCL_FREE)dnl
1028 fi
1029 ])dnl
1030
1031
1032 dnl EGG_TCL_ENABLE_THREADS()
1033 dnl
1034 AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl
1035 AC_ARG_ENABLE(tcl-threads,
1036 [ --disable-tcl-threads disable threaded Tcl support if detected ],
1037 enable_tcl_threads="$enableval",
1038 enable_tcl_threads=yes)
1039 ])dnl
1040
1041
1042 dnl EGG_TCL_CHECK_THREADS()
1043 dnl
1044 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1045 if test "$egg_tcl_changed" = "yes"
1046 then
1047 EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1048 fi
1049
1050 # Check for TclpFinalizeThreadData()
1051 AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS)
1052
1053 if test "$egg_cv_var_tcl_threaded" = "yes"
1054 then
1055 if test "$enable_tcl_threads" = "no"
1056 then
1057
1058 cat << 'EOF' >&2
1059 configure: warning:
1060
1061 You have disabled threads support on a system with a threaded Tcl library.
1062 Tcl features that rely on scheduled events may not function properly.
1063
1064 EOF
1065 else
1066 AC_DEFINE(HAVE_TCL_THREADS)dnl
1067 fi
1068
1069 # Add pthread library to $LIBS if we need it
1070 if test ! "${ac_cv_lib_pthread-x}" = "x"
1071 then
1072 LIBS="$ac_cv_lib_pthread $LIBS"
1073 fi
1074 fi
1075 ])dnl
1076
1077
1078 dnl EGG_TCL_LIB_REQS()
1079 dnl
1080 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1081 if test "$EGG_CYGWIN" = "yes"
1082 then
1083 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1084 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1085 else
1086 if test ! "$TCLLIBEXT" = ".a"
1087 then
1088 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1089 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1090 else
1091
1092 # Set default make as static for unshared Tcl library
1093 if test ! "$DEFAULT_MAKE" = "static"
1094 then
1095 cat << 'EOF' >&2
1096 configure: warning:
1097
1098 Your Tcl library is not a shared lib.
1099 configure will now set default make type to static...
1100
1101 EOF
1102 DEFAULT_MAKE=static
1103 AC_SUBST(DEFAULT_MAKE)dnl
1104 fi
1105
1106 # Are we using a pre 7.4 Tcl version ?
1107 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"}'`
1108 if test "$TCL_VER_PRE74" = "no"
1109 then
1110
1111 # Was the --with-tcllib option given ?
1112 if test ! "${tcllibname-x}" = "x"
1113 then
1114 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1115 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1116 else
1117 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1118 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1119 fi
1120 else
1121 cat << EOF >&2
1122 configure: warning:
1123
1124 Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1125 There are known problems, but we will attempt to work around them.
1126
1127 EOF
1128 TCL_REQS="libtcle.a"
1129 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1130 fi
1131 fi
1132 fi
1133 AC_SUBST(TCL_REQS)dnl
1134 AC_SUBST(TCL_LIBS)dnl
1135 ])dnl
1136
1137
1138 dnl EGG_FUNC_DLOPEN()
1139 dnl
1140 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1141 if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1142 then
1143 if test "$LINUX" = "yes"
1144 then
1145 cat << 'EOF' >&2
1146 configure: warning:
1147
1148 Since you are on a Linux system, this has a known problem...
1149 I know a kludge for it,
1150 EOF
1151
1152 if test -r "/lib/libdl.so.1"
1153 then
1154 cat << 'EOF' >&2
1155 and you seem to have it, so we'll do that...
1156
1157 EOF
1158 AC_DEFINE(HAVE_DLOPEN)dnl
1159 LIBS="/lib/libdl.so.1 $LIBS"
1160 else
1161 cat << 'EOF' >&2
1162 which you DON'T seem to have... doh!
1163 perhaps you may still have the stuff lying around somewhere
1164 if you work out where it is, add it to your XLIBS= lines
1165 and #define HAVE_DLOPEN in config.h
1166
1167 we'll proceed on anyway, but you probably won't be able
1168 to 'make eggdrop' but you might be able to make the
1169 static bot (I'll default your make to this version).
1170
1171 EOF
1172 DEFAULT_MAKE=static
1173 fi
1174 else
1175 cat << 'EOF' >&2
1176 configure: warning:
1177
1178 You don't seem to have libdl anywhere I can find it, this will
1179 prevent you from doing dynamic modules, I'll set your default
1180 make to static linking.
1181
1182 EOF
1183 DEFAULT_MAKE=static
1184 fi
1185 fi
1186 ])dnl
1187
1188
1189 dnl EGG_SUBST_EGGVERSION()
1190 dnl
1191 AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1192 EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1193 egg_version_num=`echo $EGGVERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
1194 AC_SUBST(EGGVERSION)dnl
1195 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1196 ])dnl
1197
1198
1199 dnl EGG_SUBST_DEST()
1200 dnl
1201 AC_DEFUN(EGG_SUBST_DEST, [dnl
1202 if test "${DEST-x}" = "x"
1203 then
1204 DEST=\${prefix}
1205 fi
1206 AC_SUBST(DEST)dnl
1207 ])dnl
1208
1209
1210 dnl EGG_SUBST_MOD_UPDIR()
1211 dnl
1212 dnl Since module's Makefiles aren't generated by configure, some
1213 dnl paths in src/mod/Makefile.in take care of them. For correct
1214 dnl path "calculation", we need to keep absolute paths in mind
1215 dnl (which don't need a "../" pre-pended).
1216 AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1217 case "$srcdir" in
1218 [[\\/]]* | ?:[[\\/]]*)
1219 MOD_UPDIR=""
1220 ;;
1221 *)
1222 MOD_UPDIR="../"
1223 ;;
1224 esac
1225 AC_SUBST(MOD_UPDIR)dnl
1226 ])dnl
1227
1228
1229 dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1230 dnl
1231 dnl Replace FILE-NAME if the newly created contents differs from the existing
1232 dnl file contents. Otherwise, leave the file alone. This avoids needless
1233 dnl recompiles.
1234 dnl
1235 define(EGG_REPLACE_IF_CHANGED, [dnl
1236 AC_OUTPUT_COMMANDS([
1237 egg_replace_file="$1"
1238 echo "creating $1"
1239 $2
1240 if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1241 then
1242 echo "$1 is unchanged"
1243 else
1244 mv conftest.out $egg_replace_file
1245 fi
1246 rm -f conftest.out], [$3])dnl
1247 ])dnl
1248
1249
1250 dnl EGG_TCL_LUSH()
1251 dnl
1252 AC_DEFUN(EGG_TCL_LUSH, [dnl
1253 EGG_REPLACE_IF_CHANGED(lush.h, [
1254 cat > conftest.out << EGGEOF
1255 /* Ignore me but do not erase me. I am a kludge. */
1256
1257 #include "$egg_tclinc/$egg_tclincfn"
1258 EGGEOF], [
1259 egg_tclinc="$TCLINC"
1260 egg_tclincfn="$TCLINCFN"])dnl
1261 ])dnl
1262
1263
1264 dnl EGG_CATCH_MAKEFILE_REBUILD()
1265 dnl
1266 AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1267 AC_OUTPUT_COMMANDS([
1268 if test -f .modules
1269 then
1270 $srcdir/misc/modconfig --top_srcdir="$srcdir/src" Makefile
1271 fi])
1272 ])dnl
1273
1274
1275 dnl EGG_SAVE_PARAMETERS()
1276 dnl
1277 AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1278 # Remove --cache-file and --srcdir arguments so they do not pile up.
1279 egg_ac_parameters=
1280 ac_prev=
1281 for ac_arg in $ac_configure_args; do
1282 if test -n "$ac_prev"; then
1283 ac_prev=
1284 continue
1285 fi
1286 case $ac_arg in
1287 -cache-file | --cache-file | --cache-fil | --cache-fi \
1288 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1289 ac_prev=cache_file ;;
1290 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1291 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
1292 | --c=*)
1293 ;;
1294 --config-cache | -C)
1295 ;;
1296 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1297 ac_prev=srcdir ;;
1298 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1299 ;;
1300 *) egg_ac_parameters="$egg_ac_parameters $ac_arg" ;;
1301 esac
1302 done
1303
1304 AC_SUBST(egg_ac_parameters)dnl
1305 ])dnl
1306
1307
1308 AC_DEFUN([AC_PROG_CC_WIN32], [
1309 AC_MSG_CHECKING([how to access the Win32 API])
1310 WIN32FLAGS=
1311 AC_TRY_COMPILE(,[
1312 #ifndef WIN32
1313 # ifndef _WIN32
1314 # error WIN32 or _WIN32 not defined
1315 # endif
1316 #endif], [
1317 dnl found windows.h with the current config.
1318 AC_MSG_RESULT([present by default])
1319 ], [
1320 dnl try -mwin32
1321 ac_compile_save="$ac_compile"
1322 dnl we change CC so config.log looks correct
1323 save_CC="$CC"
1324 ac_compile="$ac_compile -mwin32"
1325 CC="$CC -mwin32"
1326 AC_TRY_COMPILE(,[
1327 #ifndef WIN32
1328 # ifndef _WIN32
1329 # error WIN32 or _WIN32 not defined
1330 # endif
1331 #endif], [
1332 dnl found windows.h using -mwin32
1333 AC_MSG_RESULT([found via -mwin32])
1334 ac_compile="$ac_compile_save"
1335 CC="$save_CC"
1336 WIN32FLAGS="-mwin32"
1337 ], [
1338 ac_compile="$ac_compile_save"
1339 CC="$save_CC"
1340 AC_MSG_RESULT([not found])
1341 ])
1342 ])
1343
1344 ])
1345 dnl

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23