diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2002-03-29 17:32:55 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2002-03-29 17:32:55 +0000 |
commit | 7c1ff354105e2256d7904497d8e282ccec53d2e6 (patch) | |
tree | ae1c9485bf5eda1e049d11e327d5c759da2c19d2 /configure.in | |
parent | eb1ee9e63f1076753769f4ef1e8e0a93898a3e34 (diff) | |
download | postgresql-7c1ff354105e2256d7904497d8e282ccec53d2e6.tar.gz |
Upgrade to Autoconf version 2.53. Replaced many custom macro
calls with new or now-built-in versions. Make sure that all
calls to AC_DEFINE have a third argument, for possible use of
autoheader in the future.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 394 |
1 files changed, 189 insertions, 205 deletions
diff --git a/configure.in b/configure.in index b9f41bb885..1d63677a39 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,5 @@ dnl Process this file with autoconf to produce a configure script. +dnl $Header: /cvsroot/pgsql/configure.in,v 1.171 2002/03/29 17:32:52 petere Exp $ dnl Developers, please strive to achieve this order: dnl @@ -16,28 +17,23 @@ dnl Read the Autoconf manual for details. dnl The GNU folks apparently haven't heard that some people don't use dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir". -define([info], [doc]) -define([infodir], [docdir]) -AC_INIT(src/backend/access/common/heaptuple.c) -undefine([infodir]) -undefine([info]) - -AC_PREFIX_DEFAULT(/usr/local/pgsql) -AC_CONFIG_HEADER(src/include/pg_config.h) - -AC_PREREQ(2.13) +m4_define([info], [doc]) +m4_define([infodir], [docdir]) +AC_INIT([PostgreSQL], [7.3devel], [pgsql-bugs@postgresql.org]) +m4_undefine([infodir]) +m4_undefine([info]) +AC_SUBST(docdir) + +AC_PREREQ(2.53) +AC_COPYRIGHT([Copyright 2002 PostgreSQL Global Development Group]) +AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) AC_CONFIG_AUX_DIR(config) +AC_PREFIX_DEFAULT(/usr/local/pgsql) +AC_SUBST(configure_args, [$ac_configure_args]) -VERSION='7.3devel' -AC_SUBST(VERSION) -AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION") - -unset CDPATH +AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version]) AC_CANONICAL_HOST -AC_SUBST(host) -AC_SUBST(host_cpu) -AC_SUBST(host_os) template= AC_MSG_CHECKING([which template to use]) @@ -105,11 +101,6 @@ AC_MSG_RESULT([$template]) PORTNAME=$template AC_SUBST(PORTNAME) -AC_LINK_FILES([src/backend/port/dynloader/${template}.c], [src/backend/port/dynloader.c]) -AC_LINK_FILES([src/backend/port/dynloader/${template}.h], [src/include/dynloader.h]) -AC_LINK_FILES([src/include/port/${template}.h], [src/include/pg_config_os.h]) -AC_LINK_FILES([src/makefiles/Makefile.${template}], [src/Makefile.port]) - # Pick right test-and-set (TAS) code. Most platforms have inline # assembler code in src/include/storage/s_lock.h, so we just use # a dummy file here. @@ -119,7 +110,7 @@ case $host in i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;; *) need_tas=no; tas_file=dummy.s ;; esac -AC_LINK_FILES([src/backend/port/tas/${tas_file}], [src/backend/port/tas.s]) +AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}]) if test "$need_tas" = yes ; then TAS=tas.o @@ -206,10 +197,11 @@ AC_SUBST(MULTIBYTE) # AC_MSG_CHECKING([whether NLS is wanted]) PGAC_ARG_OPTARG(enable, nls, - [ --enable-nls[=LANGUAGES] enable Native Language Support], + [[ --enable-nls[=LANGUAGES] enable Native Language Support]], [], [WANTED_LANGUAGES=$enableval], - [AC_DEFINE(ENABLE_NLS)]) + [AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if you want National Language Support (--enable-nls)])]) AC_MSG_RESULT([$enable_nls]) AC_SUBST(enable_nls) AC_SUBST(WANTED_LANGUAGES) @@ -223,8 +215,13 @@ PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number [default_port=5432]) AC_MSG_RESULT([$default_port]) # 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_STR, "${default_port}") +AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port}, +[The default TCP port number on which the server listens and to which +clients will try to connect to. This can be overridden at run-time, +but it's convenient if your clients have the right default compiled in. +(--with-pgport=PORTNUM)]) +AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", + [Default TCP port number as string constant]) AC_SUBST(default_port) # @@ -270,29 +267,30 @@ AC_SUBST(enable_debug) # variable. PGAC_ARG_REQ(with, CC, [], [CC=$with_CC]) -# On AIX, default compiler to xlc. -if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi - -# Save CFLAGS from the environment -has_environ_CFLAGS="${CFLAGS+yes}" -save_CFLAGS=$CFLAGS +case $template in + aix) pgac_cc_list="gcc xlc";; + irix) pgac_cc_list="cc";; # no gcc + *) pgac_cc_list="gcc cc";; +esac -AC_PROG_CC +AC_PROG_CC([$pgac_cc_list]) # Read the template . "$srcdir/src/template/$template" || exit -if test "$has_environ_CFLAGS" = yes; then - CFLAGS=$save_CFLAGS +if test "$ac_env_CFLAGS_set" = set; then + CFLAGS=$ac_env_CFLAGS_value fi if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then CFLAGS="$CFLAGS -g" fi -echo "using CFLAGS=$CFLAGS" +AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) # Check if the compiler still works with the template settings -AC_PROG_CC_WORKS -AC_EXEEXT +AC_MSG_CHECKING([whether the C compiler still works]) +AC_TRY_LINK([], [return 0;], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_MSG_ERROR([cannot proceed])]) AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL AC_SUBST(GCC) # Create compiler version string @@ -372,12 +370,12 @@ 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. PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR]) -# We see if the path to the TK configuration scripts is specified. +# 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]) @@ -424,11 +422,12 @@ dnl is non-standard. # # Kerberos 4 # -PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 support [/usr/athena]], +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]]], [krb4_prefix=/usr/athena], [krb4_prefix=$withval], [ - AC_MSG_RESULT([building with Kerberos 4 support]) + AC_MSG_RESULT(yes) AC_DEFINE(KRB4, 1, [Define if you are building with Kerberos 4 support.]) if test -d "$krb4_prefix/include"; then @@ -439,7 +438,8 @@ PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 sup fi krb_srvtab="/etc/srvtab" -]) +], +[AC_MSG_RESULT(no)]) AC_SUBST(with_krb4) @@ -447,11 +447,12 @@ AC_SUBST(with_krb4) # # Kerberos 5 # -PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 support [/usr/athena]], +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]]], [krb5_prefix=/usr/athena], [krb5_prefix=$withval], [ - AC_MSG_RESULT([building with Kerberos 5 support]) + AC_MSG_RESULT([yes]) AC_DEFINE(KRB5, 1, [Define if you are building with Kerberos 5 support.]) if test -d "$krb5_prefix/include"; then @@ -462,7 +463,8 @@ PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 sup fi krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" -]) +], +[AC_MSG_RESULT(no)]) AC_SUBST(with_krb5) @@ -501,7 +503,7 @@ AC_SUBST(with_pam) # OpenSSL # PGAC_ARG_OPTARG(with, openssl, - [ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]], + [[ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]]], [openssl_prefix=/usr/local/ssl], [openssl_prefix=$withval], [ @@ -541,8 +543,12 @@ if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then fi case $enable_odbc:$with_unixodbc:$with_iodbc in yes:no:no) AC_MSG_RESULT([yes (stand-alone)]);; - yes:yes:no) AC_MSG_RESULT([yes (unixODBC)]); AC_DEFINE(WITH_UNIXODBC);; - yes:no:yes) AC_MSG_RESULT([yes (iODBC)]); AC_DEFINE(WITH_IODBC);; + yes:yes:no) AC_MSG_RESULT([yes (unixODBC)]) + AC_DEFINE(WITH_UNIXODBC, 1, [Define to 1 to build with unixODBC support (--with-unixodbc)]) + ;; + yes:no:yes) AC_MSG_RESULT([yes (iODBC)]) + AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support (--with-iodbc)]) + ;; no:*) AC_MSG_RESULT(no);; esac AC_SUBST([enable_odbc]) @@ -595,9 +601,8 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++ # If the user has specified CXXFLAGS in the environment, leave it # alone, else use a default. - has_environ_CXXFLAGS="${CXXFLAGS+yes}" AC_PROG_CXX - if test "$has_environ_CXXFLAGS" != yes; then + if test "$ac_env_CXXFLAGS" != set; then if test "$GXX" = yes; then CXXFLAGS=-O2 else @@ -611,21 +616,19 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++ if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then CXXFLAGS="$CXXFLAGS -g" fi - echo "using CXXFLAGS=$CXXFLAGS" + AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS]) AC_PROG_CXXCPP - AC_SUBST(GXX) - PGAC_CLASS_STRING - PGAC_CXX_NAMESPACE_STD ], [AC_MSG_RESULT(no)]) AC_SUBST(with_CXX) +AC_SUBST(GXX) CPPFLAGS="$CPPFLAGS $INCLUDES" LDFLAGS="$LDFLAGS $LIBDIRS" -echo "using CPPFLAGS=$CPPFLAGS" -echo "using LDFLAGS=$LDFLAGS" +AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS]) +AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS]) AC_PROG_AWK @@ -683,7 +686,9 @@ fi ## PGAC_CHECK_READLINE -AC_SEARCH_LIBS(using_history, history, [AC_DEFINE(HAVE_HISTORY_FUNCTIONS)]) +AC_SEARCH_LIBS(using_history, history, + [AC_DEFINE(HAVE_HISTORY_FUNCTIONS, 1, + [Define if you have the history functions])]) if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha" then @@ -747,25 +752,26 @@ if test "$enable_nls" = yes ; then PGAC_CHECK_GETTEXT fi +if test "$with_CXX" = yes; then + PGAC_CLASS_STRING + PGAC_CXX_NAMESPACE_STD +fi + + ## ## Header files ## -dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES -AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/types.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h]) +dnl sys/socket.h is required by AC_FUNC_ACCEPT_ARGTYPES +AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h strings.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h]) -dnl At least on IRIX, cpp test for netinet/tcp.h will fail unless netinet/in.h -dnl is included first. So can't just use AC_CHECK_HEADERS; do it this way: +# At least on IRIX, cpp test for netinet/tcp.h will fail unless +# netinet/in.h is included first. AC_CHECK_HEADERS([netinet/in.h]) -AC_MSG_CHECKING([for netinet/tcp.h]) -AC_TRY_CPP([ -#ifdef HAVE_NETINET_IN_H +AC_CHECK_HEADERS([netinet/tcp.h], [], [], +[#ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif -#include <netinet/tcp.h> -], [AC_DEFINE(HAVE_NETINET_TCP_H) AC_MSG_RESULT(yes)], -[AC_MSG_RESULT(no)]) - -PGAC_HEADER_STRING +]) AC_CHECK_HEADERS([readline/readline.h readline.h], [break]) AC_CHECK_HEADERS([readline/history.h history.h], [break]) @@ -792,30 +798,33 @@ fi ## ## Types, structures, compiler characteristics ## +m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that. AC_C_CONST AC_C_INLINE AC_C_STRINGIZE PGAC_C_SIGNED -PGAC_C_VOLATILE +AC_C_VOLATILE AC_STRUCT_TIMEZONE PGAC_UNION_SEMUN -PGAC_STRUCT_CMSGCRED -PGAC_STRUCT_FCRED -PGAC_STRUCT_SOCKCRED PGAC_STRUCT_SOCKADDR_UN +AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], +[#include <sys/param.h> +#include <sys/socket.h> +#include <sys/ucred.h>]) + if test "$with_krb5" = yes; then # Check for differences between MIT and Heimdal (KTH) releases - PGAC_CHECK_MEMBER([krb5_ticket.enc_part2], [], - [PGAC_CHECK_MEMBER([krb5_ticket.client], [], - [AC_MSG_ERROR([could not determine how to get client name from Kerberos 5 ticket])], - [#include <krb5.h>])], - [#include <krb5.h>]) - PGAC_CHECK_MEMBER([krb5_error.text.data], [], - [PGAC_CHECK_MEMBER([krb5_error.e_data], [], - [AC_MSG_ERROR([could not determine how to extract Kerberos 5 error messages])], - [#include <krb5.h>])], - [#include <krb5.h>]) + AC_CHECK_MEMBERS([krb5_ticket.enc_part2], [], + [AC_CHECK_MEMBERS([krb5_ticket.client], [], + [AC_MSG_ERROR([could not determine how to get client name from Kerberos 5 ticket])], + [#include <krb5.h>])], + [#include <krb5.h>]) + AC_CHECK_MEMBERS([krb5_error.text.data], [], + [AC_CHECK_MEMBER([krb5_error.e_data], [], + [AC_MSG_ERROR([could not determine how to extract Kerberos 5 error messages])], + [#include <krb5.h>])], + [#include <krb5.h>]) fi @@ -829,10 +838,9 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG # SunOS doesn't handle negative byte comparisons properly with +/- return PGAC_FUNC_MEMCMP -AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync]) +AC_CHECK_FUNCS([cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync]) -dnl Check whether <unistd.h> declares fdatasync(). -AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL)) +AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>]) AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS], [AC_TRY_LINK( @@ -847,27 +855,25 @@ if test "$pgac_cv_var_PS_STRINGS" = yes ; then AC_DEFINE([HAVE_PS_STRINGS], [], [Define if the PS_STRINGS thing exists.]) fi -dnl We use our snprintf.c emulation if either snprintf() or vsnprintf() -dnl is missing. Yes, there are machines that have only one. -dnl We may also decide to use snprintf.c if snprintf() is present but does -dnl not have working "long long int" support -- see below. + +# We use our snprintf.c emulation if either snprintf() or vsnprintf() +# is missing. Yes, there are machines that have only one. We may +# also decide to use snprintf.c if snprintf() is present but does not +# have working "long long int" support -- see below. + SNPRINTF='' -AC_CHECK_FUNC(snprintf, - AC_DEFINE(HAVE_SNPRINTF), - SNPRINTF='snprintf.o') -AC_CHECK_FUNC(vsnprintf, - AC_DEFINE(HAVE_VSNPRINTF), - SNPRINTF='snprintf.o') +AC_CHECK_FUNCS(snprintf, [], SNPRINTF='snprintf.o') +AC_CHECK_FUNCS(vsnprintf, [], SNPRINTF='snprintf.o') AC_SUBST(SNPRINTF) -dnl Check whether <stdio.h> declares snprintf() and vsnprintf(); if not, -dnl include/c.h will provide declarations. Note this is a separate test -dnl from whether the functions exist in the C library --- there are systems -dnl that have the functions but don't bother to declare them :-( -dnl Note: simple-minded pattern here will do wrong thing if stdio.h -dnl declares vsnprintf() but not snprintf(). Hopefully there are no -dnl systems that are *that* brain-damaged... -AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL)) -AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL)) + + +# Check whether <stdio.h> declares snprintf() and vsnprintf(); if not, +# include/c.h will provide declarations. Note this is a separate test +# from whether the functions exist in the C library --- there are +# systems that have the functions but don't bother to declare them :-( + +AC_CHECK_DECLS([snprintf, vsnprintf]) + # do this one the hard way in case isinf() is a macro AC_CACHE_CHECK([for isinf], ac_cv_func_isinf, @@ -879,7 +885,7 @@ AC_CACHE_CHECK([for isinf], ac_cv_func_isinf, [ac_cv_func_isinf=no])]) if test $ac_cv_func_isinf = yes ; then - AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISINF, 1, [Define to 1 if you have isinf()]) ISINF= else ISINF='isinf.o' @@ -888,49 +894,27 @@ else fi AC_SUBST(ISINF) -AC_CHECK_FUNC(getrusage, - AC_DEFINE(HAVE_GETRUSAGE), - GETRUSAGE='getrusage.o') + +AC_CHECK_FUNCS(getrusage, [], GETRUSAGE='getrusage.o') AC_SUBST(GETRUSAGE) -AC_CHECK_FUNC(srandom, - AC_DEFINE(HAVE_SRANDOM), - SRANDOM='srandom.o') +AC_CHECK_FUNCS(srandom, [], SRANDOM='srandom.o') AC_SUBST(SRANDOM) -AC_CHECK_FUNC(gethostname, - AC_DEFINE(HAVE_GETHOSTNAME), - GETHOSTNAME='gethostname.o') +AC_CHECK_FUNCS(gethostname, [], GETHOSTNAME='gethostname.o') AC_SUBST(GETHOSTNAME) -AC_CHECK_FUNC(random, - AC_DEFINE(HAVE_RANDOM), - MISSING_RANDOM='random.o') +AC_CHECK_FUNCS(random, [], MISSING_RANDOM='random.o') AC_SUBST(MISSING_RANDOM) -AC_CHECK_FUNC(inet_aton, - AC_DEFINE(HAVE_INET_ATON), - INET_ATON='inet_aton.o') +AC_CHECK_FUNCS(inet_aton, [], INET_ATON='inet_aton.o') AC_SUBST(INET_ATON) -AC_CHECK_FUNC(strerror, - AC_DEFINE(HAVE_STRERROR), - STRERROR='strerror.o') +AC_CHECK_FUNCS(strerror, [], STRERROR='strerror.o') AC_SUBST(STRERROR) -AC_CHECK_FUNC(strdup, - AC_DEFINE(HAVE_STRDUP), - STRDUP='../../utils/strdup.o') +AC_CHECK_FUNCS(strdup, [], STRDUP='../../utils/strdup.o') AC_SUBST(STRDUP) -AC_CHECK_FUNC(strtol, - AC_DEFINE(HAVE_STRTOL), - STRTOL='strtol.o') +AC_CHECK_FUNCS(strtol, [], STRTOL='strtol.o') AC_SUBST(STRTOL) -AC_CHECK_FUNC(strtoul, - AC_DEFINE(HAVE_STRTOUL), - STRTOUL='strtoul.o') +AC_CHECK_FUNCS(strtoul, [], STRTOUL='strtoul.o') AC_SUBST(STRTOUL) -AC_CHECK_FUNC(strcasecmp, - AC_DEFINE(HAVE_STRCASECMP), - STRCASECMP='strcasecmp.o') +AC_CHECK_FUNCS(strcasecmp, [], STRCASECMP='strcasecmp.o') AC_SUBST(STRCASECMP) -AC_CHECK_FUNC(cbrt, - AC_DEFINE(HAVE_CBRT), - AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT))) # On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a; # this hackery with HPUXMATHLIB allows us to cope. @@ -943,9 +927,8 @@ case $host_cpu in esac AC_SUBST(HPUXMATHLIB) -AC_CHECK_FUNC(rint, - AC_DEFINE(HAVE_RINT), - AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)) +AC_CHECK_FUNCS(rint, [], + [AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)]) # Readline versions < 2.1 don't have rl_completion_append_character @@ -959,7 +942,8 @@ AC_TRY_LINK([#include <stdio.h> ], [rl_completion_append_character = 'x';], [AC_MSG_RESULT(yes) -AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)], +AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1, + [Define if you have rl_completion_append_character])], [AC_MSG_RESULT(no)]) AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) @@ -968,18 +952,20 @@ AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) dnl Cannot use AC_CHECK_FUNC because finite may be a macro AC_MSG_CHECKING(for finite) AC_TRY_LINK([#include <math.h>], - [int dummy=finite(1.0);], - [AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no)) + [int dummy=finite(1.0);], + [AC_DEFINE(HAVE_FINITE, 1, [Set to 1 if you have finite()]) +AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro dnl (especially on GNU libc) dnl See also comments in pg_config.h. AC_MSG_CHECKING(for sigsetjmp) AC_TRY_LINK([#include <setjmp.h>], - [sigjmp_buf x; sigsetjmp(x, 1);], - [AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no)) + [sigjmp_buf x; sigsetjmp(x, 1);], + [AC_DEFINE(HAVE_SIGSETJMP, 1, [Set to 1 if you have sigsetjmp()]) +AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) PGAC_ARG_BOOL(enable, syslog, no, [ --enable-syslog enable logging to syslog], @@ -995,7 +981,7 @@ AC_CACHE_CHECK([for optreset], pgac_cv_var_int_optreset, [pgac_cv_var_int_optreset=yes], [pgac_cv_var_int_optreset=no])]) if test x"$pgac_cv_var_int_optreset" = x"yes"; then - AC_DEFINE(HAVE_INT_OPTRESET, 1) + AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset']) fi @@ -1042,7 +1028,7 @@ if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then long long int foo = INT64CONST(0x1234567890123456); ], [], - [AC_DEFINE(HAVE_LL_CONSTANTS)], + [AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define if you have LL constants])], []) fi @@ -1136,69 +1122,58 @@ else INT64_FORMAT='"%ld"' fi -AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT) +AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT, + [Define this as the appropriate snprintf format for 64-bit ints, if any]) AC_CHECK_FUNCS([strtoll strtoq], [break]) AC_CHECK_FUNCS([strtoull strtouq], [break]) -dnl psql needs atexit() or on_exit() -AC_CHECK_FUNC(atexit, - [AC_DEFINE(HAVE_ATEXIT)], - [AC_CHECK_FUNCS(on_exit, - [AC_DEFINE(HAVE_ON_EXIT)], - [AC_MSG_ERROR([neither atexit() nor on_exit() found])])]) +# Check for one of atexit() or on_exit() +AC_CHECK_FUNCS(atexit, [], + [AC_CHECK_FUNCS(on_exit, [], + [AC_MSG_ERROR([neither atexit() nor on_exit() found])])]) dnl Need a #define for the size of Datum (unsigned long) -AC_CHECK_SIZEOF(unsigned long, 4) -AC_DEFINE_UNQUOTED(SIZEOF_DATUM, $ac_cv_sizeof_unsigned_long) +AC_CHECK_SIZEOF([unsigned long]) +AC_DEFINE_UNQUOTED(SIZEOF_DATUM, $ac_cv_sizeof_unsigned_long, [sizeof(Datum) -- don't change]) -dnl Determine memory alignment requirements for the basic C datatypes. +# Determine memory alignment requirements for the basic C data types. PGAC_CHECK_ALIGNOF(short) PGAC_CHECK_ALIGNOF(int) PGAC_CHECK_ALIGNOF(long) -if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then +if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then PGAC_CHECK_ALIGNOF(long long int) fi PGAC_CHECK_ALIGNOF(double) -dnl Compute maximum alignment of any basic type. -dnl We assume long's alignment is at least as strong as char, short, or int; -dnl but we must check long long (if it exists) and double. +# Compute maximum alignment of any basic type. +# We assume long's alignment is at least as strong as char, short, or int; +# but we must check long long (if it exists) and double. -if test $pgac_cv_alignof_double != 'sizeof(double)' ; then - MAX_ALIGNOF=$pgac_cv_alignof_long - if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then - MAX_ALIGNOF=$pgac_cv_alignof_double - fi - if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then - MAX_ALIGNOF="$pgac_cv_alignof_long_long_int" - fi -else - dnl cross-compiling: assume that double's alignment is worst case - MAX_ALIGNOF="$pgac_cv_alignof_double" +MAX_ALIGNOF=$pgac_cv_alignof_long +if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then + MAX_ALIGNOF=$pgac_cv_alignof_double +fi +if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then + MAX_ALIGNOF="$pgac_cv_alignof_long_long_int" fi AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any type]) # Some platforms predefine the types int8, int16, etc. Only check -# a (hopefully) representative subset. We also check for sig_atomic_t, -# which *should* be defined per ANSI C, but is missing on some old platforms. - -pgac_type_includes="\ -#include <stdio.h> -#include <signal.h> +# a (hopefully) representative subset. +AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [], +[#include <stdio.h> #ifdef HAVE_SUPPORTDEFS_H #include <SupportDefs.h> -#endif" +#endif]) -PGAC_CHECK_TYPE(int8, [], [], [$pgac_type_includes]) -PGAC_CHECK_TYPE(uint8, [], [], [$pgac_type_includes]) -PGAC_CHECK_TYPE(int64, [], [], [$pgac_type_includes]) -PGAC_CHECK_TYPE(uint64, [], [], [$pgac_type_includes]) -PGAC_CHECK_TYPE(sig_atomic_t, [], [], [$pgac_type_includes]) +# We also check for sig_atomic_t, which *should* be defined per ANSI +# C, but is missing on some old platforms. +AC_CHECK_TYPES([sig_atomic_t], [], [], [#include <signal.h>]) PGAC_FUNC_POSIX_SIGNALS @@ -1227,29 +1202,38 @@ if test -n "$NSGMLS"; then AC_CHECK_PROGS(SGMLSPL, sgmlspl) fi -abs_top_srcdir= -AC_SUBST(abs_top_srcdir) # prepare build tree if outside source tree # 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 # a symlink-free name. -if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then +if test "$no_create" != yes; then + if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then : -else - abs_top_srcdir=`cd $srcdir && pwd` - echo $ac_n "preparing build tree... $ac_c" 1>&6 - /bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \ + else + AC_SUBST(vpath_build, yes) + _AS_ECHO_N([preparing build tree... ]) + pgac_abs_top_srcdir=`cd "$srcdir" && pwd` + $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \ || AC_MSG_ERROR(failed) AC_MSG_RESULT(done) + fi fi -AC_OUTPUT( -[ - GNUmakefile - src/Makefile.global -], + +AC_CONFIG_FILES([GNUmakefile src/Makefile.global]) + +AC_CONFIG_LINKS([ + src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c + src/include/dynloader.h:src/backend/port/dynloader/${template}.h + src/include/pg_config_os.h:src/include/port/${template}.h + src/Makefile.port:src/makefiles/Makefile.${template} +]) + +AC_CONFIG_HEADERS([src/include/pg_config.h], [ # Update timestamp for pg_config.h (see Makefile.global) -test x"$CONFIG_HEADERS" != x"" && echo >src/include/stamp-h +echo >src/include/stamp-h ]) + +AC_OUTPUT |