[Live-devel] iOS Simulator config update

Braden Ackerman backerman at icontrol.com
Fri Dec 19 12:21:54 PST 2014


Live555ers,​


I ran into a situation where I needed to run my project on the iOS simulator, so I fixed up the config.iphone-simulator so that it's compatible with the latest version of Xcode and the iOS SDK.


# **Note: You must install the relevant "Command line tools (OSX *.*) for Xcode - Xcode *.*"
# for this configuration file to work.
# Change the following version number, if necessary, before running "genMakefiles iphoneos"
IOS_VERSION = 8.1
MIN_IOS_VERSION = 7.0
DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
TOOL_PATH = $(DEVELOPER_PATH)/usr/bin
SDK_PATH = $(DEVELOPER_PATH)/SDKs
SDK = $(SDK_PATH)/iPhoneSimulator$(IOS_VERSION).sdk
COMPILE_OPTS =          $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O2 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -miphoneos-version-min=$(MIN_IOS_VERSION) -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC -arch i386 --sysroot=$(SDK) -isysroot $(SDK)
C =                     c
C_COMPILER =            /usr/bin/xcrun clang
C_FLAGS =               $(COMPILE_OPTS)
CPP =                   cpp
CPLUSPLUS_COMPILER =    /usr/bin/xcrun clang
CPLUSPLUS_FLAGS =       $(COMPILE_OPTS) -Wall
OBJ =                   o
LINK =                  /usr/bin/xcrun clang -o
LINK_OPTS =             -L. -arch i386 -miphoneos-version-min=$(MIN_IOS_VERSION) --sysroot=$(SDK) -isysroot $(SDK) -L$(SDK)/usr/lib/system -I$(SDK)/usr/lib /usr/lib/libc++.dylib
CONSOLE_LINK_OPTS =     $(LINK_OPTS)
LIBRARY_LINK =          libtool -s -o
LIBRARY_LINK_OPTS =
LIB_SUFFIX =            a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =


Also, as Apple requires all apps to have arm64 support by February, I wrote a bash script to compile live555 for arm7, arm7s, arm64, i386, x86_64.
It downloads live555-latest.tar.gz and uses it. However, it depends on the updated config.iphone-simulator to work.
For now, the script points to a copy of live555-latest with config.iphone-simulator replaced hosted on my website.
When/if config.iphone-simulator is replaced on the live555.com hosted tar the url in the bash script can be changed away from bradenackerman.com

Ross: Not sure if you want to distribute this with releases. It's here for anyone who reads the mailing list to use anywho :)

(Script follows)

Best regards,

Braden Ackerman



##### --> live555 universal library for iOS build script by Braden Ackerman (braden.ackerman+l555 at gmail.com) <-- #####


# **NOTE: 'Command Line Tools' (appropriate for iOS SDK version and MacOSX version) must be installed for this script to work.

# When this script completes, you should be left with a folder 'fat' which contains universal libs for the archs in PHONEARCHS + PCARCHS

LIVEFILE=live555-latest.tar.gz

PHONEARCHS=( armv7 armv7s arm64 )

LIBNAMES=( libliveMedia.a libgroupsock.a libUsageEnvironment.a libBasicUsageEnvironment.a )

PCARCHS=( i386 x86_64 )

ROOTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )


####### -- First, we'll download the live555 source and extract it to the current directory

#curl http://www.live555.com/liveMedia/public/$LIVEFILE > $LIVEFILE

curl http://www.bradenackerman.com/$LIVEFILE > $LIVEFILE



####### --- Second, make some arm libs

rm -r -f arms

mkdir $ROOTDIR/arms

for i in ${PHONEARCHS[@]}

do

rm -r -f live

tar -zxvf $LIVEFILE

chmod -R u+rwX,a+rX live

echo $i

sed -i.bak 's/armv7/'$i'/g' live/config.iphoneos

cd live

./genMakeFiles iphoneos

make

cd liveMedia

mkdir $ROOTDIR/arms/$i

cp libliveMedia.a $ROOTDIR/arms/$i

cd ..

cd groupsock

mkdir $ROOTDIR/arms/$i

cp libgroupsock.a $ROOTDIR/arms/$i

cd ..

cd UsageEnvironment

mkdir $ROOTDIR/arms/$i

cp libUsageEnvironment.a $ROOTDIR/arms/$i

cd ..

cd BasicUsageEnvironment

mkdir $ROOTDIR/arms/$i

cp libBasicUsageEnvironment.a $ROOTDIR/arms/$i

cd ..

cd ..

done



####### --- Third, make some PC libs

rm -r -f $ROOTDIR/pc

mkdir $ROOTDIR/pc

for i in ${PCARCHS[@]}

do

rm -r -f live

tar -zxvf $LIVEFILE

chmod -R u+rwX,a+rX live

echo $i

sed -i.bak 's/i386/'$i'/g' live/config.iphone-simulator

cd live

./genMakeFiles iphone-simulator

make

cd liveMedia

mkdir $ROOTDIR/pc/$i

cp libliveMedia.a $ROOTDIR/pc/$i

cd ..

cd groupsock

mkdir $ROOTDIR/pc/$i

cp libgroupsock.a $ROOTDIR/pc/$i

cd ..

cd UsageEnvironment

mkdir $ROOTDIR/pc/$i

cp libUsageEnvironment.a $ROOTDIR/pc/$i

cd ..

cd BasicUsageEnvironment

mkdir $ROOTDIR/pc/$i

cp libBasicUsageEnvironment.a $ROOTDIR/pc/$i

cd ..

cd ..

done




###### Fourth, we'll LIPO together all of our libraries

mkdir $ROOTDIR/fat


for i in ${LIBNAMES[@]}

do

lipo -output $ROOTDIR/fat/$i  -create \

-arch armv7 $ROOTDIR/arms/armv7/$i \

-arch armv7s $ROOTDIR/arms/armv7s/$i \

-arch arm64 $ROOTDIR/arms/arm64/$i \

-arch i386 $ROOTDIR/pc/i386/$i \

-arch x86_64 $ROOTDIR/pc/x86_64/$i

done


##### Fifth, clean up our mess

rm -r -f $ROOTDIR/arms

rm -r -f $ROOTDIR/pc

rm -r -f $ROOTDIR/live




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141219/9acb3c81/attachment.html>


More information about the live-devel mailing list