1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-24 21:33:51 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
James Le Cuirot
6864d92f6c
autoconf: Don't bake build time CFLAGS into pkg-config file
Having slept on it, I've realised that baking the dependency CFLAGS into
the pkg-config file is pointless when it is only used to link against
them. It may even cause problems.
2023-09-04 22:14:02 +01:00
James Le Cuirot
93e8bb2a40
build: Generate better pkg-config files for static-only builds
pkg-config supports `Requires.private` and `Libs.private` fields for
static linking. However, if you're building a dynamic binary, then
pkg-config will use the non-private fields, even if just the static
libxml2 is available. This will result in libxml2 being underlinked,
causing the build to fail. The solution is to fold the private fields
into the non-private fields when the shared libxml2 is not being built.

This works for Autotools and CMake. Meson also knows how to handle this
when it automatically generates pkg-config files.
2023-09-03 08:52:36 +01:00
James Le Cuirot
4640ccac85
build: Generate better pkg-config file for SYSROOT builds
The -I and -L flags you use to build should not necessarily be the same
ones you bake into installed files. If you are building with
dependencies located under a SYSROOT then the installed files should
have no knowledge of that SYSROOT. For example, if the build requires
`-L/path/to/sysroot/usr/lib/foo` then only `-L/usr/lib/foo` should be
baked into the installed files.

pkg-config is SYSROOT-aware, so this issue can be sidestepped by using
the `Requires` field rather than the `Libs` and `Cflags` fields. This is
easily resolved if you rely solely on pkg-config, but this project falls
back to standard Autoconf checks, so a little more effort is required.

Unfortunately, this issue cannot feasibly be resolved for CMake.
`find_package` is used rather than `pkg_check_modules`, so we cannot
tell whether a pkg-config file for each dependency is present or not,
even if `find_package` uses pkg-config behind the scenes. The CMake
build does not record any dependency -I or -L flags into the pkg-config
file anyway. This is a problem in itself, although these dependencies
are most likely installed to standard locations.

Meson is very much better at handling this, as it generates the
pkg-config file automatically using the correct logic.
2023-09-03 08:52:22 +01:00
Nick Wellnhofer
cf6cd81c3e Add WIN32_EXTRA_LIBADD to XML_PRIVATE_LIBS 2022-04-03 14:08:45 +02:00
Daniel Engberg
141d784ecf build: Make use of variables in libxml's pkg-config file
Instead of hardcoding make use of available variables and optimize usage
2022-04-03 13:43:40 +02:00
David Seifert
5c71ada83a
Detect libm using libtool's macros 2022-03-30 16:51:17 +02:00
Philip Withnall
f859d9a783 build: Add @LZMA_LIBS@ to libxml’s pkg-config files
If libxml2 is built and linked against liblzma, the latter needs to appear in
libxml2’s Libs.private pkg-config field, otherwise static linking against
libxml2 will fail due to unresolved liblzma symbols.

https://bugzilla.gnome.org/show_bug.cgi?id=711026
2013-10-29 17:35:36 +08:00
Arfrever Frehtes Taifersar Arahesis
1f01f49ba6 Handle ICU_LIBS as LIBADD, not LDFLAGS to prevent linking errors
For https://bugzilla.gnome.org/show_bug.cgi?id=677606
For https://bugs.gentoo.org/show_bug.cgi?id=417539

If libxml2-2.8.0 is built with --with-icu --with-python on a system that has an
older version of libxml2 installed, then during "make install", libxml2mod.so
gets relinked to the systemwide version of libxml2.so.2 instead of libxml2.so.2
from the build tree, and fails at runtime if symbol versions from the older
libxml2.so.2 are not available. This effectively makes it impossible to build a
libxml2-2.8.0 binary package on a system that does not already have
libxml2-2.8.0 installed.

Investigation by Rafał Mużyło and Arfrever Frehtes Taifersar Arahesis revealed
the cause of the problem to be that libxml2's configure was adding ICU_LIBS to
LDFLAGS instead of to LIBADD. This resulted in GNU libtool using the wrong
argument order in its relinking command that gets run during "make install".
2012-08-28 22:16:50 +08:00
Volker Grabsch
9031709bc7 Fix missing win32 libraries in libxml-2.0.pc
The libxml-2.0.pc file doesn't contain the win32 specific libraries. So when
(cross-)compiling for Windows, the output of

pkg-config libxml-2.0 --libs

returns an incompile set of libraries. Thus, applications using libxml2's
network functionality fail to build for the win32 platform.
2010-03-15 10:36:56 +01:00
Daniel Veillard
26ab0e6c73 applied patch from Mikhail Zabaluev to separate library flags for shared
* libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate
  library flags for shared and static builds, fixes #344594. If this
  bites you, use xml2-config.
