|
|
| version 1.258, 2003/06/11 06:56:06 | version 1.267, 2003/06/23 23:51:59 |
|---|---|
| Line 320 done | Line 320 done |
| IFS=$ac_save_IFS | IFS=$ac_save_IFS |
| # | # |
| # Enable libpq to be thread-safe | |
| # | |
| AC_MSG_CHECKING([allow threaded libpq]) | |
| PGAC_ARG_BOOL(with, threads, no, [ --with-threads allow libpq and ecpg to be thread-safe], | |
| [AC_DEFINE([USE_THREADS], 1, [Define to 1 to build libpq and ecpg to be thread-safe. (--with-threads)])]) | |
| AC_MSG_RESULT([$with_threads]) | |
| AC_SUBST(with_threads) | |
| # | |
| # Tcl/Tk | # Tcl/Tk |
| # | # |
| AC_MSG_CHECKING([whether to build with Tcl]) | AC_MSG_CHECKING([whether to build with Tcl]) |
| Line 542 fi]) | Line 552 fi]) |
| AC_SUBST(ELF_SYS) | AC_SUBST(ELF_SYS) |
| # | # |
| # Pthreads | |
| # | |
| AC_CHECK_HEADER(pthread.h, | |
| [AC_DEFINE(HAVE_THREADS, 1, [Define to 1 if you have the threads interface.])]) | |
| if test ! -z "$HAVE_THREADS" | |
| then | |
| case $host_os in | |
| # BSD/OS and NetBSD require no special libraries or flags | |
| netbsd*|bsdi*) ;; | |
| freebsd2*|freebsd3*|freebsd4*) THREAD_CFLAGS="-pthread" ;; | |
| freebsd*) THREAD_LIBS="-lc_r" ;; | |
| linux*) THREAD_LIBS="-lpthread" | |
| THREAD_CFLAGS="-D_REENTRANT" ;; | |
| # other operating systems might fail because they have pthread.h but need | |
| # special libs we don't know about yet. | |
| esac | |
| fi | |
| AC_SUBST(THREAD_LIBS) | |
| AC_SUBST(THREAD_CFLAGS) | |
| # | |
| # Assignments | # Assignments |
| # | # |
| Line 789 PGAC_C_FUNCNAME_SUPPORT | Line 777 PGAC_C_FUNCNAME_SUPPORT |
| PGAC_STRUCT_TIMEZONE | PGAC_STRUCT_TIMEZONE |
| PGAC_UNION_SEMUN | PGAC_UNION_SEMUN |
| PGAC_STRUCT_SOCKADDR_UN | PGAC_STRUCT_SOCKADDR_UN |
| PGAC_STRUCT_SOCKADDR_STORAGE | |
| PGAC_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | |
| PGAC_STRUCT_ADDRINFO | PGAC_STRUCT_ADDRINFO |
| AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], | AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], |
| [#include <sys/param.h> | [#include <sys/param.h> |
| #include <sys/types.h> | |
| #include <sys/socket.h> | #include <sys/socket.h> |
| #include <sys/ucred.h>]) | #include <sys/ucred.h>]) |
| Line 968 AC_CHECK_FUNCS(atexit, [], | Line 959 AC_CHECK_FUNCS(atexit, [], |
| AC_FUNC_FSEEKO | AC_FUNC_FSEEKO |
| # | |
| # Pthreads | |
| # | |
| # For each platform, we need to know about any special compile and link | |
| # libraries, and whether the normal C function names are thread-safe. | |
| # | |
| NEED_REENTRANT_FUNC_NAMES=no | |
| if test "$with_threads" = yes; then | |
| AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --with-threads])]) | |
| if test "$SUPPORTS_THREADS" != yes; then | |
| AC_MSG_ERROR([ | |
| Cannot enable threads on your platform. | |
| Please report your platform threading info to the PostgreSQL mailing lists | |
| so it can be added to the next release. Report any compile flags, link flags, | |
| functions, or libraries required for threading support. | |
| ]) | |
| fi | |
| fi | |
| AC_SUBST(THREAD_CFLAGS) | |
| AC_SUBST(THREAD_LIBS) | |
| # | |
| # Check for re-entrant versions of certain functions | |
| # | |
| # Include special flags if threads are enabled _and_ if required for | |
| # threading on this platform. Some platforms have *_r functions but | |
| # their natively named funcs are threadsafe, and should be used instead. | |
| # | |
| # One trick here is that if the don't call AC_CHECK_FUNCS, the | |
| # functions are marked "not found", which is perfect. | |
| # | |
| if test "$NEED_REENTRANT_FUNC_NAMES" = yes ; then | |
| _CFLAGS="$CFLAGS" | |
| _LIB="$LIBS" | |
| CFLAGS="$CFLAGS $TREAD_CFLAGS" | |
| LIBS="$LIBS $THREAD_LIBS" | |
| AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r]) | |
| CFLAGS="$_CFLAGS" | |
| LIB="$_LIBS" | |
| fi | |
| # This test makes sure that run tests work at all. Sometimes a shared | # This test makes sure that run tests work at all. Sometimes a shared |
| # library is found by the linker, but the runtime linker can't find it. | # library is found by the linker, but the runtime linker can't find it. |