[vlc-commits] update macosx/build.sh
Rafaël Carré
git at videolan.org
Wed Jan 4 02:24:48 CET 2012
vlc/vlc-1.2 | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 3 17:42:30 2012 -0500| [84cd6e041eef923ed259d9836edef8f760dbb24e] | committer: Jean-Baptiste Kempf
update macosx/build.sh
(cherry picked from commit aa7354d14a4c54f50a736098aa674f4f951e74c6)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=84cd6e041eef923ed259d9836edef8f760dbb24e
---
extras/package/macosx/build.sh | 104 +++++++++++++++++++++++++++++++++-------
1 files changed, 86 insertions(+), 18 deletions(-)
diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh
old mode 100755
new mode 100644
index 65ca902..01c5fec
--- a/extras/package/macosx/build.sh
+++ b/extras/package/macosx/build.sh
@@ -3,16 +3,26 @@ set -e
info()
{
- echo " [build] $1"
+ local green="\033[1;32m"
+ local normal="\033[0m"
+ echo "[${green}build${normal}] $1"
}
+ARCH="x86_64"
+SDK="10.6"
+
usage()
{
cat << EOF
usage: $0 [options]
+Build vlc in the current directory
+
OPTIONS:
-h Show some help
+ -v Be verbose
+ -k <sdk> Use the specified sdk (default: $SDK)
+ -a <arch> Use the specified arch (default: $ARCH)
EOF
}
@@ -27,13 +37,23 @@ spopd()
popd > /dev/null
}
-while getopts "h" OPTION
+while getopts "hvk:a:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
+ v)
+ set -x
+ VERBOSE="yes"
+ ;;
+ a)
+ ARCH=$OPTARG
+ ;;
+ k)
+ SDK=$OPTARG
+ ;;
esac
done
shift $(($OPTIND - 1))
@@ -43,42 +63,90 @@ if [ "x$1" != "x" ]; then
exit 1
fi
+#
+# Various initialization
+#
+
+out="/dev/null"
+if [ "$VERBOSE" = "yes" ]; then
+ out="/dev/stdout"
+fi
+
info "Building VLC for the Mac OS X"
spushd `dirname $0`/../../..
vlcroot=`pwd`
spopd
-builddir="${vlcroot}/build-macosx"
+builddir=`pwd`
+
+info "Building in \"$builddir\""
-export CC=/Developer/usr/bin/llvm-gcc-4.2
-export CXX=/Developer/usr/bin/llvm-g++-4.2
-export OBJC=/Developer/usr/bin/llvm-gcc-4.2
+export CC=/Developer/usr/bin/clang
+export CXX="/Developer/usr/bin/clang++"
+export OBJC=/Developer/usr/bin/clang
+export OSX_VERSION=$SDK
+export PATH="${vlcroot}/extras/tools:$PATH"
-spushd "${vlcroot}/extras/contrib"
-./bootstrap
-make
+TRIPLET=$ARCH-apple-darwin10
+
+
+#
+# vlc/extras/tools
+#
+
+info "Building building tools"
+spushd "${vlcroot}/extras/tools"
+./bootstrap > $out
+make > $out
spopd
-mkdir -p "${builddir}"
+#
+# vlc/contribs
+#
+
+info "Building contribs"
+spushd "${vlcroot}/contrib"
+mkdir -p build && cd build
+../bootstrap --build=$TRIPLET --host=$TRIPLET > $out
+if [ ! -e "../$TRIPLET" ]; then
+ make prebuilt > $out
+fi
+spopd
+
+
+#
+# vlc/bootstrap
+#
+
+info "Bootstrap-ing configure"
+spushd "${vlcroot}"
if ! [ -e "${vlcroot}/configure" ]; then
- ${vlcroot}/bootstrap
+ ${vlcroot}/bootstrap > $out
fi
+spopd
+
-spushd "${builddir}"
+#
+# vlc/configure
+#
-# Run configure only upon changes.
if [ "${vlcroot}/configure" -nt config.log ]; then
- ${vlcroot}/configure \
- --enable-debug
+
+ ${vlcroot}/extras/package/macosx/configure.sh \
+ --build=$TRIPLET \
+ --host=$TRIPLET \
+ --with-macosx-version-min=$OSX_VERSION > $out
fi
+
+#
+# make
+#
+
core_count=`sysctl -n machdep.cpu.core_count`
let jobs=$core_count+1
info "Running make -j$jobs"
-
make -j$jobs
-spopd
-
More information about the vlc-commits
mailing list