public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] compilation warnings in bfd on Alpha/Tru64
@ 2005-04-18 19:07 Jerome Guitton
  2005-04-18 21:13 ` Mark Kettenis
  0 siblings, 1 reply; 7+ messages in thread
From: Jerome Guitton @ 2005-04-18 19:07 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]


The following patch should allow to build bfd on Tru64 with -Werrors. It fixes
two problems:

* my patch for checking for basename decl was bogus;
* on OSF5.1, fseeko/ftello are available but their declarations are not
found during the build. Apparently, they are protected by a
"#if _XOPEN_SOURCE>=500"... Setting _XOPEN_SOURCE explicitly would be looking
for troubles, so I suggest to check during the configure if a declaration
is visible for these functions and, if not, to declare them.

Opinions/Thoughts?

-- 
Jerome

[-- Attachment #2: bfd_tru64.dif --]
[-- Type: text/plain, Size: 11174 bytes --]

2005-04-18  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.

Index: bfd/config.in
===================================================================
RCS file: /cvs/src/src/bfd/config.in,v
retrieving revision 1.22
diff -u -r1.22 config.in
--- bfd/config.in	31 Mar 2005 16:09:03 -0000	1.22
+++ bfd/config.in	18 Apr 2005 17:40:37 -0000
@@ -247,6 +247,18 @@
 /* Define if free is not declared in system header files. */
 #undef NEED_DECLARATION_FREE
 
+/* Define if fseeko is not declared in system header files. */
+#undef NEED_DECLARATION_FSEEKO
+
+/* Define if fseeko64 is not declared in system header files. */
+#undef NEED_DECLARATION_FSEEKO64
+
+/* Define if ftello is not declared in system header files. */
+#undef NEED_DECLARATION_FTELLO
+
+/* Define if ftello64 is not declared in system header files. */
+#undef NEED_DECLARATION_FTELLO64
+
 /* Define if getenv is not declared in system header files. */
 #undef NEED_DECLARATION_GETENV
 
Index: bfd/configure
===================================================================
RCS file: /cvs/src/src/bfd/configure,v
retrieving revision 1.203
diff -u -r1.203 configure
--- bfd/configure	14 Apr 2005 05:26:18 -0000	1.203
+++ bfd/configure	18 Apr 2005 17:40:39 -0000
@@ -9556,8 +9556,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include "sysdep.h"
-
+$ac_includes_default
 int
 main ()
 {
@@ -10085,6 +10084,310 @@
 
 fi
 
+echo "$as_me:$LINENO: checking whether ftello must be declared" >&5
+echo $ECHO_N "checking whether ftello must be declared... $ECHO_C" >&6
+if test "${bfd_cv_decl_needed_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.  */
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int
+main ()
+{
+char *(*pfn) = (char *(*)) ftello
+  ;
+  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
+  bfd_cv_decl_needed_ftello=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+bfd_cv_decl_needed_ftello=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_ftello" >&5
+echo "${ECHO_T}$bfd_cv_decl_needed_ftello" >&6
+if test $bfd_cv_decl_needed_ftello = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_FTELLO 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether ftello64 must be declared" >&5
+echo $ECHO_N "checking whether ftello64 must be declared... $ECHO_C" >&6
+if test "${bfd_cv_decl_needed_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.  */
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int
+main ()
+{
+char *(*pfn) = (char *(*)) ftello64
+  ;
+  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
+  bfd_cv_decl_needed_ftello64=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+bfd_cv_decl_needed_ftello64=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_ftello64" >&5
+echo "${ECHO_T}$bfd_cv_decl_needed_ftello64" >&6
+if test $bfd_cv_decl_needed_ftello64 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_FTELLO64 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether fseeko must be declared" >&5
+echo $ECHO_N "checking whether fseeko must be declared... $ECHO_C" >&6
+if test "${bfd_cv_decl_needed_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.  */
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int
+main ()
+{
+char *(*pfn) = (char *(*)) fseeko
+  ;
+  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
+  bfd_cv_decl_needed_fseeko=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+bfd_cv_decl_needed_fseeko=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_fseeko" >&5
+echo "${ECHO_T}$bfd_cv_decl_needed_fseeko" >&6
+if test $bfd_cv_decl_needed_fseeko = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_FSEEKO 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether fseeko64 must be declared" >&5
+echo $ECHO_N "checking whether fseeko64 must be declared... $ECHO_C" >&6
+if test "${bfd_cv_decl_needed_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.  */
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int
+main ()
+{
+char *(*pfn) = (char *(*)) fseeko64
+  ;
+  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
+  bfd_cv_decl_needed_fseeko64=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+bfd_cv_decl_needed_fseeko64=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_fseeko64" >&5
+echo "${ECHO_T}$bfd_cv_decl_needed_fseeko64" >&6
+if test $bfd_cv_decl_needed_fseeko64 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_FSEEKO64 1
+_ACEOF
+
+fi
+
 
 # If we are configured native, pick a core file support file.
 COREFILE=
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.175
diff -u -r1.175 configure.in
--- bfd/configure.in	14 Apr 2005 05:26:17 -0000	1.175
+++ bfd/configure.in	18 Apr 2005 17:40:39 -0000
@@ -127,7 +127,7 @@
 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)
 
 BFD_BINARY_FOPEN
 
@@ -137,6 +137,10 @@
 BFD_NEED_DECLARATION(malloc)
 BFD_NEED_DECLARATION(realloc)
 BFD_NEED_DECLARATION(strstr)
+BFD_NEED_DECLARATION(ftello)
+BFD_NEED_DECLARATION(ftello64)
+BFD_NEED_DECLARATION(fseeko)
+BFD_NEED_DECLARATION(fseeko64)
 
 # If we are configured native, pick a core file support file.
 COREFILE=
Index: bfd/sysdep.h
===================================================================
RCS file: /cvs/src/src/bfd/sysdep.h,v
retrieving revision 1.8
diff -u -r1.8 sysdep.h
--- bfd/sysdep.h	30 Mar 2005 02:46:25 -0000	1.8
+++ bfd/sysdep.h	18 Apr 2005 17:40:40 -0000
@@ -129,6 +129,30 @@
 extern char *strstr ();
 #endif
 
+#ifdef HAVE_FTELLO
+#ifdef NEED_DECLARATION_FTELLO
+extern off_t ftello (FILE *stream);
+#endif
+#endif
+
+#ifdef HAVE_FTELLO64
+#ifdef NEED_DECLARATION_FTELLO64
+extern off64_t ftello64 (FILE *stream);
+#endif
+#endif
+
+#ifdef HAVE_FSEEKO
+#ifdef NEED_DECLARATION_FSEEKO
+extern int fseeko (FILE *stream, off_t offset, int whence);
+#endif
+#endif
+
+#ifdef HAVE_FSEEKO64
+#ifdef NEED_DECLARATION_FSEEKO64
+extern int fseeko64 (FILE *stream, off64_t offset, int whence);
+#endif
+#endif
+
 /* Define offsetof for those systems which lack it */
 
 #ifndef offsetof

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-18 19:07 [RFA] compilation warnings in bfd on Alpha/Tru64 Jerome Guitton
@ 2005-04-18 21:13 ` Mark Kettenis
  2005-04-19 16:17   ` Jerome Guitton
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Kettenis @ 2005-04-18 21:13 UTC (permalink / raw)
  To: guitton; +Cc: binutils

   Date: Mon, 18 Apr 2005 21:06:49 +0200
   From: Jerome Guitton <guitton@adacore.com>

   The following patch should allow to build bfd on Tru64 with
   -Werrors. It fixes two problems:

   * my patch for checking for basename decl was bogus;
   * on OSF5.1, fseeko/ftello are available but their declarations are not
   found during the build. Apparently, they are protected by a
   "#if _XOPEN_SOURCE>=500"... Setting _XOPEN_SOURCE explicitly would
   be looking for troubles, so I suggest to check during the configure
   if a declaration is visible for these functions and, if not, to
   declare them.

   Opinions/Thoughts?

Hmm.  Shouldn't we start using the standard AC_CHECK_DECL instead of
BFD_NEEDED_DECLARATION?

Mark

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-18 21:13 ` Mark Kettenis
@ 2005-04-19 16:17   ` Jerome Guitton
  2005-04-20  1:31     ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Jerome Guitton @ 2005-04-19 16:17 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: binutils

Mark Kettenis (mark.kettenis@xs4all.nl):

> Hmm.  Shouldn't we start using the standard AC_CHECK_DECL instead of
> BFD_NEEDED_DECLARATION?

I am certainly *not* the good person to answer this question ;-)
It is quite easy to change from one to another, I would say. Why
BFD_NEEDED_DECLARATION was defined in the first place?

-- 
Jerome

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-19 16:17   ` Jerome Guitton
@ 2005-04-20  1:31     ` Ian Lance Taylor
  2005-04-20 12:53       ` Jerome Guitton
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Lance Taylor @ 2005-04-20  1:31 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: Mark Kettenis, binutils

