* configure.in: Fix the check for basename declaration. Add check
authorJerome Guitton <guitton@adacore.com>
Wed, 20 Apr 2005 15:00:15 +0000 (15:00 +0000)
committerJerome Guitton <guitton@adacore.com>
Wed, 20 Apr 2005 15:00:15 +0000 (15:00 +0000)
for declarations of ftello, ftello64, fseeko, fseeko64.
* configure: Regenerate.
* config.in: Ditto.
* sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64.

bfd/ChangeLog
bfd/config.in
bfd/configure
bfd/configure.in
bfd/sysdep.h

index db0ca17..a01796e 100644 (file)
@@ -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.
index 9ddd878..12f7239 100644 (file)
    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
index 8d75a92..43af588 100755 (executable)
@@ -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
index d5b7554..97b22be 100644 (file)
@@ -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
 
index e94491d..b3c917f 100644 (file)
@@ -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