Replace brain-dead Autoconf macros AC_ARG_{ENABLE,WITH} with something

that's actually useful, robust, consistent.

Better plan to generate aclocal.m4 as well: use m4 include directives,
rather than cat.
This commit is contained in:
Peter Eisentraut 2000-09-21 20:17:43 +00:00
parent b4c8d47ab0
commit 353371874f
6 changed files with 1180 additions and 1477 deletions

View File

@ -1,7 +1,7 @@
#
# PostgreSQL top level makefile
#
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.11 2000/08/31 16:08:58 petere Exp $
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.12 2000/09/21 20:17:41 petere Exp $
#
subdir =
@ -34,25 +34,6 @@ GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
# These dependencies are risky because both the target and the sources
# are in CVS and CVS doesn't preserve timestamps, thus leading to
# unnecessary reruns of these rules.
AUTOCONF = autoconf
# Only use this rule if you actually said `make configure'.
ifeq ($(MAKECMDGOALS),configure)
$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4
cd $(top_srcdir) && $(AUTOCONF)
endif
# This one we can leave unprotected because by default nothing depends
# on aclocal.m4. This rule is only invoked if you say `make
# aclocal.m4' or `make configure'.
$(top_srcdir)/aclocal.m4: $(wildcard $(top_srcdir)/config/*.m4)
cat $^ > $@
##########################################################################
distdir := postgresql-$(VERSION)

461
aclocal.m4 vendored
View File

@ -1,453 +1,8 @@
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
# This comes from the official Autoconf macro archive at
# <http://research.cys.de/autoconf-archive/>
# (I removed the $ before the Id CVS keyword below.)
dnl @synopsis AC_FUNC_ACCEPT_ARGTYPES
dnl
dnl Checks the data types of the three arguments to accept(). Results are
dnl placed into the symbols ACCEPT_TYPE_ARG[123], consistent with the
dnl following example:
dnl
dnl #define ACCEPT_TYPE_ARG1 int
dnl #define ACCEPT_TYPE_ARG2 struct sockaddr *
dnl #define ACCEPT_TYPE_ARG3 socklen_t
dnl
dnl This macro requires AC_CHECK_HEADERS to have already verified the
dnl presence or absence of sys/types.h and sys/socket.h.
dnl
dnl NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES
dnl macro. Credit for that one goes to David MacKenzie et. al.
dnl
dnl @version Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $
dnl @author Daniel Richard G. <skunk@mit.edu>
dnl
# PostgreSQL local changes: In the original version ACCEPT_TYPE_ARG3
# is a pointer type. That's kind of useless because then you can't
# use the macro to define a corresponding variable. We also make the
# reasonable(?) assumption that you can use arg3 for getsocktype etc.
# as well (i.e., anywhere POSIX.2 has socklen_t).
#
# arg2 can also be `const' (e.g., RH 4.2). Change the order of tests
# for arg3 so that `int' is first, in case there is no prototype at all.
AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES,
[AC_MSG_CHECKING([types of arguments for accept()])
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_arg3,dnl
[for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int'; do
AC_TRY_COMPILE(
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
extern accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);],
[], [ac_not_found=no; break 3], [ac_not_found=yes])
done
done
done
if test "$ac_not_found" = yes; then
AC_MSG_ERROR([could not determine argument types])
fi
])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_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1,$ac_cv_func_accept_arg1)
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2,$ac_cv_func_accept_arg2)
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$ac_cv_func_accept_arg3)
])
# Macros to detect C compiler features
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
# PGAC_C_SIGNED
# -------------
# Check if the C compiler understands signed types.
AC_DEFUN([PGAC_C_SIGNED],
[AC_CACHE_CHECK(for signed types, pgac_cv_c_signed,
[AC_TRY_COMPILE([],
[signed char c; signed short s; signed int i;],
[pgac_cv_c_signed=yes],
[pgac_cv_c_signed=no])])
if test x"$pgac_cv_c_signed" = xno ; then
AC_DEFINE(signed,, [Define empty if the C compiler does not understand signed types])
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)
# -------------------------
# Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
# yes or no respectively, and define HAVE_TYPE_64 if yes.
AC_DEFUN([PGAC_TYPE_64BIT_INT],
[define([Ac_define], [translit([have_$1_64], [a-z *], [A-Z_P])])dnl
define([Ac_cachevar], [translit([pgac_cv_type_$1_64], [ *], [_p])])dnl
AC_CACHE_CHECK([whether $1 is 64 bits], [Ac_cachevar],
[AC_TRY_RUN(
[typedef $1 int64;
/*
* These are globals to discourage the compiler from folding all the
* arithmetic tests down to compile-time constants.
*/
int64 a = 20000001;
int64 b = 40000005;
int does_int64_work()
{
int64 c,d;
if (sizeof(int64) != 8)
return 0; /* definitely not the right size */
/* Do perfunctory checks to see if 64-bit arithmetic seems to work */
c = a * b;
d = (c + b) / b;
if (d != a+1)
return 0;
return 1;
}
main() {
exit(! does_int64_work());
}],
[Ac_cachevar=yes],
[Ac_cachevar=no],
[Ac_cachevar=no
dnl We will do better here with Autoconf 2.50
AC_MSG_WARN([64 bit arithmetic disabled when cross-compiling])])])
Ac_define=$Ac_cachevar
if test x"$Ac_cachevar" = xyes ; then
AC_DEFINE(Ac_define,, [Set to 1 if `]$1[' is 64 bits])
fi
undefine([Ac_define])dnl
undefine([Ac_cachevar])dnl
])# PGAC_TYPE_64BIT_INT
# PGAC_CHECK_ALIGNOF(TYPE)
# ------------------------
# Find the alignment requirement of the given type. Define the result
# as ALIGNOF_TYPE. If cross-compiling, sizeof(type) is used as a
# default assumption.
#
# This is modeled on the standard autoconf macro AC_CHECK_SIZEOF.
# That macro never got any points for style.
AC_DEFUN([PGAC_CHECK_ALIGNOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(pgac_cv_alignof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(alignment of $1)
AC_CACHE_VAL(AC_CV_NAME,
[AC_TRY_RUN([#include <stdio.h>
struct { char filler; $1 field; } mystruct;
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
exit(0);
}], 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
# Macros that test various C library quirks
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
# PGAC_VAR_INT_TIMEZONE
# ---------------------
# Check if the global variable `timezone' exists. If so, define
# HAVE_INT_TIMEZONE.
AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
[AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone,
[AC_TRY_LINK([#include <time.h>],
[int res = timezone / 60;],
[pgac_cv_var_int_timezone=yes],
[pgac_cv_var_int_timezone=no])])
if test x"$pgac_cv_var_int_timezone" = xyes ; then
AC_DEFINE(HAVE_INT_TIMEZONE,, [Set to 1 if you have the global variable timezone])
fi])# PGAC_VAR_INT_TIMEZONE
# PGAC_FUNC_GETTIMEOFDAY_1ARG
# ---------------------------
# Check if gettimeofday() has only one arguments. (Normal is two.)
# If so, define GETTIMEOFDAY_1ARG.
AC_DEFUN([PGAC_FUNC_GETTIMEOFDAY_1ARG],
[AC_CACHE_CHECK(whether gettimeofday takes only one argument,
pgac_cv_func_gettimeofday_1arg,
[AC_TRY_COMPILE([#include <sys/time.h>],
[struct timeval *tp;
struct timezone *tzp;
gettimeofday(tp,tzp);],
[pgac_cv_func_gettimeofday_1arg=no],
[pgac_cv_func_gettimeofday_1arg=yes])])
if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
AC_DEFINE(GETTIMEOFDAY_1ARG,, [Set to 1 if gettimeofday() takes only 1 argument])
fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG
# PGAC_UNION_SEMUN
# ----------------
# Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.
# If it doesn't then one could define it as
# union semun { int val; struct semid_ds *buf; unsigned short *array; }
AC_DEFUN([PGAC_UNION_SEMUN],
[AC_CACHE_CHECK(for union semun, pgac_cv_union_semun,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>],
[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,, [Set to 1 if you have `union semun'])
fi])# PGAC_UNION_SEMUN
# PGAC_FUNC_POSIX_SIGNALS
# -----------------------
# Check to see if the machine has the POSIX signal interface. Define
# HAVE_POSIX_SIGNALS if so. Also set the output variable HAVE_POSIX_SIGNALS
# to yes or no.
#
# Note that this test only compiles a test program, it doesn't check
# whether the routines actually work. If that becomes a problem, make
# a fancier check.
AC_DEFUN([PGAC_FUNC_POSIX_SIGNALS],
[AC_CACHE_CHECK(for POSIX signal interface, pgac_cv_func_posix_signals,
[AC_TRY_LINK([#include <signal.h>
],
[struct sigaction act, oact;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);],
[pgac_cv_func_posix_signals=yes],
[pgac_cv_func_posix_signals=no])])
if test x"$pgac_cv_func_posix_signals" = xyes ; then
AC_DEFINE(HAVE_POSIX_SIGNALS,, [Set to 1 if you have the POSIX signal interface])
fi
HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS
# Macros to detect certain C++ features
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
# PGAC_CLASS_STRING
# -----------------
# Look for class `string'. First look for the <string> header. If this
# is found a <string> header then it's probably safe to assume that
# class string exists. If not, check to make sure that <string.h>
# defines class `string'.
AC_DEFUN([PGAC_CLASS_STRING],
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(string,
[AC_DEFINE(HAVE_CXX_STRING_HEADER)])
if test x"$ac_cv_header_string" != xyes ; then
AC_CACHE_CHECK([for class string in <string.h>],
[pgac_cv_class_string_in_string_h],
[AC_TRY_COMPILE([#include <stdio.h>
#include <stdlib.h>
#include <string.h>
],
[string foo = "test"],
[pgac_cv_class_string_in_string_h=yes],
[pgac_cv_class_string_in_string_h=no])])
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\'])
fi
fi
AC_LANG_RESTORE])# PGAC_CLASS_STRING
# PGAC_CXX_NAMESPACE_STD
# ----------------------
# Check whether the C++ compiler understands `using namespace std'.
#
# Note 1: On at least some compilers, it will not work until you've
# included a header that mentions namespace std. Thus, include the
# usual suspects before trying it.
#
# Note 2: This test does not actually reveal whether the C++ compiler
# properly understands namespaces in all generality. (GNU C++ 2.8.1
# is one that doesn't.) However, we don't care.
AC_DEFUN([PGAC_CXX_NAMESPACE_STD],
[AC_REQUIRE([PGAC_CLASS_STRING])
AC_CACHE_CHECK([for namespace std in C++],
pgac_cv_cxx_namespace_std,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(
[#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_CXX_STRING_HEADER
#include <string>
#endif
using namespace std;
], [],
[pgac_cv_cxx_namespace_std=yes],
[pgac_cv_cxx_namespace_std=no])
AC_LANG_RESTORE])
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'])
fi])# PGAC_CXX_NAMESPACE_STD
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
# PGAC_PATH_FLEX
# --------------
# Look for Flex, set the output variable FLEX to its path if found.
# Avoid the buggy version 2.5.3. Also find Flex if its installed
# under `lex', but do not accept other Lex programs.
AC_DEFUN([PGAC_PATH_FLEX],
[AC_CACHE_CHECK([for flex], pgac_cv_path_flex,
[# Let the user override the test
if test -n "$FLEX"; then
pgac_cv_path_flex=$FLEX
else
pgac_save_IFS=$IFS
IFS=:
for pgac_dir in $PATH; do
if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
pgac_dir=`pwd`
fi
for pgac_prog in flex lex; do
pgac_candidate="$pgac_dir/$pgac_prog"
if test -f "$pgac_candidate" \
&& $pgac_candidate --version >/dev/null 2>&1
then
echo '%%' > conftest.l
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
if $pgac_candidate --version | grep '2\.5\.3' >/dev/null 2>&1; then
pgac_broken_flex=$pgac_candidate
continue
fi
pgac_cv_path_flex=$pgac_candidate
break 2
fi
fi
done
done
IFS=$pgac_save_IFS
rm -f conftest.l
: ${pgac_cv_path_flex=no}
fi
])[]dnl AC_CACHE_CHECK
if test x"$pgac_cv_path_flex" = x"no"; then
if test -n "$pgac_broken_flex"; then
AC_MSG_WARN([
***
The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
should get version 2.5.4 or later.
###])
fi
AC_MSG_WARN([
***
Without Flex you won't be able to build PostgreSQL from scratch, or change
any of the scanner definition files. You can obtain Flex from a GNU mirror
site. (If you are using the official distribution of PostgreSQL then you
do not need to worry about this because the lexer files are pre-generated.)
***])
fi
if test x"$pgac_cv_path_flex" = x"no"; then
FLEX=
else
FLEX=$pgac_cv_path_flex
fi
AC_SUBST(FLEX)
AC_SUBST(FLEXFLAGS)
])# PGAC_PATH_FLEX
#
# Autoconf macros for configuring the build of Python extension modules
#
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.7 2000/08/29 09:36:37 petere Exp $
#
# PGAC_PROG_PYTHON
# ----------------
# Look for Python and set the output variable `PYTHON'
# to `python' if found, empty otherwise.
AC_DEFUN([PGAC_PROG_PYTHON],
[AC_CHECK_PROG(PYTHON, python, python)])
# PGAC_PATH_PYTHONDIR
# -------------------
# Finds the names of various install dirs and helper files
# necessary to build a Python extension module.
#
# It would be nice if we could check whether the current setup allows
# the build of the shared module. Future project.
AC_DEFUN([PGAC_PATH_PYTHONDIR],
[AC_REQUIRE([PGAC_PROG_PYTHON])
[if test "${PYTHON+set}" = set ; then
python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
python_configdir="${python_execprefix}/lib/python${python_version}/config"
python_moduledir="${python_prefix}/lib/python${python_version}"
python_extmakefile="${python_configdir}/Makefile.pre.in"]
AC_MSG_CHECKING(for Python extension makefile)
if test -f "${python_extmakefile}" ; then
AC_MSG_RESULT(found)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(
[The Python extension makefile was expected at \`${python_extmakefile}\'
but does not exist. This means the Python module cannot be built automatically.])
fi
AC_SUBST(python_version)
AC_SUBST(python_prefix)
AC_SUBST(python_execprefix)
AC_SUBST(python_configdir)
AC_SUBST(python_moduledir)
AC_SUBST(python_extmakefile)
else
AC_MSG_ERROR([Python not found])
fi])# PGAC_PATH_PYTHONDIR
dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.8 2000/09/21 20:17:41 petere Exp $
builtin([include], [config/ac_func_accept_argtypes.m4])
builtin([include], [config/c-compiler.m4])
builtin([include], [config/c-library.m4])
builtin([include], [config/cxx.m4])
builtin([include], [config/general.m4])
builtin([include], [config/programs.m4])
builtin([include], [config/python.m4])

138
config/general.m4 Normal file
View File

@ -0,0 +1,138 @@
# $Header: /cvsroot/pgsql/config/general.m4,v 1.1 2000/09/21 20:17:42 petere Exp $
# This file defines new macros to process configure command line
# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE.
# The flaw in these is particularly that they only differentiate
# between "given" and "not given" and do not provide enough help to
# process arguments that only accept "yes/no", that require an
# argument (other than "yes/no"), etc.
#
# The point of this implementation is to reduce code size and
# redundancy in configure.in and to improve robustness and consistency
# 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")
define([pgac_arg_to_variable],
[$1[]_[]patsubst($2, -, _)])
# PGAC_ARG(TYPE, NAME, HELP-STRING,
# [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG],
# [ACTION-IF-OMITTED])
# ----------------------------------------------------------
# This is the base layer. TYPE is either "with" or "enable", depending
# on what you like. NAME is the rest of the option name, HELP-STRING
# as usual. ACTION-IF-YES is executed if the option is given without
# and argument (or "yes", which is the same); similar for ACTION-IF-NO.
AC_DEFUN([PGAC_ARG],
[dnl Check arguments
ifelse([$1], enable, ,
[$1], with, ,
[pgac_error([first argument of $0 must be `enable' or `with', not `$1'])])[]dnl
define([pgac_variable], [pgac_arg_to_variable([$1], [$2])])[]dnl
dnl Register help string, only if there is one
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)
ifelse([$4], [], :, [$4])
;;
no)
ifelse([$5], [], :, [$5])
;;
dnl Action if called with argument
ifelse([$6], [], [],
[ *)
dnl Set up $withval or $enableval
$1[]val=[$]pgac_variable
$6
;;
])[]dnl
esac [#] [$]pgac_variable
dnl Action if omitted
ifelse([$7], [], [],
[else
$7
])[]dnl
fi[]dnl
undefine([pgac_variable])dnl
])# PGAC_ARG
# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING,
# [ACTION-IF-YES], [ACTION-IF-NO])
# -----------------------------------------------
# Accept a boolean option, that is, one that only takes yes or no.
# ("no" is equivalent to "disable" or "without"). DEFAULT is what
# should be done if the option is omitted; it should be "yes" or "no".
# (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always
# execute.)
AC_DEFUN([PGAC_ARG_BOOL],
[PGAC_ARG([$1], [$2], [$4], [$5], [$6],
[AC_MSG_ERROR([no argument expected for --$1-$2 option])],
[ifelse([$3], yes, [pgac_arg_to_variable([$1], [$2])=yes
$5],
[$3], no, [pgac_arg_to_variable([$1], [$2])=no
$6],
[pgac_error([third argument of $0 must be `yes' or `no', not `$3'])])])[]dnl
])# PGAC_ARG_BOOL
# PGAC_ARG_REQ(TYPE, NAME, HELP-STRING, [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN])
# -------------------------------------------------------------------------------
# This option will require an argument; "yes" or "no" will not be
# accepted.
AC_DEFUN([PGAC_ARG_REQ],
[PGAC_ARG([$1], [$2], [$3],
[AC_MSG_ERROR([argument required for --$1-$2 option])],
[AC_MSG_ERROR([argument required for --$1-$2 option])],
[$4],
[$5])])# PGAC_ARG_REQ
# PGAC_ARG_OPTARG(TYPE, NAME, HELP-STRING, [DEFAULT-ACTION], [ARG-ACTION]
# [ACTION-ENABLED], [ACTION-DISABLED])
# -----------------------------------------------------------------------
# This will create an option that behaves as follows: If omitted, or
# called with "no", then set the enable_variable to "no" and do
# nothing else. If called with "yes", then execute DEFAULT-ACTION. If
# called with argument, set enable_variable to "yes" and execute
# ARG-ACTION. Additionally, execute ACTION-ENABLED if we ended up with
# "yes" either way, else ACTION-DISABLED.
#
# The intent is to allow enabling a feature, and optionally pass an
# additional piece of information.
AC_DEFUN([PGAC_ARG_OPTARG],
[PGAC_ARG([$1], [$2], [$3], [$4], [],
[pgac_arg_to_variable([$1], [$2])=yes
$5],
[pgac_arg_to_variable([$1], [$2])=no])
dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED.
ifelse([$6[]$7], [], [],
[
if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then
ifelse([$6], [], :, [$6])
ifelse([$7], [], [],
[else
$7
])[]dnl
fi
])[]dnl
])# PGAC_ARG_OPTARG

1583
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -37,19 +37,19 @@ AC_CANONICAL_HOST
template=
AC_MSG_CHECKING([which template to use])
# check if --with-template was given
if test x"${with_template+set}" = xset ; then
case $with_template in
yes|no) AC_MSG_ERROR([You must supply an argument to the --with-template option.]);;
PGAC_ARG_REQ(with, template, [],
[
case $withval in
list) echo; ls "$srcdir/src/template"; exit;;
*) if test -f "$srcdir/src/template/$with_template" ; then
template=$with_template
template=$withval
else
AC_MSG_ERROR([\`$with_template' is not a valid template name. Use \`list' for a list.])
AC_MSG_ERROR([\`$withval' is not a valid template name. Use \`list' for a list.])
fi;;
esac
else # --with-template not given
],
[
# --with-template not given
case $host_os in
aix*) template=aix ;;
@ -95,7 +95,7 @@ line.
])
fi
fi # --with-template not given
])
AC_MSG_RESULT([$template])
@ -136,57 +136,36 @@ AC_SUBST(TAS)
#
# Add non-standard directories to the include path
#
AC_ARG_WITH(includes, [ --with-includes=DIRS look for additional header files in DIRS],
[
case $withval in
yes | no) AC_MSG_ERROR([You must supply an argument to the --with-includes option.]);;
esac
])
PGAC_ARG_REQ(with, includes, [ --with-includes=DIRS look for additional header files in DIRS])
#
# Add non-standard directories to the library search path
#
AC_ARG_WITH(libraries, [ --with-libraries=DIRS look for additional libraries in DIRS],
[
case $withval in
yes | no) AC_MSG_ERROR([You must supply an argument to the --with-libraries option.]);;
esac
LIBRARY_DIRS=$withval
])
PGAC_ARG_REQ(with, libraries, [ --with-libraries=DIRS look for additional libraries in DIRS],
[LIBRARY_DIRS=$withval])
AC_ARG_WITH(libs, [ --with-libs=DIRS alternative spelling of --with-libraries],
[
case $withval in
yes | no) AC_MSG_ERROR([You must supply an argument to the --with-libs option.]);;
esac
LIBRARY_DIRS=$withval
])
PGAC_ARG_REQ(with, libs, [ --with-libs=DIRS alternative spelling of --with-libraries],
[LIBRARY_DIRS=$withval])
#
# Locale (--enable-locale)
#
AC_MSG_CHECKING([whether to build with locale support])
AC_ARG_ENABLE(locale, [ --enable-locale enable locale support],
[if test x"$enable_locale" != x"no" ; then
enable_locale=yes
AC_DEFINE(USE_LOCALE, 1, [Set to 1 if you want LOCALE support (--enable-locale)])
fi],
[enable_locale=no])
PGAC_ARG_BOOL(enable, locale, no, [ --enable-locale enable locale support],
[AC_DEFINE([USE_LOCALE], 1,
[Set to 1 if you want LOCALE support (--enable-locale)])])
AC_MSG_RESULT([$enable_locale])
#
# Cyrillic recode (--enable-recode)
# Character set recode (--enable-recode)
#
AC_MSG_CHECKING([whether to build with Cyrillic recode support])
AC_ARG_ENABLE(recode, [ --enable-recode enable cyrillic recode support],
[if test x"$enable_recode" != x"no" ; then
enable_recode=yes
AC_DEFINE(CYR_RECODE, 1, [Set to 1 if you want cyrillic recode support (--enable-recode)])
fi],
[enable_recode=no])
AC_MSG_CHECKING([whether to build with recode support])
PGAC_ARG_BOOL(enable, recode, no, [ --enable-recode enable character set recode support],
[AC_DEFINE([CYR_RECODE], 1,
[Set to 1 if you want cyrillic recode support (--enable-recode)])])
AC_MSG_RESULT([$enable_recode])
@ -195,45 +174,39 @@ AC_MSG_RESULT([$enable_recode])
#
MULTIBYTE=
AC_MSG_CHECKING([whether to build with multibyte character support])
AC_ARG_ENABLE(multibyte, [ --enable-multibyte enable multibyte character support],
PGAC_ARG_OPTARG(enable, multibyte, [ --enable-multibyte enable multibyte character support],
[MULTIBYTE=SQL_ASCII],
[
case $enableval in
no) enable_multibyte=no;;
yes) enable_multibyte=yes; MULTIBYTE=SQL_ASCII;;
SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
enable_multibyte=yes; MULTIBYTE=$enableval;;
*) AC_MSG_ERROR(
MULTIBYTE=$enableval;;
*)
AC_MSG_ERROR(
[argument to --enable-multibyte must be one of:
SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
UNICODE, MULE_INTERNAL,
LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
KOI8, WIN, ALT
Or do not specify an argument to the option to use the default.]) ;;
Or do not specify an argument to the option to use the default.]);;
esac
],
[enable_multibyte=no])
AC_SUBST(MULTIBYTE)
if test "$enable_multibyte" = yes ; then
[
AC_DEFINE(MULTIBYTE, 1, [Set to 1 if you want to use multibyte characters (--enable-multibyte)])
AC_MSG_RESULT([yes, default $MULTIBYTE])
else
AC_MSG_RESULT(no)
fi
],
[AC_MSG_RESULT(no)])
AC_SUBST(MULTIBYTE)
#
# Default port number (--with-pgport), default 5432
#
AC_MSG_CHECKING([for default port number])
AC_ARG_WITH(pgport, [ --with-pgport=PORTNUM change default port number [5432]],
[case $withval in
yes|no) AC_MSG_ERROR([You must supply an argument to the --with-pgport option]);;
*) default_port=$withval;;
esac
],
[default_port=5432])
PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number [5432]],
[default_port=$withval],
[default_port=5432])
# Need both of these because backend wants an integer and frontend a string
AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port})
AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
@ -244,13 +217,12 @@ AC_MSG_RESULT([$default_port])
# Maximum number of allowed connections (--with-maxbackends), default 32
#
AC_MSG_CHECKING([for default soft limit on number of connections])
AC_ARG_WITH(maxbackends, [ --with-maxbackends=N set default maximum number of connections [32]],
[case $withval in
yes|no) AC_MSG_ERROR([You must supply an argument to the --with-maxbackends option]);;
esac],
[with_maxbackends=32])
PGAC_ARG_REQ(with, maxbackends, [ --with-maxbackends=N set default maximum number of connections [32]],
[],
[with_maxbackends=32])
AC_MSG_RESULT([$with_maxbackends])
AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, [$with_maxbackends], [The default soft limit on the number of concurrent connections, i.e., the default for the postmaster -N switch (--with-maxbackends)])
AC_DEFINE_UNQUOTED([DEF_MAXBACKENDS], [$with_maxbackends],
[The default soft limit on the number of concurrent connections, i.e., the default for the postmaster -N switch (--with-maxbackends)])
#
@ -260,12 +232,7 @@ AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, [$with_maxbackends], [The default soft limit
# For historical reasons you can also use --with-CC to specify the C compiler
# to use, although the standard way to do this is to set the CC environment
# variable.
if test "${with_CC+set}" = set; then
case $with_CC in
yes | no) AC_MSG_ERROR([You must supply an argument to the --with-CC option.]);;
*) CC=$with_CC;;
esac
fi
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
@ -297,30 +264,24 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR, ["PostgreSQL $VERSION on $host, compiled by $
#
# Automatic dependency tracking
#
AC_ARG_ENABLE(depend, [ --enable-depend turn on automatic dependency tracking],
[
if test x"$enableval" = x"yes" ; then
autodepend=yes
fi
])
PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking],
[autodepend=yes])
AC_SUBST(autodepend)
#
# --enable-debug adds -g to compiler flags
# --disable-debug will forcefully remove it
AC_MSG_CHECKING(setting debug compiler flag)
AC_ARG_ENABLE(debug, [ --enable-debug build with debugging symbols (-g)],
[
case $enableval in
yes) CFLAGS="$CFLAGS -g"
AC_MSG_RESULT(yes)
;;
*) CFLAGS=`echo "$CFLAGS" | sed -e 's/ -g/ /g' -e 's/^-g//'`
AC_MSG_RESULT(no)
;;
esac
],
[AC_MSG_RESULT(using default)])
#
PGAC_ARG_BOOL(enable, debug, no, [ --enable-debug build with debugging symbols (-g)],
[CFLAGS="$CFLAGS -g"])
#
# Enable assert checks
#
PGAC_ARG_BOOL(enable, cassert, no, [ --enable-cassert enable assertion checks (for debugging)],
[AC_DEFINE([USE_ASSERT_CHECKING], 1,
[Define to 1 to build with assertion checks])])
#
@ -357,80 +318,46 @@ IFS=$ac_save_IFS
dnl We exclude tcl support unless user says --with-tcl
# We exclude tcl support unless user says --with-tcl
AC_MSG_CHECKING(setting USE_TCL)
AC_ARG_WITH(
tcl,
[ --with-tcl build Tcl interfaces and pgtclsh ],
[
case "$withval" in
y | ye | yes) USE_TCL=true; USE_TK=true; AC_MSG_RESULT(enabled) ;;
*) USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled) ;;
esac
],
[ USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled) ]
)
PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl interfaces and pgtclsh],
[USE_TCL=true; USE_TK=true; AC_MSG_RESULT(enabled)],
[USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled)])
AC_SUBST(USE_TCL)
AC_SUBST(USE_TK)
dnl We see if the path to the TCL/TK configuration scripts is specified.
dnl This will override the use of tclsh to find the paths to search.
# 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.
AC_ARG_WITH(tclconfig,
[ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-tclconfig option.])
;;
esac
TCL_DIRS="$withval"
]
)
dnl We see if the path to the TK configuration scripts is specified.
dnl This will override the use of tclsh to find the paths to search.
AC_ARG_WITH(tkconfig,
[ --with-tkconfig=DIR tkConfig.sh is in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-tkconfig option.])
;;
esac
TK_DIRS="$withval"
]
)
PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR],
[TCL_DIRS=$withval])
dnl
dnl Optionally build Perl modules (Pg.pm and PL/Perl)
dnl
AC_MSG_CHECKING(whether to build Perl modules)
AC_ARG_WITH(perl, [ --with-perl build Perl interface and plperl],
[if test x"${withval}" = x"yes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
# 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],
[TK_DIRS=$withval])
#
# Optionally build Perl modules (Pg.pm and PL/Perl)
#
AC_MSG_CHECKING([whether to build Perl modules])
PGAC_ARG_BOOL(with, perl, no, [ --with-perl build Perl interface and PL/Perl])
AC_MSG_RESULT([$with_perl])
AC_SUBST(with_perl)
dnl
dnl Optionally build Python interface module
dnl
AC_MSG_CHECKING(whether to build Python modules)
AC_ARG_WITH(python, [ --with-python build Python interface module],
[if test x"${withval}" = x"yes" ; then
AC_MSG_RESULT(yes)
PGAC_PROG_PYTHON
PGAC_PATH_PYTHONDIR
else
AC_MSG_RESULT(no)
fi],
#
# Optionally build Python interface module
#
AC_MSG_CHECKING([whether to build Python modules])
PGAC_ARG_BOOL(with, python, no, [ --with-python build Python interface module],
[AC_MSG_RESULT(yes)
PGAC_PROG_PYTHON
PGAC_PATH_PYTHONDIR],
[AC_MSG_RESULT(no)])
AC_SUBST(with_python)
@ -448,23 +375,12 @@ dnl is non-standard.
#
# Kerberos 4
#
AC_ARG_WITH(krb4, [ --with-krb4[=DIR] use Kerberos 4 [/usr/athena]],
[if test x"$withval" != x"no"; then
if test x"$withval" != x"yes"; then
krb4_prefix=$withval
else
krb4_prefix=/usr/athena
fi
with_krb4=yes
else
with_krb4=no
fi],
[with_krb4=no])
AC_SUBST(with_krb4)
if test "$with_krb4" = yes ; then
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_DEFINE(KRB4, [], [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"; then
if test -d "$krb4_prefix/include"; then
@ -475,35 +391,26 @@ if test "$with_krb4" = yes ; then
LIBS="$krb_libdir $LIBS"
fi
fi
dnl Test for these libraries is below
# Test for these libraries is below
KRB_LIBS="$krb_libdir -lkrb -ldes"
krb_srvtab='/etc/srvtab'
fi
krb_srvtab="/etc/srvtab"
])
AC_SUBST(with_krb4)
#
# Kerberos 5
#
AC_ARG_WITH(krb5, [ --with-krb5[=DIR] use Kerberos 5 [/usr/athena]],
[if test x"$withval" != x"no"; then
if test x"$withval" != x"yes"; then
krb5_prefix=$withval
else
krb5_prefix=/usr/athena
fi
with_krb5=yes
else
with_krb5=no
fi],
[with_krb5=no])
AC_SUBST(with_krb5)
if test "$with_krb5" = yes ; then
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_DEFINE(KRB5,, [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; then
if test -d "$krb5_prefix"; then
if test -d "$krb5_prefix/include"; then
INCLUDES="$INCLUDES -I$krb5_prefix/include"
fi
@ -513,11 +420,13 @@ if test "$with_krb5" = yes ; then
fi
fi
dnl Test for these libraries is below
# Test for these libraries is below
KRB_LIBS="$krb_libdir -lkrb5 -lcrypto -lcom_err"
krb_srvtab='FILE:$(sysconfdir)/krb5.keytab'
fi
krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
])
AC_SUBST(with_krb5)
# Using both Kerberos 4 and Kerberos 5 at the same time isn't going to work.
@ -525,7 +434,6 @@ if test "$with_krb4" = yes && test "$with_krb5" = yes ; then
AC_MSG_ERROR([Kerberos 4 and Kerberos 5 support cannot be combined])
fi
AC_SUBST(krb_srvtab)
dnl Necessary for special libpq link
AC_SUBST(KRB_LIBS)
@ -534,37 +442,25 @@ AC_SUBST(KRB_LIBS)
#
# Kerberos configuration parameters
#
AC_ARG_WITH(krb-srvnam, [ --with-krb-srvnam=NAME name of the Postgres service principal in Kerberos],
[if test x"$withval" = x"yes"; then
AC_MSG_ERROR([argument required for --with-krb-srvnam])
else
krb_srvnam=$withval
fi],
[krb_srvnam="postgres"])
AC_DEFINE_UNQUOTED(PG_KRB_SRVNAM, ["$krb_srvnam"], [The name of the Postgres service principal])
PGAC_ARG_REQ(with, krb-srvnam,
[ --with-krb-srvnam=NAME name of the PostgreSQL service principal in Kerberos],
[],
[with_krb_srvnam="postgres"])
AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"],
[The name of the PostgreSQL service principal in Kerberos])
#
# OpenSSL
#
AC_ARG_WITH(openssl, [ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]],
[if test x"$withval" != x"no" ; then
if test x"$withval" != x"yes" ; then
openssl_prefix=$withval
else
openssl_prefix=/usr/local/ssl
fi
with_openssl=yes
else
with_openssl=no
fi],
[with_openssl=no])
AC_SUBST(with_openssl)
if test "$with_openssl" = yes ; then
PGAC_ARG_OPTARG(with, openssl,
[ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]],
[openssl_prefix=/usr/local/ssl],
[openssl_prefix=$withval],
[
AC_MSG_RESULT([building with OpenSSL support])
AC_DEFINE([USE_SSL], [], [Define to build with (Open)SSL support])
AC_DEFINE([USE_SSL], 1, [Define to build with (Open)SSL support])
if test -d "${openssl_prefix}/include" ; then
INCLUDES="$INCLUDES -I${openssl_prefix}/include"
@ -576,7 +472,9 @@ if test "$with_openssl" = yes ; then
openssl_libdir="${openssl_prefix}"
LIBS="$LIBS -L${openssl_prefix}"
fi
fi
])
AC_SUBST(with_openssl)
# OpenSSL and Kerberos 5 both have a `crypto' library, so if you want to
@ -586,54 +484,31 @@ if test "$with_openssl" = yes && test "$with_krb5" = yes ; then
fi
dnl
dnl Optionally enable the building of the ODBC driver
dnl
#
# Optionally enable the building of the ODBC driver
#
dnl Old option name
if test "x${with_odbc+set}" = xset && test "x${enable_odbc+set}" != xset; then
# Old option name
if test "${with_odbc+set}" = set && test "${enable_odbc+set}" != set; then
enable_odbc=$with_odbc
fi
AC_MSG_CHECKING(whether to build the ODBC driver)
AC_ARG_ENABLE(odbc, [ --enable-odbc build the ODBC driver package],
[if test x"$enableval" = x"yes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
AC_SUBST(enable_odbc)
AC_MSG_CHECKING([whether to build the ODBC driver])
PGAC_ARG_BOOL(enable, odbc, no, [ --enable-odbc build the ODBC driver package])
AC_MSG_RESULT([$enable_odbc])
AC_SUBST([enable_odbc])
dnl Allow for overriding the default location of the odbcinst.ini
dnl file which is normally ${datadir} (i.e., ${prefix}/share).
if test x"$enable_odbc" = x"yes" ; then
AC_ARG_WITH(odbcinst, [ --with-odbcinst=DIR default directory for odbcinst.ini [sysconfdir]],
[if test x"$with_odbcinst" = x"yes" || test x"$with_odbcinst" = x"no" ; then
AC_MSG_ERROR([You must supply an argument to the --with-odbcinst option.])
fi
odbcinst_ini_dir=$withval],
[odbcinst_ini_dir='${sysconfdir}'])
else
odbcinst_ini_dir='${sysconfdir}'
fi
AC_SUBST(odbcinst_ini_dir)
# Allow for overriding the default location of the odbcinst.ini
# file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
PGAC_ARG_REQ(with, odbcinst,
[ --with-odbcinst=DIR default directory for odbcinst.ini [sysconfdir]],
[odbcinst_ini_dir=$withval],
[odbcinst_ini_dir="\${sysconfdir}"])
AC_SUBST([odbcinst_ini_dir])
dnl Unless we specify the command line options
dnl --enable cassert to explicitly enable it
dnl If you do not explicitly do it, it defaults to disabled
AC_MSG_CHECKING(setting ASSERT CHECKING)
AC_ARG_ENABLE(
cassert,
[ --enable-cassert enable assertion checks (for debugging) ],
AC_DEFINE(USE_ASSERT_CHECKING) AC_MSG_RESULT(enabled),
AC_MSG_RESULT(disabled)
)
# Assume system is ELF if it predefines __ELF__ as 1,
# otherwise believe host_os based default.
case $host_os in
@ -655,28 +530,22 @@ AC_SUBST(ELF_SYS)
dnl
dnl Optionally build C++ code (i.e., libpq++)
dnl
#
# Optionally build C++ code (i.e., libpq++)
#
AC_MSG_CHECKING([whether to build C++ modules])
AC_ARG_WITH(CXX, [ --with-CXX build C++ modules (libpq++)],
[if test x"$withval" != x"no"; then
if test x"$withval" != x"yes" ; then
CXX=$withval
fi
with_CXX=yes
fi],
[with_CXX=no])
AC_MSG_RESULT([$with_CXX])
AC_SUBST(with_CXX)
if test $with_CXX = yes; then
PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++)],
[],
[CXX=$withval],
[
AC_MSG_RESULT(yes)
AC_PROG_CXX
AC_PROG_CXXCPP
PGAC_CLASS_STRING
PGAC_CXX_NAMESPACE_STD
fi
],
[AC_MSG_RESULT(no)])
AC_SUBST(with_CXX)
CPPFLAGS="$CPPFLAGS $INCLUDES"
@ -987,12 +856,13 @@ AC_TRY_LINK([#include <setjmp.h>],
[AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
AC_ARG_ENABLE(syslog, [ --enable-syslog enable logging to syslog],
[case $enableval in y|ye|yes)
AC_CHECK_FUNC(syslog, [AC_DEFINE(ENABLE_SYSLOG)], [AC_MSG_ERROR([no syslog interface found])])
;;
esac]
)
PGAC_ARG_BOOL(enable, syslog, no, [ --enable-syslog enable logging to syslog],
[AC_CHECK_FUNC(syslog,
[AC_DEFINE([ENABLE_SYSLOG], 1,
[Define to 1 if to enable the syslogging code])],
[AC_MSG_ERROR([no syslog interface found])])])
dnl Check to see if we have a working 64-bit integer type.
dnl This breaks down into two steps:
@ -1250,13 +1120,6 @@ See the file 'config.log' for further diagnostics.])
LDFLAGS="$ice_save_LDFLAGS"
fi
# Wait with these until we're done so no tests fail because of too
# many warnings.
if test x"$GCC" = x"yes" ; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations"
fi
dnl Finally ready to produce output files ...
AC_OUTPUT(

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.93 2000/09/08 18:29:20 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.94 2000/09/21 20:17:43 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@ -156,6 +156,9 @@ CXX=@CXX@
CXXFLAGS=@CXXFLAGS@ @INCLUDES@
GCC = @GCC@
ifeq ($(GCC), yes)
CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
endif
##############################################################################
#