Bug 39741 - writerperfect fails to build with system (external) libwpd, libwps, libwpg
Summary: writerperfect fails to build with system (external) libwpd, libwps, libwpg
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All Linux (All)
: medium normal
Assignee: David Tardon
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-08-01 22:31 UTC by Lionel Elie Mamane
Modified: 2011-12-06 05:07 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Patch for point 1) (1.34 KB, patch)
2011-08-01 22:31 UTC, Lionel Elie Mamane
Details
Patch for point 3) (749 bytes, patch)
2011-08-01 22:32 UTC, Lionel Elie Mamane
Details
Patch for point 2) (1.27 KB, patch)
2011-08-01 22:33 UTC, Lionel Elie Mamane
Details
patch for using extern libs in writerperfect (1008 bytes, patch)
2011-08-02 02:23 UTC, Matúš Kukan
Details
revised patch for point 1), including libvisio (1.69 KB, patch)
2011-08-02 02:50 UTC, Lionel Elie Mamane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2011-08-01 22:31:34 UTC
Created attachment 49812 [details]
Patch for point 1)

LibreOffice master (pulled 1 august 2011) fails to build subdirectory writerperfect with system (external) libwpd, lipwps and/or libwpg because:

1) The external declaration in RepositoryExternals.mk is incorrect: it does not set includes and hardcodes -llibwpX instead of using $(LIBWPx_LIBS).

2) One external declaration is missing from Library_*.mk

3) StaticLibrary_writerperfect.mk does not pull $(LIBWPG_CFLAGS)

Point 3) is interesting, because AFAICS (as far as I can see), there is no mechanism in the build system for a StaticLibrary to take the CFLAGS of an external.

The attached patches fixe 1) and 2) in the obvious way, and fix 3) by adding externals processing to StaticLibrary.
Comment 1 Lionel Elie Mamane 2011-08-01 22:32:15 UTC
Created attachment 49813 [details]
Patch for point 3)
Comment 2 Lionel Elie Mamane 2011-08-01 22:33:28 UTC
Created attachment 49814 [details]
Patch for point 2)
Comment 3 Matúš Kukan 2011-08-02 02:23:37 UTC
Created attachment 49816 [details]
patch for using extern libs in writerperfect

I'm sorry, it's my fault but attached diff should do the job according to writerperfect/util/makefile.mk.
But I guess there can also be problem with linking on windows.
Comment 4 Lionel Elie Mamane 2011-08-02 02:44:51 UTC
(In reply to comment #3)
> Created an attachment (id=49816) [details]
> patch for using extern libs in writerperfect

> I'm sorry, it's my fault but attached diff should do the job according to
> writerperfect/util/makefile.mk.

master branch does not have a writerperfect/util/makefile.mk file.

I doubt the attachment #49816 [details] is sufficient, since it does not add the include directives given by pkg-config to CFLAGS, as #49812 does. I was getting errors like:

 in file included from ...
 FILE:LINENO #include <libwpd/libwpd.h>
 no such file: libwpd/libwpd.h

On my system (Debian GNU/Linux), that file is in /usr/include/libwpd-0.9/libwpd/libwpd.h, so the CFLAGS setting is necessary.

However, indeed libvisio handling in system case in RepositoryExternals.mk also needs fixing; as I am not using a system libvisio, I missed that one.

> But I guess there can also be problem with linking on windows.

I have no clue on that.
Comment 5 Lionel Elie Mamane 2011-08-02 02:50:52 UTC
Created attachment 49817 [details]
revised patch for point 1), including libvisio
Comment 6 David Tardon 2011-08-02 02:55:09 UTC
I have got that problem too.
Comment 7 David Tardon 2011-08-02 03:21:22 UTC
Defining gb_StaticLibrary_use_external is a bit questionable, because gb_LinkTarget__use_something usually adds some libs, which really does not make sense for StaticLibrary targets. But there already is gb_Static_Library_add_lib anyway...

Thanks for the patches.
Comment 8 Matúš Kukan 2011-08-02 03:45:24 UTC
Thanks, CFLAGS are also needed.

I think you should not need wpg in visioimport but maybe you do. Also there is no need to use external libs for static library. The static library there is not really needed, it's just for linking into others.

Anyway, thanks for pointing this out, I should be more careful.
Comment 9 Lionel Elie Mamane 2011-08-02 06:16:11 UTC
(In reply to comment #8)

> there is no need to use external libs for static library.

Yes, but the CFLAGS are still needed; the idea is to reuse the "external lib" mechanism to get the CFLAGS. It is somewhat ugly, but works well and ensures maximal code sharing / factorisation.

> I think you should not need wpg in visioimport but maybe you do.

If I remove it, then:

In file included from /home/master/src/libreoffice/bootstrap/writerperfect/source/vsdimp/VisioImportFilter.cxx:49:0:
/home/master/src/libreoffice/bootstrap/solver/350/unxlngx6/inc/libvisio/libvisio.h:24:27: fatal error: libwpg/libwpg.h: No such file or directory