/[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.56 - (show annotations) (download)
Mon Feb 25 03:39:56 2002 UTC (18 years, 4 months ago) by wcc
Branch: MAIN
CVS Tags: eggdrop1_6_9
Changes since 1.55: +12 -12 lines
made a few cosmetic changes to the configure script

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23