[ MARK configure.in ] @dnl Process this file with autoconf to produce a configure script. AC_INIT(eggdrop.conf) 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 no cross-compiling! dnl AC_C_CROSS <- was merged into AC_PROG_CC 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) dnl 'nawk' is NOT compatable! dammit! dnl no longer use awk for anything dnl AC_CHECK_PROGS(AWK,awk gawk mawk) AC_PROG_RANLIB dnl stop putting -g in there! @#$!#$%! dnl also fix strength-reduce problem in gcc CFLAGS="-O" if test "x$CC" = "xgcc"; then CFLAGS="-O2 -fno-strength-reduce" fi 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 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` case $system in Linux) CFLAGS="${CFLAGS} -Wall" AC_MSG_RESULT(Linux! rock the house!) SHLIB_LD="${CC} -shared" AC_DEFINE(MODULES_OK) LINUX=yes ;; FreeBSD) AC_MSG_RESULT(FreeBSD! enjoy!) SHLIB_CC="$CC -fpic" SHLIB_LD="ld -Bshareable -x" AC_DEFINE(MODULES_OK) ;; BSD/OS) if test x`uname -r | cut -d . -f 1` = "x3"; then 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) AC_DEFINE(DLOPEN_MUST_BE_1) else AC_MSG_RESULT(BSD/OS 2! no modules for you) fi ;; 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" AC_DEFINE(DLOPEN_MUST_BE_1) 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(MODULES_OK) ;; 1.*) AC_MSG_RESULT(1.3+) SHLIB_CFL="$CC -fpic" SHLIB_LD='ld -shared' AC_DEFINE(MODULES_OK) ;; *) AC_MSG_RESULT(Some other weird OSF! No modules for you..) ;; esac AC_DEFINE(STOP_UAC) ;; IRIX) AC_MSG_RESULT(you are cursed with IRIX) IRIX=yes STRIP= ;; CYGWIN32/NT) AC_MSG_RESULT(Windows NT -- enjoy the ride! Don't come asking us for help.) NT=yes STRIP= EGGEXEC=eggdrop.exe ;; *) AC_MSG_RESULT(Something unknown!!) AC_MSG_RESULT(If you get modules to work, be sure to let the devel team know HOW :) ;; 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) 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 -- yay) else AC_MSG_RESULT(SunOS -- sigh) dnl for suns without yp or something like that: AC_CHECK_LIB(dl,main) fi fi fi dnl crazy machines AC_AIX AC_ISC_POSIX AC_MINIX 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) 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) 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 dnl check how much space is left in filedb (infoset TCLINC fi fi # check in common places now AC_MSG_CHECKING(for tcl.h) 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 $HOME/tcl $HOME/tcl/include; do if test -r $check/tcl.h; then if test "$TCLINC" != ""; then break fi AC_MSG_RESULT(found in $check/tcl.h) TCLINC=$check break fi done else AC_MSG_RESULT(found in $TCLINC/tcl.h) fi # had TCLLIB but not TCLINC? so close... :( if test "$TCLINC" = ""; then AC_MSG_RESULT(not found) unset TCLLIB unset TCLLIBFN fi fi # 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 'tcl.h'" 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 AC_MSG_CHECKING(for Tcl version) tclver=`grep TCL_VERSION $TCLINC/tcl.h | grep "7.4" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/tcl.h | grep "7.5" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/tcl.h | grep "7.6" | wc -l` if test $tclver = 0; then tclver=`grep TCL_VERSION $TCLINC/tcl.h | grep "8.0" | wc -l` if test $tclver = 1; then AC_MSG_RESULT(8.0 found!) need_dl=1 else AC_MSG_RESULT(hmm... unknown version) fi else AC_MSG_RESULT(7.6 found!) need_dl=1 fi else AC_MSG_RESULT(7.5 found!) need_dl=1 fi else AC_MSG_RESULT(7.4 found) echo " 7.4 is kind of old; you may want to upgrade soon." need_dl=0 fi if test $need_dl = 1 -a "${ac_cv_func_dlopen}" = "no"; then got_dl=0 dnl some weird weird OS's put it here :/ if test -r /usr/bin/libdl.so.1; then CFLAGS="$CFLAGS -L/usr/bin" fi AC_CHECK_LIB(dl,dlopen,got_dl=1) if test $got_dl = 0; then echo "" echo "In order to use versions of Tcl from 7.5 on, you must have" echo "the DL libraries somewhere on your system (-ldl)." echo "" if test "$LINUX" = "yes"; then echo "Since you are on a Linux system, this has a know problem," if test -r /lib/libdl.so.1; then echo "and you seem to have it, get your sys admin to make a" echo "symbolic link from libdl.so to libdl.so.1 in lib" echo "" exit 1 fi echo "which you DONT seem to have... doh!" echo "" fi echo "We'll keep going anyway, you may get away with it..." echo "I *doubt* it tho.." echo "" else AC_DEFINE(HAVE_DLOPEN) fi LIBS="-ldl $LIBS" fi TCLLIBFNS=`basename $TCLLIBFN .a` 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 AC_MSG_RESULT(7.3 or earlier -- sigh) TCL_REQS="libtcle.a" TCL_LIBS="-L. -ltcle -lm" fi fi AC_SUBST(TCLINC) AC_SUBST(TCLLIB) AC_SUBST(TCLLIBFN) AC_SUBST(TCL_REQS) AC_SUBST(TCL_LIBS) # ---------- end of robey's tcl thingies AC_SUBST(EGGEXEC) 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_OUTPUT(Makefile lush.h) # if you configure again, you must re-make everything. tough shit. make clean echo "" echo "Configure is done." echo "Type 'make eggdrop' to create the non-module bot, and" echo " 'make eggmod' for the module bot." echo ""