Is there any documentation for building OS X frameworks using autotools?

老子叫甜甜 提交于 2019-12-07 13:29:04

问题


I have a cross-platform shared library, and I am using GNU autotools for the build system. I would like to be able to package the library as a framework on OS X. Is it possible to do this with autotools + additional scripting e.g. bash?

Is there any good documentation for doing this, or does anyone know an example of a project that does this, which I could copy?


回答1:


A framework is a glorified directory that includes a metadata file (Info.plist) and one or more libraries. I’m not sure if there’s autotools support for frameworks but something like:

# create/cd MyFramework.framework
mkdir MyFramework.framework
cd MyFramework.framework

# create/cd MyFramework.framework/Versions    
mkdir Versions
cd Versions

# create/cd MyFramework.framework/Versions/A
mkdir A
cd A

# create MyFramework.framework/Versions/A/MyFramework (the dylib)
cp /path/to/mylibrary.dylib MyFramework

# create MyFramework.framework/Versions/A/Resources
mkdir Resources

# create MyFramework.framework/Versions/A/Resources/Info.plist
cp /path/to/Info.plist Resources

# cd to MyFramework.framework/Versions
cd ..

# create MyFramework.framework/Versions/Current -> A
ln -s A Current

# cd to Myframework.framework
cd ..

# create MyFramework.framework/MyFramework -> Versions/Current/MyFramework
ln -s Versions/Current/MyFramework MyFramework

# create MyFramework.framework/Resources -> Versions/Current/Resources
ln -s Versions/Current/Resources Resources

should be enough given a properly defined Info.plist file and mylibrary.dylib.

For more information about the framework directory structure and the contents of Info.plist, see the Framework Programming Guide.



来源:https://stackoverflow.com/questions/6583121/is-there-any-documentation-for-building-os-x-frameworks-using-autotools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!