Skip to content

Commit

Permalink
macosx: Add a dumb build.sh script to run all the steps requested to …
Browse files Browse the repository at this point in the history
…build VLC on macosx.

This may help some, and to link how to build VLC on Mac OS X for a certain version. (Should be more robust than wiki.videolan.org/OSXCompile)
  • Loading branch information
pdherbemont committed Nov 7, 2010
1 parent 3624edd commit 2ec5323
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions extras/package/macosx/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/sh
set -e

info()
{
echo " [build] $1"
}

usage()
{
cat << EOF
usage: $0 [options]
OPTIONS:
-h Show some help
EOF

}

spushd()
{
pushd "$1" > /dev/null
}

spopd()
{
popd > /dev/null
}

while getopts "h" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))

if [ "x$1" != "x" ]; then
usage
exit 1
fi

info "Building VLC for the Mac OS X"

spushd `dirname $0`/../../..
vlcroot=`pwd`
spopd

builddir="${vlcroot}/build-macosx"

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

spushd "${vlcroot}/extras/contrib"
./bootstrap
make
spopd

mkdir -p "${builddir}"

if ! [ -e "${vlcroot}/configure" ]; then
${vlcroot}/bootstrap
fi

spushd "${builddir}"

# Run configure only upon changes.
if [ "${vlcroot}/configure" -nt config.log ]; then
${vlcroot}/configure \
--enable-debug
fi

core_count=`sysctl -n machdep.cpu.core_count`
let jobs=$core_count+1

info "Running make -j$jobs"

make -j$jobs
spopd

0 comments on commit 2ec5323

Please sign in to comment.