Building VLC1.1.0 for IOS with Xcode4.5 Mountain Lion
Posted: 29 Jan 2013 20:13
VLC1.1.0 for IOS is a little out of date. Since Xcode and some sources have been changed. Compiling VLC1.1.0 for IOS is not easy. I made it once about one year ago. I don't remember how I made it any more. Yesterday I started working on it, and finally I made it again today. Since most information about building VLC for IOS on the Internet is slightly out of date and hard to follow. I want to share my experience here.
I didn't get a macbook, I'm just happen to get a VMware Virtual Machine installed Mountain Lion and Xcode4.5. So I use it. But I suggest using Mac computer.
Here's my environment:
I assume you already get a mac and installed with Xcode4.5. Here we go!
1.Check whether GCC is installed or not.
after Xcode 4.2 in Lion, gcc is an optional component for Xcode. So we must check it.
Open a terminal , type
if it shows this
then your need to install gcc first. if it shows something like "...gcc version 4.2.1..." then go to step 2.
Here's how to install gcc: Xcode-->Preferences-->Downloads-->Components. then Click install Command Line Tools
2.Download three source tars form http://www.videolan.org/vlc/download-ios.html, unpack them.
3.rename the folder you just unpacked.
VLC-iOS-1.1.0-sources ----> vlc
MediaLibraryKit-1.1.0-sources ----> MediaLibraryKit
MobileVLC-1.1.0-sources ----> MobileVLC
4.Put them under one folder then move MobileVLC\buildMobileVLC.sh to that folder.
So here's that folder looks like
┎----vlc
┃
┣----MediaLibraryKit
┃
┣----MobileVLC
┃
┗----buildMobileVLC.sh
5. open /vlc/extras/contrib/bootstrap with text editor.
find this part and add EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -isysroot ${IOS_SDK_ROOT}"
6.vlc/extras/contrib/src/Makefile
add --disable-asm\
or you'll see this
7. vlc\extras\package\ios\build_for_iOS.sh
find them and change
8. /vlc/extras/contrib/src/Makefile
find this
remove ; sh ./bootstrap
or you may see this error
9. /vlc/extras/contrib/Makefile
find this
remove /testing
10. /vlc/extras/contrib/bootstrap
change
to
or you'll meet this error:
11. finally you can run buildMobileVLC.sh if you are lucky,run this script twice,if no error appear, open MobileVLC/MobileVLC.xcodeproj, that's it .
notice: live555 may hit error when you first run the script. try it again, then it wouldn't show up. but some other error information may appear.
if you run buildMobileVLC.sh it may give you 3 or 4 error information, it's so confusing. , it wouldn't stop when it hits error.so I suggest at the beginning, you run build_for_iOS.sh can help you find more details.
I didn't get a macbook, I'm just happen to get a VMware Virtual Machine installed Mountain Lion and Xcode4.5. So I use it. But I suggest using Mac computer.
Here's my environment:
- lenovo Z470 i5 8GRAM
VMware Workstation 9
Max os10.8 64bit Mountain Lion
Xcode4.5 IOS6
I assume you already get a mac and installed with Xcode4.5. Here we go!
1.Check whether GCC is installed or not.
after Xcode 4.2 in Lion, gcc is an optional component for Xcode. So we must check it.
Open a terminal , type
Code: Select all
gcc -v
Code: Select all
-bash: gcc : command not found
Here's how to install gcc: Xcode-->Preferences-->Downloads-->Components. then Click install Command Line Tools
2.Download three source tars form http://www.videolan.org/vlc/download-ios.html, unpack them.
3.rename the folder you just unpacked.
VLC-iOS-1.1.0-sources ----> vlc
MediaLibraryKit-1.1.0-sources ----> MediaLibraryKit
MobileVLC-1.1.0-sources ----> MobileVLC
4.Put them under one folder then move MobileVLC\buildMobileVLC.sh to that folder.
So here's that folder looks like
┎----vlc
┃
┣----MediaLibraryKit
┃
┣----MobileVLC
┃
┗----buildMobileVLC.sh
5. open /vlc/extras/contrib/bootstrap with text editor.
find this part and add EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -isysroot ${IOS_SDK_ROOT}"
Code: Select all
...
ios)
echo 'HAVE_IOS = 1' >> config.mak
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -isysroot ${IOS_SDK_ROOT}"
if test -z "$IOS_SDK_ROOT"; then
...
add --disable-asm\
Code: Select all
FFMPEGCONF += \
--disable-debug \
--enable-gpl \
--enable-postproc \
--disable-ffprobe \
--disable-ffserver \
--disable-ffmpeg \
--disable-ffplay \
--disable-devices \
--disable-protocols \
--disable-avfilter \
--disable-asm\
--disable-network
Code: Select all
error: invalid operand in inline asm: 'adds $1, ${2:R}, ${2:Q}, lsr #31
mvnne $1, #1<<31
eorne $0, $1, ${2:R}, asr #31
'
make[2]: *** [libavcodec/audioconvert.o] Error 1
make[1]: *** [.ffmpeg] Error 2
make: *** [using-src] Error 2
find them and change
Code: Select all
DEVROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer
IOS_SDK_ROOT=${DEVROOT}/SDKs/iPhone${PLATFORM}6.0.sdk"
export IOS_SDK_ROOT
export CPP="xcrun cc -E"
export CXXCPP="xcrun c++ -E"
export CC="${DEVROOT}/usr/bin/[color=gcc"
export OBJC="${DEVROOT}/usr/bin/[color=gcc"
export CXX="${DEVROOT}/usr/bin/[color=g++"
find this
Code: Select all
...(cd $@; echo|$(CC) -iquote . -E - || sed -i 's/-iquote /-I/' libfaad/Makefile.am; sh ./bootstrap)...
Code: Select all
...(cd $@; echo|$(CC) -iquote . -E - || sed -i 's/-iquote /-I/' libfaad/Makefile.am)...
Code: Select all
./bootstrap: line 12: aclocal: command not found
make[1]: *** [faad2] Error 127
make: *** [using-src] Error 2
find this
Code: Select all
ifdef HAVE_DARWIN_OS
CONTRIBREV=34
contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
$(WGET) http://downloads.videolan.org/pub/videolan/testing/contrib/$@
Code: Select all
ifdef HAVE_DARWIN_OS
CONTRIBREV=34
contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
$(WGET) http://downloads.videolan.org/pub/videolan/contrib/$@
change
Code: Select all
.....
i686-apple-darwin*
.....
CC="/Developer/usr/bin/gcc-4.2"
CXX="/Developer/usr/bin/g++-4.2"
.....
if test -e /Developer/SDKs; then
echo "SDKs found. Everything is fine." >&2
Code: Select all
....
....
CC="/Developer/usr/bin/gcc"
CXX="/Developer/usr/bin/g++"
....
if test -e `xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs; then
echo "SDKs found. Everything is fine." >&2
....
Code: Select all
ERROR:
Your Developer Tools' SDKs were not found.
You need to add extra symbolic links to /Developer to achieve correctly
notice: live555 may hit error when you first run the script. try it again, then it wouldn't show up. but some other error information may appear.
if you run buildMobileVLC.sh it may give you 3 or 4 error information, it's so confusing. , it wouldn't stop when it hits error.so I suggest at the beginning, you run build_for_iOS.sh can help you find more details.