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