summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-19 13:28:57 +0300
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-19 11:39:50 +0000
commitb48df6c57519a333ba7d79b0cfa86541222c1913 (patch)
tree59127686e72338d75ae26da27040d8e7dcf7c830 /abuild.in
parentad50945d80451fccbbdc474ae84234b893834024 (diff)
downloadabuild-b48df6c57519a333ba7d79b0cfa86541222c1913.tar.gz
abuild-b48df6c57519a333ba7d79b0cfa86541222c1913.tar.bz2
abuild-b48df6c57519a333ba7d79b0cfa86541222c1913.tar.xz
abuild-b48df6c57519a333ba7d79b0cfa86541222c1913.zip
abuild: set CARCH and CLIBC always, guess from CHOST if not set
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in28
1 files changed, 23 insertions, 5 deletions
diff --git a/abuild.in b/abuild.in
index 3fdae0b..ebf8a00 100755
--- a/abuild.in
+++ b/abuild.in
@@ -156,14 +156,32 @@ default_sanitycheck() {
done
# check if CARCH, CBUILD, CHOST and CTARGET is set
+ [ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
+ [ -z "$CBUILD" ] && CBUILD="$CHOST"
+ [ -z "$CTARGET" ] && CTARGET="$CHOST"
+
if [ -z "$CARCH" ]; then
- case "$(uname -m)" in
- i[0-9]86) suggestion=" (Suggestion: CARCH=x86)";;
- x86_64) suggestion=" (Suggestion: CARCH=x86_64)";;
+ 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
- die "Please set CARCH in /etc/abuild.conf$suggestion"
fi
- [ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
+
+ # check CLIBC
+ if [ -z "$CLIBC" ]; then
+ if [ -z "$ALPINE_LIBC" ]; then
+ case "$CHOST" in
+ *-*-*-uclibc*) CLIBC="uclibc" ;;
+ *-*-*-musl*) CLIBC="musl" ;;
+ *-*-*-gnu*) CLIBC="eglibc" ;;
+ *) CLIBC="uclibc" ;;
+ esac
+ else
+ CLIBC="$ALPINE_LIBC"
+ fi
+ fi
for i in $install; do
local n=${i%.*}