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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23