diff options
| author | Peter Eisentraut | 2002-07-27 20:10:05 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2002-07-27 20:10:05 +0000 |
| commit | b0c3c48eb3779d9637a03c455f3934d9d7c08030 (patch) | |
| tree | 4fbf5c8d94ae2534735e1b7935edb40d6205cc44 /configure.in | |
| parent | c3fdf8925ed7fbb3017be052e0700c51ceb12e0b (diff) | |
Assemble portability modules into libpgport library.
Some makefile simplifications.
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 88 |
1 files changed, 31 insertions, 57 deletions
diff --git a/configure.in b/configure.in index 8650e126e86..8ea4f1f15fc 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Header: /cvsroot/pgsql/configure.in,v 1.193 2002/07/19 17:35:09 momjian Exp $ +dnl $Header: /cvsroot/pgsql/configure.in,v 1.194 2002/07/27 20:10:03 petere Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -747,6 +747,7 @@ fi ## ## Header files ## + 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/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h]) @@ -798,6 +799,7 @@ fi ## ## Types, structures, compiler characteristics ## + m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that. AC_C_CONST AC_C_INLINE @@ -840,12 +842,13 @@ fi ## ## Functions, global variables ## + PGAC_VAR_INT_TIMEZONE AC_FUNC_ACCEPT_ARGTYPES PGAC_FUNC_GETTIMEOFDAY_1ARG # SunOS doesn't handle negative byte comparisons properly with +/- return -PGAC_FUNC_MEMCMP +AC_FUNC_MEMCMP AC_CHECK_FUNCS([cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync]) @@ -870,10 +873,9 @@ fi # also decide to use snprintf.c if snprintf() is present but does not # have working "long long int" support -- see below. -SNPRINTF='' -AC_CHECK_FUNCS(snprintf, [], SNPRINTF='$(top_builddir)/src/port/snprintf.o') -AC_CHECK_FUNCS(vsnprintf, [], SNPRINTF='$(top_builddir)/src/port/snprintf.o') -AC_SUBST(SNPRINTF) +pgac_need_repl_snprintf=no +AC_CHECK_FUNCS(snprintf, [], pgac_need_repl_snprintf=yes) +AC_CHECK_FUNCS(vsnprintf, [], pgac_need_repl_snprintf=yes) # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not, @@ -895,49 +897,18 @@ AC_CACHE_CHECK([for isinf], ac_cv_func_isinf, if test $ac_cv_func_isinf = yes ; then AC_DEFINE(HAVE_ISINF, 1, [Define to 1 if you have isinf()]) - ISINF= else - ISINF='isinf.o' + AC_LIBOBJ(isinf) # Look for a way to implement a substitute for isinf() AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break]) fi -AC_SUBST(ISINF) - - -AC_CHECK_FUNCS(getrusage, [], GETRUSAGE='$(top_builddir)/src/port/getrusage.o') -AC_SUBST(GETRUSAGE) -AC_CHECK_FUNCS(srandom, [], SRANDOM='$(top_builddir)/src/port/srandom.o') -AC_SUBST(SRANDOM) -AC_CHECK_FUNCS(gethostname, [], GETHOSTNAME='$(top_builddir)/src/port/gethostname.o') -AC_SUBST(GETHOSTNAME) -AC_CHECK_FUNCS(random, [], MISSING_RANDOM='$(top_builddir)/src/port/random.o') -AC_SUBST(MISSING_RANDOM) -AC_CHECK_FUNCS(inet_aton, [], INET_ATON='$(top_builddir)/src/port/inet_aton.o') -AC_SUBST(INET_ATON) -AC_CHECK_FUNCS(strerror, [], STRERROR='$(top_builddir)/src/port/strerror.o') -AC_SUBST(STRERROR) -AC_CHECK_FUNCS(strdup, [], STRDUP='$(top_builddir)/src/port/strdup.o') -AC_SUBST(STRDUP) -AC_CHECK_FUNCS(strtol, [], STRTOL='$(top_builddir)/src/port/strtol.o') -AC_SUBST(STRTOL) -AC_CHECK_FUNCS(strtoul, [], STRTOUL='$(top_builddir)/src/port/strtoul.o') -AC_SUBST(STRTOUL) -AC_CHECK_FUNCS(strcasecmp, [], STRCASECMP='$(top_builddir)/src/port/strcasecmp.o') -AC_SUBST(STRCASECMP) - -# Set path of dllinit.c for cygwin -DLLINIT="" -case $host_os in - cygwin*) DLLINIT='$(top_builddir)/src/backend/port/dllinit.o' ;; -esac -AC_SUBST(DLLINIT) -# Set path of qsort for solaris, which has a very slow qsort in certain cases. -QSORT="" +AC_REPLACE_FUNCS([gethostname getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul]) + +# Solaris has a very slow qsort in certain cases. case $host_os in - solaris*) DLLINIT='$(top_builddir)/src/backend/port/qsort.o' ;; + solaris*) AC_LIBOBJ(qsort) ;; esac -AC_SUBST(QSORT) # 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. @@ -992,6 +963,14 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset']) fi +AC_CHECK_FUNCS([strtoll strtoq], [break]) +AC_CHECK_FUNCS([strtoull strtouq], [break]) + +# Check for one of atexit() or on_exit() +AC_CHECK_FUNCS(atexit, [], + [AC_CHECK_FUNCS(on_exit, [], + [AC_MSG_ERROR([neither atexit() nor on_exit() found])])]) + # This test makes sure that run tests work at all. Sometimes a shared # library is found by the linker, but the runtime linker can't find it. @@ -1047,8 +1026,8 @@ dnl We cope with snprintfs that use either %lld or %qd as the format. dnl If neither works, fall back to our own snprintf emulation (which we dnl know uses %lld). -if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then - if [[ x$SNPRINTF = x ]] ; then +if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then + if test $pgac_need_repl_snprintf = no; then AC_MSG_CHECKING(whether snprintf handles 'long long int' as %lld) AC_TRY_RUN([#include <stdio.h> typedef long long int int64; @@ -1108,17 +1087,17 @@ main() { ], [ AC_MSG_RESULT(no) # Force usage of our own snprintf, since system snprintf is broken - SNPRINTF='$(top_builddir)/src/port/snprintf.o' + pgac_need_repl_snprintf=yes INT64_FORMAT='"%lld"' ], - [ AC_MSG_RESULT(assuming not on target machine) + [ AC_MSG_RESULT([cannot test (not on host machine)]) # Force usage of our own snprintf, since we cannot test foreign snprintf - SNPRINTF='$(top_builddir)/src/port/snprintf.o' + pgac_need_repl_snprintf=yes INT64_FORMAT='"%lld"' ]) ], - [ AC_MSG_RESULT(assuming not on target machine) + [ AC_MSG_RESULT([cannot test (not on host machine)]) # Force usage of our own snprintf, since we cannot test foreign snprintf - SNPRINTF='$(top_builddir)/src/port/snprintf.o' + pgac_need_repl_snprintf=yes INT64_FORMAT='"%lld"' ]) else @@ -1133,14 +1112,9 @@ fi AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT, [Define this as the appropriate snprintf format for 64-bit ints, if any]) - -AC_CHECK_FUNCS([strtoll strtoq], [break]) -AC_CHECK_FUNCS([strtoull strtouq], [break]) - -# Check for one of atexit() or on_exit() -AC_CHECK_FUNCS(atexit, [], - [AC_CHECK_FUNCS(on_exit, [], - [AC_MSG_ERROR([neither atexit() nor on_exit() found])])]) +if test $pgac_need_repl_snprintf = yes; then + AC_LIBOBJ(snprintf) +fi dnl Need a #define for the size of Datum (unsigned long) |
