现在再编译应该不会提示工程不支持了,那么剩下的就是改变其编译选项了,就是libtool的参数问题。 我们需要修改下列文件 /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/Libtool.xcspec /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/iPhoneLinkerOptions.xcspec 在Libtool.xcspec中添加下列片段
{ Identifier = com.apple.pbx.linkers.libtooldynamic; Type = Linker; Class = PBXLinkerSpecificationLibtool; Name = "Libtool"; Description = "Create a dynamic library using Apple Mach-O Librarian (libtool)"; IsAbstract = Yes; // This is an internal tool, so we keep it out of the user interface BinaryFormats = (mach-o); Architectures = (ppc, ppc7400, ppc7450, ppc970, ppc64, i386, x86_64); CommandLine = "$(LIBTOOL) -dynamic -arch_only $(arch) -compatibility_version $(DYLIB_COMPATIBILITY_VERSION) -current_version $(DYLIB_CURRENT_VERSION) [options] [special-args] -o $(OutputPath)"; // 'special-args' includes the input files RuleName = "Libtool $(OutputPath) $(variant) $(arch)"; ExecDescription = "Create Dynamic Library $(OutputPath:file)"; InputFileTypes = ( compiled.mach-o.objfile ); Outputs = ( // We're a linker-like task, so we expect to be given an output path in 'OutputPath'. "$(OutputPath)" ); CommandOutputParser = XCGccCommandOutputParser; Options = ( // LIBTOOL { Name = LIBTOOL; Type = Path; DefaultValue = "$(PLATFORM_DEVELOPER_BIN_DIR)/libtool"; },
// SDK { Name = SDKROOT; Type = Path; CommandLineFlag = "-syslibroot"; IsInputDependency = Yes; },
// Search paths { Name = LIBRARY_SEARCH_PATHS; Type = PathList; FlattenRecursiveSearchPathsInValue = Yes; // causes any paths that have a '/**' suffix to be replaced with matching paths CommandLinePrefixFlag = "-L"; },
// Input file lists { Name = __INPUT_FILE_LIST_PATH__; Type = Path; DefaultValue = "$(LINK_FILE_LIST_$(variant)_$(arch))"; // this is set up for us as a read-only property CommandLineFlag = "-filelist"; IsInputDependency = Yes; }, { Name = auxiliary_file_lists; Type = PathList; CommandLineFlag = "-filelist"; IsInputDependency = Yes; },
// Various flags { Name = ALL_OTHER_LIBTOOLFLAGS; Type = StringList; DefaultValue = "$(LD_FLAGS) $(SECTORDER_FLAGS) $(OTHER_LDFLAGS) $(OTHER_LDFLAGS_$(variant)) $(OTHER_LDFLAGS_$(arch)) $(OTHER_LDFLAGS_$(variant)_$(arch)) $(OTHER_LIBTOOLFLAGS) $(OTHER_LIBTOOLFLAGS_$(variant)) $(OTHER_LIBTOOLFLAGS_$(arch)) $(OTHER_LIBTOOLFLAGS_$(variant)_$(arch)) $(PRODUCT_SPECIFIC_LIBTOOLFLAGS)"; CommandLinePrefixFlag = ""; }, { Name = EXPORTED_SYMBOLS_FILE; Type = Path; Condition = "$(SEPARATE_SYMBOL_EDIT) == NO"; CommandLineFlag = "-exported_symbols_list"; IsInputDependency = Yes; }, { Name = UNEXPORTED_SYMBOLS_FILE; Type = Path; Condition = "$(SEPARATE_SYMBOL_EDIT) == NO"; CommandLineFlag = "-unexported_symbols_list"; IsInputDependency = Yes; }, { Name = AdditionalCommandLineArguments; Type = StringList; CommandLinePrefixFlag = ""; },
{ Name = MACOSX_DEPLOYMENT_TARGET; Type = String; SetValueInEnvironmentVariable = "MACOSX_DEPLOYMENT_TARGET"; }, ); },
此帖纯粹讨论怎样更改xcode配置来使其支持创建iphone上的dylib工程文件,不涉及任何其他破解话题!测试机器:10.6 with Xcode3.2最近在研究如何创建iphone上的dylib文件,google出来的都是toolchain的东西,使用makefile来编译的,像我这种习惯IDE的人来说非常之不爽,所以花了一天时间来破解了下Xcode来让它可以创...