octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do we need "DEFINES=-DWIN32 -DGSL_DLL" in the Makefile of the gsl pa


From: Julien Bect
Subject: Re: Do we need "DEFINES=-DWIN32 -DGSL_DLL" in the Makefile of the gsl package?
Date: Tue, 6 Sep 2016 14:34:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0

Le 06/09/2016 à 14:14, Michael Goffioul a écrit :
On Tue, Sep 6, 2016 at 7:46 AM, Julien Bect <address@hidden> wrote:
Le 06/09/2016 à 07:30, Tatsuro MATSUOKA a écrit :
From: "address@hidden"

  Le 05/09/2016 à 15:47, Michael Goffioul a écrit :
  > The necessity of GSL_DLL macro is to deal with DLL-exported variables (not functions) and MSVC compiler (and other compilers that use the same dynamic linking rules).
  >
  > A DLL-exported function can be found by the linker using 2 symbols: NAME and _imp_NAME. A DLL-exported variable can only be found by the linker with _imp_VAR. When using MSVC, if the variable is not decorated with __declspec(dllimport), the linker will fail. When using GCC, the linker uses some magic bootstrap to make the variable be found by the linker with VAR symbol only.
In mxe-octave, one can see the descriptions for msvc build. Now it seems not to
be  maintained. I feel that they are preserved for someone resuming the work. At
that time. the description in the gsl package will be useful.
The description for msvc on mxe-octave include wrappers by which msvc cl and link behave like gcc and ld
and additional tools to use msvc in the unixy autotools (automake, autoconf , libtool etcs).

Ok, I have kept the code for MSVC preprocessor flags (-DWIN32 -DGSL_DLL) but they are now set by configure:

http://hg.code.sf.net/p/octave/gsl/rev/ce99f5326e87

I still have one question: for what kind of architecture do we need __declspec(dllimport) ?

Currently the flags are set for i686-pc-msdosmsvc only, but what about other architectures such as amd64-mingw32msvc, i586-mingw32, i686-mingw32msvc, i686-w64-mingw32, etc ?

It's not really about architecture, but more about compiler/linker. At the moment, MSVC would be the only one to require it. Other compilers, like MinGW, can work with or without it. If you want compatibility between compilers (only possible for C code, not C++), it's better to use it. Although compiler compatibility is not a concern here.

Ok, perhaps the word "architecture" is not entirely appropriate.

So, does it mean that the flags should be set for any canonical_host_type that ens with "-msdosmsvc" ?  And what about "-mingw32msvc" ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]