/[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.36 - (show annotations) (download)
Wed Oct 27 07:52:10 1999 UTC (20 years, 9 months ago) by arthur2
Branch: MAIN
Changes since 1.35: +15 -14 lines
putlog-misc-part2.diff

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 if eval "test \"`echo '$''{'ac_cv_var_filedb_struct'+set}'`\" = set"
347 then
348 echo $ac_n "(cached) $ac_c" 1>&6
349 else
350 cat > conftest.$ac_ext << EOF
351 #include "confdefs.h"
352 #include <stdio.h>
353 #include <sys/time.h>
354 #include "src/mod/filesys.mod/files.h"
355 int main() {
356 fprintf(stdout, "%d/%d %s\n", 512 - sizeof(struct filler), sizeof(filedb), "bytes");
357 }
358 EOF
359 if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
360 then
361 ac_cv_var_filedb_struct=`./conftest${ac_exeext}`
362 rm -rf conftest*
363 else
364 echo "configure: failed program was:" >&5
365 cat conftest.$ac_ext >&5
366 ac_cv_var_filedb_struct=unknown
367 rm -rf conftest*
368 fi
369 rm -f conftest*
370 fi
371 AC_MSG_RESULT($ac_cv_var_filedb_struct)
372 AC_MSG_RESULT([ (standard is currently 48/512 bytes)])
373
374 dnl where is tcl? is it here?
375 # ---------- begin robey's tcl thingies
376 # (well, what used to be robey's tcl thingies...)
377
378 tclrecommendver="8.2.1"
379
380 tcllibnames="tcl tcl8.3 tcl83 tcl8.2 tcl82 tcl8.1 tcl81 \
381 tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75 tcl7.4 tcl74 \
382 tcl7.3 tcl73 tcl7.2 tcl72 tcl7.1 tcl71 tcl7.0 tcl70"
383
384 tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
385
386 tcllibpaths="/usr/local/lib /usr/local/pkgs/tcl/lib \
387 /usr/lib /lib /usr/i486-linuxaout/lib \
388 $HOME/lib $HOME/tcl/lib $HOME"
389
390 tclheadernames="tcl.h"
391
392 tclheaderpaths="/usr/local/include /usr/local/pkgs/tcl/include \
393 /usr/include $HOME/include $HOME/tcl/include $HOME"
394
395 tclconfigfile="tclConfig.sh"
396
397 dnl oohh new configure --variables for those with multiple tcl libs
398 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
399 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
400
401 # make sure either both or neither $tcllibname and $tclincname are set
402 if test ! "x${tcllibname}" = "x"
403 then
404 if test "x${tclincname}" = "x"
405 then
406 cat << 'EOF' >&2
407 configure: warning:
408
409 You must specify both --with-tcllib and --with-tclinc for them to work.
410 configure will now attempt to autodetect both the Tcl library and header...
411
412 EOF
413 tcllibname=""
414 TCLLIB=""
415 TCLINC=""
416 fi
417 else
418 if test ! "x${tclincname}" = "x"
419 then
420 cat << 'EOF' >&2
421 configure: warning:
422
423 You must specify both --with-tcllib and --with-tclinc for them to work.
424 configure will now attempt to autodetect both the Tcl library and header...
425
426 EOF
427 tclincname=""
428 TCLLIB=""
429 TCLINC=""
430 fi
431 fi
432
433 # make sure either both or neither $TCLLIB and $TCLINC are set
434 if test ! "x${TCLLIB}" = "x"
435 then
436 if test "x${TCLINC}" = "x"
437 then
438 cat << 'EOF' >&2
439 configure: warning:
440
441 Environment variable TCLLIB was set, but I did not detect TCLINC.
442 Please set both TCLLIB and TCLINC correctly if you wish to use them.
443 configure will now attempt to autodetect both the Tcl library and header...
444
445 EOF
446 TCLLIB=""
447 fi
448 else
449 if test ! "x${TCLINC}" = "x"
450 then
451 cat << 'EOF' >&2
452 configure: warning:
453
454 Environment variable TCLINC was set, but I did not detect TCLLIB.
455 Please set both TCLLIB and TCLINC correctly if you wish to use them.
456 configure will now attempt to autodetect both the Tcl library and header...
457
458 EOF
459 TCLINC=""
460 fi
461 fi
462
463 # look for Tcl library: if $tcllibname is set, check there first
464 if test ! "x${tcllibname}" = "x"
465 then
466 if test -f "$tcllibname" && test -r "$tcllibname"
467 then
468 TCLLIB=`$DIRNAME $tcllibname`
469 TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
470 changequote(,)dnl
471 TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split($1, i, "."); print i[j]}'`"
472 changequote([, ])dnl
473 TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
474 else
475 cat << EOF >&2
476 configure: warning:
477
478 The file '$tcllibname' given to option --with-tcllib is not valid.
479 configure will now attempt to autodetect both the Tcl library and header...
480
481 EOF
482 tcllibname=""
483 tclincname=""
484 TCLLIB=""
485 TCLLIBFN=""
486 TCLINC=""
487 TCLINCFN=""
488 fi
489 fi
490
491 # look for Tcl header: if $tclincname is set, check there first
492 if test ! "x${tclincname}" = "x"
493 then
494 if test -f "$tclincname" && test -r "$tclincname"
495 then
496 TCLINC=`$DIRNAME $tclincname`
497 TCLINCFN=`$BASENAME $tclincname`
498 else
499 cat << EOF >&2
500 configure: warning:
501
502 The file '$tclincname' given to option --with-tclinc is not valid.
503 configure will now attempt to autodetect both the Tcl library and header...
504
505 EOF
506 tcllibname=""
507 tclincname=""
508 TCLLIB=""
509 TCLLIBFN=""
510 TCLINC=""
511 TCLINCFN=""
512 fi
513 fi
514
515 # look for Tcl library: if $TCLLIB is set, check there first
516 if test "x${TCLLIBFN}" = "x"
517 then
518 if test ! "x${TCLLIB}" = "x"
519 then
520 if test -d "${TCLLIB}"
521 then
522 for tcllibfns in $tcllibnames
523 do
524 for tcllibext in $tcllibextensions
525 do
526 if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
527 then
528 TCLLIBFN=$tcllibfns$tcllibext
529 TCLLIBEXT=$tcllibext
530 TCLLIBFNS=$tcllibfns
531 break 2
532 fi
533 done
534 done
535 fi
536 if test "x${TCLLIBFN}" = "x"
537 then
538 cat << 'EOF' >&2
539 configure: warning:
540
541 Environment variable TCLLIB was set, but incorrect.
542 Please set both TCLLIB and TCLINC correctly if you wish to use them.
543 configure will now attempt to autodetect both the Tcl library and header...
544
545 EOF
546 TCLLIB=""
547 TCLLIBFN=""
548 TCLINC=""
549 TCLINCFN=""
550 fi
551 fi
552 fi
553
554 # look for Tcl header: if $TCLINC is set, check there first
555 if test "x${TCLINCFN}" = "x"
556 then
557 if test ! "x${TCLINC}" = "x"
558 then
559 if test -d "${TCLINC}"
560 then
561 for tclheaderfn in $tclheadernames
562 do
563 if test -r "$TCLINC/$tclheaderfn"
564 then
565 TCLINCFN=$tclheaderfn
566 fi
567 done
568 fi
569 if test "x${TCLINCFN}" = "x"
570 then
571 cat << 'EOF' >&2
572 configure: warning:
573
574 Environment variable TCLINC was set, but incorrect.
575 Please set both TCLLIB and TCLINC correctly if you wish to use them.
576 configure will now attempt to autodetect both the Tcl library and header...
577
578 EOF
579 TCLLIB=""
580 TCLLIBFN=""
581 TCLINC=""
582 TCLINCFN=""
583 fi
584 fi
585 fi
586
587 AC_MSG_CHECKING(for Tcl library)
588
589 # attempt autodetect for $TCLLIBFN if it's not set
590 if test ! "x${TCLLIBFN}" = "x"
591 then
592 AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
593 else
594 for tcllibfns in $tcllibnames
595 do
596 for tcllibext in $tcllibextensions
597 do
598 for tcllibpath in $tcllibpaths
599 do
600 if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
601 then
602 AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
603 TCLLIB=$tcllibpath
604 TCLLIBFN=$tcllibfns$tcllibext
605 TCLLIBEXT=$tcllibext
606 TCLLIBFNS=$tcllibfns
607 break 3
608 fi
609 done
610 done
611 done
612 fi
613
614 # show if $TCLLIBFN wasn't found
615 if test "x${TCLLIBFN}" = "x"
616 then
617 AC_MSG_RESULT(not found)
618 fi
619
620 AC_MSG_CHECKING(for Tcl header)
621
622 # attempt autodetect for $TCLINCFN if it's not set
623 if test ! "x${TCLINCFN}" = "x"
624 then
625 AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
626 else
627 for tclheaderpath in $tclheaderpaths
628 do
629 for tclheaderfn in $tclheadernames
630 do
631 if test -r "$tclheaderpath/$tclheaderfn"
632 then
633 AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
634 TCLINC=$tclheaderpath
635 TCLINCFN=$tclheaderfn
636 break 2
637 fi
638 done
639 done
640 # FreeBSD hack ...
641 if test "x${TCLINCFN}" = "x"
642 then
643 for tcllibfns in $tcllibnames
644 do
645 for tclheaderpath in $tclheaderpaths
646 do
647 for tclheaderfn in $tclheadernames
648 do
649 if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
650 then
651 AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
652 TCLINC=$tclheaderpath/$tcllibfns
653 TCLINCFN=$tclheaderfn
654 break 3
655 fi
656 done
657 done
658 done
659 fi
660 fi
661
662 # show if $TCLINCFN wasn't found
663 if test "x${TCLINCFN}" = "x"
664 then
665 AC_MSG_RESULT(not found)
666 fi
667
668 # done looking, now either TCLLIBFN & TCLINCFN are both set, or we bail
669 if test ! "x${TCLLIBFN}" = "x" && test ! "x${TCLINCFN}" = "x"
670 then
671
672 # find Tcl's version
673 TCL_VERSION=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", $3); print $3}'`
674 TCL_PATCH_LEVEL=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", $3); print $3}'`
675 fi
676
677 # check if we found Tcl's version
678 AC_MSG_CHECKING(for Tcl version)
679 if test ! "x${TCL_VERSION}" = "x"
680 then
681 if test ! "x${TCL_PATCH_LEVEL}" = "x"
682 then
683 AC_MSG_RESULT($TCL_PATCH_LEVEL)
684 TCL_FOUND=1
685 else
686 AC_MSG_RESULT($TCL_VERSION)
687 TCL_FOUND=1
688 fi
689 else
690 AC_MSG_RESULT(not found)
691 TCL_FOUND=0
692 fi
693
694 if test $TCL_FOUND = 0
695 then
696 cat << 'EOF' >&2
697 configure: error:
698
699 I can't find Tcl on this system.
700
701 Eggdrop now requires Tcl to compile. If you already have Tcl
702 installed on this system, and I just wasn't looking in the right
703 place for it, set the environment variables TCLLIB and TCLINC so
704 I will know where to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h'
705 (respectively). Then run 'configure' again.
706
707 Read the README file if you don't know what Tcl is or how to get
708 it and install it.
709
710 EOF
711 exit 1
712 fi
713
714 # is this Tcl version too old for us to use ?
715 TCL_VER_PRE70=`echo $TCL_VERSION | $AWK '{split($1, i, "."); if (i[1] < 7) print "yes"; else print "no"}'`
716 if test "$TCL_VER_PRE70" = "xyes"
717 then
718 cat << EOF >&2
719 configure: error:
720
721 Your Tcl version is much too old for eggdrop to use.
722 I suggest you download and complie a more recent version.
723 The most reliable current version is $tclrecommendver
724
725 EOF
726 exit 1
727 fi
728
729 # are we using a pre 7.5 Tcl version ?
730 changequote(,)dnl
731 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"}'`
732 changequote([, ])dnl
733 if test "x${TCL_VER_PRE75}" = "xyes"
734 then
735 AC_DEFINE(HAVE_OLD_TCL)
736 fi
737
738 # check for Tcl threads
739 AC_MSG_CHECKING(for Tcl threads)
740 changequote(,)dnl
741 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"}'`
742 changequote([, ])dnl
743 if test "x${TCL_VER_POST81}" = "xyes"
744 then
745
746 # check for TclpFinalizeThreadData()
747 if eval "test \"`echo '$''{'ac_cv_var_tcl_threads'+set}'`\" = set"
748 then
749 echo $ac_n "(cached) $ac_c" 1>&6
750 else
751 ac_save_LIBS="$LIBS"
752 if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
753 then
754 LIBS="-lpthread $LIBS"
755 fi
756 if test ! "x${TCLLIBEXT}" = "x.a"
757 then
758 LIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
759 else
760 if test ! "x${tcllibname}" = "x"
761 then
762 LIBS="$TCLLIB/lib$TCLLIBFN -lm $LIBS"
763 else
764 LIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
765 fi
766 fi
767 cat > conftest.$ac_ext << EOF
768 #include "confdefs.h"
769 char TclpFinalizeThreadData();
770
771 int main() {
772 TclpFinalizeThreadData();
773 return 0;
774 }
775 EOF
776 if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}
777 then
778 rm -rf conftest*
779 eval "ac_cv_var_tcl_threads=yes"
780 else
781 echo "configure: failed program was:" >&5
782 cat conftest.$ac_ext >&5
783 rm -rf conftest*
784 eval "ac_cv_var_tcl_threads=no"
785 fi
786 rm -f conftest*
787 LIBS="$ac_save_LIBS"
788 fi
789 fi
790
791 if test "x${ac_cv_var_tcl_threads}" = "xyes"
792 then
793 AC_MSG_RESULT(yes)
794 cat << 'EOF' >&2
795 configure: warning:
796
797 Your Tcl library is compiled with threads.
798 There are known problems, but we will attempt to work around them.
799
800 EOF
801 AC_DEFINE(HAVE_BUGGY_TCL_THREADS)
802
803 # add -lpthread to $LIBS if we have it
804 if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
805 then
806 LIBS="-lpthread $LIBS"
807 fi
808 else
809 AC_MSG_RESULT(no)
810 fi
811
812 if test ! "x${TCLLIBEXT}" = "x.a"
813 then
814 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
815 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
816 else
817
818 # set default make as static for unshared Tcl library
819 if test ! "$DEFAULT_MAKE" = "static"
820 then
821 cat << 'EOF' >&2
822 configure: warning:
823
824 Your Tcl library is not a shared lib.
825 configure will now set default make type to static...
826
827 EOF
828 DEFAULT_MAKE=static
829 fi
830
831 # are we using a pre 7.4 Tcl version ?
832 changequote(,)dnl
833 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"}'`
834 changequote([, ])dnl
835 if test "x${TCL_VER_PRE74}" = "xno"
836 then
837
838 # was the --with-tcllib option given ?
839 if test ! "x${tcllibname}" = "x"
840 then
841 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
842 TCL_LIBS="$TCLLIB/lib$TCLLIBFN -lm"
843 else
844 TCL_REQS="$TCLLIB/lib$TCLLIBFN"
845 TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm"
846 fi
847 else
848 cat << EOF >&2
849 configure: warning:
850
851 Your Tcl version ($TCL_VERSION) is older then 7.4.
852 There are known problems, but we will attempt to work around them.
853
854 EOF
855 TCL_REQS="libtcle.a"
856 TCL_LIBS="-L. -ltcle -lm"
857 fi
858 fi
859
860 AC_SUBST(TCLLIB)
861 AC_SUBST(TCLLIBFN)
862 AC_SUBST(TCLINC)
863 AC_SUBST(TCLINCFN)
864 AC_SUBST(TCL_REQS)
865 AC_SUBST(TCL_LIBS)
866
867 # ---------- end of robey's tcl thingies
868
869 if test $NEED_DL = 1 && test "x${ac_cv_func_dlopen}" = "xno"
870 then
871 if test "$LINUX" = "yes"
872 then
873 cat << 'EOF' >&2
874 configure: warning:
875
876 Since you are on a Linux system, this has a known problem,
877 I know a kludge for it,
878 EOF
879
880 if test -r "/lib/libdl.so.1"
881 then
882 cat << 'EOF' >&2
883 and you seem to have it, so we'll do that...
884
885 EOF
886 AC_DEFINE(HAVE_DLOPEN)
887 LIBS="/lib/libdl.so.1 $LIBS"
888 else
889 cat << 'EOF' >&2
890 which you DONT seem to have... doh!
891 perhaps you may still have the stuff lying around somewhere
892 if you work out where it is, add it to your XLIBS= lines
893 and #define HAVE_DLOPEN in config.h
894
895 we'll proceed on anyway, but you probably won't be able
896 to 'make eggdrop' but you might be able to make the
897 static bot (I'll default your make to this version).
898
899 EOF
900 DEFAULT_MAKE=static
901 fi
902 else
903 cat << 'EOF' >&2
904 configure: warning:
905
906 You don't seem to have libdl anywhere I can find it, this will
907 prevent you from doing dynamic modules, I'll set your default
908 make to static linking.
909
910 EOF
911 DEFAULT_MAKE=static
912 fi
913 fi
914
915 EGGVERSION=`grep 'char egg_version' src/main.c | $AWK '{gsub(/(\"|\;)/, "", $4); print $4}'`
916
917 if test "x$DEST" = "x"
918 then
919 DEST=\${prefix}
920 fi
921
922 AC_SUBST(DEST)
923 AC_SUBST(CC)
924 AC_SUBST(MOD_LD)
925 AC_SUBST(MOD_CC)
926 AC_SUBST(MOD_STRIP)
927 AC_SUBST(SHLIB_LD)
928 AC_SUBST(SHLIB_CC)
929 AC_SUBST(SHLIB_STRIP)
930 AC_SUBST(DEFAULT_MAKE)
931 AC_SUBST(EGGEXEC)
932 AC_SUBST(EGGVERSION)
933 AC_OUTPUT(Makefile doc/Makefile scripts/Makefile src/Makefile src/md5/Makefile src/mod/Makefile lush.h)
934
935 AC_MSG_RESULT()
936 AC_MSG_RESULT(Configure is done.)
937 AC_MSG_RESULT()
938 if test -f "./$EGGEXEC"
939 then
940 AC_MSG_RESULT(Type 'make clean' and then 'make' to create the bot.)
941 else
942 AC_MSG_RESULT(Type 'make' to create the bot.)
943 fi
944 AC_MSG_RESULT()

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23