/[cvs]/eggdrop1.4/configure.in
ViewVC logotype

Contents of /eggdrop1.4/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.33 - (show annotations) (download)
Wed Oct 20 01:36:20 1999 UTC (20 years, 9 months ago) by guppy
Branch: MAIN
Changes since 1.32: +22 -12 lines
pthreads

1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(eggdrop.conf.dist)
3 ac_default_prefix=\${HOME}/eggdrop
4 AC_CONFIG_HEADER(config.h)
5
6 AC_MSG_RESULT()
7 AC_MSG_RESULT(This is eggdrop's GNU configure script.)
8 AC_MSG_RESULT(It's going to run a bunch of strange tests to hopefully)
9 AC_MSG_RESULT(make your compile work without much twiddling.)
10 AC_MSG_RESULT()
11
12 AC_PROG_CC
13
14 dnl no cross-compiling!
15 if test ! "x${cross_compiling}" = "xno"
16 then
17 cat << 'EOF' >&2
18 configure: error:
19
20 This system does not appear to have a working C compiler.
21 A working C compiler is required to compile eggdrop.
22
23 EOF
24 exit 1
25 fi
26
27 dnl crazy machines
28 AC_AIX
29 AC_ISC_POSIX
30 AC_MINIX
31
32 dnl Checks for programs.
33 AC_PROG_MAKE_SET
34 AC_PROG_RANLIB
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
37 AC_CHECK_PROG(STRIP,strip,strip)
38 AC_CHECK_PROG(UNAME,uname,uname)
39
40 dnl awk is needed for Tcl library stuff and version number checking.
41 AC_PROG_AWK
42 if test "x${AWK}" = "x"
43 then
44 cat << 'EOF' >&2
45 configure: error:
46
47 This system seems to lack a working 'awk' command.
48 A working 'awk' command is required to compile eggdrop.
49
50 EOF
51 exit 1
52 fi
53
54 dnl basename is needed for Tcl library stuff.
55 AC_CHECK_PROG(BASENAME,basename,basename)
56 if test "x${BASENAME}" = "x"
57 then
58 cat << 'EOF' >&2
59 configure: error:
60
61 This system seems to lack a working 'basename' command.
62 A working 'basename' command is required to compile eggdrop.
63
64 EOF
65 exit 1
66 fi
67
68 dnl dirname is needed for Tcl library stuff.
69 AC_CHECK_PROG(DIRNAME,dirname,dirname)
70 if test "x${DIRNAME}" = "x"
71 then
72 cat << 'EOF' >&2
73 configure: error:
74
75 This system seems to lack a working 'dirname' command.
76 A working 'dirname' command is required to compile eggdrop.
77
78 EOF
79 exit 1
80 fi
81
82 dnl stop putting -g in there! @#$!#$%!
83 if test "x${CFLAGS}" = "x"
84 then
85 if test "x${CC}" = "xgcc"
86 then
87 CFLAGS="-O2"
88 else
89 CFLAGS="-O"
90 fi
91 fi
92
93 if test "x${STRIP}" = "x"
94 then
95 STRIP=touch
96 fi
97
98 dnl test the os and set the module linking settings
99 EGGEXEC=eggdrop
100 LINUX=no
101 IRIX=no
102 SUNOS=no
103 HPUX=no
104 MOD_CC="${CC}"
105 MOD_LD="${CC}"
106 MOD_STRIP="${STRIP}"
107 SHLIB_CC="${CC}"
108 SHLIB_LD="${CC}"
109 SHLIB_STRIP="${STRIP}"
110 NEED_DL=1
111 DEFAULT_MAKE=eggdrop
112 AC_MSG_CHECKING(your OS)
113 SYSTEM=`${UNAME}`
114 case "$SYSTEM" in
115 BSD/OS)
116 if test "x`${UNAME} -r | cut -d . -f 1`" = "x2"
117 then
118 AC_MSG_RESULT(BSD/OS 2! statically linked modules are the only choice)
119 NEED_DL=0
120 DEFAULT_MAKE=static
121 else
122 AC_MSG_RESULT(BSD/OS 3+! ok I spose)
123 MOD_CC=shlicc
124 MOD_LD=shlicc
125 MOD_STRIP="${STRIP} -d"
126 SHLIB_LD="shlicc -r"
127 SHLIB_STRIP=touch
128 AC_DEFINE(MODULES_OK)
129 fi
130 ;;
131 CYGWIN*)
132 AC_MSG_RESULT(Cygwin)
133 NEED_DL=0
134 DEFAULT_MAKE=static
135 ;;
136 HP-UX)
137 AC_MSG_RESULT([HP-UX, just shoot yourself now])
138 HPUX=yes
139 MOD_LD="gcc -Wl,-E"
140 SHLIB_CC="gcc -fPIC"
141 SHLIB_LD="ld -b"
142 NEED_DL=0
143 AC_DEFINE(MODULES_OK)
144 AC_DEFINE(HPUX_HACKS)
145 if test "x`${UNAME} -r | cut -d . -f 2`" = "x10"
146 then
147 AC_DEFINE(HPUX10_HACKS)
148 fi
149 ;;
150 IRIX)
151 AC_MSG_RESULT(you are cursed with IRIX)
152 IRIX=yes
153 SHLIB_STRIP=touch
154 NEED_DL=0
155 DEFAULT_MAKE=static
156 ;;
157 IRIX64)
158 AC_MSG_RESULT(IRIX64)
159 IRIX=yes
160 SHLIB_STRIP=strip
161 NEED_DL=0
162 DEFAULT_MAKE=static
163 ;;
164 Linux)
165 AC_MSG_RESULT(Linux! The choice of the GNU generation)
166 LINUX=yes
167 CFLAGS="$CFLAGS -Wall"
168 MOD_LD="${CC}"
169 SHLIB_LD="${CC} -shared -nostartfiles"
170 DEFAULT_MAKE=debug
171 AC_DEFINE(MODULES_OK)
172 ;;
173 Lynx)
174 SHLIB_STRIP=touch
175 AC_MSG_RESULT(Lynx OS)
176 ;;
177 OSF1)
178 AC_MSG_RESULT(OSF...)
179 case `${UNAME} -r | cut -d . -f 1` in
180 V*)
181 AC_MSG_RESULT([ Digital OSF])
182 if test "x$AWK" = "xgawk"
183 then
184 AWK="awk"
185 fi
186 if test "x$INSTALL" = "x./install-sh"
187 then
188 INSTALL="installbsd"
189 fi
190 MOD_CC="cc"
191 MOD_LD="cc"
192 SHLIB_CC="cc"
193 SHLIB_LD="ld -shared -expect_unresolved '*'"
194 SHLIB_STRIP="touch"
195 AC_DEFINE(MODULES_OK)
196 ;;
197 1.0|1.1|1.2)
198 AC_MSG_RESULT([ pre 1.3])
199 SHLIB_LD="ld -R -export $@:"
200 AC_DEFINE(MODULES_OK)
201 AC_DEFINE(OSF1_HACKS)
202 ;;
203 1.*)
204 AC_MSG_RESULT([ 1.3+])
205 SHLIB_CC="${CC} -fpic"
206 SHLIB_LD="ld -shared"
207 AC_DEFINE(MODULES_OK)
208 AC_DEFINE(OSF1_HACKS)
209 ;;
210 *)
211 AC_MSG_RESULT([ Some other weird OSF! No modules for you...])
212 NEED_DL=0
213 DEFAULT_MAKE=static
214 ;;
215 esac
216 AC_DEFINE(STOP_UAC)
217 ;;
218 SunOS)
219 if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"
220 then
221 AC_MSG_RESULT(Solaris -- yay)
222 SHLIB_LD="/usr/ccs/bin/ld -G -z text"
223 else
224 AC_MSG_RESULT(SunOS -- sigh)
225 SUNOS=yes
226 SHLIB_LD=ld
227 SHLIB_STRIP=touch
228 AC_DEFINE(DLOPEN_1)
229 fi
230 MOD_CC="${CC} -fPIC"
231 SHLIB_CC="${CC} -fPIC"
232 AC_DEFINE(MODULES_OK)
233 ;;
234 *BSD)
235 AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison)
236 SHLIB_CC="${CC} -fpic"
237 SHLIB_LD="ld -Bshareable -x"
238 AC_DEFINE(MODULES_OK)
239 ;;
240 *)
241 if test -r "/mach"
242 then
243 AC_MSG_RESULT([NeXT...We are borg, you will be assimilated])
244 AC_MSG_RESULT([break out the static modules, it's all you'll ever get :P])
245 AC_MSG_RESULT(Hiya DK :P)
246 NEED_DL=0
247 DEFAULT_MAKE=static
248 AC_DEFINE(BORGCUBES)
249 else
250 if test -r "/cmds"
251 then
252 AC_MSG_RESULT(QNX)
253 NEED_DL=0
254 SHLIB_STRIP=touch
255 DEFAULT_MAKE=static
256 else
257 AC_MSG_RESULT(Something unknown!)
258 AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
259 NEED_DL=0
260 DEFAULT_MAKE=static
261 fi
262 fi
263 ;;
264 esac
265
266 dnl Checks for system libraries.
267 if test "$IRIX" = "yes"
268 then
269 AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
270 else
271 AC_CHECK_LIB(socket,socket)
272 AC_CHECK_LIB(nsl,connect)
273 AC_CHECK_LIB(dns,gethostbyname)
274 AC_CHECK_LIB(dl,dlopen)
275 dnl this is needed for Tcl compiled with thread support
276 AC_CHECK_LIB(pthread,pthread_create,ac_cv_lib_pthread_pthread_create=yes,ac_cv_lib_pthread_pthread_create=no)
277 if test "$SUNOS" = "yes"
278 then
279 dnl for suns without yp or something like that
280 AC_CHECK_LIB(dl,main)
281 else
282 if test "$HPUX" = "yes"
283 then
284 AC_CHECK_LIB(dld,shl_load)
285 fi
286 fi
287 fi
288
289 dnl Checks for header files.
290 AC_HEADER_DIRENT
291 AC_HEADER_SYS_WAIT
292 AC_CHECK_HEADERS(sys/time.h)
293 AC_HEADER_TIME
294 AC_CHECK_HEADERS(sys/select.h sys/rusage.h unistd.h dlfcn.h stdarg.h std_args.h)
295
296 dnl Checks for typedefs, structures, and compiler characteristics.
297 AC_TYPE_PID_T
298 AC_C_BIGENDIAN
299 AC_C_INLINE
300 AC_CHECK_SIZEOF(long,0)
301 AC_CHECK_SIZEOF(int,0)
302
303 dnl Checks for library functions.
304 AC_CHECK_FUNCS(clock getrusage setpgid uname sigaction sigemptyset)
305 AC_CHECK_FUNCS(rename strcasecmp getdtablesize bzero random srandom)
306 AC_CHECK_FUNCS(dprintf snprintf vsprintf vsnprintf dlopen)
307
308 if test "x${ac_cv_func_vsprintf}" = "xno"
309 then
310 cat << 'EOF' >&2
311 configure: error:
312
313 Your system does not have the sprintf/vsprintf libraries.
314 These are required to compile almost anything. Sorry.
315
316 EOF
317 exit 1
318 fi
319
320 if test "x${ac_cv_header_stdc}" = "xno"
321 then
322 cat << 'EOF' >&2
323 configure: error:
324
325 Your system must support ANSI C Header files.
326 These are required for the language support. Sorry.
327
328 EOF
329 exit 1
330 fi
331
332 AC_CYGWIN
333 if test ! "x${CYGWIN}" = "x"
334 then
335 AC_DEFINE(CYGWIN_HACKS)
336 fi
337
338 AC_EXEEXT
339 if test ! "x${EXEEXT}" = "x"
340 then
341 EGGEXEC=eggdrop${EXEEXT}
342 fi
343
344 dnl check how much space is left in filedb (informational purposes)
345 AC_MSG_CHECKING(space left in file database struct)
346
347 cat > abacab.c << 'EOF'
348 #include <stdio.h>
349 #include <sys/time.h>
350 #include "src/mod/filesys.mod/files.h"
351 main() {
352 fprintf(stdout, "%d/%d\n", 512 - sizeof(struct filler), sizeof(filedb));
353 }
354 EOF
355
356 ${CC} -o abacab${EXEEXT} abacab.c
357 FILEDB_SPACE=`./abacab${EXEEXT}`
358 AC_MSG_RESULT($FILEDB_SPACE bytes)
359 rm -f abacab${EXEEXT} abacab.o abacab.c
360 AC_MSG_RESULT([ (standard is currently 48/512 bytes)])
361
362 dnl where is tcl? is it here?
363 # ---------- begin robey's tcl thingies
364 # (well, what used to be robey's tcl thingies...)
365
366 tclrecommendver="8.2.1"
367
368 tcllibnames="tcl tcl8.3 tcl83 tcl8.2 tcl82 tcl8.1 tcl81 \
369 tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75 tcl7.4 tcl74 \
370 tcl7.3 tcl73 tcl7.2 tcl72 tcl7.1 tcl71 tcl7.0 tcl70"
371
372 tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
373
374 tcllibpaths="/usr/local/lib /usr/local/pkgs/tcl/lib \
375 /usr/lib /lib /usr/i486-linuxaout/lib \
376 $HOME/lib $HOME/tcl/lib $HOME"
377
378 tclheadernames="tcl.h"
379
380 tclheaderpaths="/usr/local/include /usr/local/pkgs/tcl/include \
381 /usr/include $HOME/include $HOME/tcl/include $HOME"
382
383 tclconfigfile="tclConfig.sh"
384
385 dnl oohh new configure --variables for those with multiple tcl libs
386 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
387 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
388
389 # make sure either both or neither $tcllibname and $tclincname are set
390 if test ! "x${tcllibname}" = "x"
391 then
392 if test "x${tclincname}" = "x"
393 then
394 cat << 'EOF' >&2
395 configure: warning:
396
397 You must specify both --with-tcllib and --with-tclinc for them to work.
398 configure will now attempt to autodetect both the Tcl library and header...
399
400 EOF
401 tcllibname=""
402 TCLLIB=""
403 TCLINC=""
404 fi
405 else
406 if test ! "x${tclincname}" = "x"
407 then
408 cat << 'EOF' >&2
409 configure: warning:
410
411 You must specify both --with-tcllib and --with-tclinc for them to work.
412 configure will now attempt to autodetect both the Tcl library and header...
413
414 EOF
415 tclincname=""
416 TCLLIB=""
417 TCLINC=""
418 fi
419 fi
420
421 # make sure either both or neither $TCLLIB and $TCLINC are set
422 if test ! "x${TCLLIB}" = "x"
423 then
424 if test "x${TCLINC}" = "x"
425 then
426 cat << 'EOF' >&2
427 configure: warning:
428
429 Environment variable TCLLIB was set, but I did not detect TCLINC.
430 Please set both TCLLIB and TCLINC correctly if you wish to use them.
431 configure will now attempt to autodetect both the Tcl library and header...
432
433 EOF
434 TCLLIB=""
435 fi
436 else
437 if test ! "x${TCLINC}" = "x"
438 then
439 cat << 'EOF' >&2
440 configure: warning:
441
442 Environment variable TCLINC was set, but I did not detect TCLLIB.
443 Please set both TCLLIB and TCLINC correctly if you wish to use them.
444 configure will now attempt to autodetect both the Tcl library and header...
445
446 EOF
447 TCLINC=""
448 fi
449 fi
450
451 # look for Tcl library: if $tcllibname is set, check there first
452 if test ! "x${tcllibname}" = "x"
453 then
454 if test -f "$tcllibname" && test -r "$tcllibname"
455 then
456 TCLLIB=`$DIRNAME $tcllibname`
457 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
458 changequote(,)dnl
459 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split($1, i, "."); print i[j]}'`"
460 changequote([, ])dnl
461 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
462 else
463 cat << EOF >&2
464 configure: warning:
465
466 The file '$tcllibname' given to option --with-tcllib is not valid.
467 configure will now attempt to autodetect both the Tcl library and header...
468
469 EOF
470 tcllibname=""
471 tclincname=""
472 TCLLIB=""
473 TCLLIBFN=""
474 TCLINC=""
475 TCLINCFN=""
476 fi
477 fi
478
479 # look for Tcl header: if $tclincname is set, check there first
480 if test ! "x${tclincname}" = "x"
481 then
482 if test -f "$tclincname" && test -r "$tclincname"
483 then
484 TCLINC=`$DIRNAME $tclincname`
485 TCLINCFN=`$BASENAME $tclincname`
486 else
487 cat << EOF >&2
488 configure: warning:
489
490 The file '$tclincname' given to option --with-tclinc is not valid.
491 configure will now attempt to autodetect both the Tcl library and header...
492
493 EOF
494 tcllibname=""
495 tclincname=""
496 TCLLIB=""
497 TCLLIBFN=""
498 TCLINC=""
499 TCLINCFN=""
500 fi
501 fi
502
503 # look for Tcl library: if $TCLLIB is set, check there first
504 if test "x${TCLLIBFN}" = "x"
505 then
506 if test ! "x${TCLLIB}" = "x"
507 then
508 if test -d "${TCLLIB}"
509 then
510 for tcllibfns in $tcllibnames
511 do
512 for tcllibext in $tcllibextensions
513 do
514 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
515 then
516 TCLLIBFN=$tcllibfns$tcllibext
517 TCLLIBEXT=$tcllibext
518 TCLLIBFNS=$tcllibfns
519 break 2
520 fi
521 done
522 done
523 fi
524 if test "x${TCLLIBFN}" = "x"
525 then
526 cat << 'EOF' >&2
527 configure: warning:
528
529 Environment variable TCLLIB was set, but incorrect.
530 Please set both TCLLIB and TCLINC correctly if you wish to use them.
531 configure will now attempt to autodetect both the Tcl library and header...
532
533 EOF
534 TCLLIB=""
535 TCLLIBFN=""
536 TCLINC=""
537 TCLINCFN=""
538 fi
539 fi
540 fi
541
542 # look for Tcl header: if $TCLINC is set, check there first
543 if test "x${TCLINCFN}" = "x"
544 then
545 if test ! "x${TCLINC}" = "x"
546 then
547 if test -d "${TCLINC}"
548 then
549 for tclheaderfn in $tclheadernames
550 do
551 if test -r "$TCLINC/$tclheaderfn"
552 then
553 TCLINCFN=$tclheaderfn
554 fi
555 done
556 fi
557 if test "x${TCLINCFN}" = "x"
558 then
559 cat << 'EOF' >&2
560 configure: warning:
561
562 Environment variable TCLINC was set, but incorrect.
563 Please set both TCLLIB and TCLINC correctly if you wish to use them.
564 configure will now attempt to autodetect both the Tcl library and header...
565
566 EOF
567 TCLLIB=""
568 TCLLIBFN=""
569 TCLINC=""
570 TCLINCFN=""
571 fi
572 fi
573 fi
574
575 AC_MSG_CHECKING(for Tcl library)
576
577 # attempt autodetect for $TCLLIBFN if it's not set
578 if test ! "x${TCLLIBFN}" = "x"
579 then
580 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
581 else
582 for tcllibfns in $tcllibnames
583 do
584 for tcllibext in $tcllibextensions
585 do
586 for tcllibpath in $tcllibpaths
587 do
588 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
589 then
590 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
591 TCLLIB=$tcllibpath
592 TCLLIBFN=$tcllibfns$tcllibext
593 TCLLIBEXT=$tcllibext
594 TCLLIBFNS=$tcllibfns
595 break 3
596 fi
597 done
598 done
599 done
600 fi
601
602 # show if $TCLLIBFN wasn't found
603 if test "x${TCLLIBFN}" = "x"
604 then
605 AC_MSG_RESULT(not found)
606 fi
607
608 AC_MSG_CHECKING(for Tcl header)
609
610 # attempt autodetect for $TCLINCFN if it's not set
611 if test ! "x${TCLINCFN}" = "x"
612 then
613 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
614 else
615 for tclheaderpath in $tclheaderpaths
616 do
617 for tclheaderfn in $tclheadernames
618 do
619 if test -r "$tclheaderpath/$tclheaderfn"
620 then
621 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
622 TCLINC=$tclheaderpath
623 TCLINCFN=$tclheaderfn
624 break 2
625 fi
626 done
627 done
628 # FreeBSD hack ...
629 if test "x${TCLINCFN}" = "x"
630 then
631 for tcllibfns in $tcllibnames
632 do
633 for tclheaderpath in $tclheaderpaths
634 do
635 for tclheaderfn in $tclheadernames
636 do
637 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
638 then
639 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
640 TCLINC=$tclheaderpath/$tcllibfns
641 TCLINCFN=$tclheaderfn
642 break 3
643 fi
644 done
645 done
646 done
647 fi
648 fi
649
650 # show if $TCLINCFN wasn't found
651 if test "x${TCLINCFN}" = "x"
652 then
653 AC_MSG_RESULT(not found)
654 fi
655
656 # done looking, now either TCLLIBFN & TCLINCFN are both set, or we will bail
657 if test ! "x${TCLLIBFN}" = "x" && test ! "x${TCLINCFN}" = "x"
658 then
659 # is this really Tcl ?
660 TCL_VERSION=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", $3); print $3}'`
661 fi
662
663 # check Tcl version
664 AC_MSG_CHECKING(for Tcl version)
665 if test ! "x${TCL_VERSION}" = "x"
666 then
667 AC_MSG_RESULT($TCL_VERSION)
668 TCL_FOUND=1
669 else
670 AC_MSG_RESULT(not found)
671 TCL_FOUND=0
672 fi
673
674 if test $TCL_FOUND = 0
675 then
676 cat << 'EOF' >&2
677 configure: error:
678
679 I can't find Tcl on this system.
680
681 Eggdrop now requires Tcl to compile. If you already have Tcl
682 installed on this system, and I just wasn't looking in the right
683 place for it, set the environment variables TCLLIB and TCLINC so
684 I will know where to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h'
685 (respectively). Then run 'configure' again.
686
687 Read the README file if you don't know what Tcl is or how to get
688 it and install it.
689
690 EOF
691 exit 1
692 fi
693
694 # is this Tcl version too old for us to use ?
695 TCL_VER_PRE70=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (i[1] < 7) print "yes"; else print "no"}'`
696 if test "$TCL_VER_PRE70" = "xyes"
697 then
698 cat << EOF >&2
699 configure: error:
700
701 Your Tcl version is much too old for eggdrop to use.
702 I suggest you download and complie a more recent version.
703 The most reliable current version is $tclrecommendver
704
705 EOF
706 exit 1
707 fi
708
709 # are we using a pre 7.5 Tcl version ?
710 changequote(,)dnl
711 TCL_VER_PRE75=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (((i[1] == 7) && (i[2] < 5)) || (i[1] < 7)) print "yes"; else print "no"}'`
712 changequote([, ])dnl
713 if test "x${TCL_VER_PRE75}" = "xyes"
714 then
715 AC_DEFINE(HAVE_OLD_TCL)
716 fi
717
718 # check for Tcl threads
719 AC_MSG_CHECKING(for Tcl threads)
720 changequote(,)dnl
721 TCL_VER_POST81=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (((i[1] == 8) && (i[2] >= 1)) || (i[1] >= 9)) print "yes"; else print "no"}'`
722 changequote([, ])dnl
723 if test "x${TCL_VER_POST81}" = "xyes"
724 then
725
726 # check for TclpFinalizeThreadData()
727 if eval "test \"`echo '$''{'ac_cv_var_tcl_threads'+set}'`\" = set"
728 then
729 echo $ac_n "(cached) $ac_c" 1>&6
730 else
731 ac_save_LIBS="$LIBS"
732 if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
733 then
734 LIBS="-lpthread $LIBS"
735 fi
736 if test ! "x${TCLLIBEXT}" = "x.a"
737 then
738 LIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
739 else
740 if test ! "x${tcllibname}" = "x"
741 then
742 LIBS="$TCLLIB/lib$TCLLIBFN -lm $LIBS"
743 else
744 LIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
745 fi
746 fi
747 cat > conftest.$ac_ext << EOF
748 #include "confdefs.h"
749 char TclpFinalizeThreadData();
750
751 int main() {
752 TclpFinalizeThreadData();
753 return 0;
754 }
755 EOF
756 if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
757 then
758 rm -rf conftest*
759 eval "ac_cv_var_tcl_threads=yes"
760 else
761 echo "configure: failed program was:" >&5
762 cat conftest.$ac_ext >&5
763 rm -rf conftest*
764 eval "ac_cv_var_tcl_threads=no"
765 fi
766 rm -f conftest*
767 LIBS="$ac_save_LIBS"
768 fi
769 fi
770
771 if test "x${ac_cv_var_tcl_threads}" = "xyes"
772 then
773 AC_MSG_RESULT(yes)
774 cat << 'EOF' >&2
775 configure: warning:
776
777 Your Tcl library is compiled with threads.
778 There are known problems, but we will attempt to work around them.
779
780 EOF
781 AC_DEFINE(HAVE_BUGGY_TCL_THREADS)
782 else
783 AC_MSG_RESULT(no)
784 fi
785
786 if test ! "x${TCLLIBEXT}" = "x.a"
787 then
788 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
789 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
790 else
791
792 # set default make as static for unshared Tcl library
793 if test ! "$DEFAULT_MAKE" = "static"
794 then
795 cat << 'EOF' >&2
796 configure: warning:
797
798 Your Tcl library is not a shared lib.
799 configure will now set default make type to static...
800
801 EOF
802 DEFAULT_MAKE=static
803 fi
804
805 # are we using a pre 7.4 Tcl version ?
806 changequote(,)dnl
807 TCL_VER_PRE74=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (((i[1] == 7) && (i[2] < 4)) || (i[1] < 7)) print "yes"; else print "no"}'`
808 changequote([, ])dnl
809 if test "x${TCL_VER_PRE74}" = "xno"
810 then
811
812 # was the --with-tcllib option given ?
813 if test ! "x${tcllibname}" = "x"
814 then
815 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
816 TCL_LIBS="$TCLLIB/lib$TCLLIBFN -lm"
817 else
818 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
819 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
820 fi
821 else
822 cat << EOF >&2
823 configure: warning:
824
825 Your Tcl version ($TCL_VERSION) is older then 7.4.
826 There are known problems, but we will attempt to work around them.
827
828 EOF
829 TCL_REQS="libtcle.a"
830 TCL_LIBS="-L. -ltcle -lm"
831 fi
832 fi
833
834 # add -lpthread to $LIBS if we need it
835 if test "x${ac_cv_var_tcl_threads}" = "xyes" && test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
836 then
837 LIBS="-lpthread $LIBS"
838 fi
839
840 AC_SUBST(TCLLIB)
841 AC_SUBST(TCLLIBFN)
842 AC_SUBST(TCLINC)
843 AC_SUBST(TCLINCFN)
844 AC_SUBST(TCL_REQS)
845 AC_SUBST(TCL_LIBS)
846
847 # ---------- end of robey's tcl thingies
848
849 if test $NEED_DL = 1 && test "x${ac_cv_func_dlopen}" = "xno"
850 then
851 if test "$LINUX" = "yes"
852 then
853 cat << 'EOF' >&2
854 configure: warning:
855
856 Since you are on a Linux system, this has a known problem,
857 I know a kludge for it,
858 EOF
859
860 if test -r "/lib/libdl.so.1"
861 then
862 cat << 'EOF' >&2
863 and you seem to have it, so we'll do that...
864
865 EOF
866 AC_DEFINE(HAVE_DLOPEN)
867 LIBS="/lib/libdl.so.1 $LIBS"
868 else
869 cat << 'EOF' >&2
870 which you DONT seem to have... doh!
871 perhaps you may still have the stuff lying around somewhere
872 if you work out where it is, add it to your XLIBS= lines
873 and #define HAVE_DLOPEN in config.h
874
875 we'll proceed on anyway, but you probably won't be able
876 to 'make eggdrop' but you might be able to make the
877 static bot (I'll default your make to this version).
878
879 EOF
880 DEFAULT_MAKE=static
881 fi
882 else
883 cat << 'EOF' >&2
884 configure: warning:
885
886 You don't seem to have libdl anywhere I can find it, this will
887 prevent you from doing dynamic modules, I'll set your default
888 make to static linking.
889
890 EOF
891 DEFAULT_MAKE=static
892 fi
893 fi
894
895 EGGVERSION=`grep 'char egg_version' src/main.c | $AWK '{gsub(/(\"|\;)/, "", $4); print $4}'`
896
897 if test "x$DEST" = "x"
898 then
899 DEST=\${prefix}
900 fi
901
902 AC_SUBST(DEST)
903 AC_SUBST(CC)
904 AC_SUBST(MOD_LD)
905 AC_SUBST(MOD_CC)
906 AC_SUBST(MOD_STRIP)
907 AC_SUBST(SHLIB_LD)
908 AC_SUBST(SHLIB_CC)
909 AC_SUBST(SHLIB_STRIP)
910 AC_SUBST(DEFAULT_MAKE)
911 AC_SUBST(EGGEXEC)
912 AC_SUBST(EGGVERSION)
913 AC_OUTPUT(Makefile doc/Makefile scripts/Makefile src/Makefile src/md5/Makefile src/mod/Makefile lush.h)
914
915 AC_MSG_RESULT()
916 AC_MSG_RESULT(Configure is done.)
917 AC_MSG_RESULT()
918 if test -f "./$EGGEXEC"
919 then
920 AC_MSG_RESULT(Type 'make clean' and then 'make' to create the bot.)
921 else
922 AC_MSG_RESULT(Type 'make' to create the bot.)
923 fi
924 AC_MSG_RESULT()

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23