Commit 7c1ff354 authored by Peter Eisentraut's avatar Peter Eisentraut

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.
parent eb1ee9e6
# #
# PostgreSQL top level makefile # PostgreSQL top level makefile
# #
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.23 2001/11/21 23:19:25 momjian Exp $ # $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.24 2002/03/29 17:32:48 petere Exp $
# #
subdir = subdir =
...@@ -31,6 +31,8 @@ clean: ...@@ -31,6 +31,8 @@ clean:
$(MAKE) -C doc $@ $(MAKE) -C doc $@
$(MAKE) -C contrib $@ $(MAKE) -C contrib $@
$(MAKE) -C src $@ $(MAKE) -C src $@
# Garbage from autoconf:
@rm -rf autom4te.cache/
# Important: distclean `src' last, otherwise Makefile.global # Important: distclean `src' last, otherwise Makefile.global
# will be gone too soon. # will be gone too soon.
...@@ -39,6 +41,8 @@ distclean maintainer-clean: ...@@ -39,6 +41,8 @@ distclean maintainer-clean:
-$(MAKE) -C contrib $@ -$(MAKE) -C contrib $@
-$(MAKE) -C src $@ -$(MAKE) -C src $@
-rm -f config.cache config.log config.status GNUmakefile -rm -f config.cache config.log config.status GNUmakefile
# Garbage from autoconf:
@rm -rf autom4te.cache/
check: all check: all
...@@ -46,7 +50,7 @@ check installcheck: ...@@ -46,7 +50,7 @@ check installcheck:
$(MAKE) -C src/test $@ $(MAKE) -C src/test $@
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status ./config.status $@
########################################################################## ##########################################################################
......
dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.13 2001/08/26 22:28:03 petere Exp $ dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.14 2002/03/29 17:32:48 petere Exp $
builtin([include], [config/ac_func_accept_argtypes.m4]) m4_include([config/ac_func_accept_argtypes.m4])
builtin([include], [config/c-compiler.m4]) m4_include([config/c-compiler.m4])
builtin([include], [config/c-library.m4]) m4_include([config/c-library.m4])
builtin([include], [config/cxx.m4]) m4_include([config/cxx.m4])
builtin([include], [config/docbook.m4]) m4_include([config/docbook.m4])
builtin([include], [config/general.m4]) m4_include([config/general.m4])
builtin([include], [config/java.m4]) m4_include([config/java.m4])
builtin([include], [config/libtool.m4]) m4_include([config/libtool.m4])
builtin([include], [config/perl.m4]) m4_include([config/perl.m4])
builtin([include], [config/programs.m4]) m4_include([config/programs.m4])
builtin([include], [config/python.m4]) m4_include([config/python.m4])
builtin([include], [config/tcl.m4]) m4_include([config/tcl.m4])
# $Header: /cvsroot/pgsql/config/ac_func_accept_argtypes.m4,v 1.3 2000/11/09 18:18:42 petere Exp $ # $Header: /cvsroot/pgsql/config/ac_func_accept_argtypes.m4,v 1.4 2002/03/29 17:32:53 petere Exp $
# This comes from the official Autoconf macro archive at # This comes from the official Autoconf macro archive at
# <http://research.cys.de/autoconf-archive/> # <http://research.cys.de/autoconf-archive/>
# (I removed the $ before the Id CVS keyword below.) # (I removed the $ before the Id CVS keyword below.)
...@@ -37,7 +37,7 @@ dnl ...@@ -37,7 +37,7 @@ dnl
# which is *not* 'socklen_t *'). If we detect that, then we assume # which is *not* 'socklen_t *'). If we detect that, then we assume
# 'int' as the result, because that ought to work best. # 'int' as the result, because that ought to work best.
AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES, AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
[AC_MSG_CHECKING([types of arguments for accept()]) [AC_MSG_CHECKING([types of arguments for accept()])
AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl
[AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl
...@@ -67,7 +67,10 @@ extern int accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func ...@@ -67,7 +67,10 @@ extern int accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func
])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL
AC_MSG_RESULT([$ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *]) AC_MSG_RESULT([$ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *])
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1,$ac_cv_func_accept_arg1) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1, $ac_cv_func_accept_arg1,
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2,$ac_cv_func_accept_arg2) [Define to the type of arg 1 of 'accept'])
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$ac_cv_func_accept_arg3) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2, $ac_cv_func_accept_arg2,
[Define to the type of arg 2 of 'accept'])
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3, $ac_cv_func_accept_arg3,
[Define to the type of arg 3 of 'accept'])
]) ])
# Macros to detect C compiler features # Macros to detect C compiler features
# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.4 2001/12/02 11:38:40 petere Exp $ # $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.5 2002/03/29 17:32:53 petere Exp $
# PGAC_C_SIGNED # PGAC_C_SIGNED
...@@ -17,22 +17,6 @@ fi])# PGAC_C_SIGNED ...@@ -17,22 +17,6 @@ fi])# PGAC_C_SIGNED
# PGAC_C_VOLATILE
# ---------------
# Check if the C compiler understands `volatile'. Note that if it doesn't
# then this will potentially break the program semantics.
AC_DEFUN([PGAC_C_VOLATILE],
[AC_CACHE_CHECK(for volatile, pgac_cv_c_volatile,
[AC_TRY_COMPILE([],
[extern volatile int i;],
[pgac_cv_c_volatile=yes],
[pgac_cv_c_volatile=no])])
if test x"$pgac_cv_c_volatile" = xno ; then
AC_DEFINE(volatile,, [Define empty if the C compiler does not understand `volatile'])
fi])# PGAC_C_VOLATILE
# PGAC_TYPE_64BIT_INT(TYPE) # PGAC_TYPE_64BIT_INT(TYPE)
# ------------------------- # -------------------------
# Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to # Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
...@@ -84,67 +68,27 @@ undefine([Ac_cachevar])dnl ...@@ -84,67 +68,27 @@ undefine([Ac_cachevar])dnl
# PGAC_CHECK_ALIGNOF(TYPE) # PGAC_CHECK_ALIGNOF(TYPE, [INCLUDES = DEFAULT-INCLUDES])
# ------------------------ # -----------------------------------------------------
# Find the alignment requirement of the given type. Define the result # Find the alignment requirement of the given type. Define the result
# as ALIGNOF_TYPE. If cross-compiling, sizeof(type) is used as a # as ALIGNOF_TYPE. This macro works even when cross compiling.
# default assumption. # (Modelled after AC_CHECK_SIZEOF.)
#
# This is modeled on the standard autoconf macro AC_CHECK_SIZEOF.
# That macro never got any points for style.
AC_DEFUN([PGAC_CHECK_ALIGNOF], AC_DEFUN([PGAC_CHECK_ALIGNOF],
[changequote(<<, >>)dnl [AS_LITERAL_IF([$1], [],
dnl The name to #define. [AC_FATAL([$0: requires literal arguments])])dnl
define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl AC_CHECK_TYPE([$1], [], [], [$2])
dnl The cache variable name. AC_CACHE_CHECK([alignment of $1], [AS_TR_SH([pgac_cv_alignof_$1])],
define(<<AC_CV_NAME>>, translit(pgac_cv_alignof_$1, [ *], [_p]))dnl [if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
changequote([, ])dnl _AC_COMPUTE_INT([((char*) & pgac_struct.field) - ((char*) & pgac_struct)],
AC_MSG_CHECKING(alignment of $1) [AS_TR_SH([pgac_cv_alignof_$1])],
AC_CACHE_VAL(AC_CV_NAME, [AC_INCLUDES_DEFAULT([$2])
[AC_TRY_RUN([#include <stdio.h> struct { char filler; $1 field; } pgac_struct;],
struct { char filler; $1 field; } mystruct; [AC_MSG_ERROR([cannot compute alignment of $1, 77])])
main() else
{ AS_TR_SH([pgac_cv_alignof_$1])=0
FILE *f=fopen("conftestval", "w"); fi])dnl
if (!f) exit(1); AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$1),
fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct)); [$AS_TR_SH([pgac_cv_alignof_$1])],
exit(0); [The alignment requirement of a `$1'])
}], AC_CV_NAME=`cat conftestval`,
AC_CV_NAME='sizeof($1)',
AC_CV_NAME='sizeof($1)')])dnl
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The alignment requirement of a `]$1['])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])# PGAC_CHECK_ALIGNOF ])# PGAC_CHECK_ALIGNOF
# PGAC_CHECK_TYPE(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES])
# ---------------------------------------------------------------------------
AC_DEFUN([PGAC_CHECK_TYPE],
[changequote(<<,>>)dnl
dnl The name to #define
define(<<AC_TYPE_NAME>>, translit(have_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(pgac_cv_have_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_CACHE_CHECK([for $1], AC_CV_NAME,
[AC_TRY_COMPILE([$4],
[if (($1 *) 0)
return 0;
if (sizeof ($1))
return 0;],
AC_CV_NAME[=yes],
AC_CV_NAME[=no])])
if test "$AC_CV_NAME" = yes; then
AC_DEFINE(AC_TYPE_NAME, 1, [Define to 1 if you have `]$1['])
ifelse($2,,,[$2
])[]dnl
ifelse($3,,,[else
$3
])[]dnl
fi
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])# PGAC_CHECK_TYPE
# Macros that test various C library quirks # Macros that test various C library quirks
# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.11 2002/02/23 04:17:45 petere Exp $ # $Header: /cvsroot/pgsql/config/c-library.m4,v 1.12 2002/03/29 17:32:53 petere Exp $
# PGAC_VAR_INT_TIMEZONE # PGAC_VAR_INT_TIMEZONE
...@@ -37,11 +37,11 @@ fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG ...@@ -37,11 +37,11 @@ fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG
# PGAC_FUNC_MEMCMP # PGAC_FUNC_MEMCMP
# ----------- # ----------------
# Check if memcmp() properly handles negative bytes and returns +/-. # Check if memcmp() properly handles negative bytes and returns +/-.
# SunOS does not. # SunOS does not.
# AC_FUNC_MEMCMP # AC_FUNC_MEMCMP
AC_DEFUN(PGAC_FUNC_MEMCMP, AC_DEFUN([PGAC_FUNC_MEMCMP],
[AC_CACHE_CHECK(for 8-bit clean memcmp, pgac_cv_func_memcmp_clean, [AC_CACHE_CHECK(for 8-bit clean memcmp, pgac_cv_func_memcmp_clean,
[AC_TRY_RUN([ [AC_TRY_RUN([
main() main()
...@@ -66,16 +66,10 @@ AC_SUBST(MEMCMP)dnl ...@@ -66,16 +66,10 @@ AC_SUBST(MEMCMP)dnl
# If it doesn't then one could define it as # If it doesn't then one could define it as
# union semun { int val; struct semid_ds *buf; unsigned short *array; } # union semun { int val; struct semid_ds *buf; unsigned short *array; }
AC_DEFUN([PGAC_UNION_SEMUN], AC_DEFUN([PGAC_UNION_SEMUN],
[AC_CACHE_CHECK(for union semun, pgac_cv_union_semun, [AC_CHECK_TYPE([union semun], [], [],
[AC_TRY_COMPILE([#include <sys/types.h> [#include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/sem.h>], #include <sys/sem.h>])])# PGAC_UNION_SEMUN
[union semun semun;],
[pgac_cv_union_semun=yes],
[pgac_cv_union_semun=no])])
if test x"$pgac_cv_union_semun" = xyes ; then
AC_DEFINE(HAVE_UNION_SEMUN, 1, [Set to 1 if you have `union semun'])
fi])# PGAC_UNION_SEMUN
# PGAC_STRUCT_SOCKADDR_UN # PGAC_STRUCT_SOCKADDR_UN
...@@ -84,17 +78,12 @@ fi])# PGAC_UNION_SEMUN ...@@ -84,17 +78,12 @@ fi])# PGAC_UNION_SEMUN
# it is missing then one could define it as { short int sun_family; # it is missing then one could define it as { short int sun_family;
# char sun_path[108]; }. (Requires test for <sys/un.h>!) # char sun_path[108]; }. (Requires test for <sys/un.h>!)
AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN], AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN],
[AC_CACHE_CHECK([for struct sockaddr_un], pgac_cv_struct_sockaddr_un, [AC_CHECK_TYPES([struct sockaddr_un], [], [],
[AC_TRY_COMPILE([#include <sys/types.h> [#include <sys/types.h>
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
#include <sys/un.h> #include <sys/un.h>
#endif], #endif
[struct sockaddr_un un;], ])])# PGAC_STRUCT_SOCKADDR_UN
[pgac_cv_struct_sockaddr_un=yes],
[pgac_cv_struct_sockaddr_un=no])])
if test x"$pgac_cv_struct_sockaddr_un" = xyes; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_UN, 1, [Set to 1 if you have `struct sockaddr_un'])
fi])# PGAC_STRUCT_SOCKADDR_UN
# PGAC_FUNC_POSIX_SIGNALS # PGAC_FUNC_POSIX_SIGNALS
...@@ -121,109 +110,3 @@ if test x"$pgac_cv_func_posix_signals" = xyes ; then ...@@ -121,109 +110,3 @@ if test x"$pgac_cv_func_posix_signals" = xyes ; then
fi fi
HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS
# PGAC_STRUCT_CMSGCRED
# --------------------
# Check if `struct cmsgcred' exists. Define HAVE_STRUCT_CMSGCRED if so.
AC_DEFUN([PGAC_STRUCT_CMSGCRED],
[AC_CACHE_CHECK(for struct cmsgcred, pgac_cv_struct_cmsgcred,
[AC_TRY_COMPILE([#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ucred.h>],
[struct cmsgcred sockcred;],
[pgac_cv_struct_cmsgcred=yes],
[pgac_cv_struct_cmsgcred=no])])
if test x"$pgac_cv_struct_cmsgcred" = xyes ; then
AC_DEFINE(HAVE_STRUCT_CMSGCRED, 1, [Set to 1 if you have `struct cmsgcred'])
fi])# PGAC_STRUCT_CMSGCRED
# PGAC_STRUCT_FCRED
# -----------------
# Check if `struct fcred' exists. Define HAVE_STRUCT_FCRED if so.
AC_DEFUN([PGAC_STRUCT_FCRED],
[AC_CACHE_CHECK(for struct fcred, pgac_cv_struct_fcred,
[AC_TRY_COMPILE([#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ucred.h>],
[struct fcred sockcred;],
[pgac_cv_struct_fcred=yes],
[pgac_cv_struct_fcred=no])])
if test x"$pgac_cv_struct_fcred" = xyes ; then
AC_DEFINE(HAVE_STRUCT_FCRED, 1, [Set to 1 if you have `struct fcred'])
fi])# PGAC_STRUCT_FCRED
# PGAC_STRUCT_SOCKCRED
# --------------------
# Check if `struct sockcred' exists. Define HAVE_STRUCT_SOCKCRED if so.
AC_DEFUN([PGAC_STRUCT_SOCKCRED],
[AC_CACHE_CHECK(for struct sockcred, pgac_cv_struct_sockcred,
[AC_TRY_COMPILE([#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ucred.h>],
[struct sockcred sockcred;],
[pgac_cv_struct_sockcred=yes],
[pgac_cv_struct_sockcred=no])])
if test x"$pgac_cv_struct_sockcred" = xyes ; then
AC_DEFINE(HAVE_STRUCT_SOCKCRED, 1, [Set to 1 if you have `struct sockcred'])
fi])# PGAC_STRUCT_SOCKCRED
# PGAC_HEADER_STRING
# ------------------
# Tests whether <string.h> and <strings.h> can both be included
# (without generating warnings). This is mostly useful if you need
# str[n]casecmp(), since this is not in the "standard" <string.h>
# on some systems.
AC_DEFUN([PGAC_HEADER_STRING],
[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
[pgac_cv_header_strings_both],
[AC_TRY_CPP(
[#include <string.h>
#include <strings.h>
],
[AC_TRY_COMPILE(
[#include <string.h>
#include <strings.h>
],
[int n = strcasecmp("a", "b");],
[pgac_cv_header_strings_both=yes],
[pgac_cv_header_strings_both=no])],
[pgac_cv_header_strings_both=no])])
if test x"$pgac_cv_header_strings_both" = x"yes"; then
AC_DEFINE([STRING_H_WITH_STRINGS_H], 1,
[Define if string.h and strings.h may both be included])
fi])
# PGAC_CHECK_MEMBER(AGGREGATE.MEMBER,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [INCLUDES])
# -----------------------------------------------------------
AC_DEFUN([PGAC_CHECK_MEMBER],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<pgac_define_name>>, translit(HAVE_$1, [a-z .*], [A-Z__P]))dnl
dnl The cache variable name.
define(<<pgac_cache_name>>, translit(pgac_cv_member_$1, [ .*], [__p]))dnl
changequote([, ])dnl
AC_CACHE_CHECK([for $1], [pgac_cache_name],
[AC_TRY_COMPILE([$4],
[static ]patsubst([$1], [\..*])[ pgac_var;
if (pgac_var.]patsubst([$1], [^[^.]*\.])[)
return 0;],
[pgac_cache_name=yes],
[pgac_cache_name=no])])
if test x"[$]pgac_cache_name" = x"yes"; then
AC_DEFINE_UNQUOTED(pgac_define_name)
$2
else
ifelse([$3], [], :, [$3])
fi
undefine([pgac_define_name])[]dnl
undefine([pgac_cache_name])[]dnl
])
# Macros to detect certain C++ features # Macros to detect certain C++ features
# $Header: /cvsroot/pgsql/config/Attic/cxx.m4,v 1.1 2000/06/11 11:39:46 petere Exp $ # $Header: /cvsroot/pgsql/config/Attic/cxx.m4,v 1.2 2002/03/29 17:32:53 petere Exp $
# PGAC_CLASS_STRING # PGAC_CLASS_STRING
...@@ -9,27 +9,25 @@ ...@@ -9,27 +9,25 @@
# class string exists. If not, check to make sure that <string.h> # class string exists. If not, check to make sure that <string.h>
# defines class `string'. # defines class `string'.
AC_DEFUN([PGAC_CLASS_STRING], AC_DEFUN([PGAC_CLASS_STRING],
[AC_LANG_SAVE [AC_LANG_PUSH(C++)
AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(string, AC_CHECK_HEADER(string,
[AC_DEFINE(HAVE_CXX_STRING_HEADER)]) [AC_DEFINE(HAVE_CXX_STRING_HEADER, 1,
[Define to 1 if you have the C++ <string> header])]
if test x"$ac_cv_header_string" != xyes ; then [AC_CACHE_CHECK([for class string in <string.h>],
AC_CACHE_CHECK([for class string in <string.h>], [pgac_cv_class_string_in_string_h],
[pgac_cv_class_string_in_string_h], [AC_TRY_COMPILE([#include <stdio.h>
[AC_TRY_COMPILE([#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
], ],
[string foo = "test"], [string foo = "test"],
[pgac_cv_class_string_in_string_h=yes], [pgac_cv_class_string_in_string_h=yes],
[pgac_cv_class_string_in_string_h=no])]) [pgac_cv_class_string_in_string_h=no])])
if test x"$pgac_cv_class_string_in_string_h" != xyes ; then if test x"$pgac_cv_class_string_in_string_h" != xyes ; then
AC_MSG_ERROR([neither <string> nor <string.h> seem to define the C++ class \`string\']) AC_MSG_ERROR([neither <string> nor <string.h> seem to define the C++ class 'string'])
fi fi
fi ])
AC_LANG_RESTORE])# PGAC_CLASS_STRING AC_LANG_POP(C++)])# PGAC_CLASS_STRING
# PGAC_CXX_NAMESPACE_STD # PGAC_CXX_NAMESPACE_STD
...@@ -48,8 +46,7 @@ AC_DEFUN([PGAC_CXX_NAMESPACE_STD], ...@@ -48,8 +46,7 @@ AC_DEFUN([PGAC_CXX_NAMESPACE_STD],
AC_CACHE_CHECK([for namespace std in C++], AC_CACHE_CHECK([for namespace std in C++],
pgac_cv_cxx_namespace_std, pgac_cv_cxx_namespace_std,
[ [
AC_LANG_SAVE AC_LANG_PUSH(C++)
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE( AC_TRY_COMPILE(
[#include <stdio.h> [#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -60,8 +57,8 @@ using namespace std; ...@@ -60,8 +57,8 @@ using namespace std;
], [], ], [],
[pgac_cv_cxx_namespace_std=yes], [pgac_cv_cxx_namespace_std=yes],
[pgac_cv_cxx_namespace_std=no]) [pgac_cv_cxx_namespace_std=no])
AC_LANG_RESTORE]) AC_LANG_POP(C++)])
if test $pgac_cv_cxx_namespace_std = yes ; then if test $pgac_cv_cxx_namespace_std = yes ; then
AC_DEFINE(HAVE_NAMESPACE_STD, 1, [Define to 1 if the C++ compiler understands `using namespace std']) AC_DEFINE(HAVE_NAMESPACE_STD, 1, [Define to 1 if the C++ compiler understands 'using namespace std'])
fi])# PGAC_CXX_NAMESPACE_STD fi])# PGAC_CXX_NAMESPACE_STD
# $Header: /cvsroot/pgsql/config/docbook.m4,v 1.1 2000/11/05 21:04:06 petere Exp $ # $Header: /cvsroot/pgsql/config/docbook.m4,v 1.2 2002/03/29 17:32:53 petere Exp $
# PGAC_PROG_JADE # PGAC_PROG_JADE
# -------------- # --------------
...@@ -31,7 +31,7 @@ AC_CACHE_CHECK([for DocBook V$1], [pgac_cv_check_docbook], ...@@ -31,7 +31,7 @@ AC_CACHE_CHECK([for DocBook V$1], [pgac_cv_check_docbook],
</book> </book>
EOF EOF
${NSGMLS-false} -s conftest.sgml 1>&5 2>&1 ${NSGMLS-false} -s conftest.sgml 1>&AS_MESSAGE_LOG_FD 2>&1
if test $? -eq 0; then if test $? -eq 0; then
pgac_cv_check_docbook=yes pgac_cv_check_docbook=yes
else else
......
# $Header: /cvsroot/pgsql/config/general.m4,v 1.1 2000/09/21 20:17:42 petere Exp $ # $Header: /cvsroot/pgsql/config/general.m4,v 1.2 2002/03/29 17:32:53 petere Exp $
# This file defines new macros to process configure command line # This file defines new macros to process configure command line
# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. # arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE.
...@@ -12,16 +12,9 @@ ...@@ -12,16 +12,9 @@
# in the option evaluation code. # in the option evaluation code.
# print an error message and exit (while running `autoconf')
define([pgac_error],
[errprint(__file__:__line__[: error: $1
])
m4exit(10)])
# Convert type and name to shell variable name (e.g., "enable_long_strings") # Convert type and name to shell variable name (e.g., "enable_long_strings")
define([pgac_arg_to_variable], m4_define([pgac_arg_to_variable],
[$1[]_[]patsubst($2, -, _)]) [$1[]_[]patsubst($2, -, _)])
# PGAC_ARG(TYPE, NAME, HELP-STRING, # PGAC_ARG(TYPE, NAME, HELP-STRING,
...@@ -34,42 +27,45 @@ define([pgac_arg_to_variable], ...@@ -34,42 +27,45 @@ define([pgac_arg_to_variable],
# and argument (or "yes", which is the same); similar for ACTION-IF-NO. # and argument (or "yes", which is the same); similar for ACTION-IF-NO.
AC_DEFUN([PGAC_ARG], AC_DEFUN([PGAC_ARG],
[dnl Check arguments [
ifelse([$1], enable, , m4_case([$1],
[$1], with, ,
[pgac_error([first argument of $0 must be `enable' or `with', not `$1'])])[]dnl enable, [
define([pgac_variable], [pgac_arg_to_variable([$1], [$2])])[]dnl AC_ARG_ENABLE([$2], [$3], [
dnl Register help string, only if there is one case [$]enableval in
ifelse([$3], [], [],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
ac_help="$ac_help
[$3]"
AC_DIVERT_POP()])dnl
[#] Check whether --$1-$2 was given
if test x"[$]{pgac_variable+set}" = xset; then
case [$]pgac_variable in
yes) yes)
ifelse([$4], [], :, [$4]) m4_default([$4], :)
;; ;;
no) no)
ifelse([$5], [], :, [$5]) m4_default([$5], :)
;; ;;
dnl Action if called with argument *)
ifelse([$6], [], [],
[ *)
dnl Set up $withval or $enableval
$1[]val=[$]pgac_variable
$6 $6
;; ;;
])[]dnl esac
esac [#] [$]pgac_variable ],
dnl Action if omitted [$7])[]dnl AC_ARG_ENABLE
ifelse([$7], [], [], ],
[else
$7 with, [
])[]dnl AC_ARG_WITH([$2], [$3], [
fi[]dnl case [$]withval in
undefine([pgac_variable])dnl yes)
m4_default([$4], :)
;;
no)
m4_default([$5], :)
;;
*)
$6
;;
esac
],
[$7])[]dnl AC_ARG_WITH
],
[m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])]
)
])# PGAC_ARG ])# PGAC_ARG
...@@ -83,13 +79,14 @@ undefine([pgac_variable])dnl ...@@ -83,13 +79,14 @@ undefine([pgac_variable])dnl
# execute.) # execute.)
AC_DEFUN([PGAC_ARG_BOOL], AC_DEFUN([PGAC_ARG_BOOL],
[PGAC_ARG([$1], [$2], [$4], [$5], [$6], [PGAC_ARG([$1], [$2], [$4], [$5], [$6],
[AC_MSG_ERROR([no argument expected for --$1-$2 option])], [AC_MSG_ERROR([no argument expected for --$1-$2 option])],
[ifelse([$3], yes, [pgac_arg_to_variable([$1], [$2])=yes [m4_case([$3],
yes, [pgac_arg_to_variable([$1], [$2])=yes
$5], $5],
[$3], no, [pgac_arg_to_variable([$1], [$2])=no no, [pgac_arg_to_variable([$1], [$2])=no
$6], $6],
[pgac_error([third argument of $0 must be `yes' or `no', not `$3'])])])[]dnl [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl
])# PGAC_ARG_BOOL ])# PGAC_ARG_BOOL
...@@ -125,11 +122,11 @@ AC_DEFUN([PGAC_ARG_OPTARG], ...@@ -125,11 +122,11 @@ AC_DEFUN([PGAC_ARG_OPTARG],
$5], $5],
[pgac_arg_to_variable([$1], [$2])=no]) [pgac_arg_to_variable([$1], [$2])=no])
dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED. dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED.
ifelse([$6[]$7], [], [], m4_ifval([$6[]$7],
[ [
if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then
ifelse([$6], [], :, [$6]) m4_default([$6], :)
ifelse([$7], [], [], m4_ifval([$7],
[else [else
$7 $7
])[]dnl ])[]dnl
......
# #
# Autoconf macros for configuring the build of Java JDBC Tools # Autoconf macros for configuring the build of Java JDBC Tools
# #
# $Header: /cvsroot/pgsql/config/Attic/java.m4,v 1.3 2001/07/04 21:22:55 petere Exp $ # $Header: /cvsroot/pgsql/config/Attic/java.m4,v 1.4 2002/03/29 17:32:54 petere Exp $
# #
...@@ -34,10 +34,10 @@ EOF ...@@ -34,10 +34,10 @@ EOF
if test $? = 0 && test -f ./conftest.class ; then if test $? = 0 && test -f ./conftest.class ; then
pgac_cv_prog_ant_works=yes pgac_cv_prog_ant_works=yes
else else
echo "configure: failed java program was:" >&AC_FD_CC echo "configure: failed java program was:" >&AS_MESSAGE_LOG_FD
cat conftest.java >&AC_FD_CC cat conftest.java >&AS_MESSAGE_LOG_FD
echo "configure: failed build file was:" >&AC_FD_CC echo "configure: failed build file was:" >&AS_MESSAGE_LOG_FD
cat conftest.xml >&AC_FD_CC cat conftest.xml >&AS_MESSAGE_LOG_FD
pgac_cv_prog_ant_works=no pgac_cv_prog_ant_works=no
fi fi
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# ... bunch of stuff removed here ... # ... bunch of stuff removed here ...
# AC_PROG_LD - find the path to the GNU or non-GNU linker # AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD, AC_DEFUN([AC_PROG_LD],
[AC_ARG_WITH(gnu-ld, [AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
...@@ -37,7 +37,7 @@ AC_REQUIRE([AC_PROG_CC])dnl ...@@ -37,7 +37,7 @@ AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl
dnl ###not for PostgreSQL### AC_REQUIRE([AC_CANONICAL_BUILD])dnl dnl ###not for PostgreSQL### AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path. # Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC]) AC_MSG_CHECKING([for ld used by GCC])
case $host in case $host in
...@@ -105,7 +105,7 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) ...@@ -105,7 +105,7 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU AC_PROG_LD_GNU
]) ])
AC_DEFUN(AC_PROG_LD_GNU, AC_DEFUN([AC_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
......
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.7 2001/08/28 14:59:11 petere Exp $ # $Header: /cvsroot/pgsql/config/programs.m4,v 1.8 2002/03/29 17:32:54 petere Exp $
# PGAC_PATH_FLEX # PGAC_PATH_FLEX
...@@ -106,7 +106,7 @@ LIBS=$pgac_save_LIBS ...@@ -106,7 +106,7 @@ LIBS=$pgac_save_LIBS
])[]dnl AC_CACHE_VAL ])[]dnl AC_CACHE_VAL
if test "$pgac_cv_check_readline" != no ; then if test "$pgac_cv_check_readline" != no ; then
AC_DEFINE(HAVE_LIBREADLINE) AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a function readline library])
LIBS="$pgac_cv_check_readline $LIBS" LIBS="$pgac_cv_check_readline $LIBS"
AC_MSG_RESULT([yes ($pgac_cv_check_readline)]) AC_MSG_RESULT([yes ($pgac_cv_check_readline)])
else else
......
# #
# Autoconf macros for configuring the build of Python extension modules # Autoconf macros for configuring the build of Python extension modules
# #
# $Header: /cvsroot/pgsql/config/python.m4,v 1.3 2001/07/10 16:33:01 petere Exp $ # $Header: /cvsroot/pgsql/config/python.m4,v 1.4 2002/03/29 17:32:54 petere Exp $
# #
# PGAC_PATH_PYTHON # PGAC_PATH_PYTHON
# ---------------- # ----------------
# Look for Python and set the output variable `PYTHON' # Look for Python and set the output variable 'PYTHON'
# to `python' if found, empty otherwise. # to 'python' if found, empty otherwise.
AC_DEFUN([PGAC_PATH_PYTHON], AC_DEFUN([PGAC_PATH_PYTHON],
[AC_PATH_PROG(PYTHON, python) [AC_PATH_PROG(PYTHON, python)
if test x"$PYTHON" = x""; then if test x"$PYTHON" = x""; then
......
# $Header: /cvsroot/pgsql/config/tcl.m4,v 1.2 2000/09/30 10:45:17 petere Exp $ # $Header: /cvsroot/pgsql/config/tcl.m4,v 1.3 2002/03/29 17:32:54 petere Exp $
# Autoconf macros to check for Tcl related things # Autoconf macros to check for Tcl related things
...@@ -33,7 +33,7 @@ fi ...@@ -33,7 +33,7 @@ fi
if test -z "$TCL_CONFIG_SH"; then if test -z "$TCL_CONFIG_SH"; then
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([file \`tclConfig.sh' is required for Tcl]) AC_MSG_ERROR([file 'tclConfig.sh' is required for Tcl])
else else
AC_MSG_RESULT([$TCL_CONFIG_SH]) AC_MSG_RESULT([$TCL_CONFIG_SH])
fi fi
...@@ -67,7 +67,7 @@ fi ...@@ -67,7 +67,7 @@ fi
if test -z "$TK_CONFIG_SH"; then if test -z "$TK_CONFIG_SH"; then
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([file \`tkConfig.sh' is required for Tk]) AC_MSG_ERROR([file 'tkConfig.sh' is required for Tk])
else else
AC_MSG_RESULT([$TK_CONFIG_SH]) AC_MSG_RESULT([$TK_CONFIG_SH])
fi fi
......
This source diff could not be displayed because it is too large. You can view the blob instead.
dnl Process this file with autoconf to produce a configure script. 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 Developers, please strive to achieve this order:
dnl dnl
...@@ -16,28 +17,23 @@ dnl Read the Autoconf manual for details. ...@@ -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 The GNU folks apparently haven't heard that some people don't use
dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir". dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir".
define([info], [doc]) m4_define([info], [doc])
define([infodir], [docdir]) m4_define([infodir], [docdir])
AC_INIT(src/backend/access/common/heaptuple.c) AC_INIT([PostgreSQL], [7.3devel], [pgsql-bugs@postgresql.org])
undefine([infodir]) m4_undefine([infodir])
undefine([info]) m4_undefine([info])
AC_SUBST(docdir)
AC_PREFIX_DEFAULT(/usr/local/pgsql)
AC_CONFIG_HEADER(src/include/pg_config.h) AC_PREREQ(2.53)
AC_COPYRIGHT([Copyright 2002 PostgreSQL Global Development Group])
AC_PREREQ(2.13) 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_SUBST(configure_args, [$ac_configure_args])
VERSION='7.3devel' AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version])
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")
unset CDPATH
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_SUBST(host)
AC_SUBST(host_cpu)
AC_SUBST(host_os)
template= template=
AC_MSG_CHECKING([which template to use]) AC_MSG_CHECKING([which template to use])
...@@ -105,11 +101,6 @@ AC_MSG_RESULT([$template]) ...@@ -105,11 +101,6 @@ AC_MSG_RESULT([$template])
PORTNAME=$template PORTNAME=$template
AC_SUBST(PORTNAME) 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 # Pick right test-and-set (TAS) code. Most platforms have inline
# assembler code in src/include/storage/s_lock.h, so we just use # assembler code in src/include/storage/s_lock.h, so we just use
# a dummy file here. # a dummy file here.
...@@ -119,7 +110,7 @@ case $host in ...@@ -119,7 +110,7 @@ case $host in
i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;; i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
*) need_tas=no; tas_file=dummy.s ;; *) need_tas=no; tas_file=dummy.s ;;
esac 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 if test "$need_tas" = yes ; then
TAS=tas.o TAS=tas.o
...@@ -206,10 +197,11 @@ AC_SUBST(MULTIBYTE) ...@@ -206,10 +197,11 @@ AC_SUBST(MULTIBYTE)
# #
AC_MSG_CHECKING([whether NLS is wanted]) AC_MSG_CHECKING([whether NLS is wanted])
PGAC_ARG_OPTARG(enable, nls, PGAC_ARG_OPTARG(enable, nls,
[ --enable-nls[=LANGUAGES] enable Native Language Support], [[ --enable-nls[=LANGUAGES] enable Native Language Support]],
[], [],
[WANTED_LANGUAGES=$enableval], [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_MSG_RESULT([$enable_nls])
AC_SUBST(enable_nls) AC_SUBST(enable_nls)
AC_SUBST(WANTED_LANGUAGES) AC_SUBST(WANTED_LANGUAGES)
...@@ -223,8 +215,13 @@ PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number ...@@ -223,8 +215,13 @@ PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number
[default_port=5432]) [default_port=5432])
AC_MSG_RESULT([$default_port]) 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},
AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${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) AC_SUBST(default_port)
# #
...@@ -270,29 +267,30 @@ AC_SUBST(enable_debug) ...@@ -270,29 +267,30 @@ AC_SUBST(enable_debug)
# variable. # variable.
PGAC_ARG_REQ(with, CC, [], [CC=$with_CC]) PGAC_ARG_REQ(with, CC, [], [CC=$with_CC])
# On AIX, default compiler to xlc. case $template in
if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi aix) pgac_cc_list="gcc xlc";;
irix) pgac_cc_list="cc";; # no gcc
# Save CFLAGS from the environment *) pgac_cc_list="gcc cc";;
has_environ_CFLAGS="${CFLAGS+yes}" esac
save_CFLAGS=$CFLAGS
AC_PROG_CC AC_PROG_CC([$pgac_cc_list])
# Read the template # Read the template
. "$srcdir/src/template/$template" || exit . "$srcdir/src/template/$template" || exit
if test "$has_environ_CFLAGS" = yes; then if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$save_CFLAGS CFLAGS=$ac_env_CFLAGS_value
fi fi
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
echo "using CFLAGS=$CFLAGS" AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
# Check if the compiler still works with the template settings # Check if the compiler still works with the template settings
AC_PROG_CC_WORKS AC_MSG_CHECKING([whether the C compiler still works])
AC_EXEEXT AC_TRY_LINK([], [return 0;],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot proceed])])
AC_PROG_CPP AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_SUBST(GCC) AC_SUBST(GCC)
# Create compiler version string # Create compiler version string
...@@ -372,12 +370,12 @@ AC_MSG_RESULT([$with_tk]) ...@@ -372,12 +370,12 @@ AC_MSG_RESULT([$with_tk])
AC_SUBST([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 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. # 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]) PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
...@@ -424,11 +422,12 @@ dnl is non-standard. ...@@ -424,11 +422,12 @@ dnl is non-standard.
# #
# Kerberos 4 # 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=/usr/athena],
[krb4_prefix=$withval], [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.]) AC_DEFINE(KRB4, 1, [Define if you are building with Kerberos 4 support.])
if test -d "$krb4_prefix/include"; then if test -d "$krb4_prefix/include"; then
...@@ -439,7 +438,8 @@ PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 sup ...@@ -439,7 +438,8 @@ PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 sup
fi fi
krb_srvtab="/etc/srvtab" krb_srvtab="/etc/srvtab"
]) ],
[AC_MSG_RESULT(no)])
AC_SUBST(with_krb4) AC_SUBST(with_krb4)
...@@ -447,11 +447,12 @@ AC_SUBST(with_krb4) ...@@ -447,11 +447,12 @@ AC_SUBST(with_krb4)
# #
# Kerberos 5 # 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=/usr/athena],
[krb5_prefix=$withval], [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.]) AC_DEFINE(KRB5, 1, [Define if you are building with Kerberos 5 support.])
if test -d "$krb5_prefix/include"; then if test -d "$krb5_prefix/include"; then
...@@ -462,7 +463,8 @@ PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 sup ...@@ -462,7 +463,8 @@ PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 sup
fi fi
krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
]) ],
[AC_MSG_RESULT(no)])
AC_SUBST(with_krb5) AC_SUBST(with_krb5)
...@@ -501,7 +503,7 @@ AC_SUBST(with_pam) ...@@ -501,7 +503,7 @@ AC_SUBST(with_pam)
# OpenSSL # OpenSSL
# #
PGAC_ARG_OPTARG(with, 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=/usr/local/ssl],
[openssl_prefix=$withval], [openssl_prefix=$withval],
[ [
...@@ -541,8 +543,12 @@ if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then ...@@ -541,8 +543,12 @@ if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then
fi fi
case $enable_odbc:$with_unixodbc:$with_iodbc in case $enable_odbc:$with_unixodbc:$with_iodbc in
yes:no:no) AC_MSG_RESULT([yes (stand-alone)]);; yes:no:no) AC_MSG_RESULT([yes (stand-alone)]);;
yes:yes:no) AC_MSG_RESULT([yes (unixODBC)]); AC_DEFINE(WITH_UNIXODBC);; yes:yes:no) AC_MSG_RESULT([yes (unixODBC)])
yes:no:yes) AC_MSG_RESULT([yes (iODBC)]); AC_DEFINE(WITH_IODBC);; 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);; no:*) AC_MSG_RESULT(no);;
esac esac
AC_SUBST([enable_odbc]) AC_SUBST([enable_odbc])
...@@ -595,9 +601,8 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++ ...@@ -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 # If the user has specified CXXFLAGS in the environment, leave it
# alone, else use a default. # alone, else use a default.
has_environ_CXXFLAGS="${CXXFLAGS+yes}"
AC_PROG_CXX AC_PROG_CXX
if test "$has_environ_CXXFLAGS" != yes; then if test "$ac_env_CXXFLAGS" != set; then
if test "$GXX" = yes; then if test "$GXX" = yes; then
CXXFLAGS=-O2 CXXFLAGS=-O2
else else
...@@ -611,21 +616,19 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++ ...@@ -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 if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then
CXXFLAGS="$CXXFLAGS -g" CXXFLAGS="$CXXFLAGS -g"
fi fi
echo "using CXXFLAGS=$CXXFLAGS" AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS])
AC_PROG_CXXCPP AC_PROG_CXXCPP
AC_SUBST(GXX)
PGAC_CLASS_STRING
PGAC_CXX_NAMESPACE_STD
], ],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
AC_SUBST(with_CXX) AC_SUBST(with_CXX)
AC_SUBST(GXX)
CPPFLAGS="$CPPFLAGS $INCLUDES" CPPFLAGS="$CPPFLAGS $INCLUDES"
LDFLAGS="$LDFLAGS $LIBDIRS" LDFLAGS="$LDFLAGS $LIBDIRS"
echo "using CPPFLAGS=$CPPFLAGS" AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
echo "using LDFLAGS=$LDFLAGS" AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
AC_PROG_AWK AC_PROG_AWK
...@@ -683,7 +686,9 @@ fi ...@@ -683,7 +686,9 @@ fi
## ##
PGAC_CHECK_READLINE 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" if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
then then
...@@ -747,25 +752,26 @@ if test "$enable_nls" = yes ; then ...@@ -747,25 +752,26 @@ if test "$enable_nls" = yes ; then
PGAC_CHECK_GETTEXT PGAC_CHECK_GETTEXT
fi fi
if test "$with_CXX" = yes; then
PGAC_CLASS_STRING
PGAC_CXX_NAMESPACE_STD
fi
## ##
## Header files ## Header files
## ##
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES 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 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]) 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 # At least on IRIX, cpp test for netinet/tcp.h will fail unless
dnl is included first. So can't just use AC_CHECK_HEADERS; do it this way: # netinet/in.h is included first.
AC_CHECK_HEADERS([netinet/in.h]) AC_CHECK_HEADERS([netinet/in.h])
AC_MSG_CHECKING([for netinet/tcp.h]) AC_CHECK_HEADERS([netinet/tcp.h], [], [],
AC_TRY_CPP([ [#ifdef HAVE_NETINET_IN_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h> #include <netinet/in.h>
#endif #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/readline.h readline.h], [break])
AC_CHECK_HEADERS([readline/history.h history.h], [break]) AC_CHECK_HEADERS([readline/history.h history.h], [break])
...@@ -792,30 +798,33 @@ fi ...@@ -792,30 +798,33 @@ fi
## ##
## Types, structures, compiler characteristics ## Types, structures, compiler characteristics
## ##
m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that.
AC_C_CONST AC_C_CONST
AC_C_INLINE AC_C_INLINE
AC_C_STRINGIZE AC_C_STRINGIZE
PGAC_C_SIGNED PGAC_C_SIGNED
PGAC_C_VOLATILE AC_C_VOLATILE
AC_STRUCT_TIMEZONE AC_STRUCT_TIMEZONE
PGAC_UNION_SEMUN PGAC_UNION_SEMUN
PGAC_STRUCT_CMSGCRED
PGAC_STRUCT_FCRED
PGAC_STRUCT_SOCKCRED
PGAC_STRUCT_SOCKADDR_UN 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 if test "$with_krb5" = yes; then
# Check for differences between MIT and Heimdal (KTH) releases # Check for differences between MIT and Heimdal (KTH) releases
PGAC_CHECK_MEMBER([krb5_ticket.enc_part2], [], AC_CHECK_MEMBERS([krb5_ticket.enc_part2], [],
[PGAC_CHECK_MEMBER([krb5_ticket.client], [], [AC_CHECK_MEMBERS([krb5_ticket.client], [],
[AC_MSG_ERROR([could not determine how to get client name from Kerberos 5 ticket])], [AC_MSG_ERROR([could not determine how to get client name from Kerberos 5 ticket])],
[#include <krb5.h>])], [#include <krb5.h>])],
[#include <krb5.h>]) [#include <krb5.h>])
PGAC_CHECK_MEMBER([krb5_error.text.data], [], AC_CHECK_MEMBERS([krb5_error.text.data], [],
[PGAC_CHECK_MEMBER([krb5_error.e_data], [], [AC_CHECK_MEMBER([krb5_error.e_data], [],
[AC_MSG_ERROR([could not determine how to extract Kerberos 5 error messages])], [AC_MSG_ERROR([could not determine how to extract Kerberos 5 error messages])],
[#include <krb5.h>])], [#include <krb5.h>])],
[#include <krb5.h>]) [#include <krb5.h>])
fi fi
...@@ -829,10 +838,9 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG ...@@ -829,10 +838,9 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
# SunOS doesn't handle negative byte comparisons properly with +/- return # SunOS doesn't handle negative byte comparisons properly with +/- return
PGAC_FUNC_MEMCMP 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_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL))
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(
...@@ -847,27 +855,25 @@ if test "$pgac_cv_var_PS_STRINGS" = yes ; then ...@@ -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.]) AC_DEFINE([HAVE_PS_STRINGS], [], [Define if the PS_STRINGS thing exists.])
fi fi
dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
dnl is missing. Yes, there are machines that have only one. # We use our snprintf.c emulation if either snprintf() or vsnprintf()
dnl We may also decide to use snprintf.c if snprintf() is present but does # is missing. Yes, there are machines that have only one. We may
dnl not have working "long long int" support -- see below. # also decide to use snprintf.c if snprintf() is present but does not
# have working "long long int" support -- see below.
SNPRINTF='' SNPRINTF=''
AC_CHECK_FUNC(snprintf, AC_CHECK_FUNCS(snprintf, [], SNPRINTF='snprintf.o')
AC_DEFINE(HAVE_SNPRINTF), AC_CHECK_FUNCS(vsnprintf, [], SNPRINTF='snprintf.o')
SNPRINTF='snprintf.o')
AC_CHECK_FUNC(vsnprintf,
AC_DEFINE(HAVE_VSNPRINTF),
SNPRINTF='snprintf.o')
AC_SUBST(SNPRINTF) 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 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
dnl that have the functions but don't bother to declare them :-( # include/c.h will provide declarations. Note this is a separate test
dnl Note: simple-minded pattern here will do wrong thing if stdio.h # from whether the functions exist in the C library --- there are
dnl declares vsnprintf() but not snprintf(). Hopefully there are no # systems that have the functions but don't bother to declare them :-(
dnl systems that are *that* brain-damaged...
AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL)) AC_CHECK_DECLS([snprintf, vsnprintf])
AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL))
# do this one the hard way in case isinf() is a macro # do this one the hard way in case isinf() is a macro
AC_CACHE_CHECK([for isinf], ac_cv_func_isinf, AC_CACHE_CHECK([for isinf], ac_cv_func_isinf,
...@@ -879,7 +885,7 @@ 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])]) [ac_cv_func_isinf=no])])
if test $ac_cv_func_isinf = yes ; then 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= ISINF=
else else
ISINF='isinf.o' ISINF='isinf.o'
...@@ -888,49 +894,27 @@ else ...@@ -888,49 +894,27 @@ else
fi fi
AC_SUBST(ISINF) AC_SUBST(ISINF)
AC_CHECK_FUNC(getrusage,
AC_DEFINE(HAVE_GETRUSAGE), AC_CHECK_FUNCS(getrusage, [], GETRUSAGE='getrusage.o')
GETRUSAGE='getrusage.o')
AC_SUBST(GETRUSAGE) AC_SUBST(GETRUSAGE)
AC_CHECK_FUNC(srandom, AC_CHECK_FUNCS(srandom, [], SRANDOM='srandom.o')
AC_DEFINE(HAVE_SRANDOM),
SRANDOM='srandom.o')
AC_SUBST(SRANDOM) AC_SUBST(SRANDOM)
AC_CHECK_FUNC(gethostname, AC_CHECK_FUNCS(gethostname, [], GETHOSTNAME='gethostname.o')
AC_DEFINE(HAVE_GETHOSTNAME),
GETHOSTNAME='gethostname.o')
AC_SUBST(GETHOSTNAME) AC_SUBST(GETHOSTNAME)
AC_CHECK_FUNC(random, AC_CHECK_FUNCS(random, [], MISSING_RANDOM='random.o')
AC_DEFINE(HAVE_RANDOM),
MISSING_RANDOM='random.o')
AC_SUBST(MISSING_RANDOM) AC_SUBST(MISSING_RANDOM)
AC_CHECK_FUNC(inet_aton, AC_CHECK_FUNCS(inet_aton, [], INET_ATON='inet_aton.o')
AC_DEFINE(HAVE_INET_ATON),
INET_ATON='inet_aton.o')
AC_SUBST(INET_ATON) AC_SUBST(INET_ATON)
AC_CHECK_FUNC(strerror, AC_CHECK_FUNCS(strerror, [], STRERROR='strerror.o')
AC_DEFINE(HAVE_STRERROR),
STRERROR='strerror.o')
AC_SUBST(STRERROR) AC_SUBST(STRERROR)
AC_CHECK_FUNC(strdup, AC_CHECK_FUNCS(strdup, [], STRDUP='../../utils/strdup.o')
AC_DEFINE(HAVE_STRDUP),
STRDUP='../../utils/strdup.o')
AC_SUBST(STRDUP) AC_SUBST(STRDUP)
AC_CHECK_FUNC(strtol, AC_CHECK_FUNCS(strtol, [], STRTOL='strtol.o')
AC_DEFINE(HAVE_STRTOL),
STRTOL='strtol.o')
AC_SUBST(STRTOL) AC_SUBST(STRTOL)
AC_CHECK_FUNC(strtoul, AC_CHECK_FUNCS(strtoul, [], STRTOUL='strtoul.o')
AC_DEFINE(HAVE_STRTOUL),
STRTOUL='strtoul.o')
AC_SUBST(STRTOUL) AC_SUBST(STRTOUL)
AC_CHECK_FUNC(strcasecmp, AC_CHECK_FUNCS(strcasecmp, [], STRCASECMP='strcasecmp.o')
AC_DEFINE(HAVE_STRCASECMP),
STRCASECMP='strcasecmp.o')
AC_SUBST(STRCASECMP) 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; # 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. # this hackery with HPUXMATHLIB allows us to cope.
...@@ -943,9 +927,8 @@ case $host_cpu in ...@@ -943,9 +927,8 @@ case $host_cpu in
esac esac
AC_SUBST(HPUXMATHLIB) AC_SUBST(HPUXMATHLIB)
AC_CHECK_FUNC(rint, AC_CHECK_FUNCS(rint, [],
AC_DEFINE(HAVE_RINT), [AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)])
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB))
# Readline versions < 2.1 don't have rl_completion_append_character # Readline versions < 2.1 don't have rl_completion_append_character
...@@ -959,7 +942,8 @@ AC_TRY_LINK([#include <stdio.h> ...@@ -959,7 +942,8 @@ AC_TRY_LINK([#include <stdio.h>
], ],
[rl_completion_append_character = 'x';], [rl_completion_append_character = 'x';],
[AC_MSG_RESULT(yes) [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_MSG_RESULT(no)])
AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
...@@ -968,18 +952,20 @@ 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 dnl Cannot use AC_CHECK_FUNC because finite may be a macro
AC_MSG_CHECKING(for finite) AC_MSG_CHECKING(for finite)
AC_TRY_LINK([#include <math.h>], AC_TRY_LINK([#include <math.h>],
[int dummy=finite(1.0);], [int dummy=finite(1.0);],
[AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes)], [AC_DEFINE(HAVE_FINITE, 1, [Set to 1 if you have finite()])
AC_MSG_RESULT(no)) AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
dnl (especially on GNU libc) dnl (especially on GNU libc)
dnl See also comments in pg_config.h. dnl See also comments in pg_config.h.
AC_MSG_CHECKING(for sigsetjmp) AC_MSG_CHECKING(for sigsetjmp)
AC_TRY_LINK([#include <setjmp.h>], AC_TRY_LINK([#include <setjmp.h>],
[sigjmp_buf x; sigsetjmp(x, 1);], [sigjmp_buf x; sigsetjmp(x, 1);],
[AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)], [AC_DEFINE(HAVE_SIGSETJMP, 1, [Set to 1 if you have sigsetjmp()])
AC_MSG_RESULT(no)) AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
PGAC_ARG_BOOL(enable, syslog, no, [ --enable-syslog enable logging to syslog], 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, ...@@ -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=yes],
[pgac_cv_var_int_optreset=no])]) [pgac_cv_var_int_optreset=no])])
if test x"$pgac_cv_var_int_optreset" = x"yes"; then 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 fi
...@@ -1042,7 +1028,7 @@ if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then ...@@ -1042,7 +1028,7 @@ if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then
long long int foo = INT64CONST(0x1234567890123456); long long int foo = INT64CONST(0x1234567890123456);
], ],
[], [],
[AC_DEFINE(HAVE_LL_CONSTANTS)], [AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define if you have LL constants])],
[]) [])
fi fi
...@@ -1136,69 +1122,58 @@ else ...@@ -1136,69 +1122,58 @@ else
INT64_FORMAT='"%ld"' INT64_FORMAT='"%ld"'
fi 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([strtoll strtoq], [break])
AC_CHECK_FUNCS([strtoull strtouq], [break]) AC_CHECK_FUNCS([strtoull strtouq], [break])
dnl psql needs atexit() or on_exit() # Check for one of atexit() or on_exit()
AC_CHECK_FUNC(atexit, AC_CHECK_FUNCS(atexit, [],
[AC_DEFINE(HAVE_ATEXIT)], [AC_CHECK_FUNCS(on_exit, [],
[AC_CHECK_FUNCS(on_exit, [AC_MSG_ERROR([neither atexit() nor on_exit() found])])])
[AC_DEFINE(HAVE_ON_EXIT)],
[AC_MSG_ERROR([neither atexit() nor on_exit() found])])])
dnl Need a #define for the size of Datum (unsigned long) dnl Need a #define for the size of Datum (unsigned long)
AC_CHECK_SIZEOF(unsigned long, 4) AC_CHECK_SIZEOF([unsigned long])
AC_DEFINE_UNQUOTED(SIZEOF_DATUM, $ac_cv_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(short)
PGAC_CHECK_ALIGNOF(int) PGAC_CHECK_ALIGNOF(int)
PGAC_CHECK_ALIGNOF(long) 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) PGAC_CHECK_ALIGNOF(long long int)
fi fi
PGAC_CHECK_ALIGNOF(double) PGAC_CHECK_ALIGNOF(double)
dnl Compute maximum alignment of any basic type. # Compute maximum alignment of any basic type.
dnl We assume long's alignment is at least as strong as char, short, or int; # 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. # 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
MAX_ALIGNOF=$pgac_cv_alignof_long if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then
if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then MAX_ALIGNOF=$pgac_cv_alignof_double
MAX_ALIGNOF=$pgac_cv_alignof_double fi
fi if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then
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"
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"
fi fi
AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any type]) 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 # Some platforms predefine the types int8, int16, etc. Only check
# a (hopefully) representative subset. We also check for sig_atomic_t, # a (hopefully) representative subset.
# which *should* be defined per ANSI C, but is missing on some old platforms. AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [],
[#include <stdio.h>
pgac_type_includes="\
#include <stdio.h>
#include <signal.h>
#ifdef HAVE_SUPPORTDEFS_H #ifdef HAVE_SUPPORTDEFS_H
#include <SupportDefs.h> #include <SupportDefs.h>
#endif" #endif])
PGAC_CHECK_TYPE(int8, [], [], [$pgac_type_includes]) # We also check for sig_atomic_t, which *should* be defined per ANSI
PGAC_CHECK_TYPE(uint8, [], [], [$pgac_type_includes]) # C, but is missing on some old platforms.
PGAC_CHECK_TYPE(int64, [], [], [$pgac_type_includes]) AC_CHECK_TYPES([sig_atomic_t], [], [], [#include <signal.h>])
PGAC_CHECK_TYPE(uint64, [], [], [$pgac_type_includes])
PGAC_CHECK_TYPE(sig_atomic_t, [], [], [$pgac_type_includes])
PGAC_FUNC_POSIX_SIGNALS PGAC_FUNC_POSIX_SIGNALS
...@@ -1227,29 +1202,38 @@ if test -n "$NSGMLS"; then ...@@ -1227,29 +1202,38 @@ if test -n "$NSGMLS"; then
AC_CHECK_PROGS(SGMLSPL, sgmlspl) AC_CHECK_PROGS(SGMLSPL, sgmlspl)
fi fi
abs_top_srcdir=
AC_SUBST(abs_top_srcdir)
# 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 "$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 else
abs_top_srcdir=`cd $srcdir && pwd` AC_SUBST(vpath_build, yes)
echo $ac_n "preparing build tree... $ac_c" 1>&6 _AS_ECHO_N([preparing build tree... ])
/bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \ pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
$SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
|| AC_MSG_ERROR(failed) || AC_MSG_ERROR(failed)
AC_MSG_RESULT(done) AC_MSG_RESULT(done)
fi
fi fi
AC_OUTPUT(
[ AC_CONFIG_FILES([GNUmakefile src/Makefile.global])
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) # 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
# -*-makefile-*- # -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.143 2002/03/13 00:05:02 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.144 2002/03/29 17:32:54 petere Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
...@@ -29,20 +29,24 @@ all: ...@@ -29,20 +29,24 @@ all:
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
# PostgreSQL version number # PostgreSQL version number
VERSION = @VERSION@ VERSION = @PACKAGE_VERSION@
# Support for VPATH builds # Support for VPATH builds
vpath_build = @vpath_build@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ifndef abs_top_srcdir ifneq ($(vpath_build),yes)
top_srcdir = $(top_builddir) top_srcdir = $(top_builddir)
srcdir = . srcdir = .
else else # vpath_build = yes
top_srcdir = $(abs_top_srcdir) top_srcdir = $(abs_top_srcdir)
srcdir = $(top_srcdir)/$(subdir) srcdir = $(top_srcdir)/$(subdir)
VPATH = $(srcdir) VPATH = $(srcdir)
endif endif
# Saved arguments from configure
configure_args = @configure_args@
########################################################################## ##########################################################################
# #
...@@ -357,7 +361,7 @@ TAS = @TAS@ ...@@ -357,7 +361,7 @@ TAS = @TAS@
# write `include $(top_builddir)/src/Makefile.global', not some # write `include $(top_builddir)/src/Makefile.global', not some
# shortcut thereof. # shortcut thereof.
$(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=src/Makefile.global CONFIG_HEADERS= ./config.status cd $(top_builddir) && ./config.status src/Makefile.global
# Remake pg_config.h from pg_config.h.in if the latter changed. # Remake pg_config.h from pg_config.h.in if the latter changed.
# config.status will not change the timestamp on pg_config.h if it # config.status will not change the timestamp on pg_config.h if it
...@@ -372,7 +376,7 @@ $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_ ...@@ -372,7 +376,7 @@ $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_
$(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
$(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES= CONFIG_HEADERS=src/include/pg_config.h ./config.status cd $(top_builddir) && ./config.status src/include/pg_config.h
# When configure changes, rerun configure with the same options as # When configure changes, rerun configure with the same options as
# last time. To change configure, you need to run autoconf manually. # last time. To change configure, you need to run autoconf manually.
......
# $Header: /cvsroot/pgsql/src/bin/pg_config/Makefile,v 1.3 2001/09/16 16:11:11 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pg_config/Makefile,v 1.4 2002/03/29 17:32:55 petere Exp $
subdir = src/bin/pg_config subdir = src/bin/pg_config
top_builddir = ../../.. top_builddir = ../../..
...@@ -6,14 +6,13 @@ include $(top_builddir)/src/Makefile.global ...@@ -6,14 +6,13 @@ include $(top_builddir)/src/Makefile.global
all: pg_config all: pg_config
pg_config: pg_config.sh $(top_builddir)/config.status $(top_builddir)/src/Makefile.global Makefile pg_config: pg_config.sh $(top_builddir)/src/Makefile.global Makefile
configure=`sed -n '7s,^# [^ ]*configure *,,p' $(top_builddir)/config.status` && \
sed -e 's,@bindir@,$(bindir),g' \ sed -e 's,@bindir@,$(bindir),g' \
-e 's,@includedir@,$(includedir),g' \ -e 's,@includedir@,$(includedir),g' \
-e 's,@includedir_server@,$(includedir_server),g' \ -e 's,@includedir_server@,$(includedir_server),g' \
-e 's,@libdir@,$(libdir),g' \ -e 's,@libdir@,$(libdir),g' \
-e 's,@pkglibdir@,$(pkglibdir),g' \ -e 's,@pkglibdir@,$(pkglibdir),g' \
-e "s,@configure@,$$configure,g" \ -e "s,@configure@,$(configure_args),g" \
-e 's,@version@,$(VERSION),g' \ -e 's,@version@,$(VERSION),g' \
$< >$@ $< >$@
chmod a+x $@ chmod a+x $@
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: c.h,v 1.114 2002/01/22 19:02:39 tgl Exp $ * $Id: c.h,v 1.115 2002/03/29 17:32:55 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef STRING_H_WITH_STRINGS_H #ifdef HAVE_STRINGS_H
#include <strings.h> #include <strings.h>
#endif #endif
...@@ -626,14 +626,14 @@ typedef NameData *Name; ...@@ -626,14 +626,14 @@ typedef NameData *Name;
* in pg_config.h we haven't yet included anything that defines size_t... * in pg_config.h we haven't yet included anything that defines size_t...
*/ */
#ifndef HAVE_SNPRINTF_DECL #if !HAVE_DECL_SNPRINTF
extern int extern int
snprintf(char *str, size_t count, const char *fmt,...) snprintf(char *str, size_t count, const char *fmt,...)
/* This extension allows gcc to check the format string */ /* This extension allows gcc to check the format string */
__attribute__((format(printf, 3, 4))); __attribute__((format(printf, 3, 4)));
#endif #endif
#ifndef HAVE_VSNPRINTF_DECL #if !HAVE_DECL_VSNPRINTF
extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif #endif
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your * or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
* changes will be overwritten the next time you run configure. * changes will be overwritten the next time you run configure.
* *
* $Id: pg_config.h.in,v 1.18 2002/02/25 17:11:22 tgl Exp $ * $Id: pg_config.h.in,v 1.19 2002/03/29 17:32:55 petere Exp $
*/ */
#ifndef PG_CONFIG_H #ifndef PG_CONFIG_H
...@@ -408,8 +408,8 @@ ...@@ -408,8 +408,8 @@
/* Set to 1 if you have <sys/pstat.h> */ /* Set to 1 if you have <sys/pstat.h> */
#undef HAVE_SYS_PSTAT_H #undef HAVE_SYS_PSTAT_H
/* Define if string.h and strings.h may both be included */ /* Define to 1 if you have strings.h */
#undef STRING_H_WITH_STRINGS_H #undef HAVE_STRINGS_H
/* Define if you have the setproctitle function. */ /* Define if you have the setproctitle function. */
#undef HAVE_SETPROCTITLE #undef HAVE_SETPROCTITLE
...@@ -439,13 +439,13 @@ ...@@ -439,13 +439,13 @@
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
/* Set to 1 if your standard system headers declare snprintf() */ /* Set to 1 if your standard system headers declare snprintf() */
#undef HAVE_SNPRINTF_DECL #undef HAVE_DECL_SNPRINTF
/* Set to 1 if you have vsnprintf() in the C library */ /* Set to 1 if you have vsnprintf() in the C library */
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
/* Set to 1 if your standard system headers declare vsnprintf() */ /* Set to 1 if your standard system headers declare vsnprintf() */
#undef HAVE_VSNPRINTF_DECL #undef HAVE_DECL_VSNPRINTF
/* Set to 1 if you have strerror() */ /* Set to 1 if you have strerror() */
#undef HAVE_STRERROR #undef HAVE_STRERROR
...@@ -581,9 +581,9 @@ extern void srandom(unsigned int seed); ...@@ -581,9 +581,9 @@ extern void srandom(unsigned int seed);
#undef HAVE_FDATASYNC #undef HAVE_FDATASYNC
/* Define if the standard header unistd.h declares fdatasync() */ /* Define if the standard header unistd.h declares fdatasync() */
#undef HAVE_FDATASYNC_DECL #undef HAVE_DECL_FDATASYNC
#if defined(HAVE_FDATASYNC) && !defined(HAVE_FDATASYNC_DECL) #if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC
extern int fdatasync(int fildes); extern int fdatasync(int fildes);
#endif #endif
......
...@@ -6,4 +6,5 @@ else # not GCC ...@@ -6,4 +6,5 @@ else # not GCC
aix3.2.5 | aix4.1*) aix3.2.5 | aix4.1*)
CFLAGS='-qmaxmem=16384 -qsrcmsg' ;; CFLAGS='-qmaxmem=16384 -qsrcmsg' ;;
esac esac
CCC=xlC
fi # not GCC fi # not GCC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment