From: Andrew Cagney Date: Wed, 11 Feb 2004 22:01:00 +0000 (+0000) Subject: 2004-02-11 Andrew Cagney X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1012372a47e4ca5a02b255b13553d0c288facff9;p=binutils-gdb.git 2004-02-11 Andrew Cagney * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64, fseeko and fseeko64. Determine bfd_file_ptr. * configure: Re-generate. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 81c80d3f2b2..2ffe1cde999 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2004-02-11 Andrew Cagney + + * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64, + fseeko and fseeko64. Determine bfd_file_ptr. + * configure: Re-generate. + 2004-02-09 Anil Paranjpe * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w. diff --git a/bfd/configure b/bfd/configure index 5704aef6eae..22d246d6290 100755 --- a/bfd/configure +++ b/bfd/configure @@ -6619,6 +6619,124 @@ esac +# Determine the host dependant file_ptr a.k.a. off_t type. In order +# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and +# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long. +# Hopefully a reasonable assumption since fseeko et.al. should be +# upward compatible. +for ac_func in ftello ftello64 fseeko fseeko64 +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6631: 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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6659: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking file_ptr type""... $ac_c" 1>&6 +echo "configure:6684: 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: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 < + + +int main() { +switch (0) case 0: case (sizeof (off_t) == $ac_size):; +; return 0; } +EOF +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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test x$ac_cv_sizeof_off_t != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_off_t = x ; then + { echo "configure: error: cannot determine a size for off_t" 1>&2; exit 1; } +fi +echo "$ac_t""$ac_cv_sizeof_off_t" 1>&6 +cat >> confdefs.h <&6 + + + + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" @@ -6631,17 +6749,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6635: checking for $ac_hdr" >&5 +echo "configure:6753: 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:6645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6763: \"$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* @@ -6670,12 +6788,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6674: checking for $ac_func" >&5 +echo "configure:6792: 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:6820: \"$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 @@ -6723,7 +6841,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6727: checking for working mmap" >&5 +echo "configure:6845: 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 @@ -6731,7 +6849,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:6993: \"$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 @@ -6896,12 +7014,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6900: checking for $ac_func" >&5 +echo "configure:7018: 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:7046: \"$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 @@ -7174,6 +7292,8 @@ s%@all_backends@%$all_backends%g s%@bfd_backends@%$bfd_backends%g s%@bfd_machines@%$bfd_machines%g s%@bfd_default_target_size@%$bfd_default_target_size%g +s%@bfd_file_ptr@%$bfd_file_ptr%g +s%@bfd_ufile_ptr@%$bfd_ufile_ptr%g s%@tdefaults@%$tdefaults%g CEOF diff --git a/bfd/configure.in b/bfd/configure.in index 760bfe3afea..72f4580b6cb 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -917,6 +917,31 @@ AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) AC_SUBST(bfd_default_target_size) +# Determine the host dependant file_ptr a.k.a. off_t type. In order +# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and +# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long. +# 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 + bfd_file_ptr=BFD_HOST_64_BIT + bfd_ufile_ptr=BFD_HOST_U_64_BIT +fi +AC_MSG_RESULT($bfd_file_ptr) +AC_SUBST(bfd_file_ptr) +AC_SUBST(bfd_ufile_ptr) + + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"