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

Contents of /eggdrop1.9/configure.in

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


Revision 1.4 - (show annotations) (download)
Sat Oct 9 19:31:56 1999 UTC (19 years, 8 months ago) by fabian
Branch: MAIN
Changes since 1.3: +9 -0 lines
Fabian's asyncdns patch

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 echo ""
7 echo "This is eggdrop's GNU configure script."
8 echo "It's going to run a bunch of strange tests to hopefully make"
9 echo "your compile work without much twiddling."
10 echo ""
11
12 AC_PROG_MAKE_SET
13 AC_PROG_CC
14
15 dnl no cross-compiling!
16 if test ! "x${cross_compiling}" = "xno"
17 then
18 echo ""
19 echo "This system does not appear to have a working C compiler."
20 echo "A working C compiler is required to compile eggdrop."
21 echo ""
22 exit 1
23 fi
24
25 dnl crazy machines
26 AC_AIX
27 AC_ISC_POSIX
28 AC_MINIX
29
30 dnl Checks for programs.
31 AC_PROG_RANLIB
32 AC_CHECK_PROG(STRIP,strip,strip)
33 AC_CHECK_PROG(UNAME,uname,uname)
34
35 AC_PROG_AWK
36 if test "x${AWK}" = "x"
37 then
38 AC_MSG_ERROR(This system seems to lack a working 'awk' command.)
39 fi
40
41 AC_CHECK_PROG(BASENAME,basename,basename)
42 if test "x${BASENAME}" = "x"
43 then
44 AC_MSG_ERROR(This system seems to lack a working 'basename' command.)
45 fi
46
47 AC_CHECK_PROG(DIRNAME,dirname,dirname)
48 if test "x${DIRNAME}" = "x"
49 then
50 AC_MSG_ERROR(This system seems to lack a working 'dirname' command.)
51 fi
52
53 AC_PROG_LN_S
54
55 dnl cp -f checks
56 AC_MSG_CHECKING(whether cp -f works)
57 ac_file1=beldin1
58 ac_file2=beldin2
59 ac_cp="cp -f $ac_file1 $ac_file2"
60
61 cat > $ac_file1 <<EOF
62 Beldin is a llama. :P
63 EOF
64 if { (eval echo configure: \"$ac_cp\") 1>&5; (eval $ac_cp) 2>&5; } && test -s $ac_file2
65 then
66 AC_MSG_RESULT(yes)
67 ac_cv_prog_cp_f=yes
68 CP1="cp -f"
69 CP2="cp -rf"
70 CP3="cp -pf"
71 else
72 AC_MSG_RESULT(no)
73 ac_cv_prog_cp_f=no
74 CP1="cp"
75 CP2="cp -r"
76 CP3="cp -p"
77 fi
78 rm -f $ac_file1 $ac_file2
79
80 dnl stop putting -g in there! @#$!#$%!
81 if test "x${CFLAGS}" = "x"
82 then
83 if test "x${CC}" = "xgcc"
84 then
85 CFLAGS="-O2"
86 else
87 CFLAGS="-O"
88 fi
89 fi
90
91 dnl test the os and set the module linking settings
92 if test "x${STRIP}" = "x"
93 then
94 STRIP="touch"
95 fi
96 IRIX=no
97 LINUX=no
98 need_dl=1
99 EGGEXEC=eggdrop
100 DEFAULT_MAKE=eggdrop
101 BEL_MOD_CC="${CC}"
102 BEL_MOD_LD="${CC}"
103 BEL_MOD_STRIP="${STRIP}"
104 SHLIB_CC="${CC}"
105 SHLIB_LD="${CC}"
106 SHLIB_STRIP="${STRIP}"
107 AC_MSG_CHECKING(your OS)
108 system=`${UNAME}`
109 case $system in
110 Linux)
111 CFLAGS="$CFLAGS -Wall"
112 AC_MSG_RESULT(Linux! The choice of the GNU generation)
113 SHLIB_LD="${CC} -shared -nostartfiles"
114 BEL_MOD_LD="${CC}"
115 AC_DEFINE(MODULES_OK)
116 LINUX=yes
117 DEFAULT_MAKE=debugmem
118 ;;
119 BSD/OS)
120 if test "x`${UNAME} -r | cut -d . -f 1`" = "x2"
121 then
122 AC_MSG_RESULT(BSD/OS 2! statically linked modules are the only choice)
123 need_dl=0
124 DEFAULT_MAKE=static
125 else
126 AC_MSG_RESULT(BSD/OS 3+! ok I spose)
127 BEL_MOD_CC="shlicc"
128 BEL_MOD_LD="shlicc"
129 BEL_MOD_STRIP="${STRIP} -d"
130 SHLIB_LD="shlicc -r"
131 SHLIB_STRIP="touch"
132 AC_DEFINE(MODULES_OK)
133 fi
134 AC_CHECK_PROG(GMAKE,gmake,gmake)
135 if test "x${GMAKE}" = "x"
136 then
137 echo ""
138 echo "Yoicks! you have BSD/OS & you dont have 'gmake', you may"
139 echo "not be able to compile the bot successfully :("
140 echo ""
141 fi
142 ;;
143 *BSD)
144 AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison)
145 SHLIB_CC="${CC} -fpic"
146 SHLIB_LD="ld -Bshareable -x"
147 AC_DEFINE(MODULES_OK)
148 ;;
149 SunOS)
150 if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"
151 then
152 AC_MSG_RESULT(Solaris!)
153 SHLIB_LD="/usr/ccs/bin/ld -G -z text"
154 else
155 AC_MSG_RESULT(SunOS 4 :/)
156 SHLIB_LD="ld"
157 SHLIB_STRIP="touch"
158 fi
159 SHLIB_CC="${CC} -fPIC"
160 BEL_MOD_CC="${CC} -fPIC"
161 AC_DEFINE(MODULES_OK)
162 ;;
163 OSF1)
164 AC_MSG_RESULT(OSF...)
165 case `${UNAME} -r | cut -d . -f 1` in
166 V*)
167 AC_MSG_RESULT(Digital OSF)
168 SHLIB_LD="ld -shared -expect_unresolved '*'"
169 SHLIB_STRIP="touch"
170 AC_DEFINE(MODULES_OK)
171 ;;
172 1.0|1.1|1.2|1.3)
173 AC_MSG_RESULT(pre 1.4)
174 SHLIB_LD='ld -R -export $@:'
175 AC_DEFINE(OSF1_HACKS)
176 AC_DEFINE(MODULES_OK)
177 ;;
178 1.*)
179 AC_MSG_RESULT(1.3+)
180 SHLIB_CFL="${CC} -fpic"
181 SHLIB_LD='ld -shared'
182 AC_DEFINE(OSF1_HACKS)
183 AC_DEFINE(MODULES_OK)
184 ;;
185 *)
186 AC_MSG_RESULT(Some other weird OSF! No modules for you..)
187 need_dl=0
188 DEFAULT_MAKE=static
189 ;;
190 esac
191 AC_DEFINE(STOP_UAC)
192 ;;
193 HP-UX)
194 AC_MSG_RESULT([HP-UX, just shoot yourself now])
195 AC_CHECK_LIB(dld,shl_load)
196 BEL_MOD_LD="gcc -Wl,-E"
197 SHLIB_CC="gcc -fPIC"
198 SHLIB_LD="ld -b"
199 AC_DEFINE(HPUX_HACKS)
200 if test "x`${UNAME} -r | cut -d . -f 2`" = "x10"
201 then
202 AC_DEFINE(HPUX10_HACKS)
203 fi
204 AC_DEFINE(MODULES_OK)
205 need_dl=0
206 ;;
207 IRIX|IRIX64)
208 AC_MSG_RESULT(you are cursed with IRIX)
209 IRIX=yes
210 STRIP=
211 need_dl=0
212 DEFAULT_MAKE=static
213 ;;
214 *)
215 if test -r "/mach"
216 then
217 AC_MSG_RESULT([NeXT...We are borg, you will be assimilated])
218 AC_MSG_RESULT([break out the static modules, it's all you'll ever get :P])
219 AC_MSG_RESULT(Hiya DK :P)
220 AC_DEFINE(BORGCUBES)
221 else
222 AC_MSG_RESULT(Something unknown!!)
223 AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
224 fi
225 need_dl=0
226 DEFAULT_MAKE=static
227 ;;
228 esac
229
230 dnl Check for Sun libraries.
231 if test "$IRIX" = "yes"
232 then
233 AC_MSG_WARN(Skipping library tests because they *confuse* IRIX.)
234 else
235 AC_CHECK_LIB(socket,socket)
236 AC_CHECK_LIB(nsl,connect)
237 AC_CHECK_LIB(dns,gethostbyname)
238 AC_CHECK_LIB(dl,dlopen)
239 if test "x`${UNAME}`" = "xSunOS"
240 then
241 AC_MSG_CHECKING(for SunOS 4)
242 if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"
243 then
244 AC_MSG_RESULT(Solaris -- "*bollocks*" zarni )
245 else
246 AC_MSG_RESULT(SunOS -- sigh)
247 dnl for suns without yp or something like that:
248 AC_CHECK_LIB(dl,main)
249 fi
250 fi
251 fi
252
253 AC_CHECK_FUNC(res_init, ,
254 AC_CHECK_LIB(bind, res_init, RESLIB="-lbind",
255 AC_CHECK_LIB(resolv, res_init, RESLIB="-lresolv", AC_MSG_ERROR(No resolver library found))))
256
257 AC_CHECK_FUNC(res_mkquery, ,
258 AC_CHECK_LIB(bind, res_mkquery, RESLIB="-lbind",
259 AC_CHECK_LIB(resolv, res_mkquery, RESLIB="-lresolv", AC_MSG_ERROR(No resolver library found))))
260
261 AC_C_BIGENDIAN
262 AC_CHECK_SIZEOF(long,0)
263 AC_CHECK_SIZEOF(int,0)
264
265 dnl Checks for header files.
266 AC_HEADER_DIRENT
267 AC_HEADER_SYS_WAIT
268 AC_CHECK_HEADERS(sys/time.h sys/select.h sys/rusage.h unistd.h stdarg.h dlfcn.h)
269
270 dnl Checks for typedefs, structures, and compiler characteristics.
271 AC_TYPE_PID_T
272 AC_HEADER_TIME
273 AC_C_INLINE
274
275 dnl Checks for library functions.
276 AC_CHECK_FUNCS(rename getrusage getdtablesize srandom random sigaction)
277 AC_CHECK_FUNCS(sigemptyset vsprintf strcasecmp setpgid clock dlopen)
278 AC_CHECK_FUNCS(dprintf bzero uname vsnprintf)
279
280 if test "x${ac_cv_func_vsprintf}" = "xno"
281 then
282 echo ""
283 echo "Your system does not have the sprintf/vsprintf libraries."
284 echo "These are required to compile almost anything. Sorry."
285 echo ""
286 exit 1
287 fi
288
289 if test "x${ac_cv_header_stdc}" = "xno"
290 then
291 echo ""
292 echo "Your system must support ANSI C Header files."
293 echo "These are required for the language support. Sorry."
294 echo ""
295 exit 1
296 fi
297
298 dnl check how much space is left in filedb (informational purposes)
299 AC_MSG_CHECKING(space left in file database struct)
300 cat > abacab.c <<'EOF'
301 #include <stdio.h>
302 #include <sys/time.h>
303 #include "src/mod/filesys.mod/files.h"
304 main() {
305 fprintf(stderr, "%d/%d", 512-sizeof(struct filler), sizeof(filedb));
306 }
307 EOF
308 ${CC} -o abacab abacab.c
309 FILEDB_SPACE=`./abacab`
310 AC_MSG_RESULT($FILEDB_SPACE bytes)
311 rm -f abacab abacab.o abacab.c
312 echo " (standard is currently 48/512 bytes)"
313
314 dnl where is tcl? is it here?
315 # ---------- begin robey's tcl thingies
316 # (well, what used to be robey's tcl thingies...)
317
318 tclnames="tcl tcl8.3 tcl83 tcl8.2 tcl82 tcl8.1 tcl81 \
319 tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75"
320
321 tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
322
323 tcllibpaths="/usr/local/lib /usr/local/pkgs/tcl/lib \
324 /usr/lib /lib /usr/i486-linuxaout/lib \
325 $HOME/lib $HOME/tcl/lib $HOME"
326
327 tclheaderpaths="/usr/local/include /usr/local/pkgs/tcl/include \
328 /usr/include $HOME/include $HOME/tcl/include $HOME"
329
330 # sanity checking to make sure either both or neither TCLLIB and TCLINC are set
331 if test ! "x${TCLLIB}" = "x" && test "x${TCLINC}" = "x"
332 then
333 echo ""
334 echo "You set the environment variable TCLLIB, but I failed to detect TCLINC."
335 echo "Please set both if you wish to use them."
336 echo "configure will now try to autodetect both libtcl and tcl.h"
337 echo ""
338 unset TCLLIB
339 else
340 if test ! "x${TCLINC}" = "x"
341 then
342 echo ""
343 echo "You set the environment variable TCLINC, but I failed to detect TCLLIB."
344 echo "Please set both if you wish to use them."
345 echo "configure will now try to autodetect both libtcl and tcl.h"
346 echo ""
347 unset TCLINC
348 fi
349 fi
350
351 dnl oohh new configure --variables for those with multiple tcl libs
352 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
353 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
354
355 if test -r "$tcllibname"
356 then
357 TCLLIB=`$DIRNAME $tcllibname`
358 TCLLIBEXT=".`echo $tcllibname | $AWK '{j=split($1, i, "."); k=i[[j]]; print k}'`"
359 TCLLIBFN=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
360 echo "Using Tcl library: $TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
361 else
362
363 # look for libtcl: if TCLLIB is set, check there first
364 if test ! "x${TCLLIB}" = "x"
365 then
366 for tcllibfn in $tclnames
367 do
368 for tcllibext in $tcllibextensions
369 do
370 if test -r "$TCLLIB/lib$tcllibfn$tcllibext"
371 then
372 if test "x${TCLLIBFN}" = "x"
373 then
374 TCLLIBFN=$tcllibfn
375 TCLLIBEXT=$tcllibext
376 break 2
377 fi
378 fi
379 done
380 done
381 if test "x${TCLLIBFN}" = "x"
382 then
383 echo "Environment variable TCLLIB is set, but incorrect."
384 unset TCLLIB
385 fi
386 fi
387
388 # check in common places now
389 AC_MSG_CHECKING(for libtcl)
390 if test ! "x${TCLLIB}" = "x"
391 then
392 AC_MSG_RESULT(found in $TCLLIB/lib$TCLLIBFN$TCLLIBEXT)
393 else
394 for tcllibfn in $tclnames
395 do
396 for tcllibext in $tcllibextensions
397 do
398 for tcllibpath in $tcllibpaths
399 do
400 if test -r "$tcllibpath/lib$tcllibfn$tcllibext"
401 then
402 if test "x${TCLLIB}" = "x"
403 then
404 AC_MSG_RESULT(found in $tcllibpath/lib$tcllibfn$tcllibext)
405 TCLLIB=$tcllibpath
406 TCLLIBFN=$tcllibfn
407 TCLLIBEXT=$tcllibext
408 break 3
409 fi
410 fi
411 done
412 done
413 done
414 fi
415
416 fi # test tcllibname
417
418 # give up if they don't even have that
419 if test "x${TCLLIB}" = "x"
420 then
421 AC_MSG_RESULT(not found)
422 fi
423
424 # now look for pesky $TCLINCFN file
425 if test -r "$tclincname"
426 then
427 TCLINC=`$DIRNAME $tclincname`
428 TCLINCFN=`$BASENAME $tclincname`
429 echo "Using Tcl header: $TCLINC/$TCLINCFN"
430 else
431
432 TCLINCFN=tcl.h
433
434 if test ! "x${TCLINC}" = "x"
435 then
436 if test ! -r "$TCLINC/$TCLINCFN"
437 then
438 echo "Environment variable TCLINC is set, but incorrect."
439 unset TCLINC
440 fi
441 fi
442
443 # check in common places now
444 AC_MSG_CHECKING(for $TCLINCFN)
445 if test ! "x${TCLINC}" = "x"
446 then
447 AC_MSG_RESULT(found in $TCLINC/$TCLINCFN)
448 else
449 for headerpath in $tclheaderpaths
450 do
451 if test -r "$headerpath/$TCLINCFN"
452 then
453 if test "x${TCLINC}" = "x"
454 then
455 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
456 TCLINC=$headerpath
457 break
458 fi
459 fi
460 done
461 if test "x${TCLINC}" = "x"
462 then
463 for tcllibfn in $tclnames
464 do
465 for headerpath in $tclheaderpaths
466 do
467 if test -r "$headerpath/$tcllibfn/$TCLINCFN"
468 then
469 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
470 TCLINC=$headerpath/$tcllibfn
471 break 2
472 fi
473 done
474 done
475 fi
476 fi
477
478 # had TCLLIB but not TCLINC? so close... :(
479 if test "x${TCLINC}" = "x"
480 then
481 AC_MSG_RESULT(not found)
482 unset TCLLIB
483 unset TCLLIBFN
484 unset TCLLIBEXT
485 fi
486
487 fi # test tclincname
488
489 # done looking, now either TCLLIB & TCLINC are both set, or neither is set
490 if test "x${TCLLIB}" = "x"
491 then
492 echo ""
493 echo "I can't find Tcl on this system."
494 echo ""
495 echo "Eggdrop now requires Tcl to compile. If you already have Tcl"
496 echo "installed on this system, and I just wasn't looking in the right"
497 echo "place for it, set the environment variables TCLLIB and TCLINC so"
498 echo "I will know where to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h'"
499 echo "(respectively). Then run 'configure' again."
500 echo ""
501 echo "Read the README file if you don't know what Tcl is or how to get"
502 echo "it and install it."
503 echo ""
504 exit 1
505 else
506
507 AC_MSG_CHECKING(for Tcl version)
508
509 for ver in $tclnames
510 do
511 ver=`echo $ver | cut -c4-`
512 if test ! "x${ver}" = "x"
513 then
514 TCLFOUND=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep $ver | wc -l`
515 if test ! $TCLFOUND = 0
516 then
517 TCLVER=$ver
518 break
519 fi
520 fi
521 done
522
523 if test ! "x${TCLVER}" = "x"
524 then
525 AC_MSG_RESULT($TCLVER found!)
526 else
527 AC_MSG_RESULT(hmm... unknown version)
528 fi
529
530 if test $TCLFOUND = 1
531 then
532 TCL_REQS="$TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
533 TCL_LIBS="-L$TCLLIB -l$TCLLIBFN -lm"
534 else
535 echo ""
536 echo "Your tcl version is much too old for eggdrop to use."
537 echo "I suggest you download and complie a more recent version."
538 echo "The most reliable current version is 8.2.1"
539 echo ""
540 exit 1
541 fi
542
543 if test "x${TCLLIBEXT}" = "x.a"
544 then
545 echo ""
546 echo "Your libtcl is not a shared library."
547 echo "configure will set default make type to static..."
548 echo ""
549 DEFAULT_MAKE=static
550 fi
551
552 fi # test TCLLIB
553
554 AC_SUBST(TCLINC)
555 AC_SUBST(TCLLIB)
556 AC_SUBST(TCLINCFN)
557 AC_SUBST(TCL_REQS)
558 AC_SUBST(TCL_LIBS)
559
560 # ---------- end of robey's tcl thingies
561
562 if test $need_dl = 1 && test "x${ac_cv_func_dlopen}" = "xno"
563 then
564 if test "$LINUX" = "yes"
565 then
566 echo "Since you are on a Linux system, this has a known problem,"
567 if test -r "/lib/libdl.so.1"
568 then
569 echo "and you seem to have it, I know a kludge for it,"
570 echo "so we'll do that..."
571 echo ""
572 AC_DEFINE(HAVE_DLOPEN)
573 LIBS="/lib/libdl.so.1 $LIBS"
574 got_dl=1
575 else
576 echo "which you DONT seem to have... doh!"
577 echo "perhaps you may still have the stuff lying around somewhere"
578 echo "if you work out where it is, add it to your XLIBS= lines"
579 echo "and #define HAVE_DLOPEN in config.h"
580 echo ""
581 echo "we'll proceed on anyway, but you probably won't be able"
582 echo "to 'make eggdrop' but you might be able to make the"
583 echo "static bot (I'll default your make to this version)."
584 DEFAULT_MAKE=static
585 fi
586 else
587 echo "You don't seem to have libdl anywhere I can find it, this will"
588 echo "prevent you from doing dynamic modules, I'll set your default"
589 echo "make to static linking."
590 DEFAULT_MAKE=static
591 fi
592 fi
593
594 if test ! "x${GMAKE}" = "x"
595 then
596 SET_MAKE="MAKE=gmake"
597 fi
598
599 if test -z "$DEST"
600 then
601 DEST=\${prefix}
602 fi
603
604 AC_SUBST(DEST)
605 AC_SUBST(CP1)
606 AC_SUBST(CP2)
607 AC_SUBST(CP3)
608 AC_SUBST(EGGEXEC)
609 AC_SUBST(CC)
610 AC_SUBST(RESLIB)
611 AC_SUBST(SHLIB_LD)
612 AC_SUBST(SHLIB_CC)
613 AC_SUBST(SHLIB_STRIP)
614 AC_SUBST(BEL_MOD_LD)
615 AC_SUBST(BEL_MOD_CC)
616 AC_SUBST(BEL_MOD_STRIP)
617 AC_SUBST(DLFLAGS)
618 AC_SUBST(DEFAULT_MAKE)
619 AC_OUTPUT(Makefile lush.h)
620
621 echo ""
622 echo "Configure is done."
623 echo ""
624 if test -f "./eggdrop"
625 then
626 echo "Type 'make clean' and then 'make' to create the bot."
627 else
628 echo "Type 'make' to create the bot."
629 fi
630 echo ""

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23