[Libreoffice] Link external libraries before internal ones

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri Jul 29 07:51:22 PDT 2011


On Fri, 29 Jul 2011 16:40:20 +0200
Petr Mladek <pmladek at suse.cz> wrote:

> It would help me to put $(GTK_LIBS) after shutdowniconunx.o on the
> command line.
> 
> In fact, the 3rd party libraries should be mentioned at the end of the
> command line because neither of use symbols from the internal
> libraries.
> 
> I am a bit lost how to solve this with the GNU make. Could you please
> help me?

It should be solved already on master with the changes from gnumake4
and the RepositoryExternal.mk/gb_LinkTarget_add_libs stuff.

> PS: I have temporary used --no-as-needed link flag:
> 
> --- cut ---
> # FIXME: GTK libs has to be mentioned after LO native libs 
> no_as_needed_ldflag=-Wl,--no-as-needed 
>  
> $(eval $(call gb_Library_set_ldflags,qstart_gtk,\ 
>      $$(LDFLAGS) \ 
>      $$(no_as_needed_ldflag) \
>      $(GTK_LIBS) \
> ))
> --- cut ---
> 
> I had to use extra variable because the comma ',' can't be used inside
> the macro. I am not aware about any more elegant solution :-)

Thats pretty much how I do it on Oneiric for now (I added
--no-as-needed directly as first parameter to the link command). As for
the comma, there is a variable $(COMMA) for that already ;)

My take on this is to keep with the somewhat ugly hacks on the 3.4
branch and use the clean stuff on master from now on.

Best,

Bjoern

-- 
https://launchpad.net/~bjoern-michaelsen


More information about the LibreOffice mailing list