From ba3cb84c9f999f8804f63ef6c25579ddb0e73821 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Thu, 24 Sep 2020 13:44:55 +0900 Subject: [PATCH] Call AC_CHECK_SIZEOF() or AC_CHECK_TYPES() macros at earlier stage where LIBS variable isn't set yet. These macros compile and run some programs. On some platforms(with some linker options like --no-as-needed in Lnux Gnu linker) the programs try to link libraries specified by LIBS variable at run time. There are some cases that the programs fail due to missing library which is actually not needed and AC_CHECK_SIZEOF() returns 0. --- configure.ac | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index a019190..51ffa1a 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,17 @@ AC_PROG_CC AM_CONDITIONAL([GCC], [test -n "$GCC"]) +# All AC_CHECK_SIZEOF() or AC_CHECK_TYPES() calls were move from 4. +# unixODBC wants the following to get sane behavior for ODBCINT64 +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long int) # for unixODBC +AC_CHECK_SIZEOF(void *) +AC_CHECK_TYPES([long long]) +AC_CHECK_TYPES([signed char]) +AC_CHECK_TYPES([ssize_t]) +AC_TYPE_SIZE_T + +# Check if "-Wall" is valid if test -n "$GCC" && test "$ac_test_CFLAGS" != set; then AC_MSG_CHECKING(-Wall is a valid compile option) @@ -231,17 +242,7 @@ AC_CHECK_HEADER(libpq-fe.h,,[AC_MSG_ERROR([libpq header not found])]) AC_HEADER_TIME -# 4. Types - -# unixODBC wants the following to get sane behavior for ODBCINT64 -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(long int) # for unixODBC -AC_CHECK_SIZEOF(void *) -AC_CHECK_TYPES(long long) -AC_CHECK_TYPES(signed char) - -AC_CHECK_TYPES(ssize_t) -AC_TYPE_SIZE_T +# 4. Types(all members were moved to 0.) # 5. Structures -- 2.39.5