#!/bin/sh # # To impose specific compiler or flags or install directory, use for example: # prefix=$HOME CC=cc CFLAGS="-O4" ./configure # or for csh/tcsh users: # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) CFLAGS="-O" OPTIM_CFLAGS="" LIBS="" DEBUGS="" EXE_EXT="" # -Wredundant-decls returns any libc .h errors # -Wwrite-strings returns any "discards const" errors # -Wconversion returns any "different width due to" errors # -Wall -pedantic compiles cleanly with: # Linux, FreeBSD 2.2.7, Digital UNIX 4.0 (OSF1), OpenBSD 2.2 # Other OSes might spew warnings out at you with those options # Last 2 WARNs are VERY VERY STRICT and also MAY spew tons of warnings, # except on Linux for sure. They still may if you use -O3 optims. # In general, warnings are harmless though, and will NOT break a compile. # Email me output, if you have time to try those options on your OS ########################################################################## # VERSION=`cat hdrfiles/constants.h | grep 'define VERSION' | awk -F\" '{print $2}' | awk '{print $1" "$2}'` gcc=0 old_cc="$CC" old_cflags="$CFLAGS" warnings=0 optims=1 zombie_debug=0 qwrite_debug=0 qflush_debug=0 iac_debug=0 post_debug=0 resolver_debug=0 smtp_debug=0 gcc_debug=0 ac_option=$1 ac_found_var= ac_save_LIBS= ac_save_CFLAGS= ac_func_search_save_LIBS= ac_hdr= ac_err= ac_try= ac_tr_hdr= ac_header_dirent= ac_ret_sig_type= ac_system_type= ac_config_hdr="hdrfiles/config.h" ac_configure_args= echo Configuration for $VERSION echo # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} for ac_option do case "$1" in *) ac_configure_args="$ac_configure_args $1" ;; esac done for ac_option do case "$1" in -h* | --h*) echo 'syntax: configure [option] [option]'; echo ' WARNING OPTIONS [you MAY choose only 1]' echo ' --enable-warn1 Some warning checks' echo ' --enable-warn2 Strict warning checks' echo ' --enable-warn3 Very Strict warning checks' echo ' DEBUG OPTIONS [you MAY choose more than 1]' echo ' --enable-zombie-debug Configure to debug zombie children' echo ' --enable-qwrite-debug Configure to debug queued socket writes' echo ' --enable-qflush-debug Configure to debug socket flushes' echo ' --enable-iac-debug Configure to debug telnet negotiation' echo ' --enable-post-debug Configure to debug web server POSTing' echo ' --enable-resolver-debug Configure to debug the resolver clipon' echo ' --enable-smtp-debug Configure to debug the SMTP client' echo ' --enable-gcc-debug Configure to compile debugging code for gdb' echo ' --enable-all-debug Configure to debug everything above' echo ' See docs/README.debugging for more info on the above' echo ' MISC OPTIONS [you MAY choose more than 1]' echo ' --disable-optims Turn off compiler optimizations' echo ' example: configure --enable-warn1 --enable-iac-debug' exit 0;; -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; -p* | --p*) prefix="$2"; shift; shift;; --enable-warn3) echo 'Will turn on very strict warnings' warnings=3; shift;; --enable-warn2) echo 'Will turn on strict warnings' warnings=2; shift;; --enable-warn1) echo 'Will turn on some warnings' warnings=1; shift;; --disable-optims) echo 'Turning off compiler optimizations' optims=0; shift;; --enable-zombie-debug) echo 'Will enable -DZOMBIE_DEBUG' zombie_debug=1; shift;; --enable-qwrite-debug) echo 'Will enable -DQWRITE_DEBUG' qwrite_debug=1; shift;; --enable-qflush-debug) echo 'Will enable -DQFLUSH_DEBUG' qflush_debug=1; shift;; --enable-iac-debug) echo 'Will enable -DIAC_DEBUG' iac_debug=1; shift;; --enable-post-debug) echo 'Will enable -DPOST_DEBUG' post_debug=1; shift;; --enable-resolver-debug) echo 'Will enable -DRESOLVER_DEBUG' resolver_debug=1; shift;; --enable-smtp-debug) echo 'Will enable -DSMTP_DEBUG' smtp_debug=1; shift;; --enable-gcc-debug) echo 'Will enable -g' gcc_debug=1; shift;; --enable-all-debug) echo 'Will enable -DZOMBIE_DEBUG' echo 'Will enable -DQWRITE_DEBUG' echo 'Will enable -DQFLUSH_DEBUG' echo 'Will enable -DIAC_DEBUG' echo 'Will enable -DPOST_DEBUG' echo 'Will enable -DRESOLVER_DEBUG' echo 'Will enable -DSMTP_DEBUG' zombie_debug=1; qwrite_debug=1; qflush_debug=1; iac_debug=1; post_debug=1; smtp_debug=1; resolver_debug=1; shift;; esac done # START PRE-CONFIGURE # $ac_config_hdr avoids OS command line length limits that DEFS can exceed. rm -rf conftest* $ac_config_hdr # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > $ac_config_hdr cat >> $ac_config_hdr <<EOF #define CODE_VERSION "$VERSION" EOF ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext' ac_compile_ctest='$cc -c $CFLAGS $CPPFLAGS conftest.$ac_ext' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS' ac_exeext= ac_objext=o exec 5>./config.log exec 6>&1 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c='\c' ac_t= fi fi # END PRE-CONFIGURE echo cat > conftest.$ac_ext <<EOF extern int getchar(); int hello() {return getchar();} EOF test -z "$CC" && echo $ac_n "checking for gcc... " cc=${CC-gcc} cflags=${CFLAGS-"-O3"} case "$cc" in *gcc*) echo "checking for gcc..." >&5 gcc=1;; esac #if test "$gcc" -eq 1 && ($cc -c $cflags conftest.$ac_ext) 2>/dev/null; then if { (eval echo configure:1: \"$ac_compile_ctest\") 1>&5; (eval $ac_compile_ctest) 2>&5; }; then CC="$cc" else CC=${CC-cc} fi echo compiler is $CC #echo compile line was $ac_compile_ctest echo $ac_n "checking how to run the C preprocessor""... " echo "checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$CPP" echo $ac_n "checking system type... " echo "checking system type..." >&5 # find system type case `(uname -sr || echo unknown) 2>/dev/null` in Linux* | linux*) ac_system_type="LINUX_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; *freebsd* | *FreeBSD*) ac_system_type="FREEBSD_SYS" OPTIM_CFLAGS="-m486 -O2" # LIBS="" ;; *openbsd* | *OpenBSD*) ac_system_type="OPENBSD_SYS" OPTIM_CFLAG="-m486 -O2" # LIBS="" ;; *netbsd* | *NetBSD*) ac_system_type="NETBSD_SYS" OPTIM_CFLAGS="-m486 -O2" # LIBS="" ;; *bsd* | *BSD*) ac_system_type="OTHERBSD_SYS" OPTIM_CFLAGS="-m486 -O2" # LIBS="" ;; *HP-UX* | *hpux*) ac_system_type="HPUX_SYS" OPTIM_CFLAGS="-O3" # OPTIM_CFLAGS="-O3 -Ae" # LIBS="" ;; IRIX*) ac_system_type="IRIX_SYS" OPTIM_CFLAGS="-O3 -cckr" # LIBS="" ;; OSF1) ac_system_type="OSF_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; QNX*) ac_system_type="QNX_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; UnixWare* | Unixware* | unixware*) ac_system_type="UNIXWARE_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lnsl -lsocket" ;; DYNIX* | Dynix* | dynix*) ac_system_type="DYNIX_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lnsl -lsocket" ;; SCO*) ac_system_type="SCO_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lsocket" ;; AIX* | Aix* | aix*) ac_system_type="AIX_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lmalloc -lsocket -lnsl" ;; SunOS\ 5*) ac_system_type="SUNOS5_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lmalloc -lsocket -lnsl" ;; SunOS\ 4*) ac_system_type="SUNOS4_SYS" OPTIM_CFLAGS="-O3" # LIBS="-lmalloc -lsocket -lnsl" ;; UNIX_System_V\ 4.2.0) ac_system_type="SYSV_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; UNIX_SV\ 4.2MP) ac_system_type="SV_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; Darwin* | darwin* | DARWIN*) ac_system_type="MACOSX_SYS" OPTIM_CFLAGS="-O" # LIBS="-lmalloc -lsocket -lnsl" ;; *cygwin* | *CYGWIN* | *CygWIN*) ac_system_type="CYGWIN_SYS" OPTIM_CFLAGS="-O3" EXE_EXT=".exe" # LIBS="" ;; # send working options for other systems to support@gzip.org *) ac_system_type="UNKNOWN_SYS" OPTIM_CFLAGS="-O3" # LIBS="" ;; esac echo "`(uname -sr || echo unknown) 2>/dev/null`, setting $ac_system_type" # TESTCODE #ac_system_type="UNKNOWN_SYS" # Let us see if we can find out more about this unknown system the hard way if test "$ac_system_type" = "UNKNOWN_SYS"; then echo "I am an idiot. Let me think a little harder..." # Check for AIX echo $ac_n " checking for AIX... " echo "checking for AIX..." >&5 cat > conftest.$ac_ext <<EOF #ifdef _AIX yes #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "yes" ac_system_type="AIX_SYS" else rm -rf conftest* echo "no" fi rm -f conftest* if test "$ac_system_type" = "UNKNOWN_SYS"; then # Check for FreeBSD echo $ac_n " checking for FreeBSD... " echo "checking for FreeBSD..." >&5 cat > conftest.$ac_ext <<EOF #ifdef __FreeBSD__ yes #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "yes" ac_system_type="FREEBSD_SYS" else rm -rf conftest* echo "no" fi rm -f conftest* fi if test "$ac_system_type" = "UNKNOWN_SYS"; then # Check for OpenBSD echo $ac_n " checking for OpenBSD... " echo "checking for OpenBSD..." >&5 cat > conftest.$ac_ext <<EOF #ifdef __OpenBSD__ yes #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "yes" ac_system_type="OPENBSD_SYS" else rm -rf conftest* echo "no" fi rm -f conftest* fi if test "$ac_system_type" = "UNKNOWN_SYS"; then # Check for NetBSD echo $ac_n " checking for NetBSD... " echo "checking for NetBSD..." >&5 cat > conftest.$ac_ext <<EOF #ifdef __NetBSD__ yes #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "yes" ac_system_type="NETBSD_SYS" else rm -rf conftest* echo "no" fi rm -f conftest* fi # end hard system check fi cat >> $ac_config_hdr <<EOF #define $ac_system_type 1 EOF ac_found_var="no" # START HP-UX -Ae CHECK if test $ac_system_type = "HPUX_SYS"; then echo $ac_n "checking whether ${CC-cc} accepts -Ae... " echo "checking whether ${CC-cc} accepts -Ae" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -Ae -c conftest.c 2>&1`"; then ac_found_var=yes else ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then CFLAGS2="-Ae $CFLAGS2" fi fi # END HP-UX -Ae CHECK ac_found_var="no" # START MMAP CHECK echo $ac_n "checking for mmap support... " echo "checking for mmap support..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <sys/mman.h> #include <sys/stat.h> caddr_t hello() { return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); } EOF #if test "`($CC -c $CFLAGS conftest.$ac_ext) 2>&1`" = ""; then if { (eval echo configure:2: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_MMAP 1 EOF fi # END MMAP CHECK ac_found_var="no" # START ERRNO CHECK echo $ac_n "checking for errno in errno.h... " echo "checking for errno in errno.h..." >&5 cat > conftest.$ac_ext <<EOF #include <errno.h> int main() { int i = errno ; return 0; } EOF #if test "`($CC -c $CFLAGS conftest.$ac_ext) 2>&1`" = ""; then if { (eval echo configure:2: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_ERRNO_DECL 1 EOF fi # END ERRNO CHECK ac_found_var="no" # START SYS_ERRLIST CHECK echo $ac_n "checking for sys_errlist declaration in errno.h... " echo "checking for sys_errlist declaration in errno.h... " >&5 cat > conftest.$ac_ext <<EOF #include <errno.h> int main() { char *msg = *(sys_errlist + 1); if (msg && *msg) return 12; ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define SYS_ERRLIST_DECLARED 1 EOF cat >> $ac_config_hdr <<EOF #define HAVE_SYS_ERRLIST 1 EOF else echo $ac_n "checking for sys_errlist in library... " echo "checking for sys_errlist in library... " >&5 cat > conftest.$ac_ext <<EOF int main() { extern char *sys_errlist[]; extern int sys_nerr; char *p; p = sys_errlist[sys_nerr - 1]; if (p) return 12; ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_SYS_ERRLIST 1 EOF fi fi # END SYS_ERRLIST CHECK ac_found_var="no" # START SETGRP CHECK echo $ac_n "checking if setpgrp takes arguments... " echo "checking if setpgrp takes arguments..." >&5 cat > conftest.$ac_ext <<EOF #include <unistd.h> main() { exit(setpgrp(NULL,NULL));} EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_SETPGRP_ARGS 1 EOF fi # END SETGRP CHECK ac_found_var="no" # START MKDIR CHECK echo $ac_n "checking if mkdir takes arguments... " echo "checking if mkdir takes arguments..." >&5 cat > conftest.$ac_ext <<EOF #include <unistd.h> #include <sys/stat.h> main() { exit(mkdir(NULL));} EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rm -rf conftest* ac_found_var=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=yes fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_MKDIR_ARGS 1 EOF fi # END MKDIR CHECK ac_found_var="no" # START LAST ACCEPT ARG CHECK echo $ac_n "checking for last argument type to accept... " echo "checking for last argument type to accept..." >&5 cat > conftest.$ac_ext <<EOF #if defined(inline) #undef inline #endif #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> int main() { int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0); ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var="socklen_t" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* if test "$ac_found_var" = "no"; then cat > conftest.$ac_ext <<EOF #if defined(inline) #undef inline #endif #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> int main() { int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0); ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var="size_t" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* if test "$ac_found_var" = "no"; then ac_found_var="int" fi fi # HACK FOR DARWIN/MACOSX, where this returns size_t, but manpages # and includes say int, producing warnings if test "$ac_system_type" = "MACOSX_SYS" && test "$ac_found_var" = "size_t"; then ac_found_var="int" fi echo "$ac_found_var" cat >> $ac_config_hdr <<EOF #define NET_SIZE_T $ac_found_var EOF # END LAST ACCEPT ARG CHECK ac_found_var="no" cat >> $ac_config_hdr <<EOF EOF # START HEADER CHECK echo $ac_n "checking whether time.h and sys/time.h may both be included... " echo "checking whether time.h and sys/time.h may both be included..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <sys/time.h> #include <time.h> int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* echo "$ac_found_var" if test "$ac_found_var" = "yes"; then cat >> $ac_config_hdr <<EOF #define TIME_WITH_SYS_TIME 1 EOF fi ac_found_var="no" echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible... " echo "checking for sys/wait.h that is POSIX.1 compatible..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <sys/wait.h> #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h stdarg.h varargs.h do ac_found_var="no" echo $ac_n "checking for $ac_hdr... " echo "checking for $ac_hdr..." >&5 cat > conftest.$ac_ext <<EOF #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "yes" ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF else echo "no" fi done # START NETDB CHECK echo $ac_n "checking for a working netdb.h... " echo "checking for a working netdb.h..." >&5 for ac_hdr in netdb.h arpa/netdb.h do ac_found_var="no" cat > conftest.$ac_ext <<EOF #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "YES! found $ac_hdr" ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF break fi done if test $ac_found_var = no; then echo "no..i will try my own" fi # END NETDB CHECK # START RESOLV CHECK echo $ac_n "checking for a working resolv.h... " echo "checking for a working resolv.h..." >&5 for ac_hdr in resolv.h arpa/resolv.h do ac_found_var="no" cat > conftest.$ac_ext <<EOF #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "YES! found $ac_hdr" ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF break fi done if test $ac_found_var = no; then echo "no..i will try my own" fi # END RESOLV CHECK # START NAMESER CHECK echo $ac_n "checking for a working nameser.h... " echo "checking for a working nameser.h..." >&5 for ac_hdr in arpa/nameser.h nameser.h do ac_found_var="no" cat > conftest.$ac_ext <<EOF #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "YES! found $ac_hdr" ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF break fi done if test $ac_found_var = no; then echo "no..i will try my own" fi # END NAMESER CHECK for ac_hdr in unistd.h ctype.h sys/wait.h sys/param.h sys/resource.h sys/ioctl.h sys/mode.h string.h strings.h stdlib.h sys/socket.h do ac_found_var="no" echo $ac_n "checking for $ac_hdr... " echo "checking for $ac_hdr..." >&5 cat > conftest.$ac_ext <<EOF #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "yes" ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF else echo "no" fi done # END HEADERS CHECK ac_found_var="no" cat >> $ac_config_hdr <<EOF EOF # START FUNCTION CHECK for ac_func in waitpid getcwd strdup strerror strchr strstr bzero memset snprintf strpbrk pipe strftime select mktime rename srandom random srand rand setenv bcopy memcpy tzset uname gethostname getdomainname umask do ac_found_var="no" echo $ac_n "checking for $ac_func... " echo "checking for $ac_func" >&5 cat > conftest.$ac_ext <<EOF /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* if test $ac_found_var = yes; then echo "yes" ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> $ac_config_hdr <<EOF #define $ac_tr_func 1 EOF else echo "no" fi done # END FUNCTION CHECK ac_found_var="no" # START DIRENT CHECK ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do echo $ac_n "checking for $ac_hdr that defines DIR... " echo "checking for $ac_hdr that defines DIR..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <$ac_hdr> int main() { DIR *dirp = 0; ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* if test "$ac_found_var" = "yes"; then ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> $ac_config_hdr <<EOF #define $ac_tr_hdr 1 EOF echo "yes" ac_header_dirent=$ac_hdr; break else echo "no" fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir... " echo "checking for opendir in -ldir..." >&5 ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* LIBS="$ac_save_LIBS" if test "$ac_found_var" = "yes"; then echo "yes" LIBS="$LIBS -ldir" else echo "no" fi else echo $ac_n "checking for opendir in -lx... " echo "checking for opendir in -lx..." >&5 ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* LIBS="$ac_save_LIBS" if test "$ac_found_var" = "yes"; then echo "yes" LIBS="$LIBS -lx" else echo "no" fi fi # END DIRENT CHECK ac_found_var="no" # START CONNECT CHECK echo $ac_n "checking for main in -lnsl... " echo "checking for main in -lnsl..." >&5 ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF int main() { main() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* fi rm -f conftest* LIBS="$ac_save_LIBS" if test "$ac_found_var" = "yes"; then # good to use nls echo "yes" ac_found_var="no" echo $ac_n "checking for library containing connect... " echo "checking for library containing connnect..." >&5 ac_func_search_save_LIBS="$LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { connect() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_found_var" = "no" && for i in xnet socket inet; do LIBS="-l$i -lnsl $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { connect() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" else # bad to use nls echo "no" ac_found_var="no" echo $ac_n "checking for non-nsl library containing connect... " echo "checking for non-nsl library containing connect..." >&5 ac_func_search_save_LIBS="$LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { connect() ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_found_var" = "no" && for i in xnet socket inet; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { connect() ; return 0; } EOF if { (eval echo configure:10: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" # end good-bad to use nls fi if test "$ac_found_var" != "no"; then echo "$ac_found_var" test "$ac_found_var" = "none required" || LIBS="$ac_found_var $LIBS" else echo "cannot find a good lib to use! exiting!" fi # END CONNECT CHECK ac_found_var="no" # START GETHOSTBYADDR CHECK echo $ac_n "checking for library containing gethostbyaddr... " echo "checking for library containing gethostbyaddr..." >&5 ac_func_search_save_LIBS="$LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyaddr(); int main() { gethostbyaddr() ; return 0; } EOF if { (eval echo configure:11: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_found_var" = "no" && for i in netinet nsl socket resolv; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyaddr(); int main() { gethostbyaddr() ; return 0; } EOF if { (eval echo configure:12: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" if test "$ac_found_var" != "no"; then echo "$ac_found_var" test "$ac_found_var" = "none required" || LIBS="$ac_found_var $LIBS" else echo "cannot find a good lib to use! exiting!" fi # END GETHOSTBYADDR CHECK ac_found_var="no" # START GETHOSTBYNAME CHECK echo $ac_n "checking for library containing gethostbyname... " echo "checking for library containing gethostbyname..." >&5 ac_func_search_save_LIBS="$LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); int main() { gethostbyname() ; return 0; } EOF if { (eval echo configure:11: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_found_var" = "no" && for i in netinet nsl socket resolv; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); int main() { gethostbyname() ; return 0; } EOF if { (eval echo configure:12: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" if test "$ac_found_var" != "no"; then echo "$ac_found_var" test "$ac_found_var" = "none required" || LIBS="$ac_found_var $LIBS" cat >> $ac_config_hdr <<EOF #define HAVE_GETHOSTBYNAME 1 EOF else echo "cannot find a good lib to use! exiting!" fi # END GETHOSTBYNAME CHECK ac_found_var="no" # START SIGNAL HANDLER CHECK echo $ac_n "checking return type of signal handlers... " echo "checking return type of signal handlers..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <signal.h> #ifdef signal #undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main() { int i; ; return 0; } EOF if { (eval echo configure:13: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_ret_sig_type="void" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_ret_sig_type="int" fi rm -f conftest* echo "$ac_ret_sig_type" cat >> $ac_config_hdr <<EOF #define RETSIGTYPE $ac_ret_sig_type EOF if test "$ac_ret_sig_type" = void ; then cat >> $ac_config_hdr <<EOF #define RETSIGVAL EOF else cat >> $ac_config_hdr <<EOF #define RETSIGVAL (0) EOF fi ac_found_var="no" # START SIGNAL PROTOTYPE CHECK ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wstrict-prototypes" echo $ac_n "checking if SIG_IGN function declaration is a prototype... " echo "checking if SIG_IGN function declaration is a prototype..." >&5 cat > conftest.$ac_ext <<EOF #include <sys/types.h> #include <signal.h> #ifdef signal #undef signal #endif int main(void) { signal(SIGINT, SIG_IGN); return 0; } EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo configure:xxx: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" echo "$ac_found_var" if test "$ac_found_var" = "yes"; then cat >> $ac_config_hdr <<EOF #define HAVE_SIG_IGN_PROTO 1 EOF fi ac_found_var="no" # check TYPE of signals echo $ac_n "checking flavor of signal routines... " echo "checking flavor of signal routines... " >&5 cat > conftest.$ac_ext <<EOF #include <signal.h> int main() { sigset_t ss; struct sigaction sa; sigemptyset(&ss); sigsuspend(&ss); sigaction(SIGINT, &sa, (struct sigaction *) 0); sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var=posix else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* # try sigmask if test $ac_found_var = no; then cat > conftest.$ac_ext <<EOF #include <signal.h> int main() { int mask = sigmask(SIGINT); sigsetmask(mask); sigblock(mask); sigpause(mask); ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var=bsd42 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=no fi rm -f conftest* fi # try sigset if test $ac_found_var = no; then cat > conftest.$ac_ext <<EOF #include <signal.h> $ac_ret_sig_type foo() { } int main() { int mask = sigmask(SIGINT); sigset(SIGINT, foo); sigrelse(SIGINT); sighold(SIGINT); sigpause(SIGINT); ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var=bsd41 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var=v7 fi rm -f conftest* fi echo "$ac_found_var" if test $ac_found_var = posix; then cat >> $ac_config_hdr <<EOF #define HAVE_SIGACTION 1 EOF elif test $ac_found_var = bsd42; then cat >> $ac_config_hdr <<EOF #define HAVE_SIGMASK 1 EOF elif test $ac_found_var = bsd41; then cat >> $ac_config_hdr <<EOF #define HAVE_SIGSET 1 EOF elif test $ac_found_var = v7; then cat >> $ac_config_hdr <<EOF #define HAVE_SIGNAL 1 EOF fi # END SIGNAL HANDLER CHECK ac_found_var="no" #echo $ac_n "checking if we need -lcrypt... " #echo "checking if we need -lcrypt..." >&5 #cat > conftest.$ac_ext <<EOF #extern int crypt(); #int main() {return crypt();} #EOF # #if { (eval echo configure:14: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then # echo "no" #else # echo "yes" # LIBS="$LIBS -lcrypt" #fi # #ac_found_var="no" echo $ac_n "checking if we need -lnsl... " echo "checking if we need -lnsl..." >&5 cat > conftest.$ac_ext <<EOF extern int gethostbyaddr(); int main() {return gethostbyaddr();} EOF #if test "1" -eq 1 && ($cc $cflags conftest.$ac_ext) 2>/dev/null; then if { (eval echo configure:14: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then echo "no" else echo "yes" LIBS="$LIBS -lnsl" fi echo $ac_n "checking if we need -lsocket... " echo "checking if we need -lsocket..." >&5 cat > conftest.$ac_ext <<EOF extern int accept(); int main() {return accept();} EOF #if test "1" -eq 1 && ($cc $cflags conftest.$ac_ext) 2>/dev/null; then if { (eval echo configure:15: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then echo "no" else echo "yes" LIBS="$LIBS -lsocket" fi echo $ac_n "checking if we need -lmalloc... " echo "checking if we need -lmalloc..." >&5 cat > conftest.$ac_ext <<EOF extern int malloc(); int main() {return malloc();} EOF #if test "1" -eq 1 && ($cc $cflags conftest.$ac_ext) 2>/dev/null; then if { (eval echo configure:16: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then echo "no" else echo "yes" LIBS="$LIBS -lmalloc" fi if test "$warnings" -eq 1; then CFLAGS2="$CFLAGS2 -Wall -pedantic" elif test "$warnings" -eq 2; then CFLAGS2="$CFLAGS2 -Wall -Winline -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wnested-externs -pedantic" elif test "$warnings" -eq 3; then CFLAGS2="$CFLAGS2 -Wall -Wpointer-arith -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wshadow -pedantic" fi if test "$gcc" -eq 1 && test "$gcc_debug" -eq 1; then CFLAGS2="-g $CFLAGS2" fi if test "$optims" -eq 1; then CFLAGS2="$OPTIM_CFLAGS $CFLAGS2" fi ac_found_var="no" # START RES_NMKQUERY CHECK echo $ac_n "checking for res_nmkquery... " echo "checking for res_nmkquery..." >&5 cat > conftest.$ac_ext <<EOF #include "hdrfiles/config.h" #include <stdio.h> #include <sys/types.h> #if defined(HAVE_ARPA_NAMESER_H) #include <arpa/nameser.h> #elif defined(HAVE_NAMESER_H) #include <nameser.h> #else #include "hdrfiles/nameser.h" #endif #include <netinet/in.h> #if defined(HAVE_RESOLV_H) #include <resolv.h> #elif defined(HAVE_ARPA_RESOLV_H) #include <arpa/resolv.h> #else #include "hdrfiles/resolv.h" #endif /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ int res_nmkquery(); int main() { res_nmkquery(NULL,(int)NULL,NULL,(int)NULL,(int)NULL, NULL,(int)NULL,NULL,NULL,(int)NULL) ; return 0; } EOF echo "Running $ac_link" >&5 if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* echo "$ac_found_var" if test $ac_found_var = yes; then cat >> $ac_config_hdr <<EOF #define HAVE_RES_NMKQUERY 1 EOF else # LOOK IN -lresolv echo $ac_n "checking for res_nmkquery in -lresolv... " echo "checking for res_nmkquery in -lresolv..." >&5 ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <<EOF #include "hdrfiles/config.h" #include <stdio.h> #include <sys/types.h> #if defined(HAVE_ARPA_NAMESER_H) #include <arpa/nameser.h> #elif defined(HAVE_NAMESER_H) #include <nameser.h> #else #include "hdrfiles/nameser.h" #endif #include <netinet/in.h> #if defined(HAVE_RESOLV_H) #include <resolv.h> #elif defined(HAVE_ARPA_RESOLV_H) #include <arpa/resolv.h> #else #include "hdrfiles/resolv.h" #endif /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ int res_nmkquery(); int main() { res_nmkquery(NULL,(int)NULL,NULL,(int)NULL,(int)NULL, NULL,(int)NULL,NULL,NULL,(int)NULL) ; return 0; } EOF if { (eval echo configure:xxx: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_found_var="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_found_var="no" fi rm -f conftest* LIBS="$ac_save_LIBS" if test "$ac_found_var" = "yes"; then echo "yes" cat >> $ac_config_hdr <<EOF #define HAVE_RES_NMKQUERY 1 EOF LIBS="$LIBS -lresolv" else echo "no" fi fi # END RES_NMKQUERY CHECK ac_found_var="no" if test "$zombie_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define ZOMBIE_DEBUG 1 EOF fi if test "$qwrite_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define QWRITE_DEBUG 1 EOF fi if test "$qflush_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define QFLUSH_DEBUG 1 EOF fi if test "$iac_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define IAC_DEBUG 1 EOF fi if test "$post_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define POST_DEBUG 1 EOF fi if test "$resolver_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define RESOLVER_DEBUG 1 EOF fi if test "$smtp_debug" -eq 1; then cat >> $ac_config_hdr <<EOF #define SMTP_DEBUG 1 EOF fi rm -fr conftest* echo echo creating $ac_config_hdr echo creating $CONFIG_STATUS CFLAGS2="-DHAVE_CONFIG_H $CFLAGS2" rm -f $CONFIG_STATUS 2>/dev/null echo "#!/bin/sh" > $CONFIG_STATUS echo "#" >> $CONFIG_STATUS echo "# Re-run this script to generate the same configuration" >> $CONFIG_STATUS echo "# as you had on the last successful run of configure" >> $CONFIG_STATUS echo "#" >> $CONFIG_STATUS echo "" >> $CONFIG_STATUS echo $0 $ac_configure_args >> $CONFIG_STATUS echo "" >> $CONFIG_STATUS chmod a+x $CONFIG_STATUS echo creating Makefile echo "# Makefile generated on `date` for $VERSION" > Makefile echo "#" >> Makefile echo "CC = $CC" >> Makefile echo "CFLAGS = $CFLAGS2" >> Makefile echo "LIBS = $LIBS" >> Makefile echo "EXE_EXT = $EXE_EXT" >> Makefile echo "VERSION = $VERSION" >> Makefile cat Makefile.in >> Makefile echo echo You should now run \"make\" to compile the talker