/[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.5 - (show annotations) (download)
Sun Oct 10 00:56:33 1999 UTC (20 years ago) by fabian
Branch: MAIN
Changes since 1.4: +82 -70 lines
yet another tree merge and fixups... let's see how long it takes until I learn this stuff

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 "" >&2
19 echo "This system does not appear to have a working C compiler." >&2
20 echo "A working C compiler is required to compile eggdrop." >&2
21 echo "" >&2
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 "" >&2
138 echo "Yoicks! you have BSD/OS & you dont have 'gmake', you may" >&2
139 echo "not be able to compile the bot successfully :(" >&2
140 echo "" >&2
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)
173 AC_MSG_RESULT(pre 1.3)
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 "" >&2
283 echo "Your system does not have the sprintf/vsprintf libraries." >&2
284 echo "These are required to compile almost anything. Sorry." >&2
285 echo "" >&2
286 exit 1
287 fi
288
289 if test "x${ac_cv_header_stdc}" = "xno"
290 then
291 echo "" >&2
292 echo "Your system must support ANSI C Header files." >&2
293 echo "These are required for the language support. Sorry." >&2
294 echo "" >&2
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"
332 then
333 if test "x${TCLINC}" = "x"
334 then
335 echo "" >&2
336 echo "Environment variable TCLLIB was set, but I did not detect TCLINC." >&2
337 echo "Please set both TCLLIB and TCLINC correctly if you wish to use them." >&2
338 echo "configure will now attempt to autodetect both libtcl and tcl.h..." >&2
339 echo "" >&2
340 unset TCLLIB
341 fi
342 else
343 if test ! "x${TCLINC}" = "x"
344 then
345 echo "" >&2
346 echo "Environment variable TCLINC was set, but I did not detect TCLLIB." >&2
347 echo "Please set both TCLLIB and TCLINC correctly if you wish to use them." >&2
348 echo "configure will now attempt to autodetect both libtcl and tcl.h..." >&2
349 echo "" >&2
350 unset TCLINC
351 fi
352 fi
353
354 dnl oohh new configure --variables for those with multiple tcl libs
355 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
356 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
357
358 if test -r "$tcllibname"
359 then
360 TCLLIB=`$DIRNAME $tcllibname`
361 TCLLIBEXT=".`echo $tcllibname | $AWK '{j=split($1, i, "."); k=i[[j]]; print k}'`"
362 TCLLIBFN=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
363 echo "Using Tcl library: $TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
364 else
365
366 # look for libtcl: if TCLLIB is set, check there first
367 if test ! "x${TCLLIB}" = "x"
368 then
369 for tcllibfn in $tclnames
370 do
371 for tcllibext in $tcllibextensions
372 do
373 if test -r "$TCLLIB/lib$tcllibfn$tcllibext"
374 then
375 if test "x${TCLLIBFN}" = "x"
376 then
377 TCLLIBFN=$tcllibfn
378 TCLLIBEXT=$tcllibext
379 break 2
380 fi
381 fi
382 done
383 done
384 if test "x${TCLLIBFN}" = "x"
385 then
386 echo "" >&2
387 echo "Environment variable TCLLIB was set, but incorrect." >&2
388 echo "Please set both TCLLIB and TCLINC correctly if you wish to use them." >&2
389 echo "configure will now attempt to autodetect both libtcl and tcl.h..." >&2
390 echo "" >&2
391 unset TCLLIB
392 unset TCLINC
393 fi
394 fi
395
396 # check in common places now
397 AC_MSG_CHECKING(for libtcl)
398 if test ! "x${TCLLIB}" = "x"
399 then
400 AC_MSG_RESULT(found in $TCLLIB/lib$TCLLIBFN$TCLLIBEXT)
401 else
402 for tcllibfn in $tclnames
403 do
404 for tcllibext in $tcllibextensions
405 do
406 for tcllibpath in $tcllibpaths
407 do
408 if test -r "$tcllibpath/lib$tcllibfn$tcllibext"
409 then
410 if test "x${TCLLIB}" = "x"
411 then
412 AC_MSG_RESULT(found in $tcllibpath/lib$tcllibfn$tcllibext)
413 TCLLIB=$tcllibpath
414 TCLLIBFN=$tcllibfn
415 TCLLIBEXT=$tcllibext
416 break 3
417 fi
418 fi
419 done
420 done
421 done
422 fi
423
424 fi # test tcllibname
425
426 # give up if they don't even have that
427 if test "x${TCLLIB}" = "x"
428 then
429 AC_MSG_RESULT(not found)
430 fi
431
432 # now look for pesky $TCLINCFN file
433 if test -r "$tclincname"
434 then
435 TCLINC=`$DIRNAME $tclincname`
436 TCLINCFN=`$BASENAME $tclincname`
437 echo "Using Tcl header: $TCLINC/$TCLINCFN"
438 else
439
440 TCLINCFN=tcl.h
441
442 if test ! "x${TCLINC}" = "x"
443 then
444 if test ! -r "$TCLINC/$TCLINCFN"
445 then
446 echo "" >&2
447 echo "Environment variable TCLINC was set, but incorrect." >&2
448 echo "Please set both TCLLIB and TCLINC correctly if you wish to use them." >&2
449 echo "configure cannot safely continue now..." >&2
450 echo "" >&2
451 exit 1
452 fi
453 fi
454
455 # check in common places now
456 AC_MSG_CHECKING(for $TCLINCFN)
457 if test ! "x${TCLINC}" = "x"
458 then
459 AC_MSG_RESULT(found in $TCLINC/$TCLINCFN)
460 else
461 for headerpath in $tclheaderpaths
462 do
463 if test -r "$headerpath/$TCLINCFN"
464 then
465 if test "x${TCLINC}" = "x"
466 then
467 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
468 TCLINC=$headerpath
469 break
470 fi
471 fi
472 done
473 if test "x${TCLINC}" = "x"
474 then
475 for tcllibfn in $tclnames
476 do
477 for headerpath in $tclheaderpaths
478 do
479 if test -r "$headerpath/$tcllibfn/$TCLINCFN"
480 then
481 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
482 TCLINC=$headerpath/$tcllibfn
483 break 2
484 fi
485 done
486 done
487 fi
488 fi
489
490 # had TCLLIB but not TCLINC? so close... :(
491 if test "x${TCLINC}" = "x"
492 then
493 AC_MSG_RESULT(not found)
494 unset TCLLIB
495 unset TCLLIBFN
496 unset TCLLIBEXT
497 fi
498
499 fi # test tclincname
500
501 # done looking, now either TCLLIB & TCLINC are both set, or neither is set
502 if test "x${TCLLIB}" = "x"
503 then
504 echo "" >&2
505 echo "I can't find Tcl on this system." >&2
506 echo "" >&2
507 echo "Eggdrop now requires Tcl to compile. If you already have Tcl" >&2
508 echo "installed on this system, and I just wasn't looking in the right" >&2
509 echo "place for it, set the environment variables TCLLIB and TCLINC so" >&2
510 echo "I will know where to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h'" >&2
511 echo "(respectively). Then run 'configure' again." >&2
512 echo "" >&2
513 echo "Read the README file if you don't know what Tcl is or how to get" >&2
514 echo "it and install it." >&2
515 echo "" >&2
516 exit 1
517 else
518
519 AC_MSG_CHECKING(for Tcl version)
520
521 for ver in $tclnames
522 do
523 ver=`echo $ver | cut -c4-`
524 if test ! "x${ver}" = "x"
525 then
526 TCLFOUND=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep $ver | wc -l`
527 if test ! $TCLFOUND = 0
528 then
529 TCLVER=$ver
530 break
531 fi
532 fi
533 done
534
535 if test ! "x${TCLVER}" = "x"
536 then
537 AC_MSG_RESULT($TCLVER found!)
538 else
539 AC_MSG_RESULT(hmm... unknown version)
540 fi
541
542 if test $TCLFOUND = 1
543 then
544 TCL_REQS="$TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
545 TCL_LIBS="-L$TCLLIB -l$TCLLIBFN -lm"
546 else
547 echo "" >&2
548 echo "Your Tcl version is much too old for eggdrop to use." >&2
549 echo "I suggest you download and complie a more recent version." >&2
550 echo "The most reliable current version is 8.2.1" >&2
551 echo "" >&2
552 exit 1
553 fi
554
555 if test "x${TCLLIBEXT}" = "x.a"
556 then
557 echo "" >&2
558 echo "Your libtcl is not a shared library." >&2
559 echo "configure will set default make type to static..." >&2
560 echo "" >&2
561 DEFAULT_MAKE=static
562 fi
563
564 fi # test TCLLIB
565
566 AC_SUBST(TCLINC)
567 AC_SUBST(TCLLIB)
568 AC_SUBST(TCLINCFN)
569 AC_SUBST(TCL_REQS)
570 AC_SUBST(TCL_LIBS)
571
572 # ---------- end of robey's tcl thingies
573
574 if test $need_dl = 1 && test "x${ac_cv_func_dlopen}" = "xno"
575 then
576 if test "$LINUX" = "yes"
577 then
578 echo "Since you are on a Linux system, this has a known problem," >&2
579 if test -r "/lib/libdl.so.1"
580 then
581 echo "and you seem to have it, I know a kludge for it," >&2
582 echo "so we'll do that..." >&2
583 echo "" >&2
584 AC_DEFINE(HAVE_DLOPEN)
585 LIBS="/lib/libdl.so.1 $LIBS"
586 got_dl=1
587 else
588 echo "which you DONT seem to have... doh!" >&2
589 echo "perhaps you may still have the stuff lying around somewhere" >&2
590 echo "if you work out where it is, add it to your XLIBS= lines" >&2
591 echo "and #define HAVE_DLOPEN in config.h" >&2
592 echo "" >&2
593 echo "we'll proceed on anyway, but you probably won't be able" >&2
594 echo "to 'make eggdrop' but you might be able to make the" >&2
595 echo "static bot (I'll default your make to this version)." >&2
596 DEFAULT_MAKE=static
597 fi
598 else
599 echo "You don't seem to have libdl anywhere I can find it, this will" >&2
600 echo "prevent you from doing dynamic modules, I'll set your default" >&2
601 echo "make to static linking." >&2
602 DEFAULT_MAKE=static
603 fi
604 fi
605
606 if test ! "x${GMAKE}" = "x"
607 then
608 SET_MAKE="MAKE=gmake"
609 fi
610
611 if test -z "$DEST"
612 then
613 DEST=\${prefix}
614 fi
615
616 AC_SUBST(DEST)
617 AC_SUBST(CP1)
618 AC_SUBST(CP2)
619 AC_SUBST(CP3)
620 AC_SUBST(EGGEXEC)
621 AC_SUBST(CC)
622 AC_SUBST(SHLIB_LD)
623 AC_SUBST(SHLIB_CC)
624 AC_SUBST(SHLIB_STRIP)
625 AC_SUBST(RESLIB)
626 AC_SUBST(BEL_MOD_LD)
627 AC_SUBST(BEL_MOD_CC)
628 AC_SUBST(BEL_MOD_STRIP)
629 AC_SUBST(DLFLAGS)
630 AC_SUBST(DEFAULT_MAKE)
631 AC_OUTPUT(Makefile lush.h)
632
633 echo ""
634 echo "Configure is done."
635 echo ""
636 if test -f "./eggdrop"
637 then
638 echo "Type 'make clean' and then 'make' to create the bot."
639 else
640 echo "Type 'make' to create the bot."
641 fi
642 echo ""

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23