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

Annotation of /eggdrop1.9/configure.in

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


Revision 1.2 - (hide annotations) (download)
Mon Sep 13 14:38:17 1999 UTC (20 years, 2 months ago) by segfault
Branch: MAIN
Changes since 1.1: +2 -2 lines
Commits

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23