My favorites | Sign in
Project Logo
                
Links:
Feeds:
People details
Project owners:
  0xcafefeed

Description

Helps to relocate a Mach-O library as an Apple Framework bundle. rtool is an "Automator" to relocate a library into a bundle without rebuilding it (including options for other linked Libraries and linked Executables).

If you are not familiar with the relocation table for executables under Mac OS, rtool source contains several examples using INSTALL_NAME_TOOL(1), DYLD(1), OTOOL(1), it also contains sample codes using the Core Foundation to help you to understand how the CFBundle API works.

Quickies

rtool does not produce a perfect final deployment, you may adjust the result to fit with your needs, I cannot anticipate or guess all the cases you will face, be careful with fat or "universal" binaries containing an "asynchronous" symbol / link table __LINKEDIT ... see mach-o/loader.h, we put this Issue as example, we think that is not a good idea at all, but still thinking about it, because it is opening "Pandora's box" and may lead to several new issues, regarding this one, the developer was lucky.

Anyway the following examples should cover 90% of the regular cases, rtool is "silencious" when/if is not able to find and replace a link or a library id, you may check the result using OTOOL(1), in most cases, this feature provides "flexibility" not a disadvantage. If you have any question regarding undocumented features or possibilities/behaviours; you are welcome to contact me or fill an Issue.

Usage

Usage: rtool [--version|--short_version|--help|[options]]

	options:
		--framework_root		root path, identification basename.
		--framework_name		name, the name of the bundle.
		--framework_version		version, the version of the bundle.
		--framework_identifier		(optional) identifier, the identifier of the bundle.
		--library			full path of a dynamic shared library.
		--rlinks_binaries		(optional) [$LIST_SEARCH_ID(S)]:[$LIST_REPLACE_ID(S)]
		--rlinks_framework		(optional) [$LIST_SEARCH_ID(S)]:[$LIST_REPLACE_ID(S)]
		--headers			(optional) $LIST_OF_HEADER(S) OR $DIR_OF_HEADER(S)
		--headers_no_root		(optional) copy the content of a directory not the directory itself.
		--headers_create_common		(optional)
		--builddir			(optional) $BUILD_DIR_PATH
		--binaries			(optional) $LIST_OF_BINARIE(S)
		--manuals			(optional) $LIST_OF_MANFILE(S)

Examples:
	%$ rtool \
	--framework_root="@executable_path/../Frameworks" \
	--framework_name="xmlLib" \
	--framework_version="A" \
	--framework_identifier="org.xmlsoft.xmlLib" \
	--library="/usr/lib/libxml2.2.dylib" \
	--builddir="build" \
	--binaries="/usr/bin/xmlcatalog" \
	--headers="/usr/include/libxml2/libxml" \
	--manuals="/usr/share/man/man1/xmlcatalog.1"
	
	
	%$ rtool \
	--framework_root="@executable_path/../Frameworks" \
	--framework_name="exsltLib" \
	--framework_version="A" \
	--library="/usr/lib/libexslt.0.dylib" \
	--builddir="build" \
	--binaries="/usr/bin/xsltproc" \
	--rlinks_binaries="[/usr/lib/libxml2.2.dylib]:\
	[@executable_path/../Frameworks/xmlLib.framework/Versions/A/xmlLib]" \
	--rlinks_framework="[/usr/lib/libxml2.2.dylib]:\
	[@executable_path/../Frameworks/xmlLib.framework/Versions/A/xmlLib]" \
	--headers="/usr/include/libexslt" \
	--headers_no_root \
	--manuals="/usr/share/man/man1/xsltproc.1"
	
	
	%$ rtool \
	--framework_root="/Library/Frameworks" \
	--framework_name="zLib" \
	--framework_version="1" \
	--library="/usr/lib/libz.1.2.3.dylib" \
	--builddir="build" 
	
	
	%$ rtool \
	--framework_root="@executable_path/../Frameworks" \
	--framework_name="exsltLib" \
	--framework_version="A" \
	--library="/usr/lib/libexslt.0.dylib" \
	--builddir="build" \
	--binaries="/usr/bin/xsltproc /usr/bin/xmlcatalog" \
	--rlinks_binaries="[/usr/lib/libxml2.2.dylib /usr/lib/libz.1.dylib]:\
	[@executable_path/../Frameworks/xmlLib.framework/Versions/A/xmlLib /Library/Frameworks/zLib.framework/Versions/1/zLib]" \
	--rlinks_framework="[/usr/lib/libxml2.2.dylib /usr/lib/libz.1.dylib]:\
	[@executable_path/../Frameworks/xmlLib.framework/Versions/A/xmlLib /Library/Frameworks/zLib.framework/Versions/1/zLib]" \
	--headers="/usr/include/libexslt/exslt.h /usr/include/libexslt/exsltconfig.h /usr/include/libexslt/exsltexports.h" \
	--manuals="/usr/share/man/man1/xsltproc.1 /usr/share/man/man1/xmlcatalog.1"








Hosted by Google Code