/[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.28 - (show annotations) (download)
Sun Oct 1 19:19:19 2000 UTC (19 years ago) by fabian
Branch: MAIN
Changes since 1.27: +110 -42 lines
fabian: applied SuperS' osfix3 patch. Fixed tcl configuration caching (should have made a seperate patch, but I'm too lazy. Someone please fix me ;)).

1 dnl aclocal.m4
2 dnl macros autoconf uses when building configure from configure.in
3 dnl
4 dnl $Id: aclocal.m4,v 1.27 2000/10/01 19:14:41 fabian 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 MOD_LD="${CC}"
185 SHLIB_LD="${CC} -shared"
186 MOD_EXT=dll
187 AC_DEFINE(MODULES_OK)dnl
188 ;;
189 *)
190 AC_MSG_RESULT(Cygwin pre 1.0 or unknown)
191 NEED_DL=0
192 DEFAULT_MAKE=static
193 ;;
194 esac
195 ;;
196 HP-UX)
197 AC_MSG_RESULT(HP-UX)
198 HPUX=yes
199 MOD_LD="${CC} -fPIC -shared"
200 SHLIB_CC="${CC} -fPIC"
201 SHLIB_LD="ld -b"
202 NEED_DL=0
203 AC_DEFINE(MODULES_OK)dnl
204 AC_DEFINE(HPUX_HACKS)dnl
205 if test "x`${UNAME} -r | cut -d . -f 2`" = "x10"
206 then
207 AC_DEFINE(HPUX10_HACKS)dnl
208 fi
209 ;;
210 dell)
211 AC_MSG_RESULT(Dell SVR4)
212 SHLIB_STRIP=touch
213 NEED_DL=0
214 MOD_LD="${CC} -lelf -lucb"
215 ;;
216 IRIX-4.*)
217 AC_MSG_RESULT(IRIX4.+!)
218 IRIX=yes
219 SHLIB_STRIP=touch
220 NEED_DL=0
221 DEFAULT_MAKE=static
222 ;;
223 IRIX-5.*|IRIX-6.*)
224 AC_MSG_RESULT(IRIX 5 OR 6)
225 SHLIB_LD="ld -n32 -shared -rdata_shared"
226 IRIX=yes
227 SHLIB_STRIP=touch
228 NEED_DL=0
229 DEFAULT_MAKE=static
230 ;;
231 IRIX-6.3)
232 AC_MSG_RESULT(IRIX6.3)
233 IRIX=yes
234 SHLIB_STRIP=touch
235 NEED_DL=0
236 DEFAULT_MAKE=static
237 SHLIB_LD="ld -n32 -D_OLD_TERMIOS"
238 ;;
239 IRIX64*)
240 AC_MSG_RESULT(64-BIT IRIX)
241 IRIX=yes
242 SHLIB_STRIP=strip
243 NEED_DL=0
244 DEFAULT_MAKE=static
245 SHLIB_LD="ld -32 -shared -rdata_shared"
246 ;;
247 Ultrix)
248 AC_MSG_RESULT(Ultrix)
249 NEED_DL=0
250 SHLIB_STRIP=touch
251 DEFAULT_MAKE=static
252 SHELL=/bin/sh5
253 ;;
254 SINIX*)
255 AC_MSG_RESULT(SINIX)
256 NEED_DL=0
257 SHLIB_STRIP=touch
258 DEFAULT_MAKE=static
259 SHLIB_CC="cc -G"
260 ;;
261 BeOS)
262 AC_MSG_RESULT(BeOS)
263 NEED_DL=0
264 SHLIB_STRIP=strip
265 DEFAULT_MAKE=static
266 ;;
267 Linux)
268 AC_MSG_RESULT(Linux)
269 LINUX=yes
270 CFLAGS="$CFLAGS -Wall"
271 MOD_LD="${CC}"
272 SHLIB_CC="${CC} -fPIC"
273 SHLIB_LD="${CC} -shared -nostartfiles"
274 AC_DEFINE(MODULES_OK)dnl
275 ;;
276 Lynx)
277 AC_MSG_RESULT(Lynx OS)
278 NEED_DL=0
279 DEFAULT_MAKE=static
280 SHLIB_STRIP=strip
281 ;;
282 OSF1)
283 AC_MSG_RESULT(OSF)
284 case `${UNAME} -r | cut -d . -f 1` in
285 V*)
286 AC_MSG_RESULT([ Digital OSF])
287 if test "x$AWK" = "xgawk"
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 AC_MSG_RESULT([ pre 1.3])
300 SHLIB_LD="ld -R -export $@:"
301 AC_DEFINE(MODULES_OK)dnl
302 AC_DEFINE(OSF1_HACKS)dnl
303 ;;
304 1.*)
305 AC_MSG_RESULT([ 1.3+])
306 SHLIB_CC="${CC} -fpic"
307 SHLIB_LD="ld -shared"
308 AC_DEFINE(MODULES_OK)dnl
309 AC_DEFINE(OSF1_HACKS)dnl
310 ;;
311 *)
312 AC_MSG_RESULT([ Some other weird OSF! No modules for you...])
313 NEED_DL=0
314 DEFAULT_MAKE=static
315 ;;
316 esac
317 AC_DEFINE(STOP_UAC)dnl
318 ;;
319 SunOS-4*)
320 AC_MSG_RESULT(SunOS 4)
321 SHLIB_LD="ld"
322 SHLIB_CC="${CC} -PIC"
323 SUNOS=yes
324 SHLIB_STRIP=touch
325 ;;
326 SunOS)
327 if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"
328 then
329 AC_MSG_RESULT(Solaris)
330 SHLIB_CC="${CC} -KPIC"
331 SHLIB_LD="/usr/ccs/bin/ld -G -z text"
332 else
333 AC_MSG_RESULT(SunOS)
334 SUNOS=yes
335 SHLIB_LD=ld
336 SHLIB_STRIP=touch
337 AC_DEFINE(DLOPEN_1)dnl
338 fi
339 AC_DEFINE(MODULES_OK)dnl
340 ;;
341 *BSD)
342 AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison)
343 SHLIB_CC="${CC} -fPIC"
344 SHLIB_LD="ld -Bshareable -x"
345 AC_DEFINE(MODULES_OK)dnl
346 ;;
347 *)
348 if test -r "/mach"
349 then
350 AC_MSG_RESULT([NeXT])
351 NEED_DL=0
352 DEFAULT_MAKE=static
353 AC_DEFINE(BORGCUBES)dnl
354 else
355 if test -r "/cmds"
356 then
357 AC_MSG_RESULT(QNX)
358 SHLIB_STRIP=touch
359 NEED_DL=0
360 DEFAULT_MAKE=static
361 else
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 if test "$IRIX" = "yes"
386 then
387 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
388 else
389 AC_CHECK_LIB(socket, socket)
390 AC_CHECK_LIB(nsl, connect)
391 AC_CHECK_LIB(dns, gethostbyname)
392 AC_CHECK_LIB(dl, dlopen)
393 AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
394 # This is needed for Tcl libraries compiled with thread support
395 AC_CHECK_LIB(pthread, pthread_mutex_init,
396 ac_cv_lib_pthread_pthread_mutex_init=yes,
397 ac_cv_lib_pthread_pthread_mutex_init=no)
398 if test "$SUNOS" = "yes"
399 then
400 # For suns without yp or something like that
401 AC_CHECK_LIB(dl, main)
402 else
403 if test "$HPUX" = "yes"
404 then
405 AC_CHECK_LIB(dld, shl_load)
406 fi
407 fi
408 fi
409 ])dnl
410
411
412 dnl EGG_CHECK_FUNC_VSPRINTF()
413 dnl
414 AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
415 AC_CHECK_FUNCS(vsprintf)
416 if test "x${ac_cv_func_vsprintf}" = "xno"
417 then
418 cat << 'EOF' >&2
419 configure: error:
420
421 Your system does not have the sprintf/vsprintf libraries.
422 These are required to compile almost anything. Sorry.
423
424 EOF
425 exit 1
426 fi
427 ])dnl
428
429
430 dnl EGG_HEADER_STDC()
431 dnl
432 AC_DEFUN(EGG_HEADER_STDC, [dnl
433 if test "x${ac_cv_header_stdc}" = "xno"
434 then
435 cat << 'EOF' >&2
436 configure: error:
437
438 Your system must support ANSI C Header files.
439 These are required for the language support. Sorry.
440
441 EOF
442 exit 1
443 fi
444 ])dnl
445
446
447 dnl EGG_CYGWIN()
448 dnl
449 dnl Check for Cygwin support.
450 AC_DEFUN(EGG_CYGWIN, [dnl
451 AC_CYGWIN
452 if test ! "x${CYGWIN}" = "x"
453 then
454 AC_DEFINE(CYGWIN_HACKS)dnl
455 fi
456 ])dnl
457
458
459 dnl EGG_EXEEXT()
460 dnl
461 dnl Test for executable suffix and define eggdrop's executable name
462 dnl accordingly.
463 AC_DEFUN(EGG_EXEEXT, [dnl
464 EGGEXEC=eggdrop
465 AC_EXEEXT
466 if test ! "x${EXEEXT}" = "x"
467 then
468 EGGEXEC=eggdrop${EXEEXT}
469 fi
470 AC_SUBST(EGGEXEC)dnl
471 ])dnl
472
473
474 dnl EGG_TCL_ARG_WITH()
475 dnl
476 AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
477 # oohh new configure --variables for those with multiple tcl libs
478 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
479 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
480
481 WARN=0
482 # Make sure either both or neither $tcllibname and $tclincname are set
483 if test ! "x${tcllibname}" = "x"
484 then
485 if test "x${tclincname}" = "x"
486 then
487 WARN=1
488 tcllibname=""
489 TCLLIB=""
490 TCLINC=""
491 fi
492 else
493 if test ! "x${tclincname}" = "x"
494 then
495 WARN=1
496 tclincname=""
497 TCLLIB=""
498 TCLINC=""
499 fi
500 fi
501 if test ${WARN} = 1
502 then
503 cat << 'EOF' >&2
504 configure: warning:
505
506 You must specify both --with-tcllib and --with-tclinc for them to work.
507 configure will now attempt to autodetect both the Tcl library and header...
508
509 EOF
510 fi
511 ])dnl
512
513
514 dnl EGG_TCL_ENV()
515 dnl
516 AC_DEFUN(EGG_TCL_ENV, [dnl
517 WARN=0
518 # Make sure either both or neither $TCLLIB and $TCLINC are set
519 if test ! "x${TCLLIB}" = "x"
520 then
521 if test "x${TCLINC}" = "x"
522 then
523 WARN=1
524 WVAR1=TCLLIB
525 WVAR2=TCLINC
526 TCLLIB=""
527 fi
528 else
529 if test ! "x${TCLINC}" = "x"
530 then
531 WARN=1
532 WVAR1=TCLINC
533 WVAR2=TCLLIB
534 TCLINC=""
535 fi
536 fi
537 if test ${WARN} = 1
538 then
539 cat << EOF >&2
540 configure: warning:
541
542 Environment variable ${WVAR1} was set, but I did not detect ${WVAR2}.
543 Please set both TCLLIB and TCLINC correctly if you wish to use them.
544 configure will now attempt to autodetect both the Tcl library and header...
545
546 EOF
547 fi
548 ])dnl
549
550
551 dnl EGG_TCL_WITH_TCLLIB()
552 dnl
553 AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
554 # Look for Tcl library: if $tcllibname is set, check there first
555 if test ! "x${tcllibname}" = "x"
556 then
557 if test -f "$tcllibname" && test -r "$tcllibname"
558 then
559 TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
560 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
561 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
562 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
563 else
564 cat << EOF >&2
565 configure: warning:
566
567 The file '$tcllibname' given to option --with-tcllib is not valid.
568 configure will now attempt to autodetect both the Tcl library and header...
569
570 EOF
571 tcllibname=""
572 tclincname=""
573 TCLLIB=""
574 TCLLIBFN=""
575 TCLINC=""
576 TCLINCFN=""
577 fi
578 fi
579 ])dnl
580
581
582 dnl EGG_TCL_WITH_TCLINC()
583 dnl
584 AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
585 # Look for Tcl header: if $tclincname is set, check there first
586 if test ! "x${tclincname}" = "x"
587 then
588 if test -f "$tclincname" && test -r "$tclincname"
589 then
590 TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
591 TCLINCFN=`$BASENAME $tclincname`
592 else
593 cat << EOF >&2
594 configure: warning:
595
596 The file '$tclincname' given to option --with-tclinc is not valid.
597 configure will now attempt to autodetect both the Tcl library and header...
598
599 EOF
600 tcllibname=""
601 tclincname=""
602 TCLLIB=""
603 TCLLIBFN=""
604 TCLINC=""
605 TCLINCFN=""
606 fi
607 fi
608 ])dnl
609
610
611 dnl EGG_TCL_FIND_LIBRARY()
612 dnl
613 AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
614 # Look for Tcl library: if $TCLLIB is set, check there first
615 if test "x${TCLLIBFN}" = "x"
616 then
617 if test ! "x${TCLLIB}" = "x"
618 then
619 if test -d "${TCLLIB}"
620 then
621 for tcllibfns in $tcllibnames
622 do
623 for tcllibext in $tcllibextensions
624 do
625 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
626 then
627 TCLLIBFN=$tcllibfns$tcllibext
628 TCLLIBEXT=$tcllibext
629 TCLLIBFNS=$tcllibfns
630 break 2
631 fi
632 done
633 done
634 fi
635 if test "x${TCLLIBFN}" = "x"
636 then
637 cat << 'EOF' >&2
638 configure: warning:
639
640 Environment variable TCLLIB was set, but incorrect.
641 Please set both TCLLIB and TCLINC correctly if you wish to use them.
642 configure will now attempt to autodetect both the Tcl library and header...
643
644 EOF
645 TCLLIB=""
646 TCLLIBFN=""
647 TCLINC=""
648 TCLINCFN=""
649 fi
650 fi
651 fi
652 ])dnl
653
654
655 dnl EGG_TCL_FIND_HEADER()
656 dnl
657 AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
658 # Look for Tcl header: if $TCLINC is set, check there first
659 if test "x${TCLINCFN}" = "x"
660 then
661 if test ! "x${TCLINC}" = "x"
662 then
663 if test -d "${TCLINC}"
664 then
665 for tclheaderfn in $tclheadernames
666 do
667 if test -r "$TCLINC/$tclheaderfn"
668 then
669 TCLINCFN=$tclheaderfn
670 break
671 fi
672 done
673 fi
674 if test "x${TCLINCFN}" = "x"
675 then
676 cat << 'EOF' >&2
677 configure: warning:
678
679 Environment variable TCLINC was set, but incorrect.
680 Please set both TCLLIB and TCLINC correctly if you wish to use them.
681 configure will now attempt to autodetect both the Tcl library and header...
682
683 EOF
684 TCLLIB=""
685 TCLLIBFN=""
686 TCLINC=""
687 TCLINCFN=""
688 fi
689 fi
690 fi
691 ])dnl
692
693
694 dnl EGG_TCL_CHECK_LIBRARY()
695 dnl
696 AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
697 AC_MSG_CHECKING(for Tcl library)
698
699 # Attempt autodetect for $TCLLIBFN if it's not set
700 if test ! "x${TCLLIBFN}" = "x"
701 then
702 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
703 else
704 for tcllibfns in $tcllibnames
705 do
706 for tcllibext in $tcllibextensions
707 do
708 for tcllibpath in $tcllibpaths
709 do
710 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
711 then
712 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
713 TCLLIB=$tcllibpath
714 TCLLIBFN=$tcllibfns$tcllibext
715 TCLLIBEXT=$tcllibext
716 TCLLIBFNS=$tcllibfns
717 break 3
718 fi
719 done
720 done
721 done
722 fi
723
724 # Show if $TCLLIBFN wasn't found
725 if test "x${TCLLIBFN}" = "x"
726 then
727 AC_MSG_RESULT(not found)
728 fi
729 AC_SUBST(TCLLIB)dnl
730 AC_SUBST(TCLLIBFN)dnl
731 ])dnl
732
733
734 dnl EGG_TCL_CHECK_HEADER()
735 dnl
736 AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
737 AC_MSG_CHECKING(for Tcl header)
738
739 # Attempt autodetect for $TCLINCFN if it's not set
740 if test ! "x${TCLINCFN}" = "x"
741 then
742 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
743 else
744 for tclheaderpath in $tclheaderpaths
745 do
746 for tclheaderfn in $tclheadernames
747 do
748 if test -r "$tclheaderpath/$tclheaderfn"
749 then
750 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
751 TCLINC=$tclheaderpath
752 TCLINCFN=$tclheaderfn
753 break 2
754 fi
755 done
756 done
757 # FreeBSD hack ...
758 if test "x${TCLINCFN}" = "x"
759 then
760 for tcllibfns in $tcllibnames
761 do
762 for tclheaderpath in $tclheaderpaths
763 do
764 for tclheaderfn in $tclheadernames
765 do
766 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
767 then
768 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
769 TCLINC=$tclheaderpath/$tcllibfns
770 TCLINCFN=$tclheaderfn
771 break 3
772 fi
773 done
774 done
775 done
776 fi
777 fi
778
779 # Show if $TCLINCFN wasn't found
780 if test "x${TCLINCFN}" = "x"
781 then
782 AC_MSG_RESULT(not found)
783 fi
784 AC_SUBST(TCLINC)dnl
785 AC_SUBST(TCLINCFN)dnl
786 ])dnl
787
788
789 dnl EGG_CACHE_UNSET(CACHE-ID)
790 dnl
791 dnl Unsets a certain cache item. Typically called before using
792 dnl the AC_CACHE_*() macros.
793 AC_DEFUN(EGG_CACHE_UNSET, [dnl
794 unset $1
795 ])
796
797
798 dnl EGG_TCL_DETECT_CHANGE()
799 dnl
800 dnl Detect whether the tcl system has changed since our last
801 dnl configure run. Set egg_tcl_changed accordingly.
802 dnl
803 dnl Tcl related feature and version checks should re-run their
804 dnl checks as soon as egg_tcl_changed is set to "yes".
805 AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
806 AC_MSG_CHECKING(whether the tcl system has changed)
807 egg_tcl_changed=yes
808 egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"
809 if test "${egg_tcl_id}" != ":::"; then
810 egg_tcl_cached=yes
811 AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
812 egg_cv_var_tcl_id="$egg_tcl_id"
813 egg_tcl_cached=no
814 ])
815 if test "${egg_tcl_cached}" = "yes"; then
816 if test "x${egg_cv_var_tcl_id}" = "x${egg_tcl_id}"; then
817 egg_tcl_changed=no
818 else
819 egg_cv_var_tcl_id="$egg_tcl_id"
820 fi
821 fi
822 fi
823 if test "$egg_tcl_changed" = "yes"; then
824 AC_MSG_RESULT(yes)
825 else
826 AC_MSG_RESULT(no)
827 fi
828 ])
829
830
831 dnl EGG_TCL_CHECK_VERSION()
832 dnl
833 AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
834 # Both TCLLIBFN & TCLINCFN must be set, or we bail
835 TCL_FOUND=0
836 if test "x${TCLLIBFN}" != "x" && test "x${TCLINCFN}" != "x"
837 then
838 TCL_FOUND=1
839
840 # Check Tcl's version
841 if test "$egg_tcl_changed" = "yes"; then
842 EGG_CACHE_UNSET(egg_cv_var_tcl_version)
843 fi
844 AC_MSG_CHECKING(for Tcl version)
845 AC_CACHE_VAL(egg_cv_var_tcl_version, [
846 egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
847 ])
848
849 if test ! "x${egg_cv_var_tcl_version}" = "x"
850 then
851 AC_MSG_RESULT($egg_cv_var_tcl_version)
852 else
853 AC_MSG_RESULT(not found)
854 TCL_FOUND=0
855 fi
856
857 # Check Tcl's patch level (if avaliable)
858 if test "$egg_tcl_changed" = "yes"; then
859 EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
860 fi
861 AC_MSG_CHECKING(for Tcl patch level)
862 AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [
863 eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
864 ])
865
866 if test ! "x${egg_cv_var_tcl_patch_level}" = "x"
867 then
868 AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
869 else
870 egg_cv_var_tcl_patch_level="unknown"
871 AC_MSG_RESULT(unknown)
872 fi
873 fi
874
875 # Check if we found Tcl's version
876 if test $TCL_FOUND = 0
877 then
878 cat << 'EOF' >&2
879 configure: error:
880
881 I can't find Tcl on this system.
882
883 Eggdrop requires Tcl to compile. If you already have Tcl installed
884 on this system, and I just wasn't looking in the right place for it,
885 set the environment variables TCLLIB and TCLINC so I will know where
886 to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then
887 run 'configure' again.
888
889 Read the README file if you don't know what Tcl is or how to get it
890 and install it.
891
892 EOF
893 exit 1
894 fi
895 ])dnl
896
897
898 dnl EGG_TCL_CHECK_PRE70()
899 dnl
900 AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
901 # Is this version of Tcl too old for us to use ?
902 TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
903 if test "x$TCL_VER_PRE70" = "xyes"
904 then
905 cat << EOF >&2
906 configure: error:
907
908 Your Tcl version is much too old for eggdrop to use.
909 I suggest you download and complie a more recent version.
910 The most reliable current version is $tclrecommendver and
911 can be downloaded from $tclrecommendsite
912
913 EOF
914 exit 1
915 fi
916 ])dnl
917
918
919 dnl EGG_TCL_CHECK_PRE75()
920 dnl
921 AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
922 # Are we using a pre 7.5 Tcl version ?
923 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"}'`
924 if test "x${TCL_VER_PRE75}" = "xyes"
925 then
926 AC_DEFINE(HAVE_PRE7_5_TCL)dnl
927 fi
928 ])dnl
929
930
931 dnl EGG_TCL_TESTLIBS()
932 dnl
933 AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
934 # Setup TCL_TESTLIBS for Tcl library tests
935 if test ! "x${TCLLIBEXT}" = "x.a"
936 then
937 TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"
938 else
939 if test ! "x${tcllibname}" = "x"
940 then
941 TCL_TESTLIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB $LIBS"
942 else
943 TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"
944 fi
945 fi
946 if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
947 then
948 TCL_TESTLIBS="-lpthread $TCL_TESTLIBS"
949 fi
950 ])dnl
951
952
953 dnl EGG_TCL_CHECK_FREE()
954 dnl
955 AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
956 # Check for Tcl_Free()
957 if test "$egg_tcl_changed" = "yes"; then
958 EGG_CACHE_UNSET(egg_cv_var_tcl_free)
959 fi
960 AC_CACHE_CHECK(if Tcl library has Tcl_Free, [egg_cv_var_tcl_free], [
961 ac_save_LIBS="$LIBS"
962 LIBS="$TCL_TESTLIBS"
963 cat > conftest.$ac_ext << EOF
964 #include "confdefs.h"
965 char Tcl_Free();
966
967 int main() {
968 Tcl_Free();
969 return 0;
970 }
971 EOF
972 if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
973 then
974 rm -rf conftest*
975 egg_cv_var_tcl_free=yes
976 else
977 echo "configure: failed program was:" >&5
978 cat conftest.$ac_ext >&5
979 rm -rf conftest*
980 egg_cv_var_tcl_free=no
981 fi
982 rm -f conftest*
983 LIBS="$ac_save_LIBS"
984 ])
985
986 if test "x${egg_cv_var_tcl_free}" = "xyes"
987 then
988 AC_DEFINE(HAVE_TCL_FREE)dnl
989 fi
990 ])dnl
991
992
993 dnl EGG_TCL_CHECK_THREADS()
994 dnl
995 AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
996 # Check for TclpFinalizeThreadData()
997 if test "$egg_tcl_changed" = "yes"; then
998 EGG_CACHE_UNSET(egg_cv_var_tcl_multithreaded)
999 fi
1000 AC_CACHE_CHECK(if Tcl library is multithreaded, egg_cv_var_tcl_multithreaded, [
1001 ac_save_LIBS="$LIBS"
1002 LIBS="$TCL_TESTLIBS"
1003 cat > conftest.$ac_ext << EOF
1004 #include "confdefs.h"
1005 char TclpFinalizeThreadData();
1006
1007 int main() {
1008 TclpFinalizeThreadData();
1009 return 0;
1010 }
1011 EOF
1012 if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
1013 then
1014 rm -rf conftest*
1015 egg_cv_var_tcl_multithreaded=yes
1016 else
1017 echo "configure: failed program was:" >&5
1018 cat conftest.$ac_ext >&5
1019 rm -rf conftest*
1020 egg_cv_var_tcl_multithreaded=no
1021 fi
1022 rm -f conftest*
1023 LIBS="$ac_save_LIBS"
1024 ])
1025
1026 if test "x${egg_cv_var_tcl_multithreaded}" = "xyes"
1027 then
1028 AC_DEFINE(HAVE_TCL_THREADS)dnl
1029
1030 # Add -lpthread to $LIBS if we have it
1031 if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
1032 then
1033 LIBS="-lpthread $LIBS"
1034 fi
1035 fi
1036 ])dnl
1037
1038
1039 dnl EGG_TCL_LIB_REQS()
1040 dnl
1041 AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1042 if test ! "x${TCLLIBEXT}" = "x.a"
1043 then
1044 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1045 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1046 else
1047
1048 # Set default make as static for unshared Tcl library
1049 if test ! "$DEFAULT_MAKE" = "static"
1050 then
1051 cat << 'EOF' >&2
1052 configure: warning:
1053
1054 Your Tcl library is not a shared lib.
1055 configure will now set default make type to static...
1056
1057 EOF
1058 DEFAULT_MAKE=static
1059 AC_SUBST(DEFAULT_MAKE)dnl
1060 fi
1061
1062 # Are we using a pre 7.4 Tcl version ?
1063 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"}'`
1064 if test "x${TCL_VER_PRE74}" = "xno"
1065 then
1066
1067 # Was the --with-tcllib option given ?
1068 if test ! "x${tcllibname}" = "x"
1069 then
1070 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1071 TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
1072 else
1073 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1074 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
1075 fi
1076 else
1077 cat << EOF >&2
1078 configure: warning:
1079
1080 Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4.
1081 There are known problems, but we will attempt to work around them.
1082
1083 EOF
1084 TCL_REQS="libtcle.a"
1085 TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB"
1086 fi
1087 fi
1088 AC_SUBST(TCL_REQS)dnl
1089 AC_SUBST(TCL_LIBS)dnl
1090 ])dnl
1091
1092
1093 dnl EGG_FUNC_DLOPEN()
1094 dnl
1095 AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1096 if test $NEED_DL = 1 && test "x${ac_cv_func_dlopen}" = "xno"
1097 then
1098 if test "$LINUX" = "yes"
1099 then
1100 cat << 'EOF' >&2
1101 configure: warning:
1102
1103 Since you are on a Linux system, this has a known problem...
1104 I know a kludge for it,
1105 EOF
1106
1107 if test -r "/lib/libdl.so.1"
1108 then
1109 cat << 'EOF' >&2
1110 and you seem to have it, so we'll do that...
1111
1112 EOF
1113 AC_DEFINE(HAVE_DLOPEN)dnl
1114 LIBS="/lib/libdl.so.1 $LIBS"
1115 else
1116 cat << 'EOF' >&2
1117 which you DON'T seem to have... doh!
1118 perhaps you may still have the stuff lying around somewhere
1119 if you work out where it is, add it to your XLIBS= lines
1120 and #define HAVE_DLOPEN in config.h
1121
1122 we'll proceed on anyway, but you probably won't be able
1123 to 'make eggdrop' but you might be able to make the
1124 static bot (I'll default your make to this version).
1125
1126 EOF
1127 DEFAULT_MAKE=static
1128 fi
1129 else
1130 cat << 'EOF' >&2
1131 configure: warning:
1132
1133 You don't seem to have libdl anywhere I can find it, this will
1134 prevent you from doing dynamic modules, I'll set your default
1135 make to static linking.
1136
1137 EOF
1138 DEFAULT_MAKE=static
1139 fi
1140 fi
1141 ])dnl
1142
1143
1144 dnl EGG_SUBST_EGGVERSION()
1145 dnl
1146 AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1147 EGGVERSION=`grep 'char.egg_version' ${srcdir}/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1148 egg_version_num=`echo ${EGGVERSION} | $AWK 'BEGIN { FS = "."; } { printf("%d%02d%02d", [$]1, [$]2, [$]3); }'`
1149 AC_SUBST(EGGVERSION)dnl
1150 AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1151 ])dnl
1152
1153
1154 dnl EGG_SUBST_DEST()
1155 dnl
1156 AC_DEFUN(EGG_SUBST_DEST, [dnl
1157 if test "x$DEST" = "x"
1158 then
1159 DEST=\${prefix}
1160 fi
1161 AC_SUBST(DEST)dnl
1162 ])dnl
1163
1164
1165 dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
1166 dnl
1167 dnl Replace FILE-NAME if the newly created contents differs from the existing
1168 dnl file contents. Otherwise leave the file allone. This avoids needless
1169 dnl recompiles.
1170 dnl
1171 define(EGG_REPLACE_IF_CHANGED, [dnl
1172 AC_OUTPUT_COMMANDS([
1173 egg_replace_file=$1
1174 echo "creating $1"
1175 $2
1176 if test -f ${egg_replace_file} && cmp -s conftest.out ${egg_replace_file}
1177 then
1178 echo "$1 is unchanged"
1179 else
1180 mv conftest.out ${egg_replace_file}
1181 fi
1182 rm -f conftest.out], [$3])dnl
1183 ])dnl
1184
1185
1186 dnl EGG_TCL_LUSH()
1187 dnl
1188 AC_DEFUN(EGG_TCL_LUSH, [dnl
1189 EGG_REPLACE_IF_CHANGED(lush.h, [
1190 cat > conftest.out <<EGGEOF
1191 /* Ignore me but do not erase me. I am a kludge. */
1192
1193 #include "${egg_tclinc}/${egg_tclincfn}"
1194 EGGEOF], [egg_tclinc=${TCLINC}; egg_tclincfn=${TCLINCFN}])dnl
1195 ])dnl
1196
1197
1198 dnl EGG_CATCH_MAKEFILE_REBUILD()
1199 dnl
1200 AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1201 AC_OUTPUT_COMMANDS([
1202 if test -f .modules; then
1203 ${ac_given_srcdir}/misc/modconfig --top_srcdir=${ac_given_srcdir} Makefile
1204 fi])
1205 ])dnl
1206
1207 dnl EGG_SAVE_PARAMETERS()
1208 dnl
1209 AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl
1210 dnl Normally, we shouldn't use this level as it's not intended for this
1211 dnl type of code, but there's no other way to run it before the main
1212 dnl parameter loop in configure.
1213 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
1214 egg_ac_parameters="[$]*"
1215 AC_DIVERT_POP()dnl to NORMAL
1216 AC_SUBST(egg_ac_parameters)dnl
1217 ])dnl

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23