From ccba357f634fbfc05dab5129a75eb5b7bc2b0c42 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 16 Mar 2004 09:05:22 +0000 Subject: [PATCH] * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override values selected in configure.host. Require both to be defined before setting BFD_HOST_64_BIT_DEFINED. Protect assignment to corresponding BFD_HOST vars with quotes. <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc; Always require BFD_HOST_64_BIT_DEFINED. : Find off_t size before emitting message. Combine off_t and ftello64 conditional. * configure: Regenerate. --- bfd/ChangeLog | 12 +++++++++ bfd/configure | 63 +++++++++++++++++++++++------------------------- bfd/configure.in | 33 +++++++++++-------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6ea8786e6b..95135726df 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,15 @@ +2004-03-16 Alan Modra + + * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override + values selected in configure.host. Require both to be defined + before setting BFD_HOST_64_BIT_DEFINED. Protect assignment to + corresponding BFD_HOST vars with quotes. + <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc; + Always require BFD_HOST_64_BIT_DEFINED. + : Find off_t size before emitting message. Combine + off_t and ftello64 conditional. + * configure: Regenerate. + 2004-03-16 Alan Modra * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer diff --git a/bfd/configure b/bfd/configure index b2625651f9..ab9049b058 100755 --- a/bfd/configure +++ b/bfd/configure @@ -4615,18 +4615,18 @@ EOF if test "x${ac_cv_sizeof_long}" = "x8"; then host64=true - HOST_64BIT_TYPE="long" + BFD_HOST_64BIT_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" elif test "x${ac_cv_sizeof_long_long}" = "x8"; then - HOST_64BIT_TYPE="long long" - HOST_U_64BIT_TYPE="unsigned long long" + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" fi -if test "x${HOST_64BIT_TYPE}" = "xlong"; then - BFD_HOST_64BIT_LONG=1 -elif test "x${HOST_64BIT_TYPE}" != "x"; then +if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then BFD_HOST_64_BIT_DEFINED=1 - BFD_HOST_64_BIT=${HOST_64BIT_TYPE} - BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE} + BFD_HOST_64_BIT="${HOST_64BIT_TYPE}" + BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}" fi @@ -6579,7 +6579,7 @@ case ${host64}-${target64}-${want64} in wordsize=64 bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' - if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then + if test $BFD_HOST_64_BIT_DEFINED = 0; then echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2 fi @@ -6683,19 +6683,15 @@ else fi done -echo $ac_n "checking file_ptr type""... $ac_c" 1>&6 -echo "configure:6688: checking file_ptr type" >&5 -bfd_file_ptr="long" -bfd_ufile_ptr="unsigned long" if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:6693: checking size of off_t" >&5 +echo "configure:6689: checking size of off_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -6705,7 +6701,7 @@ int main() { switch (0) case 0: case (sizeof (off_t) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:6709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_off_t=$ac_size else @@ -6727,12 +6723,13 @@ cat >> confdefs.h <&6 +echo "configure:6729: checking file_ptr type" >&5 +bfd_file_ptr="long" +bfd_ufile_ptr="unsigned long" +if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ + -o x"${ac_cv_sizeof_off_t}" = x8; then bfd_file_ptr=BFD_HOST_64_BIT bfd_ufile_ptr=BFD_HOST_U_64_BIT fi @@ -6753,17 +6750,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6757: checking for $ac_hdr" >&5 +echo "configure:6754: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6792,12 +6789,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6796: checking for $ac_func" >&5 +echo "configure:6793: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6821: \"$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 @@ -6845,7 +6842,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6849: checking for working mmap" >&5 +echo "configure:6846: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6853,7 +6850,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -7031,12 +7028,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7035: checking for $ac_func" >&5 +echo "configure:7032: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7060: \"$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 diff --git a/bfd/configure.in b/bfd/configure.in index 851be41ff3..e08a663dcd 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -132,20 +132,18 @@ fi AC_COMPILE_CHECK_SIZEOF(long) if test "x${ac_cv_sizeof_long}" = "x8"; then host64=true - HOST_64BIT_TYPE="long" - HOST_U_64BIT_TYPE="unsigned long" + BFD_HOST_64BIT_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" elif test "x${ac_cv_sizeof_long_long}" = "x8"; then - HOST_64BIT_TYPE="long long" - HOST_U_64BIT_TYPE="unsigned long long" + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" fi -if test "x${HOST_64BIT_TYPE}" = "xlong"; then - BFD_HOST_64BIT_LONG=1 -fi -if test "x${HOST_64BIT_TYPE}" != "x"; then +if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then BFD_HOST_64_BIT_DEFINED=1 - BFD_HOST_64_BIT=${HOST_64BIT_TYPE} - BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE} + BFD_HOST_64_BIT="${HOST_64BIT_TYPE}" + BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}" fi AC_SUBST(BFD_HOST_64BIT_LONG) @@ -890,7 +888,7 @@ case ${host64}-${target64}-${want64} in wordsize=64 bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' - if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then + if test $BFD_HOST_64_BIT_DEFINED = 0; then AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) AC_MSG_WARN([your compiler may not have a 64 bit integral type]) fi @@ -927,17 +925,14 @@ AC_SUBST(bfd_default_target_size) # Hopefully a reasonable assumption since fseeko et.al. should be # upward compatible. AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64) -AC_MSG_CHECKING([file_ptr type]) -bfd_file_ptr="long" -bfd_ufile_ptr="unsigned long" if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then AC_COMPILE_CHECK_SIZEOF(off_t) - if test "x${ac_cv_sizeof_off_t}" = "x8"; then - bfd_file_ptr=BFD_HOST_64_BIT - bfd_ufile_ptr=BFD_HOST_U_64_BIT - fi fi -if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes; then +AC_MSG_CHECKING([file_ptr type]) +bfd_file_ptr="long" +bfd_ufile_ptr="unsigned long" +if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ + -o x"${ac_cv_sizeof_off_t}" = x8; then bfd_file_ptr=BFD_HOST_64_BIT bfd_ufile_ptr=BFD_HOST_U_64_BIT fi -- 2.34.1