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

update macosx/build.sh

parent e0fee1e5
......@@ -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/clang
export CXX="/Developer/usr/bin/clang++"
export OBJC=/Developer/usr/bin/clang
export OSX_VERSION=$SDK
export PATH="${vlcroot}/extras/tools:$PATH"
TRIPLET=$ARCH-apple-darwin10
#
# vlc/extras/tools
#
info "Building building tools"
spushd "${vlcroot}/extras/tools"
./bootstrap > $out
make > $out
spopd
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
#
# vlc/contribs
#
spushd "${vlcroot}/extras/contrib"
./bootstrap
make
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
mkdir -p "${builddir}"
#
# 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
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