bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bootstrapping glibc vs. dependency on system headers


From: Thomas Schwinge
Subject: Re: Bootstrapping glibc vs. dependency on system headers
Date: Fri, 18 Jan 2013 10:44:18 +0100
User-agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu)

Hi!

On Thu, 17 Jan 2013 17:18:41 +0000, "Joseph S. Myers" <address@hidden> wrote:
> Really, for glibc bootstrapping I don't think you want to include any 
> headers there.  If $CPP is defined and nonempty, use that, otherwise use 
> $CC -E; no testing for a "working" preprocessor is needed; we require GCC 
> 4.3 or later for building glibc.

OK.  I'd still be interested in hearing from the Autoconf folks whether
something should be done on Autoconf side, too.  Also, regarding the
/lib/cpp fallback in the cross-compilation case.

> > Issue 3: Assuming fixing Autoconf is the way to go, what do we do in
> > glibc until we upgrade to the respective future version of Autoconf?
> > Supply our own copy of _AC_PROG_PREPROC_WORKS_IFELSE (or AC_PROG_CPP)?
> 
> Yes.  There's already code in configure.in to do something special with 
> _AC_INCLUDES_DEFAULT_REQUIREMENTS.

Yep -- I had submitted an equivalent patch months before H.J.'s was then
applied.  ;-)

Here's now one for AC_PROG_CPP, borrowing from Autoconf's definition of
AC_PROG_CPP, leaving out the "details" we're not interested in (in
particular also the final »C preprocessor "$CPP" [...] sanity check«).
Tested on x86_64 GNU/Linux for a ARM GNU/Linux host.  OK to apply?

        * configure.in (AC_PROG_CPP): New definition.

diff --git configure.in configure.in
index 05cbad5..ee72c17 100644
--- configure.in
+++ configure.in
@@ -17,6 +17,32 @@ AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
   [m4_divert_text([DEFAULTS],
     [ac_includes_default='/* none */'])])
 
+# We require GCC, and by default use its preprocessor.  Override AC_PROG_CPP
+# here to work around the Autoconf issue discussed in
+# <http://news.gmane.org/address@hidden>.
+AC_DEFUN([AC_PROG_CPP],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+AC_MSG_CHECKING([how to run the C preprocessor])
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  AC_CACHE_VAL([ac_cv_prog_CPP],
+  [dnl
+    ac_cv_prog_CPP="$CC -E"
+  ])dnl
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+AC_MSG_RESULT([$CPP])
+AC_SUBST(CPP)dnl
+])# AC_PROG_CPP
+
+
 dnl This is here so we can set $subdirs directly based on configure fragments.
 AC_CONFIG_SUBDIRS()
 


Grüße,
 Thomas

Attachment: pgpfBCQVYV_me.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]