aboutsummaryrefslogtreecommitdiff
path: root/build-scripts
diff options
context:
space:
mode:
authorMichael Hudson <michael.hudson@linaro.org>2011-03-23 10:58:31 +1300
committerMichael Hudson <michael.hudson@linaro.org>2011-03-23 10:58:31 +1300
commite7ec0ba30aa3d8b5e8e835770fb92d7a4e356f76 (patch)
tree3185bc1d22d41f97af332fb12962a920a30b03f8 /build-scripts
parent78aa2901eda75e5ae97fe5a062a09b00fd825a04 (diff)
more refactoring
Diffstat (limited to 'build-scripts')
-rwxr-xr-xbuild-scripts/build-android16
-rwxr-xr-xbuild-scripts/build-android-toolchain23
-rw-r--r--build-scripts/helpers15
3 files changed, 21 insertions, 33 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index 0f41693..372f605 100755
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -1,18 +1,8 @@
#!/bin/sh
-# Defaults
-MANIFEST_REPO="${MANIFEST_REPO-git://http://android.git.kernel.org/platform/manifest.git}"
-MANIFEST_BRANCH="${MANIFEST_BRANCH-master}"
-MANIFEST_FILENAME="${MANIFEST_FILENAME-default.xml}"
-
-repo init -u "${MANIFEST_REPO}" -b "${MANIFEST_BRANCH}" -m "${MANIFEST_FILENAME}"
-
-time python -c 'import xmlrpclib, sys; print xmlrpclib.ServerProxy(sys.argv[1]).mirror(open(".repo/manifest.xml").read())' "http://${1}:8080" > temp-manifest.xml
-echo "Received modified manifest"
-cat temp-manifest.xml
-echo ----------------------------
-mv temp-manifest.xml .repo/manifest.xml
-repo sync -j8
+source "${BUILD_SCRIPT_ROOT}"/helpers
+
+repo-sync-from-mirror
. build/envsetup.sh
diff --git a/build-scripts/build-android-toolchain b/build-scripts/build-android-toolchain
index 418be19..25d96e3 100755
--- a/build-scripts/build-android-toolchain
+++ b/build-scripts/build-android-toolchain
@@ -8,29 +8,16 @@
# http://www.eclipse.org/legal/epl-v10.html
###############################################################################
+source "${BUILD_SCRIPT_ROOT}"/helpers
+
# BINUTILS_URL - set this in env to override default binutils version shipped by a version downloaded from ftp
BINUTILS_VERSION=2.21
# GCC_URL - set this in env to override default gcc version shipped by a version downloaded from ftp
GCC_VERSION=4.6+linaro
EABI="${EABI-arm-eabi}"
-MANIFEST_REPO="${MANIFEST_REPO-git://http://android.git.kernel.org/platform/manifest.git}"
-MANIFEST_BRANCH="${MANIFEST_BRANCH-master}"
-MANIFEST_FILENAME="${MANIFEST_FILENAME-default.xml}"
-
-repo init -u "${MANIFEST_REPO}" -b "${MANIFEST_BRANCH}" -m "${MANIFEST_FILENAME}"
-
-time python -c 'import xmlrpclib, sys; print xmlrpclib.ServerProxy(sys.argv[1]).mirror(open(".repo/manifest.xml").read())' "http://${1}:8080" > temp-manifest.xml
-echo "Received modified manifest"
-cat temp-manifest.xml
-echo ----------------------------
-mv temp-manifest.xml .repo/manifest.xml
-repo sync -j8
-wget http://dl.google.com/android/ndk/android-ndk-r5-linux-x86.tar.bz2
-
-tar xvjf android-ndk-r5-linux-x86.tar.bz2
-rm -f android-ndk-r5-linux-x86.tar.bz2
+repo-sync-from-mirror
cpuc=`cat /proc/cpuinfo | grep processor | wc -l`
threads=$(($cpuc * 4))
@@ -63,7 +50,3 @@ cd objdir/
time -p make -j${threads}
-# here submit stuff back:
-# + logs
-# + build results
-
diff --git a/build-scripts/helpers b/build-scripts/helpers
new file mode 100644
index 0000000..3942a73
--- /dev/null
+++ b/build-scripts/helpers
@@ -0,0 +1,15 @@
+repo-sync-from-mirror () {
+ EABI="${EABI-arm-eabi}"
+ MANIFEST_REPO="${MANIFEST_REPO-git://http://android.git.kernel.org/platform/manifest.git}"
+ MANIFEST_BRANCH="${MANIFEST_BRANCH-master}"
+ MANIFEST_FILENAME="${MANIFEST_FILENAME-default.xml}"
+
+ repo init -u "${MANIFEST_REPO}" -b "${MANIFEST_BRANCH}" -m "${MANIFEST_FILENAME}"
+
+ time python -c 'import xmlrpclib, sys; print xmlrpclib.ServerProxy(sys.argv[1]).mirror(open(".repo/manifest.xml").read())' "http://${1}:8080" > temp-manifest.xml
+ echo "Received modified manifest"
+ cat temp-manifest.xml
+ echo ----------------------------
+ mv temp-manifest.xml .repo/manifest.xml
+ repo sync -j8
+} \ No newline at end of file