[gtkada] patch to support Mac OS X
jim hopper
hopperj at macconnect.com
Tue Dec 16 14:09:20 CET 2003
On Dec 16, 2003, at 6:01 AM, gtkada-request at lists.act-europe.fr wrote:
Arno,
thanks for the comments some notes below.
>> 1. -shared is used in a couple of link lines. since so_opts is used
>> in
>> every case it is, and so_opts can be set up to do port specific things
>> (i added darwin branch for the mac stuff). is it possible to move
>> that
>> to there?
>
> The proper fix here is to teach gcc to do the proper thing when using
> -shared on darwin.
well i am not sure i agree. its a port specific flag i would think.
darwins gcc doesnt choke on it, instead it prints out a warning. its a
trivial matter to move it into the default value of so_opts then it can
be over ridden on those ports that need to, but its a default for
everyone else. just my two cents worth, its not a show stopper if you
all don't want to do this.
>
> Also, using 2.2.2 in configure will cause trouble for new versions.
> Note that configure is regenerated automatically: you need to modify
> configure.in and/or aclocal.m4
i only did this because i didnt know how to get the version number from
variables in configure,ing. if someone will let me know how to get the
various (.micro etc) numberrs inside configure that would be much
preferred. i didnt know how configure.in is used, i will look at
configure.in. when i built gtkada i just did ./configure like it said
in the docs how do i use configure.in to generate a new configure?
This does raise another mac specific issue in my code. in darwin the
version number goes before the .dylib not after as it does in linux as
far as i can see. i changed this in the make files. again it will
needs to be special cased somehow.
>
> config.sub is part of the GNU auto* stuff, so we do not want to patch
> this file ourselves. Instead, if there's an official version of
> config.sub
> that recognizes darwin, we can incorporate this version.
>
> Otherwise, please coordinate with the GNU maintainers so that
> config.sub
> will recognize darwin properly.
Gtk+ recognizes darwin as do most code i have downloaded and built. i
did this patch only because gtkada didnt recognize darwin. i got the
working version of config.guess and config.sub from gtk source
distribution i believe. i will check to be sure.
>
>> 2. i added ...CFLAGS = -fno-common ... and .. GNATFLAGS =
>> -fno-common
>> and ..GNATFLAGS_DEVEL = -fno-common..
>>
>> in most of the make files I don't know how to special case this so
>> only darwin sees it.
>
> Why is it needed ? Why isn't the compiler doing this automatically if
> it
> is needed ? You could probably use the FPIC variable in aclocal.m4,
> although
> I suspect this option is more a work around of a gcc bug rather than a
> proper fix (in which case the proper approach is to fix gcc).
-fno-common is standard option in darwin when generating dynamic
libraries. its not a compiler bug its part of the way darwin works for
building shared libraries.
>
>> 3. is added ! GTK_LIBS = @GTK_LIBS@ -L/usr/X11R6/lib -lX11
>> -flat_namespace -undefined suppress again i don't know how to make
>> that
>> darwin specific.
>
> The first part (-L/usr/X11R6/lib -lX11) should be handled by pkg-config
> and the gtk+ install directly, so I'd suggest working with the Gtk+
> maintainers of the darwin port to find out why this is not the case.
i will check with them. it would be better if it was there.
>
> What does the last part do ? If it's not another work around of a gcc
> bug/limitation (in which case...) you could probably use the
> OS_SPECIFIC_LINK_OPTIONS variable in aclocal.m4
>
not a compiler bug that i know of. just a library dependency. though
now that you mention it i think it might not be required after some
stuff i put in the darwin specific part of configure. i will check it
out.
jim
More information about the gtkada
mailing list