Commit bd2c4b17 authored by Felix Paul Kühne's avatar Felix Paul Kühne

extras/ios: add a debug flag to the build script

(cherry picked from commit afa9344cb8c479503aaacbd6605a89c4a0e3026b)
parent 89f19489
...@@ -3,6 +3,7 @@ set -e ...@@ -3,6 +3,7 @@ set -e
PLATFORM=OS PLATFORM=OS
VERBOSE=no VERBOSE=no
DEBUG=no
SDK_VERSION=7.0 SDK_VERSION=7.0
SDK_MIN=5.1 SDK_MIN=5.1
SIXTYFOURBIT_SDK_MIN=7.0 SIXTYFOURBIT_SDK_MIN=7.0
...@@ -11,12 +12,14 @@ ARCH=armv7 ...@@ -11,12 +12,14 @@ ARCH=armv7
usage() usage()
{ {
cat << EOF cat << EOF
usage: $0 [-s] [-k sdk] usage: $0 [-s] [-d] [-v] [-k sdk]
OPTIONS OPTIONS
-k <sdk version> Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK_VERSION}) -k <sdk version> Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK_VERSION})
-s Build for simulator -s Build for simulator
-a <arch> Specify which arch to use (current: ${ARCH}) -a <arch> Specify which arch to use (current: ${ARCH})
-d Enable debug
-v Enable verbose command-line output
EOF EOF
} }
...@@ -37,7 +40,7 @@ info() ...@@ -37,7 +40,7 @@ info()
echo "[${blue}info${normal}] $1" echo "[${blue}info${normal}] $1"
} }
while getopts "hvsk:a:" OPTION while getopts "hvdsk:a:" OPTION
do do
case $OPTION in case $OPTION in
h) h)
...@@ -50,6 +53,9 @@ do ...@@ -50,6 +53,9 @@ do
s) s)
PLATFORM=Simulator PLATFORM=Simulator
;; ;;
d)
DEBUG=yes
;;
k) k)
SDK_VERSION=$OPTARG SDK_VERSION=$OPTARG
;; ;;
...@@ -78,9 +84,13 @@ info "Building libvlc for iOS" ...@@ -78,9 +84,13 @@ info "Building libvlc for iOS"
if [ "$PLATFORM" = "Simulator" ]; then if [ "$PLATFORM" = "Simulator" ]; then
TARGET="${ARCH}-apple-darwin11" TARGET="${ARCH}-apple-darwin11"
OPTIM="-O3 -g"
else else
TARGET="arm-apple-darwin11" TARGET="arm-apple-darwin11"
fi
if [ "$DEBUG" = "yes" ]; then
OPTIM="-O0 -g"
else
OPTIM="-O3 -g" OPTIM="-O3 -g"
fi fi
...@@ -210,7 +220,7 @@ else ...@@ -210,7 +220,7 @@ else
export ASCPP="xcrun as" export ASCPP="xcrun as"
fi fi
../bootstrap --build=x86_64-apple-darwin11 --host=${TARGET} --prefix=${VLCROOT}/contrib/${TARGET}-${ARCH} --disable-gpl \ ../bootstrap --build=x86_64-apple-darwin11 --host=${TARGET} --prefix=${VLCROOT}/contrib/${TARGET}-${ARCH} --arch=${ARCH} --disable-gpl \
--disable-disc --disable-sout \ --disable-disc --disable-sout \
--disable-sdl \ --disable-sdl \
--disable-SDL_image \ --disable-SDL_image \
...@@ -270,6 +280,12 @@ spushd ${BUILDDIR} ...@@ -270,6 +280,12 @@ spushd ${BUILDDIR}
info ">> --prefix=${PREFIX} --host=${TARGET}" info ">> --prefix=${PREFIX} --host=${TARGET}"
if [ "$DEBUG" = "yes" ]; then
DEBUGFLAG="--enable-debug"
else
DEBUGFLAG="--disable-debug"
fi
# Run configure only upon changes. # Run configure only upon changes.
if [ "${VLCROOT}/configure" -nt config.log -o \ if [ "${VLCROOT}/configure" -nt config.log -o \
"${THIS_SCRIPT_PATH}" -nt config.log ]; then "${THIS_SCRIPT_PATH}" -nt config.log ]; then
...@@ -277,8 +293,8 @@ ${VLCROOT}/configure \ ...@@ -277,8 +293,8 @@ ${VLCROOT}/configure \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
--host="${TARGET}" \ --host="${TARGET}" \
--with-contrib="${VLCROOT}/contrib/${TARGET}-${ARCH}" \ --with-contrib="${VLCROOT}/contrib/${TARGET}-${ARCH}" \
--disable-debug \
--enable-static \ --enable-static \
${DEBUGFLAG} \
--disable-macosx \ --disable-macosx \
--disable-macosx-dialog-provider \ --disable-macosx-dialog-provider \
--disable-macosx-qtkit \ --disable-macosx-qtkit \
......
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