[gtkada] patch for mac

Chris Douty Chris_Douty at ampex.com
Tue Jul 27 00:03:30 CEST 2004


On Monday, July 26, 2004, at 02:21 PM, Arnaud Charlet wrote:
[snip]
>> It would be nice to provide a configure argument 
>> --with-shared=(yes|no)
>> rather than hacking at aclocal.m4.  Some folks probably need a static
>> library even on an OS where you build shared by default, unless both
>> variants are built.
>
> Both variants are built and can be used when shared libs are 
> supported, so
> this argument isn't needed.
> aclocal.m4 simply sets the right value for a given OS, which is 
> clearly better
> than having a bad default, and force every user to have to guess what
> --with-shared they should use.

OK.  I'll note some more Darwin oddities.  You can not force the linker 
to choose static libraries with a "-l<name>" flag if a .dylib is 
available.  If "gtkada-config --static" works by listing the full path 
to the static archive, then it'll work on darwin.

>
>> You already have a conditional section on BUILD_SHARED in the
>> Makefiles.  Darwin uses significantly different arguments to build
>
> This conditional section has no target dependent code: it only 
> enables/disables
> build of shared libs.

OK, it's your project, but it really only builds on a software 
monoculture of ELF platforms.  The link line *will not work* on darwin 
without major changes.  No combination of SO_OPTS and SONAME will give 
you a working command.  In fact I can't even craft a valid SONAME 
because that's coded as "libgtkada-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)" 
unless I change the meaning of SO_EXT and MICRO which breaks a lot more.

>> shared libraries than ELF-based OSes.  This seemed like the easiest
>> solution, but it probably requires GNUMake.  If you banish if's from
>
> We already require gnumake, that's not the issue.
>
> The issue is to put target specific sections in these makefiles, which 
> isn't
> needed.
>
>> the Makefiles then I will need to do radical surgery on the whole 
>> build
>> system.  Note that many other projects use GNU libtool to handle
>> library building mechanics.  I'd prefer not to because it is really
>> complicated.
>
> I believe all you needed is gcc -shared, and set FPIC to -fno-common 
> (or
> whatever weird option is needed on darwin to generate code compatible 
> with
> shared libs).
>
> You can also set OS_SPECIFIC_LINK_OPTIONS in aclocal.m4 for any weird
> options passed to the linker.
>
> If gcc -shared can't be used, then please fix gcc first to properly 
> support
> the -shared option under darwin.

No.  I can not and will not change Apple's compiler driver.  The 
"-shared" flag has no meaning on Darwin.  There are seven different 
output formats from the linker, at least three of which could be 
indicated by "-shared".  OTOH, it looks like "-shared" just generates a 
warning and not a fatal error.  The rest of the commandline requires 
major surgery.  Oh yeah, stripping a shared library generates *pages* 
of warnings under darwin.


> If gcc -shared can be used, then the current gtkada makefile should be
> useable as-is.

The other thing that concerns me is listing dependent libraries which 
ELF platforms don't require.

Ack this is frustrating.  I signed up to this list under my work 
address, but my only usable Mac development platform is at home.

I'll see what can be done with minimal changes.

	-Chris

-- 
Christopher Douty <Chris_Douty at ampexdata.com> +1-650-367-3129
Senior Engineer, Software & Systems  - AMPEX Data Systems Corp.




More information about the gtkada mailing list