Commit db041b2e authored by Benoit Rat's avatar Benoit Rat Committed by Alessandro Rubini

build: buildroot: correct bug when CROSS_COMPILER was wrongly set

parent ffa02b11
...@@ -25,7 +25,7 @@ rm -rf $dirname ...@@ -25,7 +25,7 @@ rm -rf $dirname
tar xjf ${WRS_DOWNLOAD_DIR}/$zipname || wrs_die "untar $zipname" tar xjf ${WRS_DOWNLOAD_DIR}/$zipname || wrs_die "untar $zipname"
# copy the config and replace "-j" level. First remove it in case it's left in # copy the config and replace "-j" level. First remove it in case it's left in
cd $dirname cd $WRS_OUTPUT_DIR/build/${dirname}
CFG="$WRS_BASE_DIR/../patches/buildroot/buildroot-config-wrswitch" CFG="$WRS_BASE_DIR/../patches/buildroot/buildroot-config-wrswitch"
if [ "x$WRS_BUILDROOT_CONFIG" != "x" ]; then if [ "x$WRS_BUILDROOT_CONFIG" != "x" ]; then
if [ -f $WRS_BUILDROOT_CONFIG ]; then if [ -f $WRS_BUILDROOT_CONFIG ]; then
...@@ -49,7 +49,7 @@ fi ...@@ -49,7 +49,7 @@ fi
# apply any pending patches # apply any pending patches
wrs_echo "Patching buildroot" wrs_echo "Patching buildroot"
cd $dirname cd $WRS_OUTPUT_DIR/build/${dirname}
for n in $WRS_BASE_DIR/../patches/buildroot/*patch; do for n in $WRS_BASE_DIR/../patches/buildroot/*patch; do
# the shell passes the "*" over if no matches are there, so check # the shell passes the "*" over if no matches are there, so check
if test -f "$n"; then if test -f "$n"; then
...@@ -59,17 +59,21 @@ done ...@@ -59,17 +59,21 @@ done
# now, if CROSS_COMPILE is already set and is not ours, change the config # now, if CROSS_COMPILE is already set and is not ours, change the config
if [ "x$CROSS_COMPILE" != "x" ]; then if [ "x$CROSS_COMPILE" != "x" ]; then
wrs_echo "Changing config for external compiler" wrs_echo "Checking CROSS_COMPILE"
wrs_unset_config BR2_TOOLCHAIN_BUILDROOT ${CROSS_COMPILE}gcc -v 2>&1 | grep arm &> /dev/null
wrs_unset_config BR2_TOOLCHAIN_SOURCE if [ $? -eq "0" ]; then
wrs_set_config BR2_TOOLCHAIN_EXTERNAL wrs_echo "Changing config for external compiler ($CROSS_COMPILE)"
wrs_unset_config BR2_TOOLCHAIN_BUILDROOT
echo BR2_TOOLCHAIN_EXTERNAL_PATH=\"$(dirname $(dirname $CROSS_COMPILE))\" \ wrs_unset_config BR2_TOOLCHAIN_SOURCE
>> .config wrs_set_config BR2_TOOLCHAIN_EXTERNAL
echo BR2_TOOLCHAIN_EXTERNAL_PREFIX="\"\$(ARCH)-linux\"" >> .config
echo '# BR2_TOOLCHAIN_EXTERNAL_UCLIBC is not set' >> .config echo BR2_TOOLCHAIN_EXTERNAL_PATH=\"$(dirname $(dirname $CROSS_COMPILE))\" \
echo BR2_TOOLCHAIN_EXTERNAL_GLIBC=y >> .config >> .config
echo BR2_TOOLCHAIN_EXTERNAL_STRIP=y >> .config echo BR2_TOOLCHAIN_EXTERNAL_PREFIX="\"\$(ARCH)-linux\"" >> .config
echo '# BR2_TOOLCHAIN_EXTERNAL_UCLIBC is not set' >> .config
echo BR2_TOOLCHAIN_EXTERNAL_GLIBC=y >> .config
echo BR2_TOOLCHAIN_EXTERNAL_STRIP=y >> .config
fi
fi fi
# re-digest the config we built # re-digest the config we built
......
...@@ -58,6 +58,8 @@ showhelp() { ...@@ -58,6 +58,8 @@ showhelp() {
pack() pack()
{ {
olddir=$(/bin/pwd)
cd ${WRS_BASE_DIR}/../
#Check if the current git repo correspond to a tag #Check if the current git repo correspond to a tag
name=$(git describe --exact-match --tags HEAD &> /dev/null) name=$(git describe --exact-match --tags HEAD &> /dev/null)
...@@ -69,6 +71,7 @@ pack() ...@@ -69,6 +71,7 @@ pack()
name="$name+"; name="$name+";
fi; fi;
fi fi
cd ${olddir}
echo "Packing into wrs-firmware-$name.tar.gz"; echo "Packing into wrs-firmware-$name.tar.gz";
tar -czvf "wrs-firmware-$name.tar.gz" -C ${WRS_OUTPUT_DIR}/images/ at91bootstrap.bin barebox.bin zImage wrs-image.jffs2.img tar -czvf "wrs-firmware-$name.tar.gz" -C ${WRS_OUTPUT_DIR}/images/ at91bootstrap.bin barebox.bin zImage wrs-image.jffs2.img
exit 0 exit 0
...@@ -80,6 +83,7 @@ clean() ...@@ -80,6 +83,7 @@ clean()
rm -Rf ${WRS_OUTPUT_DIR}/build/ rm -Rf ${WRS_OUTPUT_DIR}/build/
rm -Rf ${WRS_OUTPUT_DIR}/images/ rm -Rf ${WRS_OUTPUT_DIR}/images/
rm -Rf ${WRS_OUTPUT_DIR}/doc/ rm -Rf ${WRS_OUTPUT_DIR}/doc/
exit 0
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment