mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# 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
|
||||
@ -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)
|
||||
# -------------------------
|
||||
# Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
|
||||
@ -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
|
||||
# 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.
|
||||
# as ALIGNOF_TYPE. This macro works even when cross compiling.
|
||||
# (Modelled after AC_CHECK_SIZEOF.)
|
||||
|
||||
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
|
||||
[AS_LITERAL_IF([$1], [],
|
||||
[AC_FATAL([$0: requires literal arguments])])dnl
|
||||
AC_CHECK_TYPE([$1], [], [], [$2])
|
||||
AC_CACHE_CHECK([alignment of $1], [AS_TR_SH([pgac_cv_alignof_$1])],
|
||||
[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
|
||||
_AC_COMPUTE_INT([((char*) & pgac_struct.field) - ((char*) & pgac_struct)],
|
||||
[AS_TR_SH([pgac_cv_alignof_$1])],
|
||||
[AC_INCLUDES_DEFAULT([$2])
|
||||
struct { char filler; $1 field; } pgac_struct;],
|
||||
[AC_MSG_ERROR([cannot compute alignment of $1, 77])])
|
||||
else
|
||||
AS_TR_SH([pgac_cv_alignof_$1])=0
|
||||
fi])dnl
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$1),
|
||||
[$AS_TR_SH([pgac_cv_alignof_$1])],
|
||||
[The alignment requirement of a `$1'])
|
||||
])# 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
|
||||
|
Reference in New Issue
Block a user