/[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.3 - (show annotations) (download)
Sat Oct 9 15:46:33 1999 UTC (20 years ago) by fabian
Branch: MAIN
Changes since 1.2: +262 -238 lines
all changes to the 1.3 tree merged with 1.4

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_C_BIGENDIAN
254 AC_CHECK_SIZEOF(long,0)
255 AC_CHECK_SIZEOF(int,0)
256
257 dnl Checks for header files.
258 AC_HEADER_DIRENT
259 AC_HEADER_SYS_WAIT
260 AC_CHECK_HEADERS(sys/time.h sys/select.h sys/rusage.h unistd.h stdarg.h dlfcn.h)
261
262 dnl Checks for typedefs, structures, and compiler characteristics.
263 AC_TYPE_PID_T
264 AC_HEADER_TIME
265 AC_C_INLINE
266
267 dnl Checks for library functions.
268 AC_CHECK_FUNCS(rename getrusage getdtablesize srandom random sigaction)
269 AC_CHECK_FUNCS(sigemptyset vsprintf strcasecmp setpgid clock dlopen)
270 AC_CHECK_FUNCS(dprintf bzero uname vsnprintf)
271
272 if test "x${ac_cv_func_vsprintf}" = "xno"
273 then
274 echo ""
275 echo "Your system does not have the sprintf/vsprintf libraries."
276 echo "These are required to compile almost anything. Sorry."
277 echo ""
278 exit 1
279 fi
280
281 if test "x${ac_cv_header_stdc}" = "xno"
282 then
283 echo ""
284 echo "Your system must support ANSI C Header files."
285 echo "These are required for the language support. Sorry."
286 echo ""
287 exit 1
288 fi
289
290 dnl check how much space is left in filedb (informational purposes)
291 AC_MSG_CHECKING(space left in file database struct)
292 cat > abacab.c <<'EOF'
293 #include <stdio.h>
294 #include <sys/time.h>
295 #include "src/mod/filesys.mod/files.h"
296 main() {
297 fprintf(stderr, "%d/%d", 512-sizeof(struct filler), sizeof(filedb));
298 }
299 EOF
300 ${CC} -o abacab abacab.c
301 FILEDB_SPACE=`./abacab`
302 AC_MSG_RESULT($FILEDB_SPACE bytes)
303 rm -f abacab abacab.o abacab.c
304 echo " (standard is currently 48/512 bytes)"
305
306 dnl where is tcl? is it here?
307 # ---------- begin robey's tcl thingies
308 # (well, what used to be robey's tcl thingies...)
309
310 tclnames="tcl tcl8.3 tcl83 tcl8.2 tcl82 tcl8.1 tcl81 \
311 tcl8.0 tcl80 tcl7.6 tcl76 tcl7.5 tcl75"
312
313 tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .a"
314
315 tcllibpaths="/usr/local/lib /usr/local/pkgs/tcl/lib \
316 /usr/lib /lib /usr/i486-linuxaout/lib \
317 $HOME/lib $HOME/tcl/lib $HOME"
318
319 tclheaderpaths="/usr/local/include /usr/local/pkgs/tcl/include \
320 /usr/include $HOME/include $HOME/tcl/include $HOME"
321
322 # sanity checking to make sure either both or neither TCLLIB and TCLINC are set
323 if test ! "x${TCLLIB}" = "x" && test "x${TCLINC}" = "x"
324 then
325 echo ""
326 echo "You set the environment variable TCLLIB, but I failed to detect TCLINC."
327 echo "Please set both if you wish to use them."
328 echo "configure will now try to autodetect both libtcl and tcl.h"
329 echo ""
330 unset TCLLIB
331 else
332 if test ! "x${TCLINC}" = "x"
333 then
334 echo ""
335 echo "You set the environment variable TCLINC, but I failed to detect TCLLIB."
336 echo "Please set both if you wish to use them."
337 echo "configure will now try to autodetect both libtcl and tcl.h"
338 echo ""
339 unset TCLINC
340 fi
341 fi
342
343 dnl oohh new configure --variables for those with multiple tcl libs
344 AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval)
345 AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval)
346
347 if test -r "$tcllibname"
348 then
349 TCLLIB=`$DIRNAME $tcllibname`
350 TCLLIBEXT=".`echo $tcllibname | $AWK '{j=split($1, i, "."); k=i[[j]]; print k}'`"
351 TCLLIBFN=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
352 echo "Using Tcl library: $TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
353 else
354
355 # look for libtcl: if TCLLIB is set, check there first
356 if test ! "x${TCLLIB}" = "x"
357 then
358 for tcllibfn in $tclnames
359 do
360 for tcllibext in $tcllibextensions
361 do
362 if test -r "$TCLLIB/lib$tcllibfn$tcllibext"
363 then
364 if test "x${TCLLIBFN}" = "x"
365 then
366 TCLLIBFN=$tcllibfn
367 TCLLIBEXT=$tcllibext
368 break 2
369 fi
370 fi
371 done
372 done
373 if test "x${TCLLIBFN}" = "x"
374 then
375 echo "Environment variable TCLLIB is set, but incorrect."
376 unset TCLLIB
377 fi
378 fi
379
380 # check in common places now
381 AC_MSG_CHECKING(for libtcl)
382 if test ! "x${TCLLIB}" = "x"
383 then
384 AC_MSG_RESULT(found in $TCLLIB/lib$TCLLIBFN$TCLLIBEXT)
385 else
386 for tcllibfn in $tclnames
387 do
388 for tcllibext in $tcllibextensions
389 do
390 for tcllibpath in $tcllibpaths
391 do
392 if test -r "$tcllibpath/lib$tcllibfn$tcllibext"
393 then
394 if test "x${TCLLIB}" = "x"
395 then
396 AC_MSG_RESULT(found in $tcllibpath/lib$tcllibfn$tcllibext)
397 TCLLIB=$tcllibpath
398 TCLLIBFN=$tcllibfn
399 TCLLIBEXT=$tcllibext
400 break 3
401 fi
402 fi
403 done
404 done
405 done
406 fi
407
408 fi # test tcllibname
409
410 # give up if they don't even have that
411 if test "x${TCLLIB}" = "x"
412 then
413 AC_MSG_RESULT(not found)
414 fi
415
416 # now look for pesky $TCLINCFN file
417 if test -r "$tclincname"
418 then
419 TCLINC=`$DIRNAME $tclincname`
420 TCLINCFN=`$BASENAME $tclincname`
421 echo "Using Tcl header: $TCLINC/$TCLINCFN"
422 else
423
424 TCLINCFN=tcl.h
425
426 if test ! "x${TCLINC}" = "x"
427 then
428 if test ! -r "$TCLINC/$TCLINCFN"
429 then
430 echo "Environment variable TCLINC is set, but incorrect."
431 unset TCLINC
432 fi
433 fi
434
435 # check in common places now
436 AC_MSG_CHECKING(for $TCLINCFN)
437 if test ! "x${TCLINC}" = "x"
438 then
439 AC_MSG_RESULT(found in $TCLINC/$TCLINCFN)
440 else
441 for headerpath in $tclheaderpaths
442 do
443 if test -r "$headerpath/$TCLINCFN"
444 then
445 if test "x${TCLINC}" = "x"
446 then
447 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
448 TCLINC=$headerpath
449 break
450 fi
451 fi
452 done
453 if test "x${TCLINC}" = "x"
454 then
455 for tcllibfn in $tclnames
456 do
457 for headerpath in $tclheaderpaths
458 do
459 if test -r "$headerpath/$tcllibfn/$TCLINCFN"
460 then
461 AC_MSG_RESULT(found in $headerpath/$TCLINCFN)
462 TCLINC=$headerpath/$tcllibfn
463 break 2
464 fi
465 done
466 done
467 fi
468 fi
469
470 # had TCLLIB but not TCLINC? so close... :(
471 if test "x${TCLINC}" = "x"
472 then
473 AC_MSG_RESULT(not found)
474 unset TCLLIB
475 unset TCLLIBFN
476 unset TCLLIBEXT
477 fi
478
479 fi # test tclincname
480
481 # done looking, now either TCLLIB & TCLINC are both set, or neither is set
482 if test "x${TCLLIB}" = "x"
483 then
484 echo ""
485 echo "I can't find Tcl on this system."
486 echo ""
487 echo "Eggdrop now requires Tcl to compile. If you already have Tcl"
488 echo "installed on this system, and I just wasn't looking in the right"
489 echo "place for it, set the environment variables TCLLIB and TCLINC so"
490 echo "I will know where to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h'"
491 echo "(respectively). Then run 'configure' again."
492 echo ""
493 echo "Read the README file if you don't know what Tcl is or how to get"
494 echo "it and install it."
495 echo ""
496 exit 1
497 else
498
499 AC_MSG_CHECKING(for Tcl version)
500
501 for ver in $tclnames
502 do
503 ver=`echo $ver | cut -c4-`
504 if test ! "x${ver}" = "x"
505 then
506 TCLFOUND=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep $ver | wc -l`
507 if test ! $TCLFOUND = 0
508 then
509 TCLVER=$ver
510 break
511 fi
512 fi
513 done
514
515 if test ! "x${TCLVER}" = "x"
516 then
517 AC_MSG_RESULT($TCLVER found!)
518 else
519 AC_MSG_RESULT(hmm... unknown version)
520 fi
521
522 if test $TCLFOUND = 1
523 then
524 TCL_REQS="$TCLLIB/lib$TCLLIBFN$TCLLIBEXT"
525 TCL_LIBS="-L$TCLLIB -l$TCLLIBFN -lm"
526 else
527 echo ""
528 echo "Your tcl version is much too old for eggdrop to use."
529 echo "I suggest you download and complie a more recent version."
530 echo "The most reliable current version is 8.2.1"
531 echo ""
532 exit 1
533 fi
534
535 if test "x${TCLLIBEXT}" = "x.a"
536 then
537 echo ""
538 echo "Your libtcl is not a shared library."
539 echo "configure will set default make type to static..."
540 echo ""
541 DEFAULT_MAKE=static
542 fi
543
544 fi # test TCLLIB
545
546 AC_SUBST(TCLINC)
547 AC_SUBST(TCLLIB)
548 AC_SUBST(TCLINCFN)
549 AC_SUBST(TCL_REQS)
550 AC_SUBST(TCL_LIBS)
551
552 # ---------- end of robey's tcl thingies
553
554 if test $need_dl = 1 && test "x${ac_cv_func_dlopen}" = "xno"
555 then
556 if test "$LINUX" = "yes"
557 then
558 echo "Since you are on a Linux system, this has a known problem,"
559 if test -r "/lib/libdl.so.1"
560 then
561 echo "and you seem to have it, I know a kludge for it,"
562 echo "so we'll do that..."
563 echo ""
564 AC_DEFINE(HAVE_DLOPEN)
565 LIBS="/lib/libdl.so.1 $LIBS"
566 got_dl=1
567 else
568 echo "which you DONT seem to have... doh!"
569 echo "perhaps you may still have the stuff lying around somewhere"
570 echo "if you work out where it is, add it to your XLIBS= lines"
571 echo "and #define HAVE_DLOPEN in config.h"
572 echo ""
573 echo "we'll proceed on anyway, but you probably won't be able"
574 echo "to 'make eggdrop' but you might be able to make the"
575 echo "static bot (I'll default your make to this version)."
576 DEFAULT_MAKE=static
577 fi
578 else
579 echo "You don't seem to have libdl anywhere I can find it, this will"
580 echo "prevent you from doing dynamic modules, I'll set your default"
581 echo "make to static linking."
582 DEFAULT_MAKE=static
583 fi
584 fi
585
586 if test ! "x${GMAKE}" = "x"
587 then
588 SET_MAKE="MAKE=gmake"
589 fi
590
591 if test -z "$DEST"
592 then
593 DEST=\${prefix}
594 fi
595
596 AC_SUBST(DEST)
597 AC_SUBST(CP1)
598 AC_SUBST(CP2)
599 AC_SUBST(CP3)
600 AC_SUBST(EGGEXEC)
601 AC_SUBST(CC)
602 AC_SUBST(SHLIB_LD)
603 AC_SUBST(SHLIB_CC)
604 AC_SUBST(SHLIB_STRIP)
605 AC_SUBST(BEL_MOD_LD)
606 AC_SUBST(BEL_MOD_CC)
607 AC_SUBST(BEL_MOD_STRIP)
608 AC_SUBST(DLFLAGS)
609 AC_SUBST(DEFAULT_MAKE)
610 AC_OUTPUT(Makefile lush.h)
611
612 echo ""
613 echo "Configure is done."
614 echo ""
615 if test -f "./eggdrop"
616 then
617 echo "Type 'make clean' and then 'make' to create the bot."
618 else
619 echo "Type 'make' to create the bot."
620 fi
621 echo ""

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23