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

Contents of /eggdrop1.9/aclocal.m4

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


Revision 1.39 - (show annotations) (download)
Mon Jun 25 21:32:07 2001 UTC (18 years ago) by guppy
Branch: MAIN
Changes since 1.38: +14 -6 lines
added a fixed up version of Kirben's pthreads patch .. also I forgot an update for his previous cygwin_bind patch

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23