Try to run empty test program before running any real AC_TRY_RUN's, to

prevent disguised failures.
This commit is contained in:
Peter Eisentraut 2001-03-14 18:00:09 +00:00
parent 5dd04603b9
commit 707c0ffdab
2 changed files with 102 additions and 53 deletions

139
configure vendored
View File

@ -6831,8 +6831,41 @@ EOF
fi
# 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.
# This check should come after all modifications of compiler or linker
# variables, and before any other run tests.
echo $ac_n "checking test program""... $ac_c" 1>&6
echo "configure:6840: checking test program" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""cross-compiling" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6845 "configure"
#include "confdefs.h"
int main() { return 0; }
EOF
if { (eval echo configure:6849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""ok" 1>&6
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
echo "$ac_t""failed" 1>&6
{ echo "configure: error:
*** Could not execute a simple test program. This may be a problem
*** related to locating shared libraries. Check the file 'config.log'
*** for the exact reason." 1>&2; exit 1; }
fi
rm -fr conftest*
fi
echo $ac_n "checking whether long int is 64 bits""... $ac_c" 1>&6
echo "configure:6836: checking whether long int is 64 bits" >&5
echo "configure:6869: checking whether long int is 64 bits" >&5
if eval "test \"`echo '$''{'pgac_cv_type_long_int_64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -6841,7 +6874,7 @@ else
echo "configure: warning: 64 bit arithmetic disabled when cross-compiling" 1>&2
else
cat > conftest.$ac_ext <<EOF
#line 6845 "configure"
#line 6878 "configure"
#include "confdefs.h"
typedef long int int64;
@ -6870,7 +6903,7 @@ main() {
exit(! does_int64_work());
}
EOF
if { (eval echo configure:6874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:6907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_type_long_int_64=yes
else
@ -6897,7 +6930,7 @@ fi
if test x"$HAVE_LONG_INT_64" = x"no" ; then
echo $ac_n "checking whether long long int is 64 bits""... $ac_c" 1>&6
echo "configure:6901: checking whether long long int is 64 bits" >&5
echo "configure:6934: checking whether long long int is 64 bits" >&5
if eval "test \"`echo '$''{'pgac_cv_type_long_long_int_64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -6906,7 +6939,7 @@ else
echo "configure: warning: 64 bit arithmetic disabled when cross-compiling" 1>&2
else
cat > conftest.$ac_ext <<EOF
#line 6910 "configure"
#line 6943 "configure"
#include "confdefs.h"
typedef long long int int64;
@ -6935,7 +6968,7 @@ main() {
exit(! does_int64_work());
}
EOF
if { (eval echo configure:6939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:6972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_type_long_long_int_64=yes
else
@ -6966,7 +6999,7 @@ fi
if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
if [ x$SNPRINTF = x ] ; then
echo $ac_n "checking whether snprintf handles 'long long int' as %lld""... $ac_c" 1>&6
echo "configure:6970: checking whether snprintf handles 'long long int' as %lld" >&5
echo "configure:7003: checking whether snprintf handles 'long long int' as %lld" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""assuming not on target machine" 1>&6
# Force usage of our own snprintf, since we cannot test foreign snprintf
@ -6975,7 +7008,7 @@ echo "configure:6970: checking whether snprintf handles 'long long int' as %lld"
else
cat > conftest.$ac_ext <<EOF
#line 6979 "configure"
#line 7012 "configure"
#include "confdefs.h"
#include <stdio.h>
typedef long long int int64;
@ -7002,7 +7035,7 @@ main() {
exit(! does_int64_snprintf_work());
}
EOF
if { (eval echo configure:7006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
INT64_FORMAT='"%lld"'
@ -7013,7 +7046,7 @@ else
rm -fr conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking whether snprintf handles 'long long int' as %qd""... $ac_c" 1>&6
echo "configure:7017: checking whether snprintf handles 'long long int' as %qd" >&5
echo "configure:7050: checking whether snprintf handles 'long long int' as %qd" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""assuming not on target machine" 1>&6
# Force usage of our own snprintf, since we cannot test foreign snprintf
@ -7022,7 +7055,7 @@ echo "configure:7017: checking whether snprintf handles 'long long int' as %qd"
else
cat > conftest.$ac_ext <<EOF
#line 7026 "configure"
#line 7059 "configure"
#include "confdefs.h"
#include <stdio.h>
typedef long long int int64;
@ -7049,7 +7082,7 @@ main() {
exit(! does_int64_snprintf_work());
}
EOF
if { (eval echo configure:7053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
INT64_FORMAT='"%qd"'
@ -7089,12 +7122,12 @@ EOF
for ac_func in strtoll strtoq
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7093: checking for $ac_func" >&5
echo "configure:7126: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7098 "configure"
#line 7131 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7117,7 +7150,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7144,12 +7177,12 @@ done
for ac_func in strtoull strtouq
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7148: checking for $ac_func" >&5
echo "configure:7181: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7153 "configure"
#line 7186 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7172,7 +7205,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7198,12 +7231,12 @@ done
echo $ac_n "checking for atexit""... $ac_c" 1>&6
echo "configure:7202: checking for atexit" >&5
echo "configure:7235: checking for atexit" >&5
if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7207 "configure"
#line 7240 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char atexit(); below. */
@ -7226,7 +7259,7 @@ atexit();
; return 0; }
EOF
if { (eval echo configure:7230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_atexit=yes"
else
@ -7249,12 +7282,12 @@ else
for ac_func in on_exit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7253: checking for $ac_func" >&5
echo "configure:7286: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7258 "configure"
#line 7291 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -7277,7 +7310,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -7310,7 +7343,7 @@ fi
echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
echo "configure:7314: checking size of unsigned long" >&5
echo "configure:7347: checking size of unsigned long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7318,7 +7351,7 @@ else
ac_cv_sizeof_unsigned_long=4
else
cat > conftest.$ac_ext <<EOF
#line 7322 "configure"
#line 7355 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -7329,7 +7362,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_unsigned_long=`cat conftestval`
else
@ -7355,7 +7388,7 @@ EOF
echo $ac_n "checking alignment of short""... $ac_c" 1>&6
echo "configure:7359: checking alignment of short" >&5
echo "configure:7392: checking alignment of short" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7363,7 +7396,7 @@ else
pgac_cv_alignof_short='sizeof(short)'
else
cat > conftest.$ac_ext <<EOF
#line 7367 "configure"
#line 7400 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; short field; } mystruct;
@ -7375,7 +7408,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_short=`cat conftestval`
else
@ -7395,7 +7428,7 @@ EOF
echo $ac_n "checking alignment of int""... $ac_c" 1>&6
echo "configure:7399: checking alignment of int" >&5
echo "configure:7432: checking alignment of int" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7403,7 +7436,7 @@ else
pgac_cv_alignof_int='sizeof(int)'
else
cat > conftest.$ac_ext <<EOF
#line 7407 "configure"
#line 7440 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; int field; } mystruct;
@ -7415,7 +7448,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_int=`cat conftestval`
else
@ -7435,7 +7468,7 @@ EOF
echo $ac_n "checking alignment of long""... $ac_c" 1>&6
echo "configure:7439: checking alignment of long" >&5
echo "configure:7472: checking alignment of long" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7443,7 +7476,7 @@ else
pgac_cv_alignof_long='sizeof(long)'
else
cat > conftest.$ac_ext <<EOF
#line 7447 "configure"
#line 7480 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long field; } mystruct;
@ -7455,7 +7488,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_long=`cat conftestval`
else
@ -7476,7 +7509,7 @@ EOF
if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
echo $ac_n "checking alignment of long long int""... $ac_c" 1>&6
echo "configure:7480: checking alignment of long long int" >&5
echo "configure:7513: checking alignment of long long int" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_long_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7484,7 +7517,7 @@ else
pgac_cv_alignof_long_long_int='sizeof(long long int)'
else
cat > conftest.$ac_ext <<EOF
#line 7488 "configure"
#line 7521 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; long long int field; } mystruct;
@ -7496,7 +7529,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_long_long_int=`cat conftestval`
else
@ -7517,7 +7550,7 @@ EOF
fi
echo $ac_n "checking alignment of double""... $ac_c" 1>&6
echo "configure:7521: checking alignment of double" >&5
echo "configure:7554: checking alignment of double" >&5
if eval "test \"`echo '$''{'pgac_cv_alignof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7525,7 +7558,7 @@ else
pgac_cv_alignof_double='sizeof(double)'
else
cat > conftest.$ac_ext <<EOF
#line 7529 "configure"
#line 7562 "configure"
#include "confdefs.h"
#include <stdio.h>
struct { char filler; double field; } mystruct;
@ -7537,7 +7570,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:7541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:7574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pgac_cv_alignof_double=`cat conftestval`
else
@ -7575,12 +7608,12 @@ EOF
echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
echo "configure:7579: checking for POSIX signal interface" >&5
echo "configure:7612: checking for POSIX signal interface" >&5
if eval "test \"`echo '$''{'pgac_cv_func_posix_signals'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7584 "configure"
#line 7617 "configure"
#include "confdefs.h"
#include <signal.h>
@ -7591,7 +7624,7 @@ act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);
; return 0; }
EOF
if { (eval echo configure:7595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
pgac_cv_func_posix_signals=yes
else
@ -7621,7 +7654,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7625: checking for $ac_word" >&5
echo "configure:7658: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7657,7 +7690,7 @@ test -n "$TCLSH" && break
done
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
echo "configure:7661: checking for tclConfig.sh" >&5
echo "configure:7694: checking for tclConfig.sh" >&5
# Let user override test
if test -z "$TCL_CONFIG_SH"; then
pgac_test_dirs="$with_tclconfig"
@ -7690,7 +7723,7 @@ fi
# Check for Tk configuration script tkConfig.sh
if test "$with_tk" = yes; then
echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
echo "configure:7694: checking for tkConfig.sh" >&5
echo "configure:7727: checking for tkConfig.sh" >&5
# Let user override test
if test -z "$TK_CONFIG_SH"; then
pgac_test_dirs="$with_tkconfig $with_tclconfig"
@ -7729,7 +7762,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7733: checking for $ac_word" >&5
echo "configure:7766: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NSGMLS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7765,7 +7798,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7769: checking for $ac_word" >&5
echo "configure:7802: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_JADE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7796,7 +7829,7 @@ done
echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
echo "configure:7800: checking for DocBook V3.1" >&5
echo "configure:7833: checking for DocBook V3.1" >&5
if eval "test \"`echo '$''{'pgac_cv_check_docbook'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7829,7 +7862,7 @@ have_docbook=$pgac_cv_check_docbook
echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
echo "configure:7833: checking for DocBook stylesheets" >&5
echo "configure:7866: checking for DocBook stylesheets" >&5
if eval "test \"`echo '$''{'pgac_cv_path_stylesheets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7868,7 +7901,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7872: checking for $ac_word" >&5
echo "configure:7905: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else

View File

@ -943,6 +943,22 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
AC_DEFINE(HAVE_INT_OPTRESET, 1)
fi
# 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.
# This check should come after all modifications of compiler or linker
# variables, and before any other run tests.
AC_MSG_CHECKING([test program])
AC_TRY_RUN([int main() { return 0; }],
[AC_MSG_RESULT(ok)],
[AC_MSG_RESULT(failed)
AC_MSG_ERROR([[
*** Could not execute a simple test program. This may be a problem
*** related to locating shared libraries. Check the file 'config.log'
*** for the exact reason.]])],
[AC_MSG_RESULT([cross-compiling])])
dnl Check to see if we have a working 64-bit integer type.
dnl This breaks down into two steps:
dnl (1) figure out if the compiler has a 64-bit int type with working