[gtkada] patch for mac

Arnaud Charlet charlet at ACT-Europe.FR
Mon Jul 26 23:21:18 CEST 2004


> That's what I did first.  For the current GNAT on OS X 10.3 I don't 
> think any other modifications are necessary other than replacing 
> config.guess and config.sub.  Basic static libraries are easy.

OK, so that's where we should start integrating needed changes.

> 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.

> 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.

> 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.

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

> If I can get some time tonight (I've got a 2 month-old to contend with 
> :-) I will try to spin out a working patch that builds static GtkAda 
> for darwin.  Then I'll follow up with a dynamic library version.

Sounds good.

Arno



More information about the gtkada mailing list