split native and cross builds

This commit is contained in:
Joey Hess 2013-05-08 12:23:38 -04:00
parent d63a0a77f2
commit da3ca6eb0d

View file

@ -8,8 +8,9 @@
# Needs some extra C libraries to be installed inside the cross-compiler # Needs some extra C libraries to be installed inside the cross-compiler
# lib directory: libgnutls libxml2 # lib directory: libgnutls libxml2
# #
# The same versions are also installed in the host system. This is needed # When run with "native" as a parameter, the same versions are installed
# in order to use the EvilSplicer to expand Template Haskell. # in the host system. This is needed in order to use the EvilSplicer to
# expand Template Haskell.
# lib dir # lib dir
set -e set -e
@ -146,17 +147,17 @@ install_pkgs () {
rm -rf tmp rm -rf tmp
} }
# First, the native build. if [ "$1" = native ]; then
native=1 native=1
if [ ! -e $HOME/.cabal/packages/hackage.haskell.org ]; then if [ ! -e $HOME/.cabal/packages/hackage.haskell.org ]; then
cabal update cabal update
fi
install_pkgs
else
native=0
PATH=$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin:$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:$PATH
if [ ! -e $HOME/.ghc/android-14/arm-linux-androideabi-4.7/cabal/packages/hackage.haskell.org ]; then
cabal update
fi
install_pkgs
fi fi
install_pkgs
# Now the cross compile.
native=0
PATH=$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin:$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:$PATH
if [ ! -e $HOME/.ghc/android-14/arm-linux-androideabi-4.7/cabal/packages/hackage.haskell.org ]; then
cabal update
fi
install_pkgs