[coreboot] New patch to review for coreboot: 5132665 Add autotools to reference toolchain (WIP)

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Fri Dec 7 23:43:59 CET 2012


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1996

-gerrit

commit 513266501928d8c06cca7651922622c8e52a41f4
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Fri Dec 7 23:40:36 2012 +0100

    Add autotools to reference toolchain (WIP)
    
    DO NOT SUBMIT!
    
    I thought this might fix autotools' inability to install
    two GNU projects into the same directory but I was wrong.
    The problem is deeper than that.
    
    Change-Id: I11b0f5e9015a2953ca70d52dc0fabcbcaa082208
    Signed-off-by: Stefan Reinauer <reinauer at google.com>
---
 util/crossgcc/buildgcc | 109 +++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 101 insertions(+), 8 deletions(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 6d3be97..5958a9a 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -29,6 +29,9 @@ TARGETARCH=i386-elf
 DESTDIR=
 
 # version numbers
+AUTOCONF_VERSION=2.69
+AUTOMAKE_VERSION=1.12.5
+LIBTOOL_VERSION=2.4.2
 GMP_VERSION=5.0.5
 MPFR_VERSION=3.1.1
 MPC_VERSION=1.0.1
@@ -46,6 +49,9 @@ PYTHON_VERSION=2.7.3
 EXPAT_VERSION=2.1.0
 
 # archive locations
+AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz"
+AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz"
+LIBTOOL_ARCHIVE="http://ftpmirror.gnu.org/libtool/libtool-${LIBTOOL_VERSION}.tar.gz"
 GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2"
 MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2"
 MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz"
@@ -59,6 +65,9 @@ IASL_ARCHIVE="http://www.acpica.org/download/acpica-unix-${IASL_VERSION}.tar.gz"
 PYTHON_ARCHIVE="http://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.bz2"
 EXPAT_ARCHIVE="http://downloads.sourceforge.net/sourceforge/expat/expat-${EXPAT_VERSION}.tar.gz"
 
+AUTOCONF_DIR="autoconf-${AUTOCONF_VERSION}"
+AUTOMAKE_DIR="automake-${AUTOMAKE_VERSION}"
+LIBTOOL_DIR="libtool-${LIBTOOL_VERSION}"
 GMP_DIR="gmp-${GMP_VERSION}"
 MPFR_DIR="mpfr-${MPFR_VERSION}"
 MPC_DIR="mpc-${MPC_VERSION}"
@@ -128,7 +137,7 @@ fi
 cleanup()
 {
 	printf "Cleaning up temporary files... "
-	rm -rf build-* combined gcc-* gmp-* mpfr-* mpc-* libelf-* binutils-*
+	rm -rf build-* autoconf-* libtool-* gcc-* gmp-* mpfr-* mpc-* libelf-* binutils-*
 	rm -rf gdb-* w32api-* mingwrt-* acpica-* python-* expat-*
 	printf "${green}ok${NC}\n"
 }
@@ -266,7 +275,8 @@ fi
 
 printf "Downloading tar balls ... \n"
 mkdir -p tarballs
-for ARCHIVE in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $LIBELF_ARCHIVE  \
+for ARCHIVE in $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $LIBTOOL_ARCHIVE $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \
+	    $LIBELF_ARCHIVE  \
 	    $GCC_ARCHIVE $BINUTILS_ARCHIVE $GDB_ARCHIVE $MINGW_ARCHIVES \
 	    $IASL_ARCHIVE $PYTHON_ARCHIVE $EXPAT_ARCHIVE; do
 	FILE=`basename $ARCHIVE`
@@ -290,7 +300,7 @@ if [ "`echo $TARGETARCH | grep -c -- -mingw32`" -gt 0 ]; then
 fi
 
 printf "Unpacking and patching ... \n"
-for PACKAGE in GMP MPFR MPC LIBELF GCC BINUTILS $PYTHON_PACKAGE \
+for PACKAGE in AUTOCONF AUTOMAKE LIBTOOL GMP MPFR MPC LIBELF GCC BINUTILS $PYTHON_PACKAGE \
 	    $EXPAT_PACKAGE $GDB_PACKAGE $MINGW_PACKAGES IASL; do
 	archive=$PACKAGE"_ARCHIVE"
 	archive="`eval echo '$'$archive`"
@@ -348,17 +358,86 @@ if [ "$USECCACHE" = 1 ]; then
 	CC="ccache $CC"
 fi
 
-mkdir -p build-gmp build-mpfr build-mpc build-libelf build-binutils \
+mkdir -p build-autoconf build-automake build-libtool build-gmp build-mpfr build-mpc build-libelf build-binutils \
 		build-gcc build-python build-expat
+
+mkdir -p $DESTDIR$TARGETDIR/bin
+export PATH=$DESTDIR$TARGETDIR/bin:$PATH
+
 if [ $SKIPGDB -eq 0 ]; then
 	mkdir -p build-gdb
 fi
+
+
+if [ -f build-automake/.success ]; then
+	printf "Skipping Automake as it is already built\n"
+else
+printf "Building Automake ${AUTOMAKE_VERSION} ... "
+(
+	cd build-automake
+	rm -f .failed
+	CC="$CC" ../${AUTOMAKE_DIR}/configure --prefix=$TARGETDIR \
+		|| touch .failed
+	$MAKE $JOBS || touch .failed
+	$MAKE install DESTDIR=$DESTDIR || touch .failed
+	if [ ! -f .failed ]; then touch .success; fi
+) > build-automake/crossgcc-build.log 2>&1
+test -r build-automake/.failed && printf "${RED}failed${NC}\n" || \
+	printf "${green}ok${NC}\n"
+test -r build-automake/.failed && exit 1
+fi
+
+
+
+if [ -f build-libtool/.success ]; then
+	printf "Skipping libtool as it is already built\n"
+else
+printf "Building libtool ${LIBTOOL_VERSION} ... "
+(
+	cd build-libtool
+	rm -f .failed
+	CC="$CC" ../${LIBTOOL_DIR}/configure --prefix=$TARGETDIR \
+		|| touch .failed
+	$MAKE $JOBS || touch .failed
+	$MAKE install DESTDIR=$DESTDIR || touch .failed
+	if [ ! -f .failed ]; then touch .success; fi
+) > build-libtool/crossgcc-build.log 2>&1
+test -r build-libtool/.failed && printf "${RED}failed${NC}\n" || \
+	printf "${green}ok${NC}\n"
+test -r build-libtool/.failed && exit 1
+fi
+
+if [ -f build-autoconf/.success ]; then
+	printf "Skipping Autoconf as it is already built\n"
+else
+printf "Building Autoconf ${AUTOCONF_VERSION} ... "
+(
+	cd build-autoconf
+	rm -f .failed
+	CC="$CC" ../${AUTOCONF_DIR}/configure --prefix=$TARGETDIR \
+		|| touch .failed
+	$MAKE $JOBS || touch .failed
+	$MAKE install DESTDIR=$DESTDIR || touch .failed
+	if [ ! -f .failed ]; then touch .success; fi
+) > build-autoconf/crossgcc-build.log 2>&1
+test -r build-autoconf/.failed && printf "${RED}failed${NC}\n" || \
+	printf "${green}ok${NC}\n"
+test -r build-autoconf/.failed && exit 1
+fi
+
+
+
 if [ -f build-gmp/.success ]; then
 	printf "Skipping GMP as it is already built\n"
 else
 printf "Building GMP ${GMP_VERSION} ... "
 (
-	cd build-gmp
+	cd ${GMP_DIR}
+	libtoolize --force --install
+	aclocal --force --install
+	autoreconf --force --install
+	autoconf --force
+	cd ../build-gmp
 	rm -f .failed
 	CC="$CC" ../${GMP_DIR}/configure --disable-shared --prefix=$TARGETDIR $OPTIONS \
 		|| touch .failed
@@ -387,7 +466,12 @@ else
 printf "Building MPFR ${MPFR_VERSION} ... "
 (
 	test `uname` = "Darwin" && CFLAGS="$CFLAGS -force_cpusubtype_ALL"
-	cd build-mpfr
+	cd ${MPFR_DIR}
+	libtoolize --force --install
+	aclocal --force --install
+	autoreconf --force --install
+	autoconf --force
+	cd ../build-mpfr
 	rm -f .failed
 	CC="$CC" ../${MPFR_DIR}/configure --disable-shared --prefix=$TARGETDIR \
 		--infodir=$TARGETDIR/info \
@@ -414,8 +498,18 @@ else
 printf "Building MPC ${MPC_VERSION} ... "
 (
 	#test `uname` = "Darwin" && CFLAGS="$CFLAGS -force_cpusubtype_ALL"
-	cd build-mpc
+ 	cd ${MPC_DIR}
+	libtoolize --force --install
+	aclocal --force --install
+	autoreconf --force --install
+	autoconf --force
+	cd ../build-mpc
 	rm -f .failed
+
+	echo CC="$CC" ../${MPC_DIR}/configure --disable-shared --prefix=$TARGETDIR \
+		--infodir=$TARGETDIR/info --with-mpfr=$DESTDIR$TARGETDIR \
+		--with-gmp=$DESTDIR$TARGETDIR CFLAGS="$HOSTCFLAGS" || \
+		touch .failed
 	CC="$CC" ../${MPC_DIR}/configure --disable-shared --prefix=$TARGETDIR \
 		--infodir=$TARGETDIR/info --with-mpfr=$DESTDIR$TARGETDIR \
 		--with-gmp=$DESTDIR$TARGETDIR CFLAGS="$HOSTCFLAGS" || \
@@ -495,7 +589,6 @@ printf "Building GCC ${GCC_VERSION} ... "
 	cd ..
 	# Now, finally, we can build gcc:
 	cd build-gcc
-	export PATH=$PATH:$DESTDIR$TARGETDIR/bin
 	rm -f .failed
 	# GCC does not honour HOSTCFLAGS at all. CFLAGS are used for
 	# both target and host object files. This is pretty misdesigned.




More information about the coreboot mailing list