aMule Forum
English => Multiplatform => Mac OSX => Topic started by: gtoso on May 14, 2009, 03:37:37 PM
-
Hi,
to build Mac bundle, libraries are copied to Frameworks and then the "linking" between executables and libraries are changed by install_name_tool
See mac_packager (http://gtoso.tor.it/pub/amule/osx/2.2.4/OSXBuild/mac_packager).
The script works fine,
but at some point install_name_tool refuses to change the name of some libraries in some executables.
It never happened on Tiger PPC, now I'm on Leopard Intel.
I added some debug output and at some point:
install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
Full output:
Step 1: Cleaning bundles... Done
Step 2: Copying aMule to app bundles... Done
Step 3: Installing translations to aMule bundle... Done
Step 4: Copying libs to aMule Framework
wxWidgets/MacPorts...
Libs copy done.
Step 5: Update aMule libs info
Updating libGeoIP.1.dylib
Updating aMule lib info for libGeoIP.1.dylib
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libGeoIP.1.dylib @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amule
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amuled
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amuleweb
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libiconv.2.dylib
Updating aMule lib info for libiconv.2.dylib
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/alcc
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amule
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amulecmd
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amuled
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libiconv.2.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libiconv.2.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/mulefileview
Updating libintl.8.dylib
Updating aMule lib info for libintl.8.dylib
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/amule
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/amuled
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libintl.8.dylib @executable_path/../Frameworks/libintl.8.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libintl.8.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libixml.2.dylib
Updating aMule lib info for libixml.2.dylib
install_name_tool -change @executable_path/../Frameworks/libixml.2.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libixml.2.dylib @executable_path/../Frameworks/libixml.2.dylib MacOS/amule
install_name_tool -change @executable_path/../Frameworks/libixml.2.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libixml.2.dylib @executable_path/../Frameworks/libixml.2.dylib MacOS/amuled
install_name_tool -change /opt/local/lib/libixml.2.dylib @executable_path/../Frameworks/libixml.2.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libixml.2.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libixml.2.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libixml.2.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libpng12.0.dylib
Updating aMule lib info for libpng12.0.dylib
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/amule
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/amuled
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libpng12.0.dylib @executable_path/../Frameworks/libpng12.0.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libpng12.0.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libthreadutil.2.dylib
Updating aMule lib info for libthreadutil.2.dylib
install_name_tool -change @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libthreadutil.2.dylib @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
install_name_tool -change @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libthreadutil.2.dylib @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/amuled
install_name_tool -change /opt/local/lib/libthreadutil.2.dylib @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libupnp.3.dylib
Updating aMule lib info for libupnp.3.dylib
install_name_tool -change @executable_path/../Frameworks/libupnp.3.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
install_name_tool -change @executable_path/../Frameworks/libupnp.3.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib MacOS/amuled
install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libupnp.3.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libupnp.3.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libupnp.3.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Updating libz.1.dylib
Updating aMule lib info for libz.1.dylib
install_name_tool -change @executable_path/../Frameworks/libz.1.dylib MacOS/alcc
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amulecmd
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amuled
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amuleweb
install_name_tool -change @executable_path/../Frameworks/libz.1.dylib MacOS/cas
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libz.1.dylib MacOS/ed2k
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change @executable_path/../Frameworks/libz.1.dylib MacOS/mulefileview
Usage: install_name_tool [-change old new] ... [-id name] input
Libs info updated, aMule.app is ready to package.
Step 6: Installing translations to aMuleGUI bundle... Done
Step 7: Copying libs to aMuleGUI Framework
wxWidgets/MacPorts...
Libs copy done.
Step 8: Update aMuleGUI libs info
Updating libGeoIP.1.dylib
Updating aMuleGUI lib info for libGeoIP.1.dylib
install_name_tool -change @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amulecmd
Usage: install_name_tool [-change old new] ... [-id name] input
install_name_tool -change /opt/local/lib/libGeoIP.1.dylib @executable_path/../Frameworks/libGeoIP.1.dylib MacOS/amulegui
Updating libiconv.2.dylib
Updating aMuleGUI lib info for libiconv.2.dylib
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amulecmd
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/amulegui
Updating libz.1.dylib
Updating aMuleGUI lib info for libz.1.dylib
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amulecmd
install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amulegui
Libs info updated, aMuleGUI.app is ready to package.
Step 9: Installing translations to WxCas bundle... Done
Step 10: Copying libs to WxCas Framework
wxWidgets/MacPorts...
Libs copy done.
Step 11: Update WxCas libs info
Updating libiconv.2.dylib
Updating WxCas lib info for libiconv.2.dylib
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/wxcas
Libs info updated, WxCas.app is ready to package.
Step 12: Installing translations to aLinkCreator bundle... Done
Step 13: Copying libs to aLinkCreator Framework
wxWidgets/MacPorts...
Libs copy done.
Step 14: Update aLinkCreator libs info
Updating libiconv.2.dylib
Updating aLinkCreator lib info for libiconv.2.dylib
install_name_tool -change /opt/local/lib/libiconv.2.dylib @executable_path/../Frameworks/libiconv.2.dylib MacOS/alc
Libs info updated, aLinkCreator.app is ready to package.
Creating aMule-2.2.4-aDebug-GeoIP-OSX10.4+-GToso.dmg... Done
-
The problem doesn't depends from the particulary library.
enterprise:Contents sadmin$ cp ../../src/amule MacOS/
enterprise:Contents sadmin$ install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib MacOS/amule
enterprise:Contents sadmin$ install_name_tool -change /opt/local/lib/libixml.2.dylib @executable_path/../Frameworks/libixml.2.dylib MacOS/amule
enterprise:Contents sadmin$ install_name_tool -change /opt/local/lib/libthreadutil.2.dylib @executable_path/../Frameworks/libthreadutil.2.dylib MacOS/amule
enterprise:Contents sadmin$ install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
enterprise:Contents sadmin$ cp ../../src/amule MacOS/
enterprise:Contents sadmin$ install_name_tool -change /opt/local/lib/libupnp.3.dylib @executable_path/../Frameworks/libupnp.3.dylib -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib -change /opt/local/lib/libthreadutil.2.dylib @executable_path/../Frameworks/libthreadutil.2.dylib -change /opt/local/lib/libixml.2.dylib @executable_path/../Frameworks/libixml.2.dylib MacOS/amule
install_name_tool: changing install names can't be redone for: MacOS/amule (for architecture ppc) because larger updated load commands do not fit (the program must be relinked)
enterprise:Contents sadmin$
-
Maybe I found the solution (http://annoyingtechnicaldetails.wordpress.com/2007/04/18/install_name_tool-changing-install-names-cant-be-redone-for-for-architecture-ppc-because-larger-updated-load-commands-do-not-fit-the-program-must-be-relinked/):
From ld man:
-headerpad size
Specifies the minimum space for future expansion of the load commands. Only useful if intend to run install_name_tool to alter the load commands later. Size is a hexadecimal number.
-headerpad_max_install_names
Automatically adds space for future expansion of load commands such that all paths could expand to MAXPATHLEN. Only useful if intend to run install_name_tool to alter the load commands later.
Size is a hexadecimal number.
Now I have no more time to try.
ASAP I'll try to rebuild aMule.
EDIT: Done and it works.
PS: I modified mac_packager to write down the stderr of install_name_tool...
Another question:
I used not libgd: configure warns if it is missing, but it seemed not needed.
So I have less libraries in Frameworks, and the Application bundle is more small.
But Cas needs libgd to create the Online Signature Image, so in my package the command line utility cas doesn't generate image.
It seems that only cas uses it, here (http://www.amule.org/amule/index.php?topic=8688.0) a confirm.
So is it better to leave cas without image (WxCas works) or an aMule.app more big?
EDIT:
For now, I preferred to have a fully functional cas, the new libraries don't weigh much:
aMule.app is 100.2MB instead of 97.5MB.
To reduce the size and maybe enhance performance on old macs, we could disable debug, but I think it is better to keep it.
(My previous packages, with one exception, were without debug and had stripped binaries: it was an incubus to identify problems.)
Only aMule is compiled with debugging enabled, wxMac no:
the last time I tried it the size was about 1GB.