dc071c1999-11-14Per Hedbor AC_INIT(accept_and_parse.c) AC_CONFIG_HEADER(config.h) AC_SET_MAKE
b111821999-11-18Fredrik Hübinette (Hubbe) AC_MODULE_INIT()
dc071c1999-11-14Per Hedbor 
cae06e2003-04-22Marcus Comstedt AC_CHECK_LIB(bind, __inet_ntoa) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname)
5f0a822003-12-07Marcus Comstedt AC_CHECK_LIB(net, __get_socket_descriptor)
cae06e2003-04-22Marcus Comstedt 
dc071c1999-11-14Per Hedbor AC_CHECK_HEADERS(poll.h sys/poll.h sys/socket.h netinet/in.h arpa/inet.h \
f033262009-05-27Henrik Grubbström (Grubba)  asm/unistd.h sys/uio.h sys/types.h winsock2.h ws2tcpip.h) if test "$ac_cv_header_winsock2_h" = "yes"; then :; else # Note: This header file interferes with winsock2.h. AC_CHECK_HEADERS(winsock.h) fi
8d17be2006-07-02Martin Stjernholm 
46b3372014-09-04Martin Nilsson AC_CHECK_FUNCS(poll gmtime_r gmtime sendfile inet_ntoa inet_ntop)
dc071c1999-11-14Per Hedbor  AC_SUBST(RANLIB)
b1e2b12000-03-26Henrik Grubbström (Grubba) # # NOTE: The test for sendfile is a duplicate of the test in the files module. # It should probably be moved to the main configure-script. # Note also that the test in the files module is more complete than this one. # /grubba 2000-03-26 #
dc071c1999-11-14Per Hedbor if test "$ac_cv_func_sendfile" = "yes"; then AC_MSG_CHECKING(if sendfile takes 4(Linux) or 7(FreeBSD) arguments) AC_CACHE_VAL(pike_cv_freebsd_sendfile, [ AC_TRY_COMPILE([
b1e2b12000-03-26Henrik Grubbström (Grubba) #include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_SYS_UIO_H #include <sys/uio.h> #endif /* HAVE_SYS_UIO_H */
dc071c1999-11-14Per Hedbor  ], [ return sendfile(0,0,0,0,(void *)0,(void *)0,0); ], [ # Probably FreeBSD-style, but we need to check that # we indeed have a prototype... AC_TRY_COMPILE([
b1e2b12000-03-26Henrik Grubbström (Grubba) #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_SYS_UIO_H #include <sys/uio.h> #endif /* HAVE_SYS_UIO_H */
dc071c1999-11-14Per Hedbor  ], [ /* This should fail on FreeBSD * If it succeeds, we don't have a prototype, * which would indicate Linux. */ return sendfile(0,0,(void *)0,0); ], [ pike_cv_freebsd_sendfile=no ], [ pike_cv_freebsd_sendfile=yes ]) ], [ pike_cv_freebsd_sendfile=no ]) ]) if test "$pike_cv_freebsd_sendfile" = "yes"; then AC_MSG_RESULT([7 - FreeBSD style]) AC_DEFINE(HAVE_FREEBSD_SENDFILE)
b1e2b12000-03-26Henrik Grubbström (Grubba)  AC_MSG_CHECKING([if sendfile looks thread-safe]) AC_CACHE_VAL(pike_cv_freebsd_sendfile_threadsafe, [ # We're optimistic -- default to assuming it works. pike_cv_freebsd_sendfile_threadsafe="yes" if test -f /usr/lib/libc_r.so; then if /usr/bin/nm -D /usr/lib/libc_r.so 2>&1 | grep _thread_sys >/dev/null 2>&1; then # Ok, looks like we can perform the test. # Assume we have a broken sendfile(2). pike_cv_freebsd_sendfile_threadsafe="no" if /usr/bin/nm -D /usr/lib/libc_r.so 2>&1 | grep _thread_sys_sendfile >/dev/null 2>&1; then # Wee! They have actually added a wrapper for sendfile(2)! pike_cv_freebsd_sendfile_threadsafe="yes" else :; fi else :; fi else :; fi ]) if test "$pike_cv_freebsd_sendfile_threadsafe" = "yes"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no - disabling use of sendfile) AC_DEFINE(HAVE_BROKEN_SENDFILE) fi
dc071c1999-11-14Per Hedbor  else AC_MSG_RESULT([4 - Linux style]) fi fi
6dc2772000-07-28Fredrik Hübinette (Hubbe) if test x"$pike_cv_sys_os" = xWindows_NT ; then # FIXME: These look suspiciouly much like 32bit versions. # We probably want to use 64bit versions on IA64. LDFLAGS="-lws2_32 $LDFLAGS" fi
dc071c1999-11-14Per Hedbor AC_OUTPUT(Makefile,echo FOO >stamp-h )