Tag Archives: RDP

[iOS] How to build FreeRDP for iOS properly

Install HomeBrew for OS X
Goto http://brew.sh
Run followings on Terminal.app.
 
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
 
Run brew command for install CMake and PkgConfig.
 
brew install cmake pkg-config
 
 
Download FreeRDP-master from github
Download FreeRDP-master.zip from github.
Read carefully README.iOS file.
 
Enter scripts directory and edit  OpenSSL-iFreeRDP.diff file like followings:
Add “ -miphoneos-version-min=4.3” on armv7 and armv7s lines.
before
+”darwin-armv7s-cc”,”/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib”,
+”darwin-armv7-cc”,”/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib”,
After
+”darwin-armv7s-cc”,”/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7s -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib”,
+”darwin-armv7-cc”,”/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7 -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib”,
 
Run followings on Terminal.app.
cd scripts
./OpenSSL-DownloadAndBuild.command
 
Move openssl directory into external directory if not exist.
cd scripts
mv openssl ../external
 
Run followings on Terminal.app.
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/iOSToolchain.cmake -GXcode -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config
 
 
Make a script for changing absolute paths to relative paths
Run vi on Terminal.app or TextEdit.app and add followings in `changePathToRelative.command`.
#!/bin/sh
#
# Written by Henry Kim on May 28, 2015, 11:10
#
PROJECT=”FreeRDP.xcodeproj/project.pbxproj”
TARGET=$(PWD)

if [ -f $PROJECT ]; then
cp $PROJECT $PROJECT.bak
cat $PROJECT.bak | sed -e ‘s|’$TARGET’|\$\(SRCROOT\)|g’ > $PROJECT.new

        mv -f $PROJECT.new $PROJECT
        echo “Successfully replaced into relative pathes on iOS project file”

else
echo “No iOS project file in this directory”

fi
 
Save above script file and change a permission and run.
$ chmod +x changePathToRelative.command
$ ./changePathToRelative.command
Successfully replaced into relative pathes on iOS project file
 
Now you can open FreeRDP.xcodeproj anywhere !!!