/[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.22 - (show annotations) (download)
Mon Aug 7 10:09:16 2000 UTC (19 years, 1 month ago) by fabian
Branch: MAIN
CVS Tags: eggdrop105040
Changes since 1.21: +9 -8 lines
1.4 reync, Aug7 965641446

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23