summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-07-22 14:14:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-22 14:14:32 +0000
commitc20c6132306391271a30eadf6d3b429d31c8dae4 (patch)
treed5fb4d5986a3c46ae4c038f7c1d2af309f26e03b
parent2760f35c57e86ad1396d7dd9d26cc4e37f84a430 (diff)
downloadabuild-c20c6132306391271a30eadf6d3b429d31c8dae4.tar.gz
abuild-c20c6132306391271a30eadf6d3b429d31c8dae4.tar.bz2
abuild-c20c6132306391271a30eadf6d3b429d31c8dae4.tar.xz
abuild-c20c6132306391271a30eadf6d3b429d31c8dae4.zip
abuild: fix CARCH/CLIBC
We need set it in global scope as we need it even if we have not called sanitycheck
-rwxr-xr-xabuild.in34
1 files changed, 18 insertions, 16 deletions
diff --git a/abuild.in b/abuild.in
index 013d059..17ff611 100755
--- a/abuild.in
+++ b/abuild.in
@@ -161,22 +161,7 @@ default_sanitycheck() {
[ -z "$CTARGET" ] && CTARGET="$CHOST"
if [ -z "$CARCH" ]; then
- case "$CHOST" in
- arm*-*-*-*) CARCH="armel" ;;
- i[0-9]86-*-*-*) CARCH="x86" ;;
- x86_64-*-*-*) CARCH="x86_64" ;;
- *) die "Please fix CHOST, or set CARCH in abuild.conf"
- esac
- fi
-
- # check CLIBC
- if [ -z "$CLIBC" ]; then
- case "$CHOST" in
- *-*-*-uclibc*) CLIBC="uclibc" ;;
- *-*-*-musl*) CLIBC="musl" ;;
- *-*-*-gnu*) CLIBC="eglibc" ;;
- *) CLIBC="uclibc" ;;
- esac
+ die "Please fix CHOST, or set CARCH in abuild.conf"
fi
for i in $install; do
@@ -1878,6 +1863,23 @@ repo=${repo##*/}
SRCDEST=${SRCDEST:-$startdir}
PKGDEST=${PKGDEST:-$startdir}
+if [ -z "$CARCH" ]; then
+ case "$CHOST" in
+ arm*-*-*-*) CARCH="armel" ;;
+ i[0-9]86-*-*-*) CARCH="x86" ;;
+ x86_64-*-*-*) CARCH="x86_64" ;;
+ esac
+fi
+
+if [ -z "$CLIBC" ]; then
+ case "$CHOST" in
+ *-*-*-uclibc*) CLIBC="uclibc" ;;
+ *-*-*-musl*) CLIBC="musl" ;;
+ *-*-*-gnu*) CLIBC="eglibc" ;;
+ *) CLIBC="uclibc" ;;
+ esac
+fi
+
cd "$startdir" || die
. "$APKBUILD"