/[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.3 - (show annotations) (download)
Sun Jun 27 21:57:23 1999 UTC (21 years, 1 month ago) by guppy
Branch: MAIN
Changes since 1.2: +9 -0 lines
Mixter's configure shit

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23