|
|
@ -87,7 +87,15 @@ if [ "$pkg_gcc_cross" ] ; then |
|
|
|
fi |
|
|
|
elif [ $stagelevel -eq 0 ] ; then |
|
|
|
configprefix="" |
|
|
|
# --build=${CLFS_HOST} added for gcc 4.3 in stages 0 and 1. This avoids |
|
|
|
# cross-building the (cross-)compiler, which does not work here, and |
|
|
|
# builds the compiler natively. Previous gcc versions (4.2.4 at least) |
|
|
|
# seem to assume that build == host if --host is set but --build is not. |
|
|
|
# gcc 4.3.1 configure warns about this with: |
|
|
|
# WARNING: If you wanted to set the --build type, don't use --host. |
|
|
|
# If a cross compiler is detected then cross compile mode will be used. |
|
|
|
confopt="--prefix=${CLFS}/$cross_tools \ |
|
|
|
--build=${CLFS_HOST} \ |
|
|
|
--host=${CLFS_HOST} --target=${CLFS_TARGET} \$extraconfopt" |
|
|
|
var_append extraconfopt " " " \ |
|
|
|
--with-sysroot=${CLFS} --disable-nls --disable-shared \ |
|
|
@ -102,6 +110,7 @@ elif [ $stagelevel -eq 0 ] ; then |
|
|
|
elif [ $stagelevel -eq 1 ] ; then |
|
|
|
configprefix="" |
|
|
|
confopt="--prefix=${CLFS}/$cross_tools \ |
|
|
|
--build=${CLFS_HOST} \ |
|
|
|
--host=${CLFS_HOST} --target=${CLFS_TARGET} \$extraconfopt" |
|
|
|
var_append extraconfopt " " " \ |
|
|
|
--with-sysroot=${CLFS} --disable-nls --enable-shared \ |
|
|
@ -118,6 +127,26 @@ elif [ $stagelevel -ge 2 ] ; then |
|
|
|
if [ $stagelevel -eq 2 ] ; then |
|
|
|
var_append extraconfopt " " "--enable-languages=\$languages \ |
|
|
|
--disable-libstdcxx-pch" |
|
|
|
# Help configure find the right target tools, esp. important in |
|
|
|
# native builds. Without this the tools installed on the build system |
|
|
|
# might be used instead of the ones built in stage 0 and 1, and |
|
|
|
# cause build errors. |
|
|
|
export CC_FOR_TARGET=$pkg_gcc_target-gcc |
|
|
|
export CXX_FOR_TARGET=$pkg_gcc_target-g++ |
|
|
|
export GCC_FOR_TARGET=$pkg_gcc_target-gcc |
|
|
|
export GCJ_FOR_TARGET=$pkg_gcc_target-gcj |
|
|
|
export GFORTRAN_FOR_TARGET=$pkg_gcc_target-gfortran |
|
|
|
export AS_FOR_TARGET=$pkg_gcc_target-as |
|
|
|
export AR_FOR_TARGET=$pkg_gcc_target-ar |
|
|
|
export LD_FOR_TARGET=$pkg_gcc_target-ld |
|
|
|
export NM_FOR_TARGET=$pkg_gcc_target-nm |
|
|
|
export OBJDUMP_FOR_TARGET=$pkg_gcc_target-objdump |
|
|
|
export RANLIB_FOR_TARGET=$pkg_gcc_target-ranlib |
|
|
|
export STRIP_FOR_TARGET=$pkg_gcc_target-strip |
|
|
|
# The configure option |
|
|
|
# var_append extraconfopt " " "--with-build-time-tools=$root/$cross_tools/$pkg_gcc_target/bin" |
|
|
|
# does not work because $builddir/$cross_tools/$pkg_gcc_target/bin/gcc can't find cc1 |
|
|
|
# (but $builddir/$cross_tools/bin/$pkg_gcc_target-gcc can). |
|
|
|
else |
|
|
|
var_append extraconfopt ' ' '--enable-languages=$languages' |
|
|
|
x="ROCKCFG_PKG_GCC${pkg_gcc_version}_BOOTSTRAP" |
|
|
@ -363,6 +392,15 @@ custmain () { |
|
|
|
} > $root/etc/profile.d/gxx |
|
|
|
fi |
|
|
|
|
|
|
|
# The location of libgcc_s.so{,.1} has changed in gcc 4.3, move to old location. |
|
|
|
if [ $pkg_gcc_version -ge 43 ]; then |
|
|
|
for x in $root/$prefix/lib/${gcc_lib_dir}/../lib/libgcc_s.so.* ; do |
|
|
|
[ -e "$x" ] && mv -v "$x" $root/$prefix/lib/${gcc_lib_dir}/ |
|
|
|
done |
|
|
|
[ -e $root/$prefix/lib/${gcc_lib_dir}/../lib ] && \ |
|
|
|
rmdir -v --ignore-fail-on-non-empty $root/$prefix/lib/${gcc_lib_dir}/../lib |
|
|
|
fi |
|
|
|
|
|
|
|
# Create symlinks for runtime libraries so they can be found by |
|
|
|
# the dynamic loader and force rebuilding of the wrapper links |
|
|
|
# |
|
|
|