Re: Macirssi build problem - ugly source

"Mark Duling" <[email protected]> Sun, 13 Aug 2006 14:26:13 -0700
Newsgroups gmane.os.opendarwin.darwinports
Message-ID <[email protected]>
John Labovitz <[email protected]> writes:
>On Aug 13, 2006, at 12:01pm, Mark Duling wrote:
>
>> Just to see how hard it would be I grabbed the latest source and  
>> tried to
>> update the portfile to use it.  The developers have hardcoded Fink
>> dependencies in it.  So I reinplaced all the /sw's with ${prefix} and
>> things went great until then it hit hardcoded /sw paths in the .dylib
>> files!  What a piece of work that is.  Just out of curiosity, is  
>> there a
>> Unix utility that can replace in a binary file without damaging it?
>
>Actually, it might be easier.  There's a tool called  
>"install_name_tool" that might do what you're trying to do.  From its  
>man page:
>
>        Install_name_tool  changes  the  dynamic  shared  library  
>install names
>        recorded in a Mach-O binary.  For this tool to work  when   
>the  install
>        names  are  larger  the  binary should be built with the ld 
>(1) -header-
>        pad_max_install_names option.
>
>I used this recently in a project to embed libraries built with  
>DarwinPorts into the Frameworks directory of an application bundle.   
>It worked great.  I think you should be able to do something like:
>
>	install_name_tool -change /sw/lib/libfoo.1.dylib /opt/local/lib/ 
>libfoo.1.dylib  appfile
>
>...where appfile is the executable file in the bundle at Contents/ 
>MacOS/<appname>, and "libfoo" is the library for which you need to  
>change the reference.
>
>--John

John,

Nice to know.  Thanks.  But in this case I may have mis-diagnosed the
problem.  There are paths embedded in the dylibs provided in the package
and the "not prebound" error led me to believe that was the porblem.  But
the error occurs during the build before the app is created and I suppose
the cause problem may be different than I thought.  If the build would
complete I think I could do as you suggested.  But this is such an
unfriendly app that my interest is mostly academic at this point anyway.

/usr/bin/ld: warning prebinding disabled because dependent library:
/sw/lib/libglib-2.0.0.dylib is not prebound
/usr/bin/ld: Undefined symbols:
_g_return_if_fail_warning
_g_assert_warning
collect2: ld returned 1 exit status
** BUILD FAILED **

Mark