Daniel
2006-10-11 12:32:51 +00:00
Daniel Veillard
9ea5565f41 removed a redundant include path Daniel
* libxml-2.0.pc.in: removed a redundant include path
Daniel
2005-06-14 10:35:37 +00:00
Daniel Veillard
ce1648b124 applied DSO support patch 2 from Joel Reed Daniel
* Makefile.am config.h.in configure.in error.c libxml-2.0.pc.in
  testModule.c testdso.c xml2-config.in xmllint.c xmlmodule.c
  include/libxml/Makefile.am include/libxml/xmlerror.h
  include/libxml/xmlmodule.h include/libxml/xmlversion.h.in
  include/libxml/xmlwin32version.h.in: applied DSO support
  patch 2 from Joel Reed
Daniel
2005-01-04 15:10:22 +00:00
Daniel Veillard
0aaaacdb43 applied the patch to fix #101894 Daniel
* libxml-2.0.pc.in: applied the patch to fix #101894
Daniel
2003-01-06 10:59:57 +00:00
Daniel Veillard
b82c16694d do not reference strdup() ! trying to fix the libs of the various config
* globals.c: do not reference strdup() !
* configure.in libxml-2.0.pc.in: trying to fix the libs
  of the various config extraction modules
Daniel
2001-12-09 14:00:54 +00:00
Daniel Veillard
98fed37a39 dohh generated the wrong include path :-( re-dohh forgot the new manpage
* libxml-2.0.pc.in: dohh generated the wrong include path :-(
* doc/Makefile.am libxml.spec.in: re-dohh forgot the new manpage :-(
Daniel
2001-09-13 11:34:58 +00:00
Daniel Veillard
07cdb2a84f moved includes to includedir/libxml2/libxml, updated the configuration
* config.h.in configure.in libxml.spec.in include/libxml/Makefile.am
  libxml-2.0.pc.in: moved includes to includedir/libxml2/libxml,
  updated the configuration scripts systems accordingly
2001-09-12 20:19:58 +00:00
Owen Taylor
3473f88a7a Revert directory structure changes 2001-02-23 17:55:21 +00:00
CET 2001 Tomasz Koczko
64636e7f6e moved to libxml directory - this allow simplify automake/autoconf. Now
Thu Feb 23 02:03:56 CET 2001 Tomasz Koczko <kloczek@pld.org.pl>

        * *.c *.h libxml files: moved to libxml directory - this allow
	  simplify automake/autoconf. Now isn't neccessary hack on
	  am/ac level for make and remove libxml symlink (modified for this
	  also configure.in and main Makefile.am). Now automake abilities
	  are used in best way (like in many other projects with libraries).
	* include/win32config.h: moved to libxml directory (now include
	  directory isn't neccessary).
	* Makefile.am, examples/Makefile.am, libxml/Makefile.am:
	  added empty DEFS and in INCLUDES rest only -I$(top_builddir) -
	  this allow minimize parameters count passed to libtool script
	  (now compilation is also slyghtly more quiet).
	* configure.in: simplifies libzdetestion - prepare separated
	  variables for keep libz name and path to libz header files isn't
	  realy neccessary (if someone have libz installed in non standard
	  prefix path to header files ald library can be passed as:
	  $ CFALGS="-I</libz.h/path>" LDFLAGS="-L</libz/path>" ./configure
	* autogen.sh: check now for libxml/entities.h.

	After above building libxml pass correctly and also pass
	"make install DESTDIR=</install/prefix>" from tar ball generated by
	"make dist". Seems ac/am reorganization is finished. This changes
	not touches any other things on *.{c,h} files level.
2001-02-23 01:37:32 +00:00
Daniel Veillard
ee0a4660b0 - Makefile.am configure.in libxml-2.0.pc.in: started working on getting
libxml2-devel installable in // as libxml-devel.
Daniel
2001-01-27 18:59:33 +00:00
Martin Baulig
1b478d113c Use the correct pkg-config syntax
(the pkg-config that comes with the RedHat 7.0 glib-gtkbeta RPM
 and not the one from pkgconfig.sourceforge.net which is old).
2000-09-30 02:27:55 +00:00
Martin Baulig
dd7d1f6d79 Provide pkg-config script.
2000-09-30  Martin Baulig  <baulig@suse.de>

	* libxml-2.0.pc.in: Provide pkg-config script.

	* configure.in: Create the libxml-2.0.pc script from the
	libxml-2.0.pc.in templates.
	* Makefile.am (pkgconfig_DATA): Install the libxml-2.0.pc
	script in `$(libexecdir)/pkgconfig'.
2000-09-29 23:17:57 +00:00