diff options
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/config.in | 16 | ||||
-rwxr-xr-x | bfd/configure | 291 | ||||
-rw-r--r-- | bfd/configure.in | 6 | ||||
-rw-r--r-- | bfd/sysdep.h | 24 |
5 files changed, 342 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index db0ca17..a01796e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2005-04-20 Jerome Guitton <guitton@gnat.com> + + * configure.in: Fix the check for basename declaration. Add check + for declarations of ftello, ftello64, fseeko, fseeko64. + * configure: Regenerate. + * config.in: Ditto. + * sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64. + 2005-04-19 David S. Miller <davem@davemloft.net> * elfxx-sparc.c: New file. diff --git a/bfd/config.in b/bfd/config.in index 9ddd878..12f7239 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -28,6 +28,22 @@ don't. */ #undef HAVE_DECL_BASENAME +/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't. + */ +#undef HAVE_DECL_FSEEKO + +/* Define to 1 if you have the declaration of `fseeko64', and to 0 if you + don't. */ +#undef HAVE_DECL_FSEEKO64 + +/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't. + */ +#undef HAVE_DECL_FTELLO + +/* Define to 1 if you have the declaration of `ftello64', and to 0 if you + don't. */ +#undef HAVE_DECL_FTELLO64 + /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H diff --git a/bfd/configure b/bfd/configure index 8d75a92..43af588 100755 --- a/bfd/configure +++ b/bfd/configure @@ -9556,8 +9556,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "sysdep.h" - +$ac_includes_default int main () { @@ -9618,6 +9617,294 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether ftello is declared" >&5 +echo $ECHO_N "checking whether ftello is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_ftello+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef ftello + char *p = (char *) ftello; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_ftello=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_ftello=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ftello" >&6 +if test $ac_cv_have_decl_ftello = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FTELLO 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FTELLO 0 +_ACEOF + + +fi + + +echo "$as_me:$LINENO: checking whether ftello64 is declared" >&5 +echo $ECHO_N "checking whether ftello64 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_ftello64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef ftello64 + char *p = (char *) ftello64; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_ftello64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_ftello64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ftello64" >&6 +if test $ac_cv_have_decl_ftello64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FTELLO64 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FTELLO64 0 +_ACEOF + + +fi + + +echo "$as_me:$LINENO: checking whether fseeko is declared" >&5 +echo $ECHO_N "checking whether fseeko is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fseeko+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fseeko + char *p = (char *) fseeko; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fseeko=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fseeko=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fseeko" >&6 +if test $ac_cv_have_decl_fseeko = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FSEEKO 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FSEEKO 0 +_ACEOF + + +fi + + +echo "$as_me:$LINENO: checking whether fseeko64 is declared" >&5 +echo $ECHO_N "checking whether fseeko64 is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fseeko64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fseeko64 + char *p = (char *) fseeko64; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fseeko64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fseeko64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fseeko64" >&6 +if test $ac_cv_have_decl_fseeko64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FSEEKO64 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FSEEKO64 0 +_ACEOF + + +fi + + case "${host}" in diff --git a/bfd/configure.in b/bfd/configure.in index d5b7554..97b22be 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -127,7 +127,11 @@ AC_HEADER_DIRENT AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid) AC_CHECK_FUNCS(strtoull) -AC_CHECK_DECLS(basename, , , [#include "sysdep.h"]) +AC_CHECK_DECLS(basename) +AC_CHECK_DECLS(ftello) +AC_CHECK_DECLS(ftello64) +AC_CHECK_DECLS(fseeko) +AC_CHECK_DECLS(fseeko64) BFD_BINARY_FOPEN diff --git a/bfd/sysdep.h b/bfd/sysdep.h index e94491d..b3c917f 100644 --- a/bfd/sysdep.h +++ b/bfd/sysdep.h @@ -129,6 +129,30 @@ extern PTR realloc (); extern char *strstr (); #endif +#ifdef HAVE_FTELLO +#if !HAVE_DECL_FTELLO +extern off_t ftello (FILE *stream); +#endif +#endif + +#ifdef HAVE_FTELLO64 +#if !HAVE_DECL_FTELLO64 +extern off64_t ftello64 (FILE *stream); +#endif +#endif + +#ifdef HAVE_FSEEKO +#if !HAVE_DECL_FSEEKO +extern int fseeko (FILE *stream, off_t offset, int whence); +#endif +#endif + +#ifdef HAVE_FSEEKO64 +#if !HAVE_DECL_FSEEKO64 +extern int fseeko64 (FILE *stream, off64_t offset, int whence); +#endif +#endif + /* Define offsetof for those systems which lack it */ #ifndef offsetof |