This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: $RANLIB not passed to libiberty
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Development <gcc at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Date: Thu, 27 Sep 2007 10:34:50 +0200
- Subject: Re: $RANLIB not passed to libiberty
- References: <20070926162145.GQ25795@sygehus.dk>
Rask Ingemann Lambertsen wrote:
I'm having a look at building GCC with OpenWatcom to reduce build
times. There seems to be something wrong with the build machinery:
Can you try this patch? RANLIB_FOR_BUILD was defined nowhere, hence it
was passed as empty to configure and detected (incorrectly) to be
"ranlib" instead of "owranlib".
This dates back more or less to the dawn of time^Whaving a separate
directory for build-side libraries
(http://gcc.gnu.org/ml/gcc-patches/2001-11/msg01576.html). This evolved
into more complete support over time (including e.g. building
flex/bison/texinfo that can be used when building other tools, which in
turn evolved into toplevel fixincludes), but this bit was always missing.
(It might even be that it worked with Cygnus configure, and stopped
working after autoconfiscation).
If it works, feel free to apply it.
Paolo
2007-09-27 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (AR_FOR_BUILD, AS_FOR_BUILD, CXX_FOR_BUILD,
DLLTOOL_FOR_BUILD, GCJ_FOR_BUILD, GFORTRAN_FOR_BUILD,
LDFLAGS_FOR_BUILD, LD_FOR_BUILD, NM_FOR_BUILD, RANLIB_FOR_BUILD,
WINDMC_FOR_BUILD, WINDRES_FOR_BUILD): Use autoconf substitutions.
* configure.ac: Default them to host tools for $host = $build.
Subst them.
* configure: Regenerate.
* Makefile.in: Regenerate.
Index: Makefile.tpl
===================================================================
--- Makefile.tpl (revision 127728)
+++ Makefile.tpl (working copy)
@@ -251,10 +251,21 @@ PWD_COMMAND = $${PWDCMD-pwd}
# compilers to use to create programs which must be run in the build
# environment.
+AR_FOR_BUILD = @AR_FOR_BUILD@
+AS_FOR_BUILD = @AS_FOR_BUILD@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-
-CXX_FOR_BUILD = $(CXX)
+CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
+CXX_FOR_BUILD = @CXX_FOR_BUILD@
+DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
+GCJ_FOR_BUILD = @GCJ_FOR_BUILD@
+GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
+LD_FOR_BUILD = @LD_FOR_BUILD@
+NM_FOR_BUILD = @NM_FOR_BUILD@
+RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
+WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
+WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
# here so that they can be overridden by Makefile fragments.
Index: configure.ac
===================================================================
--- configure.ac (revision 127728)
+++ configure.ac (working copy)
@@ -1047,9 +1047,31 @@ if test -z "${CC}" && test "${build}" =
fi
if test "${build}" != "${host}" ; then
+ AR_FOR_BUILD=${AR_FOR_BUILD-ar}
+ AS_FOR_BUILD=${AS_FOR_BUILD-as}
CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
+ CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
+ GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj}
+ GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
+ DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
+ LD_FOR_BUILD=${LD_FOR_BUILD-ld}
+ NM_FOR_BUILD=${NM_FOR_BUILD-nm}
+ RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
+ WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres
+ WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc
else
+ AR_FOR_BUILD="\$(AR)"
+ AS_FOR_BUILD="\$(AS)"
CC_FOR_BUILD="\$(CC)"
+ CXX_FOR_BUILD="\$(CXX)"
+ GCJ_FOR_BUILD="\$(GCJ)"
+ GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
+ DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
+ LD_FOR_BUILD="\$(LD)"
+ NM_FOR_BUILD="\$(NM)"
+ RANLIB_FOR_BUILD="\$(RANLIB)"
+ WINDRES_FOR_BUILD="\$(WINDRES)"
+ WINDMC_FOR_BUILD="\$(WINDMC)"
fi
AC_PROG_CC
@@ -2314,6 +2336,8 @@ esac
# Allow the user to override the flags for
# our build compiler if desired.
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
+CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CFLAGS}}
+LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${CFLAGS}}
# On Canadian crosses, we'll be searching the right directories for
# the previously-installed cross compiler, so don't bother to add
@@ -2381,7 +2405,21 @@ AC_SUBST(target_configargs)
# Build tools.
+AC_SUBST(AR_FOR_BUILD)
+AC_SUBST(AS_FOR_BUILD)
AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CFLAGS_FOR_BUILD)
+AC_SUBST(CXXFLAGS_FOR_BUILD)
+AC_SUBST(CXX_FOR_BUILD)
+AC_SUBST(DLLTOOL_FOR_BUILD)
+AC_SUBST(GCJ_FOR_BUILD)
+AC_SUBST(GFORTRAN_FOR_BUILD)
+AC_SUBST(LDFLAGS_FOR_BUILD)
+AC_SUBST(LD_FOR_BUILD)
+AC_SUBST(NM_FOR_BUILD)
+AC_SUBST(RANLIB_FOR_BUILD)
+AC_SUBST(WINDMC_FOR_BUILD)
+AC_SUBST(WINDRES_FOR_BUILD)
AC_SUBST(config_shell)
# Generate default definitions for YACC, M4, LEX and other programs that run
@@ -2466,7 +2504,6 @@ NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
AC_SUBST(CC)
AC_SUBST(CXX)
AC_SUBST(CFLAGS)
-AC_SUBST(CFLAGS_FOR_BUILD)
AC_SUBST(CXXFLAGS)
# Target tools.