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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23