Commit 1d7d3a9f authored by Gleb Pinigin's avatar Gleb Pinigin Committed by Jean-Baptiste Kempf

Add option to specify arhitecture variant for building vlc for iOS

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 224c8e33
......@@ -143,7 +143,6 @@ case "${host_os}" in
ARCH_flag="-arch x86_64"
;;
arm*)
ARCH_flag="-arch armv7"
ac_cv_c_bigendian="no"
ac_cv_c_attribute_packed="no"
;;
......
......@@ -135,13 +135,6 @@ AR=xcrun ar
LD=xcrun ld
STRIP=xcrun strip
RANLIB=xcrun ranlib
ifeq ($(ARCH), arm)
EXTRA_CFLAGS += -arch armv7 -mcpu=cortex-a8
EXTRA_LDFLAGS += -arch armv7
else
EXTRA_CFLAGS += -m32
EXTRA_LDFLAGS += -m32
endif
EXTRA_CFLAGS += -isysroot $(SDKROOT) -miphoneos-version-min=5.0
EXTRA_LDFLAGS += -Wl,-syslibroot,$(SDKROOT) -isysroot $(SDKROOT) -miphoneos-version-min=5.0
endif
......
......@@ -5,6 +5,7 @@ PLATFORM=OS
VERBOSE=no
SDK_VERSION=6.0
SDK_MIN=5.1
ARCH=armv7
usage()
{
......@@ -12,8 +13,9 @@ cat << EOF
usage: $0 [-s] [-k sdk]
OPTIONS
-k Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK})
-s Build for simulator
-k <sdk> Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK})
-s Build for simulator
-a <arch> Specify which arch to use (current: ${ARCH})
EOF
}
......@@ -34,7 +36,7 @@ info()
echo "[${blue}info${normal}] $1"
}
while getopts "hvsk:" OPTION
while getopts "hvsk:a:" OPTION
do
case $OPTION in
h)
......@@ -51,6 +53,9 @@ do
k)
SDK=$OPTARG
;;
a)
ARCH=$OPTARG
;;
?)
usage
exit 1
......@@ -77,7 +82,6 @@ if [ "$PLATFORM" = "Simulator" ]; then
OPTIM="-O3 -g"
else
TARGET="arm-apple-darwin11"
ARCH="armv7 -g"
fi
info "Using ${ARCH} with SDK version ${SDK_VERSION}"
......@@ -100,9 +104,9 @@ then
exit 1
fi
BUILDDIR="${VLCROOT}/build-ios-${PLATFORM}"
BUILDDIR="${VLCROOT}/build-ios-${PLATFORM}/${ARCH}"
PREFIX="${VLCROOT}/install-ios-${PLATFORM}"
PREFIX="${VLCROOT}/install-ios-${PLATFORM}/${ARCH}"
IOS_GAS_PREPROCESSOR="${VLCROOT}/extras/tools/gas/gas-preprocessor.pl"
......@@ -117,7 +121,7 @@ spushd "${VLCROOT}/extras/tools"
make && make .gas
spopd
info "Building contrib for iOS in '${VLCROOT}/contrib/iPhone${PLATFORM}'"
info "Building contrib for iOS in '${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}'"
# The contrib will read the following
export AR="xcrun ar"
......@@ -156,13 +160,21 @@ else
export LDFLAGS="-syslibroot=${SDKROOT}/ -arch ${ARCH} -miphoneos-version-min=${SDK_MIN}"
fi
if [ "$PLATFORM" = "OS" ]; then
EXTRA_CFLAGS="-arch ${ARCH} -mcpu=cortex-a8"
EXTRA_LDFLAGS="-arch ${ARCH}"
else
EXTRA_CFLAGS="-m32"
EXTRA_LDFLAGS="-m32"
fi
info "LD FLAGS SELECTED = '${LDFLAGS}'"
spushd ${VLCROOT}/contrib
echo ${VLCROOT}
mkdir -p "${VLCROOT}/contrib/iPhone${PLATFORM}"
cd "${VLCROOT}/contrib/iPhone${PLATFORM}"
mkdir -p "${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}"
cd "${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}"
if [ "$PLATFORM" = "OS" ]; then
export AS="${IOS_GAS_PREPROCESSOR} ${CC}"
......@@ -200,6 +212,9 @@ fi
--disable-schroedinger \
--disable-libmpeg2 \
--enable-mad > ${out}
echo "EXTRA_CFLAGS += ${EXTRA_CFLAGS}" >> config.mak
echo "EXTRA_LDFLAGS += ${EXTRA_LDFLAGS}" >> config.mak
make
spopd
......@@ -316,7 +331,9 @@ make -j$MAKE_JOBS > ${out}
info "Installing libvlc"
make install > ${out}
find ${PREFIX}/lib/vlc/plugins -name *.a -type f -exec cp '{}' ${PREFIX}/lib/vlc/plugins \;
cp -R "${VLCROOT}/contrib/${TARGET}" "${PREFIX}/contribs"
info "Removing unneeded modules"
blacklist="
......
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