[patch 3.4] PR8180: --without-headers broken (was: -Dinhibit_libc not being set in gcc-3.4/gcc/configure?)

Dan Kegel dank@kegel.com
Thu Aug 14 18:42:00 GMT 2003


Dan Kegel wrote:
> My build script, which happily built gcc-3.3.1/glibc-2.3.2,
> now fails with
> /crosstool-0.18/result/powerpc-750-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/powerpc-750-linux-gnu/include/stdio.h:138:28:bits/stdio_lim.h: No such file or directory
>
> And aha, it looks like --without-headers is setting $with_headers to 'no',
> which is misinterpreted by the new line
>      test "x$with_headers" = x ; then
> in gcc/configure.  Should that be
>      test "x$with_headers" = xno ; then
> or something of the sort?

(cf. http://gcc.gnu.org/PR8180 )
The following patch at least gets gcc-3.4-* past that build
failure.  It also tries to fix the other config file that
uses ${with_headers} to let it handle the value that --without-headers
puts in there.

How's this look?  If it's ok I'll send it to gcc-patches...
or is the protocol to send it there first?
- Dan


--- gcc-3.4-20030813/configure.in.old	Thu Aug 14 09:10:53 2003
+++ gcc-3.4-20030813/configure.in	Thu Aug 14 09:13:36 2003
@@ -242,7 +242,7 @@

  # If both --with-headers and --with-libs are specified, default to
  # --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno && test x"${with_libs}" != x ; then
    if test x"${with_newlib}" = x ; then
      with_newlib=no
    fi
@@ -922,12 +922,12 @@

  # Handle --with-headers=XXX.  If the value is not "yes", the contents of
  # the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
    if test x${is_cross_compiler} = xno ; then
      echo 1>&2 '***' --with-headers is only supported when cross compiling
      exit 1
    fi
-  if test x"${with_headers}" != xyes ; then
+  if test x"${with_headers}" != xyes && test x"${with_headers}" != xno ; then
      case "${exec_prefixoption}" in
      "") x=${prefix} ;;
      *) x=${exec_prefix} ;;
--- gcc-3.4-20030813/gcc/configure.in.old	Thu Aug 14 09:05:09 2003
+++ gcc-3.4-20030813/gcc/configure.in	Thu Aug 14 09:10:39 2003
@@ -1395,7 +1395,7 @@
  inhibit_libc=
  if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
         test x$with_newlib = xyes ; } &&
-     test "x$with_headers" = x ; then
+     { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
         inhibit_libc=-Dinhibit_libc
  fi
  AC_SUBST(inhibit_libc)

======== And, for those people building the snapshot who don't want to run autoconf: =========

--- gcc-3.4-20030813/configure.old	Thu Aug 14 09:14:06 2003
+++ gcc-3.4-20030813/configure	Thu Aug 14 09:15:00 2003
@@ -991,7 +991,7 @@

  # If both --with-headers and --with-libs are specified, default to
  # --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno && test x"${with_libs}" != x ; then
    if test x"${with_newlib}" = x ; then
      with_newlib=no
    fi
@@ -1671,12 +1671,12 @@

  # Handle --with-headers=XXX.  If the value is not "yes", the contents of
  # the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
    if test x${is_cross_compiler} = xno ; then
      echo 1>&2 '***' --with-headers is only supported when cross compiling
      exit 1
    fi
-  if test x"${with_headers}" != xyes ; then
+  if test x"${with_headers}" != xyes && test x"${with_headers}" != xno ; then
      case "${exec_prefixoption}" in
      "") x=${prefix} ;;
      *) x=${exec_prefix} ;;
--- gcc-3.4-20030813/gcc/configure.old	Thu Aug 14 09:15:10 2003
+++ gcc-3.4-20030813/gcc/configure	Thu Aug 14 09:16:20 2003
@@ -5690,7 +5690,7 @@
  inhibit_libc=
  if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
         test x$with_newlib = xyes ; } &&
-     test "x$with_headers" = x ; then
+     { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
         inhibit_libc=-Dinhibit_libc
  fi


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list