Commit aa7354d1 authored by Rafaël Carré's avatar Rafaël Carré

update macosx/build.sh

parent e0fee1e5
...@@ -3,16 +3,26 @@ set -e ...@@ -3,16 +3,26 @@ set -e
info() 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() usage()
{ {
cat << EOF cat << EOF
usage: $0 [options] usage: $0 [options]
Build vlc in the current directory
OPTIONS: OPTIONS:
-h Show some help -h Show some help
-v Be verbose
-k <sdk> Use the specified sdk (default: $SDK)
-a <arch> Use the specified arch (default: $ARCH)
EOF EOF
} }
...@@ -27,13 +37,23 @@ spopd() ...@@ -27,13 +37,23 @@ spopd()
popd > /dev/null popd > /dev/null
} }
while getopts "h" OPTION while getopts "hvk:a:" OPTION
do do
case $OPTION in case $OPTION in
h) h)
usage usage
exit 1 exit 1
;; ;;
v)
set -x
VERBOSE="yes"
;;
a)
ARCH=$OPTARG
;;
k)
SDK=$OPTARG
;;
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
...@@ -43,42 +63,90 @@ if [ "x$1" != "x" ]; then ...@@ -43,42 +63,90 @@ if [ "x$1" != "x" ]; then
exit 1 exit 1
fi fi
#
# Various initialization
#
out="/dev/null"
if [ "$VERBOSE" = "yes" ]; then
out="/dev/stdout"
fi
info "Building VLC for the Mac OS X" info "Building VLC for the Mac OS X"
spushd `dirname $0`/../../.. spushd `dirname $0`/../../..
vlcroot=`pwd` vlcroot=`pwd`
spopd spopd
builddir="${vlcroot}/build-macosx" builddir=`pwd`
info "Building in \"$builddir\""
export CC=/Developer/usr/bin/llvm-gcc-4.2 export CC=/Developer/usr/bin/clang
export CXX=/Developer/usr/bin/llvm-g++-4.2 export CXX="/Developer/usr/bin/clang++"
export OBJC=/Developer/usr/bin/llvm-gcc-4.2 export OBJC=/Developer/usr/bin/clang
export OSX_VERSION=$SDK
export PATH="${vlcroot}/extras/tools:$PATH"
spushd "${vlcroot}/extras/contrib" TRIPLET=$ARCH-apple-darwin10
./bootstrap
make
#
# vlc/extras/tools
#
info "Building building tools"
spushd "${vlcroot}/extras/tools"
./bootstrap > $out
make > $out
spopd 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 if ! [ -e "${vlcroot}/configure" ]; then
${vlcroot}/bootstrap ${vlcroot}/bootstrap > $out
fi fi
spopd
spushd "${builddir}" #
# vlc/configure
#
# Run configure only upon changes.
if [ "${vlcroot}/configure" -nt config.log ]; then 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 fi
#
# make
#
core_count=`sysctl -n machdep.cpu.core_count` core_count=`sysctl -n machdep.cpu.core_count`
let jobs=$core_count+1 let jobs=$core_count+1
info "Running make -j$jobs" info "Running make -j$jobs"
make -j$jobs make -j$jobs
spopd
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment