dnl Process this file with autoconf to produce a configure script. AC_INIT(eggdrop.doc) AC_CONFIG_HEADER(config.h) echo "" echo "Okay, this is a 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 "" echo "First, it's gonna check for a bunch of random things... Here we go." echo "" dnl Checks for programs. AC_PROG_MAKE_SET AC_CHECK_PROG(STRIP,strip,-s) AC_CHECK_PROG(UNAME,uname,uname) dnl 'nawk' is NOT compatable! dammit! AC_CHECK_PROGS(AWK,gawk mawk awk) AC_PROG_CC AC_PROG_RANLIB dnl stop putting -g in there! @#$!#$%! CFLAGS="-O" if test "x$CC" = "xgcc"; then CFLAGS="-O2 -Wall" fi dnl crazy machines AC_AIX AC_ISC_POSIX AC_MINIX dnl Check for OSF/1. AC_MSG_CHECKING(for OSF/1) if test x`${UNAME}` = "xOSF1"; then AC_MSG_RESULT(yes) AC_DEFINE(STOP_UAC) else AC_MSG_RESULT(no) fi if test x`${UNAME}` = "xLinux"; then AC_MSG_CHECKING(for Linux threads) cat >abacab.c <<'EOF' #include #include #include #include #include void fn() { return; } main() { long retval; unsigned long x; void **newstack; newstack=(void **)(x+sizeof(unsigned long)); __asm__ __volatile__( "int $0x80\n\t" "testl %0,%0\n\t" "jne 1f\n\t" "call *%3\n\t" "movl %2,%0\n\t" "int $0x80\n" "1:\t" :"=a" (retval) :"0" (__NR_clone),"i" (__NR_exit), "r" (fn),"b" (0x0000700|SIGCHLD),"c" (newstack)); if (retval<0) exit(1); /* failed */ exit(0); } EOF ${CC} -o abacab abacab.c if `./abacab`; then AC_MSG_RESULT(yes) dnl AC_DEFINE(LINUX_THREADS) else AC_MSG_RESULT(no) fi rm -f abacab abacab.o abacab.c fi dnl Check for Sun libraries. AC_CHECK_LIB(socket,main) dnl AC_CHECK_LIB(ucb,main,LIBS=$LIBS -lucb -L/usr/ucblib) AC_CHECK_LIB(nsl,main) dnl for suns without yp or something like that: AC_CHECK_LIB(dl,main) 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 waitpid vsprintf strcasecmp) dnl where is tcl? is it here? # ---------- begin robey's tcl thingies if test "x$TCL" = "xno"; then echo "" echo "You've chosen to compile WITHOUT Tcl." echo "" else echo "" echo "Now I'm gonna look for Tcl, and if I can find it, you'll compile" echo "using that, to get a much more powerful bot." echo "" # look for libtcl.a: if TCLLIB is set, check there first if test "$TCLLIB" != ""; then if test -r $TCLLIB/libtcl.a; then TCLLIBFN=libtcl.a elif test -r $TCLLIB/libtcl7.4.a; then TCLLIBFN=libtcl7.4.a else echo "Environment variable TCLLIB is set, but incorrect." unset TCLLIB fi fi # check in common places now AC_MSG_CHECKING(for libtcl.a) if test "$TCLLIB" = ""; then for checkfn in libtcl.a libtcl7.4.a; do if test "$TCLLIB" != ""; then break fi for check in /usr/local/lib /usr/local/lib/tcl /usr/local/pkgs/tcl/lib /usr/lib $HOME $HOME/tcl $HOME/tcl/lib; do if test -r $check/$checkfn; then AC_MSG_RESULT(found in $check/$checkfn) TCLLIB=$check TCLLIBFN=$checkfn break fi done done else AC_MSG_RESULT(found in $TCLLIB/$TCLLIBFN) fi # give up if they don't even have that if test "$TCLLIB" = ""; then AC_MSG_RESULT(not found) else # now look for pesky tcl.h file if test "$TCLINC" != ""; then if test ! -r $TCLINC/tcl.h; then echo "Environment variable TCLINC is set, but incorrect." unset 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 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 "NOT using Tcl because I can't find the files I need." echo "Eggdrop is intended to compile with Tcl extensions, and will be" echo "handicapped without them. You might want to consider installing" echo "Tcl on your system." echo "" echo "If you believe you DO have Tcl installed on the system, then you" echo "will need to set the environment variables TCLLIB and TCLINC so" echo "I will know where to find 'libtcl.a' and 'tcl.h' (respectively)." echo "Then run 'configure' again." echo "" TCL_OBJS="" TCL_REQS="" else AC_MSG_CHECKING(for Tcl 7.4) tclver=`grep TCL_VERSION $TCLINC/tcl.h | grep "7.4" | wc -l` if test $tclver = 1; then AC_MSG_RESULT(7.4 found!) if test "$TCLLIBFN" = "libtcl.a"; then libfn="tcl" else libfn="tcl7.4" fi TCL_REQS="$TCLLIB/$TCLLIBFN" TCL_LIBS="-L$TCLLIB -l$libfn -lm" else AC_MSG_RESULT(non-7.4 but that's okay) TCL_REQS="libtcle.a" TCL_LIBS="-L. -ltcle -lm" fi echo "" echo "Gonna compile WITH Tcl because you seem to have all the necessary" echo "files and things." echo "" echo "If for some reason you DON'T want to compile with Tcl, set the" echo "environment variable TCL to 'no' and run configure again." echo "" TCL_OBJS="tcl.o tclhash.o" TCL_DEFS="-DTCL" fi fi AC_SUBST(TCLINC) AC_SUBST(TCLLIB) AC_SUBST(TCLLIBFN) AC_SUBST(TCL_OBJS) AC_SUBST(TCL_REQS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_LIBS) # ---------- end of robey's tcl thingies 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' to create the bot." echo ""