|
|
| version 1.267, 2003/06/23 23:51:59 | version 1.343, 2004/04/30 16:08:01 |
|---|---|
| Line 1 | Line 1 |
| dnl Process this file with autoconf to produce a configure script. | dnl Process this file with autoconf to produce a configure script. |
| dnl $Header$ | dnl $PostgreSQL: pgsql-server/configure.in,v 1.342 2004/04/30 15:01:25 momjian Exp $ |
| dnl | dnl |
| dnl Developers, please strive to achieve this order: | dnl Developers, please strive to achieve this order: |
| dnl | dnl |
| Line 16 dnl | Line 16 dnl |
| dnl Read the Autoconf manual for details. | dnl Read the Autoconf manual for details. |
| dnl | dnl |
| m4_pattern_forbid(^PGAC_)dnl to catch undefined macros | m4_pattern_forbid(^PGAC_)dnl to catch undefined macros |
| dnl | |
| dnl The GNU folks apparently haven't heard that some people don't use | AC_INIT([PostgreSQL], [7.5devel], [[email protected]]) |
| dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir". | |
| m4_define([info], [doc]) | |
| m4_define([infodir], [docdir]) | |
| AC_INIT([PostgreSQL], [7.4devel], [[email protected]]) | |
| m4_undefine([infodir]) | |
| m4_undefine([info]) | |
| AC_SUBST(docdir) | |
| AC_PREREQ(2.53) | AC_PREREQ(2.53) |
| AC_COPYRIGHT([Copyright 2002 PostgreSQL Global Development Group]) | AC_COPYRIGHT([Copyright 2003 PostgreSQL Global Development Group]) |
| AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) | AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) |
| AC_CONFIG_AUX_DIR(config) | AC_CONFIG_AUX_DIR(config) |
| AC_PREFIX_DEFAULT(/usr/local/pgsql) | AC_PREFIX_DEFAULT(/usr/local/pgsql) |
| Line 52 PGAC_ARG_REQ(with, template, [], | Line 45 PGAC_ARG_REQ(with, template, [], |
| esac | esac |
| ], | ], |
| [ | [ |
| # --with-template not given | # --with-template not given |
| case $host_os in | case $host_os in |
| aix*) template=aix ;; | aix*) template=aix ;; |
| Line 104 AC_MSG_RESULT([$template]) | Line 97 AC_MSG_RESULT([$template]) |
| PORTNAME=$template | PORTNAME=$template |
| AC_SUBST(PORTNAME) | AC_SUBST(PORTNAME) |
| # Pick right test-and-set (TAS) code. Most platforms have inline | # Initialize default assumption that we do not need separate assembly code |
| # assembler code in src/include/storage/s_lock.h, so we just use | # for TAS (test-and-set). This can be overridden by the template file |
| # a dummy file here. | # when it's executed. |
| case $host in | need_tas=no |
| *-*-hpux*) need_tas=yes; tas_file=hpux.s ;; | tas_file=dummy.s |
| sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;; | |
| i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;; | |
| *) need_tas=no; tas_file=dummy.s ;; | |
| esac | |
| AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}]) | |
| if test "$need_tas" = yes ; then | |
| TAS=tas.o | |
| fi | |
| AC_SUBST(TAS) | |
| Line 126 AC_SUBST(TAS) | Line 109 AC_SUBST(TAS) |
| ## Command line options | ## Command line options |
| ## | ## |
| # | |
| # Installation directory for documentation | |
| # | |
| PGAC_ARG(with, docdir, [ --with-docdir=DIR install the documentation in DIR [[PREFIX/doc]] | |
| --without-docdir do not install the documentation], | |
| [AC_MSG_ERROR([option --with-docdir requires an argument])], | |
| [docdir=], | |
| [docdir=$withval], | |
| [docdir='${prefix}/doc']) | |
| AC_SUBST(docdir) | |
| # | # |
| # Add non-standard directories to the include path | # Add non-standard directories to the include path |
| Line 153 PGAC_ARG_BOOL(enable, integer-datetimes, | Line 147 PGAC_ARG_BOOL(enable, integer-datetimes, |
| AC_MSG_RESULT([$enable_integer_datetimes]) | AC_MSG_RESULT([$enable_integer_datetimes]) |
| # Character set recode (--enable-recode) | |
| # | |
| AC_MSG_CHECKING([whether to build with recode support]) | |
| PGAC_ARG_BOOL(enable, recode, no, [ --enable-recode enable single-byte recode support], | |
| [AC_DEFINE([CYR_RECODE], 1, | |
| [Define to 1 if you want single-byte recode support. (--enable-recode)])]) | |
| AC_MSG_RESULT([$enable_recode]) | |
| # | # |
| # NLS | # NLS |
| # | # |
| Line 187 AC_MSG_RESULT([$default_port]) | Line 172 AC_MSG_RESULT([$default_port]) |
| # Need both of these because some places want an integer and some a string | # Need both of these because some places want an integer and some a string |
| AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port}, | AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port}, |
| [Define to the default TCP port number on which the server listens and | [Define to the default TCP port number on which the server listens and |
| to which clients will try to connect to. This can be overridden at | to which clients will try to connect. This can be overridden at run-time, |
| run-time, but it's convenient if your clients have the right default | but it's convenient if your clients have the right default compiled in. |
| compiled in. (--with-pgport=PORTNUM)]) | (--with-pgport=PORTNUM)]) |
| AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", | AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", |
| [Define to the default TCP port number as string constant.]) | [Define to the default TCP port number as a string constant.]) |
| AC_SUBST(default_port) | AC_SUBST(default_port) |
| # | # |
| Line 208 PGAC_ARG_BOOL(enable, rpath, yes, | Line 193 PGAC_ARG_BOOL(enable, rpath, yes, |
| [ --disable-rpath do not embed shared library search path in executables]) | [ --disable-rpath do not embed shared library search path in executables]) |
| AC_SUBST(enable_rpath) | AC_SUBST(enable_rpath) |
| # | |
| # Spinlocks | |
| # | |
| PGAC_ARG_BOOL(enable, spinlocks, yes, | |
| [ --disable-spinlocks do not use spinlocks]) | |
| # | # |
| # --enable-debug adds -g to compiler flags | # --enable-debug adds -g to compiler flags |
| Line 232 case $template in | Line 222 case $template in |
| esac | esac |
| AC_PROG_CC([$pgac_cc_list]) | AC_PROG_CC([$pgac_cc_list]) |
| unset CFLAGS | |
| # | |
| # Read the template | # Read the template |
| # | |
| . "$srcdir/src/template/$template" || exit | . "$srcdir/src/template/$template" || exit |
| # CFLAGS are selected so: | |
| # If the user specifies something in the environment, that is used. | |
| # else: If the template file set something, that is used. | |
| # else: If the compiler is GCC, then we use -O2. | |
| # else: If the compiler is something else, then we use -0. | |
| if test "$ac_env_CFLAGS_set" = set; then | if test "$ac_env_CFLAGS_set" = set; then |
| CFLAGS=$ac_env_CFLAGS_value | CFLAGS=$ac_env_CFLAGS_value |
| elif test "${CFLAGS+set}" = set; then | |
| : # (keep what template set) | |
| elif test "$GCC" = yes; then | |
| CFLAGS="-O2" | |
| else | |
| # if the user selected debug mode, don't use -O | |
| if test "$enable_debug" != yes; then | |
| CFLAGS="-O" | |
| fi | |
| fi | fi |
| # Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later. | |
| PGAC_PROG_CC_NO_STRICT_ALIASING | |
| # supply -g if --enable-debug | |
| if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then | if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then |
| CFLAGS="$CFLAGS -g" | CFLAGS="$CFLAGS -g" |
| fi | fi |
| AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) | AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) |
| # We already have this in Makefile.win32, but configure needs it too | |
| if test "$PORTNAME" = "win32"; then | |
| CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND" | |
| fi | |
| # Check if the compiler still works with the template settings | # Check if the compiler still works with the template settings |
| AC_MSG_CHECKING([whether the C compiler still works]) | AC_MSG_CHECKING([whether the C compiler still works]) |
| AC_TRY_LINK([], [return 0;], | AC_TRY_LINK([], [return 0;], |
| Line 250 AC_TRY_LINK([], [return 0;], | Line 271 AC_TRY_LINK([], [return 0;], |
| [AC_MSG_RESULT(no) | [AC_MSG_RESULT(no) |
| AC_MSG_ERROR([cannot proceed])]) | AC_MSG_ERROR([cannot proceed])]) |
| # Defend against gcc -ffastmath | # Defend against gcc -ffast-math |
| if test "$GCC" = yes; then | if test "$GCC" = yes; then |
| AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__ | AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__ |
| choke me | choke me |
| Line 272 AC_DEFINE_UNQUOTED(PG_VERSION_STR, | Line 293 AC_DEFINE_UNQUOTED(PG_VERSION_STR, |
| # | # |
| # Set up TAS assembly code if needed; the template file has now had its | |
| # chance to request this. | |
| # | |
| AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}]) | |
| if test "$need_tas" = yes ; then | |
| TAS=tas.o | |
| else | |
| TAS="" | |
| fi | |
| AC_SUBST(TAS) | |
| # | |
| # Automatic dependency tracking | # Automatic dependency tracking |
| # | # |
| PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking], | PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking], |
| Line 320 done | Line 355 done |
| IFS=$ac_save_IFS | IFS=$ac_save_IFS |
| # | # |
| # Enable libpq to be thread-safe | # Enable thread-safe client libraries |
| # | # |
| AC_MSG_CHECKING([allow threaded libpq]) | AC_MSG_CHECKING([allow thread-safe client libraries]) |
| PGAC_ARG_BOOL(with, threads, no, [ --with-threads allow libpq and ecpg to be thread-safe], | PGAC_ARG_BOOL(enable, thread-safety, no, [ --enable-thread-safety make client libraries thread-safe], |
| [AC_DEFINE([USE_THREADS], 1, [Define to 1 to build libpq and ecpg to be thread-safe. (--with-threads)])]) | [AC_DEFINE([ENABLE_THREAD_SAFETY], 1, |
| [Define to 1 to build client libraries as thread-safe code. (--enable-thread-safety)])]) | |
| AC_MSG_RESULT([$with_threads]) | AC_MSG_RESULT([$enable_thread_safety]) |
| AC_SUBST(with_threads) | AC_SUBST(enable_thread_safety) |
| # | # |
| # Tcl/Tk | # Tcl/Tk |
| Line 337 PGAC_ARG_BOOL(with, tcl, no, [ --with-t | Line 372 PGAC_ARG_BOOL(with, tcl, no, [ --with-t |
| AC_MSG_RESULT([$with_tcl]) | AC_MSG_RESULT([$with_tcl]) |
| AC_SUBST([with_tcl]) | AC_SUBST([with_tcl]) |
| # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk | |
| AC_MSG_CHECKING([whether to build with Tk]) | |
| if test "$with_tcl" = yes; then | |
| PGAC_ARG_BOOL(with, tk, yes, [ --without-tk do not build Tk interfaces if Tcl is enabled]) | |
| else | |
| with_tk=no | |
| fi | |
| AC_MSG_RESULT([$with_tk]) | |
| AC_SUBST([with_tk]) | |
| # We see if the path to the Tcl/Tk configuration scripts is specified. | # We see if the path to the Tcl/Tk configuration scripts is specified. |
| # This will override the use of tclsh to find the paths to search. | # This will override the use of tclsh to find the paths to search. |
| PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR]) | PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh is in DIR]) |
| # We see if the path to the Tk configuration scripts is specified. | |
| # This will override the use of tclsh to find the paths to search. | |
| PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR]) | |
| # | # |
| # Optionally build Perl modules (PL/Perl) | # Optionally build Perl modules (PL/Perl) |
| Line 367 AC_MSG_RESULT([$with_perl]) | Line 386 AC_MSG_RESULT([$with_perl]) |
| AC_SUBST(with_perl) | AC_SUBST(with_perl) |
| # | # |
| # Optionally build Python interface module | # Optionally build Python modules (PL/Python) |
| # | # |
| AC_MSG_CHECKING([whether to build Python modules]) | AC_MSG_CHECKING([whether to build Python modules]) |
| PGAC_ARG_BOOL(with, python, no, [ --with-python build Python interface module]) | PGAC_ARG_BOOL(with, python, no, [ --with-python build Python modules (PL/Python)]) |
| AC_MSG_RESULT([$with_python]) | AC_MSG_RESULT([$with_python]) |
| AC_SUBST(with_python) | AC_SUBST(with_python) |
| # | # |
| # Optionally build the Java/JDBC tools | |
| # | |
| AC_MSG_CHECKING([whether to build Java/JDBC tools]) | |
| PGAC_ARG_BOOL(with, java, no, [ --with-java build JDBC interface and Java tools], | |
| [AC_MSG_RESULT(yes) | |
| PGAC_PATH_ANT | |
| if test -z "$ANT"; then | |
| AC_MSG_ERROR([Ant is required to build Java components | |
| If you have Ant already installed, see config.log for details on the failure.]) | |
| fi | |
| if "$ANT" -version | sed q | egrep -v ' 1\.[[5-9]]| [[2-9]]\.' >/dev/null ; then | |
| AC_MSG_ERROR([Ant version >= 1.5 is required to build Java components]) | |
| fi], | |
| [AC_MSG_RESULT(no)]) | |
| AC_SUBST(with_java) | |
| dnl A note on the Kerberos and OpenSSL options: | |
| dnl | |
| dnl The user can give an argument to the option in order the specify | |
| dnl the base path of the respective installation (what he specified | |
| dnl perhaps as --prefix). If no argument is given ($withval is "yes") | |
| dnl then we take the path where the package installs by default. This | |
| dnl way the user doesn't have to use redundant --with-includes and | |
| dnl --with-libraries options, but he can still use them if the layout | |
| dnl is non-standard. | |
| # | |
| # Kerberos 4 | # Kerberos 4 |
| # | # |
| AC_MSG_CHECKING([whether to build with Kerberos 4 support]) | AC_MSG_CHECKING([whether to build with Kerberos 4 support]) |
| PGAC_ARG_OPTARG(with, krb4, [[ --with-krb4[=DIR] build with Kerberos 4 support [/usr/athena]]], | PGAC_ARG_BOOL(with, krb4, no, [ --with-krb4 build with Kerberos 4 support], |
| [krb4_prefix=/usr/athena], | |
| [krb4_prefix=$withval], | |
| [ | [ |
| AC_MSG_RESULT(yes) | |
| AC_DEFINE(KRB4, 1, [Define to build with Kerberos 4 support. (--with-krb4)]) | AC_DEFINE(KRB4, 1, [Define to build with Kerberos 4 support. (--with-krb4)]) |
| if test -d "$krb4_prefix/include"; then | |
| INCLUDES="$INCLUDES -I$krb4_prefix/include" | |
| fi | |
| if test -d "$krb4_prefix/lib"; then | |
| LIBDIRS="$LIBDIRS -L$krb4_prefix/lib" | |
| fi | |
| krb_srvtab="/etc/srvtab" | krb_srvtab="/etc/srvtab" |
| ], | ]) |
| [AC_MSG_RESULT(no)]) | AC_MSG_RESULT([$with_krb4]) |
| AC_SUBST(with_krb4) | AC_SUBST(with_krb4) |
| Line 430 AC_SUBST(with_krb4) | Line 410 AC_SUBST(with_krb4) |
| # Kerberos 5 | # Kerberos 5 |
| # | # |
| AC_MSG_CHECKING([whether to build with Kerberos 5 support]) | AC_MSG_CHECKING([whether to build with Kerberos 5 support]) |
| PGAC_ARG_OPTARG(with, krb5, [[ --with-krb5[=DIR] build with Kerberos 5 support [/usr/athena]]], | PGAC_ARG_BOOL(with, krb5, no, [ --with-krb5 build with Kerberos 5 support], |
| [krb5_prefix=/usr/athena], | |
| [krb5_prefix=$withval], | |
| [ | [ |
| AC_MSG_RESULT([yes]) | |
| AC_DEFINE(KRB5, 1, [Define to build with Kerberos 5 support. (--with-krb5)]) | AC_DEFINE(KRB5, 1, [Define to build with Kerberos 5 support. (--with-krb5)]) |
| if test -d "$krb5_prefix/include"; then | |
| INCLUDES="$INCLUDES -I$krb5_prefix/include" | |
| fi | |
| if test -d "$krb5_prefix/lib"; then | |
| LIBDIRS="$LIBDIRS -L$krb5_prefix/lib" | |
| fi | |
| krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" | krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" |
| ], | ]) |
| [AC_MSG_RESULT(no)]) | AC_MSG_RESULT([$with_krb5]) |
| AC_SUBST(with_krb5) | AC_SUBST(with_krb5) |
| Line 463 AC_SUBST(krb_srvtab) | Line 431 AC_SUBST(krb_srvtab) |
| # Kerberos configuration parameters | # Kerberos configuration parameters |
| # | # |
| PGAC_ARG_REQ(with, krb-srvnam, | PGAC_ARG_REQ(with, krb-srvnam, |
| [ --with-krb-srvnam=NAME name of the service principal in Kerberos [postgres]], | [ --with-krb-srvnam=NAME name of the service principal in Kerberos [[postgres]]], |
| [], | [], |
| [with_krb_srvnam="postgres"]) | [with_krb_srvnam="postgres"]) |
| AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"], | AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"], |
| Line 495 AC_SUBST(with_rendezvous) | Line 463 AC_SUBST(with_rendezvous) |
| # | # |
| # OpenSSL | # OpenSSL |
| # | # |
| PGAC_ARG_OPTARG(with, openssl, | AC_MSG_CHECKING([whether to build with OpenSSL support]) |
| [[ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]]], | PGAC_ARG_BOOL(with, openssl, no, [ --with-openssl build with OpenSSL support], |
| [openssl_prefix=/usr/local/ssl], | [AC_DEFINE([USE_SSL], 1, [Define to build with (Open)SSL support. (--with-openssl)])]) |
| [openssl_prefix=$withval], | AC_MSG_RESULT([$with_openssl]) |
| [ | |
| AC_MSG_RESULT([building with OpenSSL support]) | |
| AC_DEFINE([USE_SSL], 1, [Define to build with (Open)SSL support. (--with-openssl)]) | |
| if test -d "${openssl_prefix}/include" ; then | |
| INCLUDES="$INCLUDES -I${openssl_prefix}/include" | |
| fi | |
| if test -d "${openssl_prefix}/lib" ; then | |
| LIBDIRS="$LIBDIRS -L${openssl_prefix}/lib" | |
| fi | |
| ]) | |
| AC_SUBST(with_openssl) | AC_SUBST(with_openssl) |
| Line 526 PGAC_ARG_BOOL(with, readline, yes, | Line 482 PGAC_ARG_BOOL(with, readline, yes, |
| PGAC_ARG_BOOL(with, zlib, yes, | PGAC_ARG_BOOL(with, zlib, yes, |
| [ --without-zlib do not use Zlib]) | [ --without-zlib do not use Zlib]) |
| # | # |
| # Elf | # Elf |
| # | # |
| Line 588 AC_CHECK_PROGS(YACC, ['bison -y']) | Line 543 AC_CHECK_PROGS(YACC, ['bison -y']) |
| if test "$YACC"; then | if test "$YACC"; then |
| if $YACC --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then | if $YACC --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then |
| AC_MSG_WARN([ | AC_MSG_WARN([ |
| *** The installed version of Bison is too old. PostgreSQL needs | *** If you are going to modify the grammar files or build from CVS, the installed |
| *** Bison version 1.875 or later.]) | *** version of Bison is too old. Bison version 1.875 or later is required.]) |
| fi | fi |
| fi | fi |
| Line 613 fi | Line 568 fi |
| if test "$with_python" = yes; then | if test "$with_python" = yes; then |
| PGAC_PATH_PYTHON | PGAC_PATH_PYTHON |
| PGAC_CHECK_PYTHON_MODULE_SETUP | |
| PGAC_CHECK_PYTHON_EMBED_SETUP | PGAC_CHECK_PYTHON_EMBED_SETUP |
| fi | fi |
| Line 641 AC_CHECK_LIB(BSD, main) | Line 595 AC_CHECK_LIB(BSD, main) |
| AC_CHECK_LIB(gen, main) | AC_CHECK_LIB(gen, main) |
| AC_CHECK_LIB(PW, main) | AC_CHECK_LIB(PW, main) |
| AC_CHECK_LIB(resolv, main) | AC_CHECK_LIB(resolv, main) |
| AC_CHECK_LIB(wsock32, main) | |
| AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) | AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) |
| # QNX: | # QNX: |
| AC_CHECK_LIB(unix, main) | AC_CHECK_LIB(unix, main) |
| AC_SEARCH_LIBS(crypt, crypt) | AC_SEARCH_LIBS(crypt, crypt) |
| # BeOS: | # BeOS: |
| AC_CHECK_LIB(bind, __inet_ntoa) | if test "$PORTNAME" = "beos" |
| then | |
| AC_CHECK_LIB(bind, __inet_ntoa) | |
| fi | |
| # Solaris: | # Solaris: |
| AC_SEARCH_LIBS(fdatasync, [rt posix4]) | AC_SEARCH_LIBS(fdatasync, [rt posix4]) |
| # Cygwin: | # Cygwin: |
| AC_CHECK_LIB(cygipc, shmget) | AC_CHECK_LIB(cygipc, shmget) |
| # WIN32: | |
| if test "$PORTNAME" = "win32" | |
| then | |
| AC_CHECK_LIB(wsock32, main) | |
| fi | |
| if test "$with_readline" = yes; then | if test "$with_readline" = yes; then |
| PGAC_CHECK_READLINE | PGAC_CHECK_READLINE |
| Line 671 failure. It is possible the compiler is | Line 632 failure. It is possible the compiler is |
| Use --without-zlib to disable zlib support.])]) | Use --without-zlib to disable zlib support.])]) |
| fi | fi |
| if test "$enable_spinlocks" = yes; then | |
| AC_DEFINE(HAVE_SPINLOCKS, 1, [Define to 1 if you have spinlocks.]) | |
| else | |
| AC_MSG_WARN([ | |
| *** Not using spinlocks will cause poor performance.]) | |
| fi | |
| if test "$with_krb4" = yes ; then | if test "$with_krb4" = yes ; then |
| AC_CHECK_LIB(des, des_encrypt, [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])]) | AC_CHECK_LIB(des, des_encrypt, [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])]) |
| AC_CHECK_LIB(krb, krb_sendauth, [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])]) | AC_CHECK_LIB(krb, krb_sendauth, [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])]) |
| Line 778 PGAC_STRUCT_TIMEZONE | Line 746 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 |
| PGAC_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS |
| PGAC_STRUCT_ADDRINFO | PGAC_STRUCT_ADDRINFO |
| AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], | AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], |
| Line 787 AC_CHECK_TYPES([struct cmsgcred, struct | Line 755 AC_CHECK_TYPES([struct cmsgcred, struct |
| #include <sys/socket.h> | #include <sys/socket.h> |
| #include <sys/ucred.h>]) | #include <sys/ucred.h>]) |
| AC_CHECK_TYPES([struct option], [], [], | |
| [#ifdef HAVE_GETOPT_H | |
| #include <getopt.h> | |
| #endif]) | |
| if test "$with_zlib" = yes; then | if test "$with_zlib" = yes; then |
| # Check that <zlib.h> defines z_streamp (versions before about 1.0.4 | # Check that <zlib.h> defines z_streamp (versions before about 1.0.4 |
| # did not). While we could work around the lack of z_streamp, it | # did not). While we could work around the lack of z_streamp, it |
| Line 826 AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasy | Line 799 AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasy |
| AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>]) | AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>]) |
| HAVE_IPV6=no | |
| AC_CHECK_TYPE([struct sockaddr_in6], | AC_CHECK_TYPE([struct sockaddr_in6], |
| [AC_CHECK_FUNC(inet_ntop, | [AC_CHECK_FUNC(inet_ntop, |
| [AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if you have support for IPv6.])])], | [AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if you have support for IPv6.]) |
| HAVE_IPV6=yes])], | |
| [], | [], |
| [$ac_includes_default | [$ac_includes_default |
| #include <netinet/in.h>]) | #include <netinet/in.h>]) |
| AC_SUBST(HAVE_IPV6) | |
| AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS], | AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS], |
| [AC_TRY_LINK( | [AC_TRY_LINK( |
| Line 882 else | Line 858 else |
| AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break]) | AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break]) |
| fi | fi |
| AC_REPLACE_FUNCS([crypt fseeko getopt getopt_long getrusage inet_aton random rint srandom strcasecmp strdup strerror strtol strtoul]) | AC_REPLACE_FUNCS([crypt fseeko getopt getrusage inet_aton random rint srandom strcasecmp strdup strerror strtol strtoul]) |
| # system's version of getaddrinfo(), if any, may be used only if we found | # system's version of getaddrinfo(), if any, may be used only if we found |
| # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h | # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h |
| Line 892 else | Line 868 else |
| AC_LIBOBJ(getaddrinfo) | AC_LIBOBJ(getaddrinfo) |
| fi | fi |
| # similarly, use system's getopt_long() only if system provides struct option. | |
| if test x"$ac_cv_type_struct_option" = xyes ; then | |
| AC_REPLACE_FUNCS([getopt_long]) | |
| else | |
| AC_LIBOBJ(getopt_long) | |
| fi | |
| # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos | # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos |
| # We override the previous test that said fseeko/ftello didn't exist | # We override the previous test that said fseeko/ftello didn't exist |
| # OS tests are also done in include/c.h and port/fseeko.c | # OS tests are also done in include/c.h and port/fseeko.c |
| Line 904 case $host_os in solaris*) | Line 887 case $host_os in solaris*) |
| AC_LIBOBJ(qsort) ;; | AC_LIBOBJ(qsort) ;; |
| esac | esac |
| # Win32 can't to rename or unlink on an open file | # Win32 support |
| case $host_os in mingw*) | case $host_os in mingw*) |
| AC_LIBOBJ(dirmod) | |
| AC_LIBOBJ(copydir) | AC_LIBOBJ(copydir) |
| AC_LIBOBJ(gettimeofday) ;; | AC_LIBOBJ(gettimeofday) |
| AC_LIBOBJ(open) | |
| AC_LIBOBJ(pipe) | |
| AC_LIBOBJ(rand) | |
| AC_DEFINE(USE_PGTZ, 1, | |
| [Define to 1 to use our own timezone library]) | |
| USE_PGTZ=yes | |
| AC_SUBST(USE_PGTZ) ;; | |
| esac | |
| # Win32 can't to rename or unlink on an open file | |
| case $host_os in mingw*|cygwin*) | |
| AC_LIBOBJ(dirmod) ;; | |
| esac | esac |
| if test "$with_readline" = yes; then | if test "$with_readline" = yes; then |
| Line 964 AC_FUNC_FSEEKO | Line 958 AC_FUNC_FSEEKO |
| # | # |
| # For each platform, we need to know about any special compile and link | # For each platform, we need to know about any special compile and link |
| # libraries, and whether the normal C function names are thread-safe. | # libraries, and whether the normal C function names are thread-safe. |
| # See the comment at the top of src/port/thread.c for more information. | |
| # | # |
| NEED_REENTRANT_FUNC_NAMES=no | if test "$enable_thread_safety" = yes; then |
| if test "$with_threads" = yes; then | ACX_PTHREAD # set thread flags |
| AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --with-threads])]) | |
| # Some platforms use these, so just defineed them. They can't hurt if they | |
| # are not supported. | |
| PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS" | |
| if test "$SUPPORTS_THREADS" != yes; then | |
| # At this point, we don't want to muck with the compiler name for threading. | |
| # Let's see who fails, perhaps AIX. 2004-04-23 | |
| if test "$PTHREAD_CC" != "$CC"; then | |
| AC_MSG_ERROR([ | AC_MSG_ERROR([ |
| Cannot enable threads on your platform. | PostgreSQL does not support platforms that require a special |
| Please report your platform threading info to the PostgreSQL mailing lists | compiler binary for thread-safety. |
| so it can be added to the next release. Report any compile flags, link flags, | |
| functions, or libraries required for threading support. | |
| ]) | ]) |
| fi | fi |
| if test "$THREAD_SUPPORT" = no; then | |
| AC_MSG_ERROR([ | |
| Cannot enable threads on your platform. | |
| Your platform is known to not support thread-safe programs. | |
| For details, compile and run src/bin/pg_thread_test. | |
| ]) | |
| fi | fi |
| AC_SUBST(THREAD_CFLAGS) | |
| AC_SUBST(THREAD_LIBS) | |
| AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --enable-thread-safety])]) | |
| # | # Check for *_r functions |
| # 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" | _CFLAGS="$CFLAGS" |
| _LIB="$LIBS" | _LIBS="$LIBS" |
| CFLAGS="$CFLAGS $TREAD_CFLAGS" | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
| LIBS="$LIBS $THREAD_LIBS" | LIBS="$LIBS $PTHREAD_LIBS" |
| AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r]) | AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r]) |
| CFLAGS="$_CFLAGS" | CFLAGS="$_CFLAGS" |
| LIB="$_LIBS" | LIBS="$_LIBS" |
| PGAC_FUNC_GETPWUID_R_5ARG | |
| else | |
| # do not use values from template file | |
| PTHREAD_CFLAGS= | |
| PTHREAD_LIBS= | |
| fi | fi |
| AC_SUBST(PTHREAD_CFLAGS) | |
| AC_SUBST(PTHREAD_LIBS) | |
| # 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. |
| Line 1053 fi | Line 1058 fi |
| # If we found "long int" is 64 bits, assume snprintf handles it. If | # If we found "long int" is 64 bits, assume snprintf handles it. If |
| # we found we need to use "long long int", better check. We cope with | # we found we need to use "long long int", better check. We cope with |
| # snprintfs that use either %lld, %qd, or %I64d as the format. If | # snprintfs that use %lld, %qd, or %I64d as the format. If none of these |
| # neither works, fall back to our own snprintf emulation (which we | # work, fall back to our own snprintf emulation (which we know uses %lld). |
| # know uses %lld). | |
| if test "$HAVE_LONG_LONG_INT_64" = yes ; then | if test "$HAVE_LONG_LONG_INT_64" = yes ; then |
| if test $pgac_need_repl_snprintf = no; then | if test $pgac_need_repl_snprintf = no; then |
| Line 1069 if test "$HAVE_LONG_LONG_INT_64" = yes ; | Line 1073 if test "$HAVE_LONG_LONG_INT_64" = yes ; |
| # Here if we previously decided we needed to use our own snprintf | # Here if we previously decided we needed to use our own snprintf |
| LONG_LONG_INT_FORMAT='%lld' | LONG_LONG_INT_FORMAT='%lld' |
| fi | fi |
| LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'` | |
| INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\"" | INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\"" |
| UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\"" | |
| else | else |
| # Here if we are not using 'long long int' at all | # Here if we are not using 'long long int' at all |
| INT64_FORMAT='"%ld"' | INT64_FORMAT='"%ld"' |
| UINT64_FORMAT='"%lu"' | |
| fi | fi |
| AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT, | AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT, |
| [Define to the appropriate snprintf format for 64-bit ints, if any.]) | [Define to the appropriate snprintf format for 64-bit ints, if any.]) |
| AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT, | |
| [Define to the appropriate snprintf format for unsigned 64-bit ints, if any.]) | |
| if test $pgac_need_repl_snprintf = yes; then | if test $pgac_need_repl_snprintf = yes; then |
| AC_LIBOBJ(snprintf) | AC_LIBOBJ(snprintf) |
| fi | fi |
| Line 1160 if test "$with_tcl" = yes; then | Line 1170 if test "$with_tcl" = yes; then |
| AC_SUBST(TCL_SHLIB_LD_LIBS)dnl don't want to double-evaluate that one | AC_SUBST(TCL_SHLIB_LD_LIBS)dnl don't want to double-evaluate that one |
| fi | fi |
| # Check for Tk configuration script tkConfig.sh | |
| if test "$with_tk" = yes; then | |
| PGAC_PATH_TKCONFIGSH([$with_tkconfig $with_tclconfig]) | |
| PGAC_EVAL_TCLCONFIGSH([$TK_CONFIG_SH], [TK_LIBS,TK_LIB_SPEC,TK_XINCLUDES]) | |
| fi | |
| # | # |
| # Check for DocBook and tools | # Check for DocBook and tools |
| # | # |
| PGAC_PROG_NSGMLS | PGAC_PROG_NSGMLS |
| PGAC_PROG_JADE | PGAC_PROG_JADE |
| PGAC_CHECK_DOCBOOK(3.1) | PGAC_CHECK_DOCBOOK(4.2) |
| PGAC_PATH_DOCBOOK_STYLESHEETS | PGAC_PATH_DOCBOOK_STYLESHEETS |
| PGAC_PATH_COLLATEINDEX | PGAC_PATH_COLLATEINDEX |
| AC_CHECK_PROGS(SGMLSPL, sgmlspl) | AC_CHECK_PROGS(SGMLSPL, sgmlspl) |
| # Thread testing | |
| # We have to run the thread test near the end so we have all our symbols | |
| # defined. Cross compiling throws a warning. | |
| # | |
| if test "$enable_thread_safety" = yes; then | |
| AC_MSG_CHECKING([thread safety of required library functions]) | |
| _CFLAGS="$CFLAGS" | |
| _LIBS="$LIBS" | |
| CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE" | |
| LIBS="$LIBS $PTHREAD_LIBS" | |
| AC_TRY_RUN([#include "$srcdir/src/tools/thread/thread_test.c"], | |
| [AC_MSG_RESULT(yes)], | |
| [AC_MSG_RESULT(no) | |
| AC_MSG_ERROR([ | |
| *** Thread test program failed. Your platform is not thread-safe. | |
| *** Check the file 'config.log'for the exact reason.])], | |
| [AC_MSG_RESULT(maybe) | |
| AC_MSG_WARN([ | |
| *** Skipping thread test program because of cross-compile build. | |
| *** Run the program in src/tools/thread on the target matchine. | |
| ])]) | |
| CFLAGS="$_CFLAGS" | |
| LIBS="$_LIBS" | |
| fi | |
| # prepare build tree if outside source tree | # prepare build tree if outside source tree |
| # Note 1: test -ef might not exist, but it's more reliable than `pwd`. | # Note 1: test -ef might not exist, but it's more reliable than `pwd`. |
| # Note 2: /bin/pwd might be better than shell's built-in at getting | # Note 2: /bin/pwd might be better than shell's built-in at getting |
| # a symlink-free name. | # a symlink-free name. |
| if test "$no_create" != yes; then | if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then |
| if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then | vpath_build=no |
| : | else |
| else | vpath_build=yes |
| AC_SUBST(vpath_build, yes) | if test "$no_create" != yes; then |
| _AS_ECHO_N([preparing build tree... ]) | _AS_ECHO_N([preparing build tree... ]) |
| pgac_abs_top_srcdir=`cd "$srcdir" && pwd` | pgac_abs_top_srcdir=`cd "$srcdir" && pwd` |
| $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \ | $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \ |
| Line 1194 if test "$no_create" != yes; then | Line 1223 if test "$no_create" != yes; then |
| AC_MSG_RESULT(done) | AC_MSG_RESULT(done) |
| fi | fi |
| fi | fi |
| AC_SUBST(vpath_build) | |
| AC_CONFIG_FILES([GNUmakefile src/Makefile.global]) | AC_CONFIG_FILES([GNUmakefile src/Makefile.global]) |