Jerome Guitton <guitton@adacore.com> writes:

> Mark Kettenis (mark.kettenis@xs4all.nl):
> 
> > Hmm.  Shouldn't we start using the standard AC_CHECK_DECL instead of
> > BFD_NEEDED_DECLARATION?
> 
> I am certainly *not* the good person to answer this question ;-)
> It is quite easy to change from one to another, I would say. Why
> BFD_NEEDED_DECLARATION was defined in the first place?

Because BFD_NEEDED_DECLARATION was invented before AC_CHECK_DECL
existed.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-20  1:31     ` Ian Lance Taylor
@ 2005-04-20 12:53       ` Jerome Guitton
  2005-04-20 14:18         ` Nick Clifton
  0 siblings, 1 reply; 7+ messages in thread
From: Jerome Guitton @ 2005-04-20 12:53 UTC (permalink / raw)
  To: mark.kettenis, binutils

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Ian Lance Taylor (ian@airs.com):

> Because BFD_NEEDED_DECLARATION was invented before AC_CHECK_DECL
> existed.

OK, thanks. Updated patch in attachment. OK to apply?

If I understand correctly, the calls to BFD_NEEDED_DECLARATION are not
needed anymore.  I will replace them in a separate patch.

-- 
Jerome


[-- Attachment #2: bfd_tru64.dif --]
[-- Type: text/plain, Size: 10248 bytes --]

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.

Index: config.in
===================================================================
RCS file: /cvs/src/src/bfd/config.in,v
retrieving revision 1.22
diff -u -r1.22 config.in
--- config.in	31 Mar 2005 16:09:03 -0000	1.22
+++ config.in	20 Apr 2005 12:39:40 -0000
@@ -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
Index: configure
===================================================================
RCS file: /cvs/src/src/bfd/configure,v
retrieving revision 1.203
diff -u -r1.203 configure
--- configure	14 Apr 2005 05:26:18 -0000	1.203
+++ configure	20 Apr 2005 12:39:43 -0000
@@ -9556,8 +9556,7 @@
 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 @@
 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: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.175
diff -u -r1.175 configure.in
--- configure.in	14 Apr 2005 05:26:17 -0000	1.175
+++ configure.in	20 Apr 2005 12:39:43 -0000
@@ -127,7 +127,11 @@
 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: sysdep.h
===================================================================
RCS file: /cvs/src/src/bfd/sysdep.h,v
retrieving revision 1.8
diff -u -r1.8 sysdep.h
--- sysdep.h	30 Mar 2005 02:46:25 -0000	1.8
+++ sysdep.h	20 Apr 2005 12:39:43 -0000
@@ -129,6 +129,30 @@
 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-20 12:53       ` Jerome Guitton
