configure.ac: Tweak test for HAVE_DECL_LDGETNAME to avoid a system header conflict...
authorRoger Sayle <roger@eyesopen.com>
Thu, 25 Nov 2004 01:41:20 +0000 (01:41 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 25 Nov 2004 01:41:20 +0000 (01:41 +0000)
* configure.ac: Tweak test for HAVE_DECL_LDGETNAME to avoid a
system header conflict on AIX 5.2.
* configure: Regenerate.

From-SVN: r91266

gcc/ChangeLog
gcc/configure
gcc/configure.ac

index ad7c33f1c7fb2c3f824c32c609f3b4ea0db7cc87..5f5865c22dc719effb525cea75b708ec085e006f 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-24  Roger Sayle  <roger@eyesopen.com>
+
+       * configure.ac: Tweak test for HAVE_DECL_LDGETNAME to avoid a
+       system header conflict on AIX 5.2.
+       * configure: Regenerate.
+
 2004-11-24  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-outof-ssa.c (coalesce_abnormal_edges): Use e->dest_idx
index 5ccbd34834cc5a0af089bdfbdef1450fea9a441c..48ec4dd1e80a82ddaecc53cfe4cd1d3e44732a51 100755 (executable)
@@ -11355,6 +11355,10 @@ _ACEOF
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+# On AIX 5.2, <ldfcn.h> conflicts with <fcntl.h>, as both define incompatible
+# FREAD and FWRITE macros.  Fortunately, for GCC's single usage of ldgetname
+# in collect2.c, <fcntl.h> isn't visible, but the configure test below needs
+# to undef these macros to get the correct value for HAVE_DECL_LDGETNAME.
 
 for ac_func in ldgetname
 do
@@ -11376,6 +11380,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include "ansidecl.h"
 #include "system.h"
 #ifdef HAVE_LDFCN_H
+#undef FREAD
+#undef FWRITE
 #include <ldfcn.h>
 #endif
 
index 80eb7161ca84e4cc40233752ff4a36983e7cac92..c7e49c0fc45fd23e66cf28773abff71fda1428e9 100644 (file)
@@ -1053,10 +1053,16 @@ AC_TRY_COMPILE([
 ],[rlim_t l = 0;],,[AC_DEFINE([rlim_t],[long],
 [Define to \`long' if <sys/resource.h> doesn't define.])])
 
+# On AIX 5.2, <ldfcn.h> conflicts with <fcntl.h>, as both define incompatible
+# FREAD and FWRITE macros.  Fortunately, for GCC's single usage of ldgetname
+# in collect2.c, <fcntl.h> isn't visible, but the configure test below needs
+# to undef these macros to get the correct value for HAVE_DECL_LDGETNAME.
 gcc_AC_CHECK_DECLS(ldgetname, , ,[
 #include "ansidecl.h"
 #include "system.h"
 #ifdef HAVE_LDFCN_H
+#undef FREAD
+#undef FWRITE
 #include <ldfcn.h>
 #endif
 ])