crosstool PATCH: enhancements to SYSROOT support
Alon Ziv
alon.ziv@zoran.com
Tue Oct 26 07:49:00 GMT 2004
The following patch (in use here) enhances the SYSROOT support in crosstool by
making _all_ generated target binaries / libraries / etc. go into the SYSROOT
directory.
As an added bonus, this also allows setting the SYSROOT to a different
directory than the standard $PREFIX/$TARGET/sys-root.
-Alon Ziv
Index: crosstool-0.28-rc37/crosstool.sh
diff -u -r1.1 -r1.2
--- crosstool-0.28-rc37/crosstool.sh 10 Oct 2004 16:05:25 -0000 1.1
+++ crosstool-0.28-rc37/crosstool.sh 17 Oct 2004 14:08:53 -0000 1.2
@@ -155,10 +155,13 @@
else
# spiffy new sysroot way. libraries split between
# prefix/target/sys-root/lib and prefix/target/sys-root/usr/lib
- SYSROOT=${PREFIX}/${TARGET}/sys-root
+ if test -z "$SYSROOT_RELATIVE"; then
+ SYSROOT_RELATIVE="${TARGET}/sys-root";
+ fi
+ SYSROOT=${PREFIX}/${SYSROOT_RELATIVE}
HEADERDIR=$SYSROOT/usr/include
BINUTILS_SYSROOT_ARG="--with-sysroot=${SYSROOT}"
- GCC_SYSROOT_ARG="--with-sysroot=${SYSROOT}"
+ GCC_SYSROOT_ARG="--with-sysroot=${SYSROOT} --with-slibdir=${SYSROOT}/lib"
GCC_SYSROOT_ARG_CORE=$GCC_SYSROOT_ARG
GLIBC_SYSROOT_ARG=""
# glibc's prefix must be exactly /usr, else --with-sysroot'd
@@ -404,6 +407,8 @@
else
sed '/BUG in libc.scripts.output-format.sed/d' <
${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file
fi
+ # PATCH: remove those .so_orig's... they are useless
+ rm ${SYSROOT}/$lib/${file}_orig
fi
done
done
@@ -417,6 +422,8 @@
mkdir -p build-gcc; cd build-gcc
if test '!' -f Makefile; then
+ # There must be a better way :-(
+ GCC_VERSION=`echo $GCC_DIR | sed 's,.*-,,'`
# --enable-symvers=gnu really only needed for sh4 to work around a
detection problem
# only matters for gcc-3.2.x and later, I think
# --disable-nls to work around crash bug on ppc405, but also because
embedded
@@ -425,6 +432,7 @@
${GCC_EXTRA_CONFIG} \
$GCC_SYSROOT_ARG \
--with-local-prefix=${SYSROOT} \
+ --with-gxx-include-dir=${HEADERDIR}/c++/${GCC_VERSION} \
--disable-nls \
--enable-threads=posix \
--enable-symvers=gnu \
@@ -458,6 +466,11 @@
test -x ${PREFIX}/bin/${TARGET}-gcc || Build failed during final gcc
+# move libstdc++ to SYSROOT/usr/lib
+if test -n "$USE_SYSROOT"; then
+ mv $PREFIX/$TARGET/lib/lib*++* $SYSROOT/usr/lib
+fi
+
# Set up to let user install individual shared libraries in /etc/ld.so.conf
easily
cd $TOP_DIR
sh mkoverride.sh
------
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