Simon Wright <[email protected]> writes:

> I've attached a makefile snippet that sets OS appropriately (and
> includes some explanation).

I'm puzzled. "OS" is only defined by default on Windows, so why use that
at all?

You also did not consider Windows without Cygwin, where "OSTYPE" and
"uname" are undefined.

Since we are running gprbuild, we know gcc is available, so using 'gcc
-dumpmachine' is guaranteed to work. And we already have that output in
GPRBUILD_TARGET.

The specific problem is picking the name for the dynamic library; that
depends on the OS. Did you find some gpr syntax that lets you set the
Library_Name from the OS string? I think you will need to set an
external variable to the actual library name fragment. Something like
this in the makefile (not tested):

ifeq ($(findstring mingw,$(GPRUILD_TARGET))
    dyn_lib_fragment := dll
else ifeq ($(findstring darwin,$(GPRUILD_TARGET))
    dyn_lib_fragment := dynlib
else ifeq ($(findstring linux,$(GPRUILD_TARGET))
    dyn_lib_fragment := so
else
    is there a way to generate a make error?
endif

>>> On Mac OS X it's important to build shared libraries with gprbuild,
>>> not gnatmake, because only gprbuild knows how to do it properly. Is
>>> there a reason you use gnatmake for this?
>>
>> No; feel free to change it.
>
> I need to revisit MTN :-)

I don't think you have write privs on this branch; I meant "edit it
locally and report results/propose a patch". Which I think you are
implying is what you did.

I guess just changing 'gnatmake' to 'gprbuild' is all that is needed?

--
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to