This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fixed build failure on Linux in cppfiles (_XOPEN_SOURCE is evil)


>>>>> Mark Mitchell writes:

>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:
>>> - Notice that we are using glibc, or particular versions of
>>> glibc, and turn on the defines there, since we know what they
>>> will do.

Alexandre> But this is probably the way to go at this time.

Mark> I agree.  Andreas, please produce an appropriate patch.

Mark> Thanks!

Here's a patch to follow your suggestions (the regenerated files are
not attached).  It reverts Geoff's last patch.  Is this ok to install?

Andreas

2000-09-18  Andreas Jaeger  <aj@suse.de>

	* configure.in: Define _GNU_SOURCE only when using the GNU C
	Library.
        * configure: Regenerated.
        * config.in: Regenerated.

============================================================
Index: configure.in
--- configure.in	2000/09/17 00:12:33	1.420
+++ configure.in	2000/09/18 07:12:42
@@ -395,8 +395,19 @@
     AC_MSG_RESULT(no)
 fi
 
-# Define _GNU_SOURCE, since this is a GNU program.
-AC_DEFINE(_GNU_SOURCE, 1, [Always define this])
+AC_MSG_CHECKING(for GNU C library)
+AC_CACHE_VAL(gcc_cv_glibc,
+[AC_TRY_COMPILE(
+  [#include <features.h>],[
+#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
+#error Not a GNU C library system
+#endif], 
+  [gcc_cv_glibc=yes], 
+  gcc_cv_glibc=no)])
+AC_MSG_RESULT($gcc_cv_glibc)
+if test "gcc_cv_glibc" = "yes"; then
+  AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
+fi
 
 AC_C_INLINE
 


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]