Problem with shared build
Kit Bishop
kit at bishop.net.nz
Wed Oct 17 13:59:41 PDT 2007
Vadim Zeitlin wrote:
> On Wed, 17 Oct 2007 12:00:41 +1300 Kit Bishop <kit at bishop.net.nz> wrote:
>
> KB> The value of --ld from wx-config is obtained from EXE_LINKER as set in
> KB> configure
> KB> For a shared build, EXE_LINKER is set from SHARED_LD_CXX
>
> This is where it's wrong, SHARED_LD_CXX is the program which must be used
> for creating the shared libraries, EXE_LINKER should probably be always
> just set to "$CXX -o" in configure. Of course, if this is true, we likely
> don't need EXE_LINKER at all and can just output "$CXX -o" from wx-config
> directly.
>
Since SHARED_LD_CXX is used for more than just linux and can have
different values depending on the platform and since EXE_LINKER is
derived from it for shared libraries and since I only have access to
linux and MinGW for testing, I am submitting a patch to configure that
just removes "-shared" from EXE_LINKER.
I have tested this on linux (SUSE 10.3) and MinGW and it works fine for me.
> Does anybody know/remember if we need anything other than this to link an
> application using wx?
>
>
> KB> I believe I can sort out a fix for this, however, it raises another issue:
> KB> wx-config may be used to just build an application, or it may also be
> KB> used to build a dynamic library (.so).
>
> For this we'd need a new "wx-config --shared-ld" option which would return
> the value of SHARED_LD_CXX.
>
> KB> Further, I note that the sample Makefiles for the shared case have
> KB> -DWXUSINGDLL in the compile flags, whereas the wx-config flags output do
> KB> not include this.
> KB> This of course leads on to the question: should -DWXUSINGDLL be included
> KB> in the wx-config compile flags for shared case?
>
> Yes, definitely. Currently it seems to be done for Cygwin/mingw32 builds
> only on the assumption that it only does something there, but this is
> actually not true any longer as it's now also used with gcc versions
> supporting ELF visibility. I'll fix this.
>
I'll leave that to you then - though I'm happy to give it a go myself if
you want.
> KB> Should we correspondingly have -DWXMAKINGDLL if we were building a
> KB> dynamic library?
>
> No, -DWXMAKINGDLL is only for wx itself.
>
> KB> Unless you indicate otherwise, it is my intention to try to create a
> KB> patch that will: omit the -shared in wx-config --ld for shared build
>
> As I said, I think it's as simple as removing EXE_LINKER completely. But
> it needs testing, of course.
>
> Regards,
> VZ
>
Best regards,
Kit
More information about the wx-users
mailing list