dnl Process this file with autoconf to produce a configure script. AC_INIT(eggdrop.conf.dist) ac_default_prefix=\${HOME}/eggdrop AC_CONFIG_HEADER(config.h) echo "" echo "This is eggdrop's GNU configure script." echo "It's going to run a bunch of strange tests to hopefully make" echo "your compile work without much twiddling." echo "" AC_PROG_CC dnl crazy machines AC_AIX AC_ISC_POSIX AC_MINIX dnl no cross-compiling! if test ! x${cross_compiling} = xno then echo "" echo "This system does not appear to have a working C compiler." echo "A working C compiler is required to compile eggdrop." echo "" exit fi dnl Checks for programs. AC_PROG_MAKE_SET AC_CHECK_PROG(STRIP,strip,strip) AC_CHECK_PROG(UNAME,uname,uname) AC_PROG_RANLIB dnl stop putting -g in there! @#$!#$%! if test "x${CFLAGS}" = "x" then CFLAGS="-O" if test "x$CC" = "xgcc" then CFLAGS="-O2" fi else CFLAGS=${CFLAGS} fi dnl cp checks AC_MSG_CHECKING(whether cp takes -f) ac_file1=beldin1 ac_file2=beldin2 ac_cp="cp -f $ac_file1 $ac_file2" cat > $ac_file1 <&5; (eval $ac_cp) 2>&5; } && test -s $ac_file2; then AC_MSG_RESULT(yes) ac_cv_prog_cp_f=yes CP1="cp -f" CP2="cp -rf" CP3="cp -pf" else AC_MSG_RESULT(no) ac_cv_prog_cp_f=no CP1="cp" CP2="cp -r" CP3="cp -p" fi rm -f $ac_file1 $ac_file2 dnl test the os and set the module linking settings if test "x$STRIP" = "x" then STRIP="touch" fi IRIX=no NT=no EGGEXEC=eggdrop LINUX=no need_dl=1 DEFAULT_MAKE=eggdrop BEL_MOD_CC="${CC}" BEL_MOD_LD="${CC}" BEL_MOD_STRIP="${STRIP}" SHLIB_CC="${CC}" SHLIB_LD="${CC}" SHLIB_STRIP="${STRIP}" AC_MSG_CHECKING(your OS) system=`$UNAME` DLOPEN_1=1 case $system in Linux) CFLAGS="$CFLAGS -Wall" AC_MSG_RESULT(Linux! The choice of the GNU generation) SHLIB_LD="${CC} -shared -nostartfiles" BEL_MOD_LD="${CC}" AC_DEFINE(MODULES_OK) LINUX=yes DLOPEN_1= ;; BSD/OS) if test x`uname -r | cut -d . -f 1` = "x2" then AC_MSG_RESULT(BSD/OS 2! statically linked modules are the only choice) need_dl=0 DEFAULT_MAKE=static else AC_MSG_RESULT(BSD/OS 3+! ok I spose) BEL_MOD_CC="shlicc" BEL_MOD_LD="shlicc" BEL_MOD_STRIP="${STRIP} -d" SHLIB_LD="shlicc -r" SHLIB_STRIP="touch" AC_DEFINE(MODULES_OK) fi AC_CHECK_PROG(GMAKE,gmake,gmake) if test "x$GMAKE" = "x" then echo "" echo "Yoicks! you have BSD/OS & you dont have 'gmake', you may" echo "not be able to compile the bot successfully :(" echo "" fi ;; *BSD) AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison) SHLIB_CC="$CC -fpic" SHLIB_LD="ld -Bshareable -x" AC_DEFINE(MODULES_OK) DLOPEN_1= ;; SunOS) if test x`uname -r | cut -d . -f 1` = "x5" then AC_MSG_RESULT(Solaris!) SHLIB_LD="/usr/ccs/bin/ld -G -z text" else AC_MSG_RESULT(SunOS 4 :/) SHLIB_LD="ld" SHLIB_STRIP="touch" fi AC_DEFINE(MODULES_OK) SHLIB_CC="${CC} -fPIC" BEL_MOD_CC="${CC} -fPIC" ;; OSF1) AC_MSG_RESULT(OSF...) case `uname -r | cut -d . -f 1` in V*) AC_MSG_RESULT(Digital OSF) SHLIB_LD="ld -shared -expect_unresolved '*'" SHLIB_STRIP="touch" AC_DEFINE(MODULES_OK) ;; 1.0|1.1|1.2) AC_MSG_RESULT(pre 1.3) SHLIB_LD='ld -R -export $@:' AC_DEFINE(OSF1_HACKS) AC_DEFINE(MODULES_OK) ;; 1.*) AC_MSG_RESULT(1.3+) SHLIB_CFL="$CC -fpic" SHLIB_LD='ld -shared' AC_DEFINE(OSF1_HACKS) AC_DEFINE(MODULES_OK) ;; *) AC_MSG_RESULT(Some other weird OSF! No modules for you..) need_dl=0 DEFAULT_MAKE=static ;; esac AC_DEFINE(STOP_UAC) ;; HP-UX) AC_MSG_RESULT(HP-UX, just shoot yourself now) AC_CHECK_LIB(dld,shl_load) AC_DEFINE(MODULES_OK) AC_DEFINE(HPUX_HACKS) if test x`uname -r | cut -d . -f 2` = "x10" then AC_DEFINE(HPUX10_HACKS) fi BEL_MOD_LD="gcc -Wl,-E" SHLIB_CC="gcc -fPIC" SHLIB_LD="ld -b" need_dl=0 ;; IRIX64) echo "$ac_t""you are cursed with IRIX" 1>&6 IRIX=yes STRIP= need_dl=0 DEFAULT_MAKE=static ;; IRIX) AC_MSG_RESULT(you are cursed with IRIX) IRIX=yes STRIP= need_dl=0 DEFAULT_MAKE=static ;; *) if test -r /mach then AC_MSG_RESULT(NeXT...We are borg, you will be assimilated) AC_MSG_RESULT(break out the static modules, it's all you'll ever get :P) AC_MSG_RESULT(Hiya DK :P) AC_DEFINE(BORGCUBES) else AC_MSG_RESULT(Something unknown!!) AC_MSG_RESULT(If you get dynamic modules to work, be sure to let the devel team know HOW :) fi need_dl=0 DEFAULT_MAKE=static ;; esac dnl Check for Sun libraries. if test ${IRIX} = yes then echo Skipping library tests because they CONFUSE Irix. else AC_CHECK_LIB(socket,socket) AC_CHECK_LIB(nsl,connect) AC_CHECK_LIB(dns,gethostbyname) AC_CHECK_LIB(dl,dlopen) if test x`${UNAME}` = "xSunOS" then AC_MSG_CHECKING(for SunOS 4) if test x`uname -r | cut -d . -f 1` = "x5" then AC_MSG_RESULT(Solaris -- "*bollocks*" zarni ) else AC_MSG_RESULT(SunOS -- sigh) dnl for suns without yp or something like that: AC_CHECK_LIB(dl,main) fi fi fi AC_C_BIGENDIAN AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/time.h sys/select.h sys/rusage.h unistd.h stdarg.h dlfcn.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_HEADER_TIME dnl Checks for library functions. AC_CHECK_FUNCS(rename getrusage getdtablesize srandom random sigaction) AC_CHECK_FUNCS(sigemptyset vsprintf strcasecmp setpgid clock dlopen) AC_CHECK_FUNCS(dprintf bzero uname vsnprintf) if test "${ac_cv_func_vsprintf}" = "no" then echo "" echo "Your system does not have the sprintf/vsprintf libraries." echo "These are required to compile almost anything. Sorry." echo "" exit fi if test "${ac_cv_header_stdc}" = "no" then echo "" echo "Your system must support ANSI C Header files." echo "These are required for the language support. Sorry." exit fi dnl check how much space is left in filedb (informational purposes) AC_MSG_CHECKING(space left in file database struct) cat >abacab.c <<'EOF' #include #include #include "src/mod/filesys.mod/files.h" main() { fprintf(stderr,"%d/%d",512-sizeof(struct filler),sizeof(filedb)); } EOF ${CC} -o abacab abacab.c FILEDB_SPACE=`./abacab` AC_MSG_RESULT($FILEDB_SPACE bytes) rm -f abacab abacab.o abacab.c echo " (standard is currently 48/512 bytes)" dnl where is tcl? is it here? # ---------- begin robey's tcl thingies dnl oohh new configure --variables for those with multiple tcl libs AC_CHECK_PROG(BASENAME,basename,basename) AC_CHECK_PROG(DIRNAME,dirname,dirname) if test $BASENAME = "" || test $DIRNAME = "" then echo ack...no basename or dirname, we cant configure tcl without em. exit 1 fi AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname=$withval) AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname=$withval) if test -r "$tcllibname" then TCLLIB=`$DIRNAME $tcllibname` TCLLIBFN=`$BASENAME $tcllibname | cut -c4-` echo "using tcllib $TCLLIB/lib$TCLLIBFN" else libnames="tcl.so tcl.so.1\ tcl8.2.so tcl8.2.so.1 tcl82.so.1.0 tcl82.so.1\ tcl8.1.so tcl8.1.so.1 tcl81.so.1.0 tcl81.so.1\ tcl8.0.so tcl8.0.so.1 tcl80.so.1.0 tcl80.so.1\ tcl7.6.so tcl7.6.so.1 tcl76.so.1.0 tcl76.so.1\ tcl7.5.so tcl7.5.so.1 tcl75.so.1.0 tcl75.so.1\ tcl.a\ tcl8.2.a tcl82.a\ tcl8.1.a tcl81.a\ tcl8.0.a tcl80.a\ tcl7.6.a tcl76.a\ tcl7.5.a tcl75.a\ tcl7.4.a tcl74.a" # look for libtcl: if TCLLIB is set, check there first if test "$TCLLIB" != "" then TCLLIBFN=notfound for checkfn in $libnames do if test -r $TCLLIB/lib$checkfn then if test $TCLLIBFN = notfound then TCLLIBFN=$checkfn fi fi done if test $TCLLIBFN = notfound then echo "Environment variable TCLLIB is set, but incorrect." unset TCLLIB fi fi # check in common places now AC_MSG_CHECKING(for libtcl) if test "$TCLLIB" = "" then for checkfn in $libnames do if test "$TCLLIB" = "" then 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 do if test -r $check/lib$checkfn then if test "$TCLLIB" = "" then AC_MSG_RESULT(found in $check/lib$checkfn) TCLLIB=$check TCLLIBFN=$checkfn fi fi done fi done else AC_MSG_RESULT(found in $TCLLIB/lib$TCLLIBFN) fi fi # option # give up if they don't even have that if test "$TCLLIB" = "" then AC_MSG_RESULT(not found) fi # now look for pesky $TCLINCFN file if test -r "$tclincname" then TCLINC=`$DIRNAME $tclincname` TCLINCFN=`$BASENAME $tclincname` echo "using TCL header $TCLINC/$TCLINCFN" else TCLINCFN=tcl.h if test "$TCLINC" != "" then if test ! -r $TCLINC/$TCLINCFN then echo "Environment variable TCLINC is set, but incorrect." unset TCLINC fi fi # check in common places now AC_MSG_CHECKING(for $TCLINCFN) if test "$TCLINC" = "" then 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 do if test -r $check/$TCLINCFN then if test "$TCLINC" != "" then break fi AC_MSG_RESULT(found in $check/$TCLINCFN) TCLINC=$check break fi done # freebsd hack if test "$TCLINC" = "" then for ver in 8.2 8.1 8.0 7.6 7.5 7.4 do if test -r /usr/local/include/tcl$ver/$TCLINCFN then if test "$TCLINC" != "" then break fi AC_MSG_RESULT(found in /usr/local/include/tcl$ver/$TCLINCFN) TCLINC=/usr/local/include/tcl$ver break fi done fi else AC_MSG_RESULT(found in $TCLINC/$TCLINCFN) fi # had TCLLIB but not TCLINC? so close... :( if test "$TCLINC" = "" then AC_MSG_RESULT(not found) unset TCLLIB unset TCLLIBFN fi fi # option # done looking, now either TCLLIB & TCLINC are both set, or neither is set if test "$TCLLIB" = "" then echo "" echo "I can't find Tcl on this system." echo "" echo "Eggdrop now requires Tcl to compile. If you already have Tcl" echo "installed on this system, and I just wasn't looking in the right" echo "place for it, set the environment variables TCLLIB and TCLINC so" echo "I will know where to find 'libtcl.a' (or 'libtcl.so') and '$TCLINCFN'" echo "(respectively). Then run 'configure' again." echo "" echo "Read the README file if you don't know what Tcl is or how to get" echo "it and install it." echo "" exit 1 else echo Checking $TCLINC directory for tcl version AC_MSG_CHECKING(for Tcl version) tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.5" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "7.6" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.0" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.1" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/$TCLINCFN | grep "8.2" | wc -l` if test $tclver = 1; then AC_MSG_RESULT(8.2 found) else AC_MSG_RESULT(hmm... unknown version) fi else AC_MSG_RESULT(8.1 found) fi else AC_MSG_RESULT(8.0 found!) fi else AC_MSG_RESULT(7.6 found!) fi else AC_MSG_RESULT(7.5 found) fi fi # option if test $need_dl = 1 -a "${ac_cv_func_dlopen}" = "no" then if test "$LINUX" = "yes" then echo "Since you are on a Linux system, this has a known problem," if test -r /lib/libdl.so.1 then echo "and you seem to have it, I know a kludge for it," echo "so we'll do that..." echo "" AC_DEFINE(HAVE_DLOPEN) LIBS="/lib/libdl.so.1 $LIBS" got_dl=1 else echo "which you DONT seem to have... doh!" echo "perhaps you may still have the stuff lying around somewhere" echo "if you work out where it is, add it to your XLIBS= lines" echo "and #define HAVE_DLOPEN in config.h" echo "" echo "we'll proceed on anyways, but you probably won't be able" echo "to 'make eggdrop' but you might be able to make the" echo "static bot (I'll default your make to this version)." DEFAULT_MAKE=static fi else echo "You don't seem to have libdl anywhere I can find it, this will" echo "prevent you from doing dynamic modules, I'll set your default" echo "make to static linking." DEFAULT_MAKE=static fi fi TCLLIBFNS=`basename $TCLLIBFN .a` TCLLIBFNS=`basename $TCLLIBFNS .so.1.2` TCLLIBFNS=`basename $TCLLIBFNS .so.1.0` TCLLIBFNS=`basename $TCLLIBFNS .so.1` TCLLIBFNS=`basename $TCLLIBFNS .so` if test $tclver = 1 then TCL_REQS="$TCLLIB/lib$TCLLIBFN" TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS -lm" else echo "" echo "You're tcl version is way too old - Version 7.4 or earlier" echo "I suggest you download and complie a more recent version" echo "The most reliable current version is 8.2b1" echo "" exit 1 fi AC_SUBST(TCLINC) AC_SUBST(TCLLIB) AC_SUBST(TCLINCFN) AC_SUBST(TCLLIBFN) AC_SUBST(TCL_REQS) AC_SUBST(TCL_LIBS) # ---------- end of robey's tcl thingies if test ! "x$GMAKE" = "x" then SET_MAKE="MAKE=gmake" fi if test -z "$DEST" then DEST=\${prefix} fi AC_SUBST(DEST) AC_SUBST(CP1) AC_SUBST(CP2) AC_SUBST(CP3) AC_SUBST(EGGEXEC) AC_SUBST(CC) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_CC) AC_SUBST(SHLIB_STRIP) AC_SUBST(BEL_MOD_LD) AC_SUBST(BEL_MOD_CC) AC_SUBST(BEL_MOD_STRIP) AC_SUBST(DLFLAGS) AC_SUBST(DEFAULT_MAKE) AC_OUTPUT(Makefile lush.h) # if you configure again, you must re-make everything. tough shit. make clean echo "" echo "Configure is done." echo "" echo "If your bot will be on Dalnet, or a network that uses their server" echo "code, please edit the Makefile and remove \"-DRFC_COMPLIANT\" from" echo "the \"CFLGS=\" line." echo "" echo "Type 'make' to create the bot" echo ""