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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23