diff --git a/lutinEnv.py b/lutinEnv.py index 36ba2b1..439e9bd 100644 --- a/lutinEnv.py +++ b/lutinEnv.py @@ -41,14 +41,12 @@ def print_pretty(myString): tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t') tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t') tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t') - tmpcmdLine = tmpcmdLine.replace('-o\n\t', '-o ') - tmpcmdLine = tmpcmdLine.replace('-D\n\t', '-D ') - tmpcmdLine = tmpcmdLine.replace('-I\n\t', '-I ') - tmpcmdLine = tmpcmdLine.replace('-L\n\t', '-L ') - tmpcmdLine = tmpcmdLine.replace('g++\n\t', 'g++\t') - tmpcmdLine = tmpcmdLine.replace('gcc\n\t', 'gcc\t') - tmpcmdLine = tmpcmdLine.replace('ar\n\t', 'ar\t') - tmpcmdLine = tmpcmdLine.replace('ranlib\n\t', 'ranlib\t') + baseElementList = ["-o", "-D", "-I", "-L", "g++", "gcc", "clang", "clang++", "ar", "ld", "ranlib", "-framework", "-isysroot", "-arch"] + for element in baseElementList: + tmpcmdLine = tmpcmdLine.replace(element+'\n\t', element+' ') + baseElementList = ["g++", "gcc", "clang", "clang++", "ar", "ld", "ranlib"] + for element in baseElementList: + tmpcmdLine = tmpcmdLine.replace('/'+element+' ', '/'+element+'\n\t') tmpcmdLine = tmpcmdLine.replace('\n\t', ' \\\n\t') return tmpcmdLine diff --git a/lutinModule.py b/lutinModule.py index c48e92b..7a4aca3 100644 --- a/lutinModule.py +++ b/lutinModule.py @@ -124,6 +124,7 @@ class Module: cmdLine=lutinTools.list_to_str([ target.xx, "-o", file_dst, + target.arch, target.sysroot, target.global_include_cc, lutinTools.add_prefix("-I",self.export_path), @@ -158,6 +159,7 @@ class Module: cmdLine=lutinTools.list_to_str([ target.cc, "-o", file_dst , + target.arch, target.sysroot, target.global_include_cc, lutinTools.add_prefix("-I",self.export_path), @@ -192,6 +194,7 @@ class Module: cmdLine=lutinTools.list_to_str([ target.xx, "-o", file_dst, + target.arch, target.sysroot, target.global_include_cc, lutinTools.add_prefix("-I",self.export_path), @@ -225,6 +228,7 @@ class Module: cmdLine=lutinTools.list_to_str([ target.cc, "-o", file_dst, + target.arch, target.sysroot, target.global_include_cc, lutinTools.add_prefix("-I",self.export_path), @@ -293,6 +297,7 @@ class Module: target.xx, "-o", file_dst, target.global_sysroot, + target.arch, "-shared", file_src, depancy.src, @@ -332,9 +337,10 @@ class Module: #create comdLine : cmdLine=lutinTools.list_to_str([ target.xx, - "-o", file_dst, + target.arch, target.sysroot, target.global_sysroot, + "-o", file_dst, file_src, depancy.src, self.flags_ld, diff --git a/lutinTarget.py b/lutinTarget.py index 0d415b9..36a6674 100644 --- a/lutinTarget.py +++ b/lutinTarget.py @@ -6,7 +6,10 @@ import lutinModule class Target: def __init__(self, name, typeCompilator, debugMode, generatePackage, arch, cross): - self.arch = arch + if arch != "": + self.arch = "-arch " + arch + else: + self.arch = "" self.cross = cross self.name=name self.endGeneratePackage = generatePackage diff --git a/lutinTargetIOs.py b/lutinTargetIOs.py index 77ce892..9f807dc 100644 --- a/lutinTargetIOs.py +++ b/lutinTargetIOs.py @@ -5,14 +5,17 @@ import lutinTools import os import stat import lutinExtProjectGeneratorXCode +import lutinMultiprocess class Target(lutinTarget.Target): def __init__(self, typeCompilator, debugMode, generatePackage): - cross = "" - + cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/" + if typeCompilator == "gcc": + debug.info("compile only with clang for IOs"); + typeCompilator = "clang" # http://biolpc22.york.ac.uk/pub/linux-mac-cross/ # http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt - lutinTarget.Target.__init__(self, "IOs", typeCompilator, debugMode, generatePackage, "", cross) + lutinTarget.Target.__init__(self, "IOs", typeCompilator, debugMode, generatePackage, "i386", cross) self.folder_bin="" self.folder_lib="/lib" @@ -26,13 +29,22 @@ class Target(lutinTarget.Target): self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk" - self.global_flags_ld.append("-mios-simulator-version-min=7.0") + self.global_flags_ld.append([ + "-mios-simulator-version-min=7.0", + "-Xlinker", + "-objc_abi_version", + "-Xlinker 2", + "-Xlinker", + "-no_implicit_dylibs", + "-stdlib=libc++", + "-fobjc-arc", + "-fobjc-link-runtime"]) + self.global_flags_cc.append("-mios-simulator-version-min=7.0") #add a project generator: self.externProjectManager = lutinExtProjectGeneratorXCode.ExtProjectGeneratorXCode() - - + def get_staging_folder(self, binaryName): return lutinTools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/" @@ -71,33 +83,35 @@ class Target(lutinTarget.Target): tmpFile.write(" CFBundleInfoDictionaryVersion\n") tmpFile.write(" 6.0\n") tmpFile.write(" CFBundleName\n") - tmpFile.write(" projectName\n") + tmpFile.write(" " + pkgName + "\n") tmpFile.write(" CFBundlePackageType\n") tmpFile.write(" APPL\n") tmpFile.write(" CFBundleShortVersionString\n") tmpFile.write(" 1.0\n") tmpFile.write(" CFBundleSignature\n") tmpFile.write(" ????\n") - """ tmpFile.write(" CFBundleSupportedPlatforms\n") tmpFile.write(" \n") tmpFile.write(" iPhoneSimulator\n") tmpFile.write(" \n") + """ tmpFile.write(" CFBundleVersion\n") tmpFile.write(" 1.0\n") + """ tmpFile.write(" DTPlatformName\n") tmpFile.write(" iphonesimulator\n") tmpFile.write(" DTSDKName\n") tmpFile.write(" iphonesimulator7.0\n") + """ tmpFile.write(" LSRequiresIPhoneOS\n") tmpFile.write(" \n") + """ tmpFile.write(" UIDeviceFamily\n") tmpFile.write(" \n") tmpFile.write(" 1\n") tmpFile.write(" 2\n") tmpFile.write(" \n") """ - """ tmpFile.write(" UILaunchImages\n") tmpFile.write(" \n") tmpFile.write(" \n") @@ -118,7 +132,6 @@ class Target(lutinTarget.Target): tmpFile.write(" UIMainStoryboardFile~ipad\n") tmpFile.write(" Main_iPad\n") """ - """ tmpFile.write(" UIRequiredDeviceCapabilities\n") tmpFile.write(" \n") tmpFile.write(" armv7\n") @@ -128,6 +141,7 @@ class Target(lutinTarget.Target): tmpFile.write(" UISupportedInterfaceOrientations\n") tmpFile.write(" \n") tmpFile.write(" UIInterfaceOrientationPortrait\n") + tmpFile.write(" UIInterfaceOrientationPortraitUpsideDown\n") tmpFile.write(" UIInterfaceOrientationLandscapeLeft\n") tmpFile.write(" UIInterfaceOrientationLandscapeRight\n") tmpFile.write(" \n") @@ -138,7 +152,6 @@ class Target(lutinTarget.Target): tmpFile.write(" UIInterfaceOrientationLandscapeLeft\n") tmpFile.write(" UIInterfaceOrientationLandscapeRight\n") tmpFile.write(" \n") - """ tmpFile.write(" \n") tmpFile.write("\n") tmpFile.write("\n\n") @@ -177,7 +190,11 @@ class Target(lutinTarget.Target): debug.debug("------------------------------------------------------------------------") debug.info("Install package '" + pkgName + "'") debug.debug("------------------------------------------------------------------------") - debug.warning(" ==> TODO") + #destinationFolder = "~/Library/Developer/Xcode/DerivedData/" + pkgName + "-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphonesimulator/" + pkgName + ".app" + destinationFolder = "~/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/9F1F8349-E13D-4DC3-8343-1DCEB055489A/" + pkgName + ".app" + lutinTools.create_directory_of_file(destinationFolder + "/plop.txt") + cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder + lutinMultiprocess.run_command(cmdLine) #sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package def un_install_package(self, pkgName): @@ -186,6 +203,13 @@ class Target(lutinTarget.Target): debug.debug("------------------------------------------------------------------------") debug.warning(" ==> TODO") #sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package + + def Log(self, pkgName): + debug.debug("------------------------------------------------------------------------") + debug.info("log of iOs board") + debug.debug("------------------------------------------------------------------------") + cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.0.3/system.log" + lutinMultiprocess.run_command(cmdLine)