[Libreoffice] gbuild of external libraries and question about apparently special case like zlib, jpeg etc.

Norbert Thiebaud nthiebaud at gmail.com
Sun Sep 4 14:47:04 PDT 2011


I've been working on gbuildification of 'external libraires'

taking the approach of untar - patch - configure - post_patch
(sometimes it may be easier/useful to patch the result of configure,
rather that the input) - make - make install (--prefix=solver)
and make uninstall to clean the 'delivered stuff

Th make install/uninstall approch seems nice because it avoid the need
to enumerate the file to be delivered (hence reduce maintenance cost
and mishap). sure it 'deliver' more than we strictly need (like man
pages and the like) but overall I think that is still a win.

Now, the question is: is there any scenario where one would build the
internal library but only use the internal library for some module and
the system library for others?
iow, why does the current code use a separate name for the internal
library, like libzlib or libjpeglib ? is this really (still) needed ?

in the same vein, why is there zlib/zlib.h and external/zlib/zlib.h ?

if it is still needed then for these modules I guess I will have to
'install' in workdir and still have a 'packaging' step to deliver to
solver...
or, when possible patch the external library (I did that to zlib to
add a configure option to change the library name.. )

ps: I started a ExternalLib.mk extention of gbuild.

use will look something like:

$(eval $(call gb_ExternalLib_ExternalLib,zlib,autotools))

$(eval $(call gb_ExternalLib_set_src_package,zlib,c735eab2d659a96e5a594c9e8541ad63-zlib-1.2.5.tar.gz))

$(eval $(call gb_ExternalLib_add_patches,zlib, \
    zlib/zlib-1.2.5.basename.patch \
))

$(eval $(call gb_ExternalLib_add_cflags,zlib,-fPIC))

$(eval $(call gb_ExternalLib_add_conf_arg,zlib,--zprefix --basename=libloz))

# vim: set noet sw=4 ts=4:

note: the 3rd argument of gb_ExternalLib_ExternalLib is meant to allow
for the support of different kind of build system (like ant, some
custom script, etc.)
I am planning also to expend it to have a 'fetch' target so that make
fetch would be gbuildified too, and that would also allow for
'as-needed' download of external package, based on autogen settings...


Norbert


More information about the LibreOffice mailing list