<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Live555ers,</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<div># **Note: You must install the relevant "Command line tools (OSX *.*) for Xcode - Xcode *.*"</div>
<div># for this configuration file to work.</div>
<div># Change the following version number, if necessary, before running "genMakefiles iphoneos"</div>
<div>IOS_VERSION =<span class="Apple-tab-span" style="white-space:pre"> </span>8.1</div>
<div>MIN_IOS_VERSION =<span class="Apple-tab-span" style="white-space:pre"> </span>
7.0</div>
<div>DEVELOPER_PATH =<span class="Apple-tab-span" style="white-space:pre"> </span>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer</div>
<div>TOOL_PATH =<span class="Apple-tab-span" style="white-space:pre"> </span>$(DEVELOPER_PATH)/usr/bin</div>
<div>SDK_PATH =<span class="Apple-tab-span" style="white-space:pre"> </span>$(DEVELOPER_PATH)/SDKs</div>
<div>SDK =<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>$(SDK_PATH)/iPhoneSimulator$(IOS_VERSION).sdk</div>
<div>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)</div>
<div>C = c</div>
<div>C_COMPILER = /usr/bin/xcrun clang</div>
<div>C_FLAGS = $(COMPILE_OPTS)</div>
<div>CPP = cpp</div>
<div>CPLUSPLUS_COMPILER = /usr/bin/xcrun clang</div>
<div>CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall</div>
<div>OBJ = o</div>
<div>LINK = /usr/bin/xcrun clang -o </div>
<div>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</div>
<div>CONSOLE_LINK_OPTS = $(LINK_OPTS)</div>
<div>LIBRARY_LINK = libtool -s -o </div>
<div>LIBRARY_LINK_OPTS =</div>
<div>LIB_SUFFIX = a</div>
<div>LIBS_FOR_CONSOLE_APPLICATION =</div>
<div>LIBS_FOR_GUI_APPLICATION =</div>
<div>EXE =</div>
<div><br>
</div>
<div><br>
</div>
<div>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.<br>
</div>
<div>It downloads live555-latest.tar.gz and uses it. However, it depends on the updated <span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">config.</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">iphone</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">-simulator</span>
to work.</div>
<div>For now, the script points to a copy of live555-latest with <span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">config.</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">iphone</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">-simulator</span>
replaced hosted on my website.</div>
<div>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</div>
<div><br>
</div>
<div>Ross: Not sure if you want to distribute this with releases. It's here for anyone who reads the mailing list to use anywho :)<br>
</div>
<div><br>
</div>
<div>(Script follows)<br>
</div>
<div><br>
</div>
<div>Best regards,<br>
</div>
<div><br>
</div>
<div>Braden Ackerman<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<p class="p1">##### --> live555 universal library for iOS build script by Braden Ackerman (braden.ackerman+l555@gmail.com) <-- #####</p>
<p class="p2"><br>
</p>
<p class="p1"># **NOTE: 'Command Line Tools' (appropriate for iOS SDK version and MacOSX version) must be installed for this script to work.</p>
<p class="p1"># When this script completes, you should be left with a folder 'fat' which contains universal libs for the archs in PHONEARCHS + PCARCHS</p>
<p class="p3">LIVEFILE=live555-latest.tar.gz<br>
</p>
<p class="p3">PHONEARCHS=( armv7 armv7s arm64 )</p>
<p class="p3">LIBNAMES=( libliveMedia.a libgroupsock.a libUsageEnvironment.a libBasicUsageEnvironment.a )</p>
<p class="p3">PCARCHS=( i386 x86_<span class="s1">64</span> )</p>
<p class="p3">ROOTDIR=$( cd <span class="s2">"$( dirname "</span>${BASH_SOURCE[<span class="s1">0</span>]}<span class="s2">" )"</span> && pwd )</p>
<p class="p2"><br>
</p>
<p class="p1">####### -- First, we'll download the live555 source and extract it to the current directory</p>
<p class="p3"><span class="s3">#curl <a href="http://www.live555.com/liveMedia/public/$LIVEFILE">
<span class="s4">http://www.live555.com/liveMedia/public/$LIVEFILE</span></a> > $LIVEFILE</span></p>
<p class="p3">curl http://www.bradenackerman.com/$LIVEFILE > $LIVEFILE</p>
<p class="p2"><br>
</p>
<p class="p2"><br>
</p>
<p class="p1">####### --- Second, make some arm libs</p>
<p class="p3">rm -r -f arms</p>
<p class="p3">mkdir $ROOTDIR/arms</p>
<p class="p3"><span class="s5">for</span> i <span class="s5">in</span> ${PHONEARCHS[@]}</p>
<p class="p4">do</p>
<p class="p3">rm -r -f live</p>
<p class="p3">tar -zxvf $LIVEFILE</p>
<p class="p3">chmod -R u+rwX,a+rX live</p>
<p class="p3">echo $i</p>
<p class="p3">sed -i.bak <span class="s2">'s/armv7/'</span>$i<span class="s2">'/g'</span> live/config.iphoneos</p>
<p class="p3">cd live</p>
<p class="p3">./genMakeFiles iphoneos</p>
<p class="p3">make</p>
<p class="p3">cd liveMedia</p>
<p class="p3">mkdir $ROOTDIR/arms/$i</p>
<p class="p3">cp libliveMedia.a $ROOTDIR/arms/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd groupsock</p>
<p class="p3">mkdir $ROOTDIR/arms/$i</p>
<p class="p3">cp libgroupsock.a $ROOTDIR/arms/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd UsageEnvironment</p>
<p class="p3">mkdir $ROOTDIR/arms/$i</p>
<p class="p3">cp libUsageEnvironment.a $ROOTDIR/arms/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd BasicUsageEnvironment</p>
<p class="p3">mkdir $ROOTDIR/arms/$i</p>
<p class="p3">cp libBasicUsageEnvironment.a $ROOTDIR/arms/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd ..</p>
<p class="p4">done</p>
<p class="p2"><br>
</p>
<p class="p2"><br>
</p>
<p class="p1">####### --- Third, make some PC libs</p>
<p class="p3">rm -r -f $ROOTDIR/pc</p>
<p class="p3">mkdir $ROOTDIR/pc</p>
<p class="p3"><span class="s5">for</span> i <span class="s5">in</span> ${PCARCHS[@]}</p>
<p class="p4">do</p>
<p class="p3">rm -r -f live</p>
<p class="p3">tar -zxvf $LIVEFILE</p>
<p class="p3">chmod -R u+rwX,a+rX live</p>
<p class="p3">echo $i</p>
<p class="p3">sed -i.bak <span class="s2">'s/i386/'</span>$i<span class="s2">'/g'</span> live/config.iphone-simulator</p>
<p class="p3">cd live</p>
<p class="p3">./genMakeFiles iphone-simulator</p>
<p class="p3">make</p>
<p class="p3">cd liveMedia</p>
<p class="p3">mkdir $ROOTDIR/pc/$i</p>
<p class="p3">cp libliveMedia.a $ROOTDIR/pc/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd groupsock</p>
<p class="p3">mkdir $ROOTDIR/pc/$i</p>
<p class="p3">cp libgroupsock.a $ROOTDIR/pc/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd UsageEnvironment</p>
<p class="p3">mkdir $ROOTDIR/pc/$i</p>
<p class="p3">cp libUsageEnvironment.a $ROOTDIR/pc/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd BasicUsageEnvironment</p>
<p class="p3">mkdir $ROOTDIR/pc/$i</p>
<p class="p3">cp libBasicUsageEnvironment.a $ROOTDIR/pc/$i</p>
<p class="p3">cd ..</p>
<p class="p3">cd ..</p>
<p class="p4">done</p>
<p class="p2"><br>
</p>
<p class="p2"><br>
</p>
<p class="p2"><br>
</p>
<p class="p1">###### Fourth, we'll LIPO together all of our libraries</p>
<p class="p3">mkdir $ROOTDIR/fat</p>
<p class="p2"><br>
</p>
<p class="p3"><span class="s5">for</span> i <span class="s5">in</span> ${LIBNAMES[@]}</p>
<p class="p4">do</p>
<p class="p3">lipo -output $ROOTDIR/fat/$i -create \</p>
<p class="p3">-arch armv7 $ROOTDIR/arms/armv7/$i \</p>
<p class="p3">-arch armv7s $ROOTDIR/arms/armv7s/$i \</p>
<p class="p3">-arch arm64 $ROOTDIR/arms/arm64/$i \</p>
<p class="p3">-arch i386 $ROOTDIR/pc/i386/$i \</p>
<p class="p3">-arch x86_<span class="s1">64</span> $ROOTDIR/pc/x86_<span class="s1">64</span>/$i</p>
<p class="p4">done</p>
<p class="p2"><br>
</p>
<p class="p1">##### Fifth, clean up our mess</p>
<p class="p3">rm -r -f $ROOTDIR/arms</p>
<p class="p3">rm -r -f $ROOTDIR/pc</p>
<p class="p3">rm -r -f $ROOTDIR/live<br>
</p>
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<p><br>
</p>
</div>
</body>
</html>