@ 2005-04-20 14:18         ` Nick Clifton
  2005-04-20 15:27           ` Jerome Guitton
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Clifton @ 2005-04-20 14:18 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: mark.kettenis, binutils

Hi Jerome,

> OK, thanks. Updated patch in attachment. OK to apply?


 > 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.

Approved - please apply.

Cheers
   Nick

PS. Normally you do not need to post the patch to generated files like 
configure, you can just say "Regenerate" in the ChangeLog, and of course 
remember to check it in when you do do the commit.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] compilation warnings in bfd on Alpha/Tru64
  2005-04-20 14:18         ` Nick Clifton
@ 2005-04-20 15:27           ` Jerome Guitton
  0 siblings, 0 replies; 7+ messages in thread
From: Jerome Guitton @ 2005-04-20 15:27 UTC (permalink / raw)
  To: Nick Clifton; +Cc: mark.kettenis, binutils

Nick Clifton (nickc@redhat.com):

> Approved - please apply.

Thanks. Applied.

> PS. Normally you do not need to post the patch to generated files like 
> configure, you can just say "Regenerate" in the ChangeLog, and of course 
> remember to check it in when you do do the commit.

OK, I will do that next time!

-- 
Jerome

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-04-20 15:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-18 19:07 [RFA] compilation warnings in bfd on Alpha/Tru64 Jerome Guitton
2005-04-18 21:13 ` Mark Kettenis
2005-04-19 16:17   ` Jerome Guitton
2005-04-20  1:31     ` Ian Lance Taylor
2005-04-20 12:53       ` Jerome Guitton
2005-04-20 14:18         ` Nick Clifton
2005-04-20 15:27           ` Jerome Guitton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).