@ -224,107 +224,124 @@ if test "$LIBRARY_DIRS" -o "$SRCH_LIB"; then
done
done
fi
fi
##
## Command line options
##
AC_MSG_CHECKING(whether to support locale)
AC_ARG_ENABLE(
locale,
[ --enable-locale enable locale support ],
[AC_DEFINE(USE_LOCALE) AC_MSG_RESULT(enabled)],
AC_MSG_RESULT(disabled)
)
dnl We exclude cyrillic recode support unless we override it with
#
dnl --enable-recode to explicitly enable it
# Locale (--enable-locale)
dnl It defaults to disabled
#
AC_MSG_CHECKING(whether to support cyrillic recode)
AC_MSG_CHECKING([whether to build with locale support])
AC_ARG_ENABLE(
AC_ARG_ENABLE(locale, [ --enable-locale enable locale support],
recode,
[if test x"$enable_locale" != x"no" ; then
[ --enable-recode enable cyrillic recode support ],
enable_locale=yes
[AC_DEFINE(CYR_RECODE) AC_MSG_RESULT(enabled)],
AC_DEFINE(USE_LOCALE, [], [Set to 1 if you want LOCALE support (--enable-locale)])
AC_MSG_RESULT(disabled)
fi],
)
[enable_locale=no])
AC_MSG_RESULT([$enable_locale])
dnl Multibyte support
AC_MSG_CHECKING(whether to support multibyte)
#
AC_ARG_ENABLE(multibyte,
# Cyrillic recode (--enable-recode)
[ --enable-multibyte enable multibyte character support ],
#
[
AC_MSG_CHECKING([whether to build with Cyrillic recode support])
MULTIBYTE=SQL_ASCII
AC_ARG_ENABLE(recode, [ --enable-recode enable cyrillic recode support],
if test "$enableval" != "yes"; then
[if test x"$enable_recode" != x"no" ; then
case "$enableval" in
enable_recode=yes
SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
AC_DEFINE(CYR_RECODE, [], [Set to 1 if you want cyrillic recode support (--enable-recode)])
# ok
fi],
;;
[enable_recode=no])
*)
AC_MSG_RESULT([$enable_recode])
AC_MSG_ERROR(
[Argument to --enable-multibyte must be one of:
#
# Multibyte support
#
MULTIBYTE=
AC_MSG_CHECKING([whether to build with multibyte character support])
AC_ARG_ENABLE(multibyte, [ --enable-multibyte enable multibyte character support],
[
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(
[argument to --enable-multibyte must be one of:
SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
UNICODE, MULE_INTERNAL,
UNICODE, MULE_INTERNAL,
LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
KOI8, WIN, ALT
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
esac
MULTIBYTE=$enableval
],
fi
[enable_multibyte=no])
AC_DEFINE(MULTIBYTE)
AC_MSG_RESULT(enabled)
AC_SUBST(MULTIBYTE)
],
AC_MSG_RESULT("disabled")
)
dnl Old option variant
if test "$enable_multibyte" = yes ; then
if test "${with_mb}"; then
AC_DEFINE(MULTIBYTE, [], [Set to 1 if you want to use multibyte characters (--enable-multibyte)])
AC_MSG_ERROR([--with-mb is not supported anymore. Use --enable-multibyte instead.])
AC_MSG_RESULT([yes, default $MULTIBYTE])
else
AC_MSG_RESULT(no)
fi
fi
dnl We use the default value of 5432 for the DEF_PGPORT value. If
#
dnl we over-ride it with --with-pgport=port then we bypass this piece
# Default port number (--with-pgport), default 5432
AC_MSG_CHECKING(setting DEF_PGPORT)
#
AC_ARG_WITH(
AC_MSG_CHECKING([for default port number])
pgport,
AC_ARG_WITH(pgport, [ --with-pgport=PORTNUM change default port number [5432]],
[ --with-pgport=PORTNUM change default postmaster port ],
[case $withval in
[default_port="$withval"],
yes|no) AC_MSG_ERROR([You must supply an argument to the --with-pgport option]);;
[default_port=5432]
*) default_port=$withval;;
)
esac
dnl Need both of these because backend wants an integer and frontend a string
],
[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, ${default_port})
AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
AC_MSG_RESULT(${default_port} )
AC_MSG_RESULT([$default_port] )
dnl DEF_MAXBACKENDS can be set by --with-maxbackends. Default value is 32.
#
AC_MSG_CHECKING(setting DEF_MAXBACKENDS)
# Maximum number of allowed connections (--with-maxbackends), default 32
AC_ARG_WITH(
#
maxbackends,
AC_MSG_CHECKING([for default soft limit on number of connections])
[ --with-maxbackends=N set default maximum number of server processes ],
AC_ARG_WITH(maxbackends, [ --with-maxbackends=N set default maximum number of connections [32]],
AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, ${withval}) AC_MSG_RESULT($with_maxbackends),
[case $withval in
AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, 32) AC_MSG_RESULT(32)
yes|no) AC_MSG_ERROR([You must supply an argument to the --with-maxbackends option]);;
)
esac],
[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)])
dnl Check for C support (allow override if needed)
#
dnl Note: actually, setting CC environment variable works just as well.
# For historical reasons you can also use --with-CC to specify the C compiler
AC_ARG_WITH(CC,
# to use, although the standard way to do this is to set the CC environment
[ --with-CC=compiler use specific C compiler],
# variable.
[
#
case "$withval" in
if test "${with_CC+set}" = set; then
"" | y | ye | yes | n | no)
case $with_CC in
AC_MSG_ERROR([*** You must supply an argument to the --with-CC option.])
yes | no) AC_MSG_ERROR([You must supply an argument to the --with-CC option.]);;
;;
*) CC=$with_CC;;
esac
esac
CC="$withval"
fi
])
dnl Find a compiler if CC is not already set.
#
# C compiler
#
AC_PROG_CC
AC_PROG_CC
dnl Find CPP, then check traditional.
dnl Caution: these macros must be called in this order...
AC_PROG_CPP
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_GCC_TRADITIONAL
AC_SUBST(GCC)
AC_SUBST(GCC)
#
# Create compiler version string
#
if test x"$GCC" = x"yes" ; then
if test x"$GCC" = x"yes" ; then
cc_string="GCC `${CC} --version`"
cc_string="GCC `${CC} --version`"
else
else
@ -671,7 +688,6 @@ AC_SUBST(DL_LIB)
AC_SUBST(USE_TCL)
AC_SUBST(USE_TCL)
AC_SUBST(USE_TK)
AC_SUBST(USE_TK)
AC_SUBST(WISH)
AC_SUBST(WISH)
AC_SUBST(MULTIBYTE)
dnl
dnl
@ -748,6 +764,10 @@ AC_PROG_YACC
AC_SUBST(YFLAGS)
AC_SUBST(YFLAGS)
##
## Libraries
##
AC_CHECK_LIB(sfio, main)
AC_CHECK_LIB(sfio, main)
AC_CHECK_LIB(ncurses, main, [], [AC_CHECK_LIB(curses, main)])
AC_CHECK_LIB(ncurses, main, [], [AC_CHECK_LIB(curses, main)])
AC_CHECK_LIB(termcap, main)
AC_CHECK_LIB(termcap, main)
@ -795,31 +815,14 @@ if test "$with_openssl" = yes ; then
fi
fi
dnl
##
dnl Checks for header files.
## Header files
dnl
##
AC_HEADER_STDC
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h termios.h values.h])
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(dld.h)
AC_CHECK_HEADERS(endian.h)
AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(fp_class.h)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(netinet/in.h)
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])
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(termios.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(values.h)
AC_CHECK_HEADERS(sys/pstat.h)
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
AC_CHECK_HEADERS(sys/param.h pwd.h)
if test "$with_krb4" = yes ; then
if test "$with_krb4" = yes ; then
AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is required for Kerberos 4])])
AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is required for Kerberos 4])])
@ -836,26 +839,24 @@ if test "$with_openssl" = yes ; then
fi
fi
dnl
##
dnl Checks for typedefs, structures, and compiler characteristics.
## Types, structures, compiler characteristics
dnl
##
AC_C_CONST
AC_C_CONST
AC_C_INLINE
AC_C_INLINE
AC_C_STRINGIZE
AC_C_STRINGIZE
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_STRUCT_TIMEZONE
PGAC_C_SIGNED
PGAC_C_SIGNED
PGAC_C_VOLATILE
PGAC_C_VOLATILE
AC_FUNC_ACCEPT_ARGTYPES
AC_STRUCT_TIMEZONE
PGAC_UNION_SEMUN
##
## Functions, global variables
##
PGAC_VAR_INT_TIMEZONE
PGAC_VAR_INT_TIMEZONE
AC_FUNC_ACCEPT_ARGTYPES
PGAC_FUNC_GETTIMEOFDAY_1ARG
PGAC_FUNC_GETTIMEOFDAY_1ARG
PGAC_UNION_SEMUN
AC_MSG_CHECKING(for fcntl(F_SETLK))
AC_MSG_CHECKING(for fcntl(F_SETLK))
if test "$os" != linux ; then
if test "$os" != linux ; then
@ -871,13 +872,7 @@ else
AC_MSG_RESULT([broken on Linux])
AC_MSG_RESULT([broken on Linux])
fi
fi
dnl Checks for library functions.
AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid])
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(memmove sysconf)
AC_CHECK_FUNCS(sigprocmask waitpid setsid fcvt)
AC_CHECK_FUNCS(setproctitle pstat)
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(
@ -892,7 +887,6 @@ 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
AC_CHECK_FUNCS(fpclass fp_class fp_class_d class)
dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
dnl is missing. Yes, there are machines that have only one.
dnl is missing. Yes, there are machines that have only one.
dnl We may also decide to use snprintf.c if snprintf() is present but does
dnl We may also decide to use snprintf.c if snprintf() is present but does
@ -914,24 +908,26 @@ dnl declares vsnprintf() but not snprintf(). Hopefully there are no
dnl systems that are *that* brain-damaged...
dnl systems that are *that* brain-damaged...
AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL))
AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL))
AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL))
AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL))
dnl
dnl 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_MSG_CHECKING(for isinf)
AC_CACHE_CHECK([for isinf], ac_cv_func_isinf,
AC_CACHE_VAL(ac_cv_func_or_macro_isinf,
[AC_TRY_LINK(
[AC_TRY_LINK(
[#include <math.h>],
[#include <math.h>
],
[double x = 0.0; int res = isinf(x);],
[double x = 0.0; int res = isinf(x);],
[ac_cv_func_or_macro_ isinf=yes],
[ac_cv_func_isinf=yes],
[ac_cv_func_or_macro_ isinf=no])])
[ac_cv_func_isinf=no])])
if [[ $ac_cv_func_or_macro_isinf = yes ]]; then
AC_MSG_RESULT(yes)
if test $ac_cv_func_isinf = yes ; then
AC_DEFINE(HAVE_ISINF)
AC_DEFINE(HAVE_ISINF)
ISINF=''
ISINF=
else
else
AC_MSG_RESULT(no)
ISINF='isinf.o'
ISINF='isinf.o'
# Look for a way to implement a substitute for isinf()
AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
fi
fi
AC_SUBST(ISINF)
AC_SUBST(ISINF)
AC_CHECK_FUNC(getrusage,
AC_CHECK_FUNC(getrusage,
AC_DEFINE(HAVE_GETRUSAGE),
AC_DEFINE(HAVE_GETRUSAGE),
GETRUSAGE='getrusage.o')
GETRUSAGE='getrusage.o')
@ -1011,8 +1007,6 @@ AC_CHECK_FUNCS(filename_completion_function,
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION)
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION)
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
dnl Check for GNU style long options support (getopt_long)
AC_CHECK_FUNCS(getopt_long)
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)