Commit graph

32 commits

Author SHA1 Message Date
Dan Nicholson
4623b5e85a Split rpmvercmp code into separate file
The rpmvercmp code is taken directly from upstream. Moving it to a
separate file allows it to be diffed and synced easily with the upstream
version. It also becomes really easy to switch to the actual rpmlib
version if that's ever desired.
2013-05-17 05:36:12 -07:00
Dan Nicholson
8b7489a36f Remove $host-pkg-config when uninstalling
Fixes an error from distcheck about files left in the destdir after
uninstalling.
2013-01-23 11:09:56 -08:00
Dan Nicholson
6b07296902 Install pkg-config link with $host- prefix
If pkg-config is used in a multiarch or cross-compiling scenario it's
likely pkg-config needs to behave differently for each of them. It's
possible to handle this through environment variables with one
pkg-config, but another option is to have one pkg-config per platform,
each with the host alias prefixed to the program.

PKG_PROG_PKG_CONFIG supports this type of installation, and this is also
how autoconf/libtool handle other build tools like compilers and
linkers.

The host-prefixed tool is installed as a hardlink where supported and a
copy otherwise. This is how gcc handles it's host-prefixed versions.
This feature can be turned off by passing --disable-host-tool to
configure.

Freedesktop #130
2012-10-13 08:08:42 -07:00
Dan Nicholson
e68baa7463 Add optional usage of gcov for test coverage
Use gcov to find how much code coverage our current testing gets. This
can be enabled by passing --with-gcov to configure and running "make
gcov". This is limited to gcc. Here's a run from the current code (for
some reason, gcov insists on profiling gstring.h).

/usr/bin/gcov pkg.h pkg.c parse.h parse.c main.c
File 'pkg.c'
Lines executed:73.16% of 611
pkg.c:creating 'pkg.c.gcov'

File '/usr/include/glib-2.0/glib/gstring.h'
Lines executed:100.00% of 6
/usr/include/glib-2.0/glib/gstring.h:creating 'gstring.h.gcov'

File 'parse.c'
Lines executed:79.67% of 492
parse.c:creating 'parse.c.gcov'

File 'main.c'
Lines executed:57.34% of 293
main.c:creating 'main.c.gcov'
2012-09-28 05:45:37 -07:00
Dan Nicholson
5c219ca67d Makefile cleanup
No functional change, but makes things a little cleaner.
2012-05-23 05:47:26 -07:00
Javier Jardón
7a8cc77163 Update autotools configuration
Replace deprecated macros and use the new libtool syntax. The required
versions of the tools have been bumped up to match the versions of the
bundled glib. This was effectively the requirement, anyway. The new
required autotools versions are:

autoconf-2.62 (released 2008-04-08)
automake-1.11 (released 2009-05-17)
libtool-2.2 (released 2008-03-01)

Also use silent rules to quiet the build a bit.

Freedesktop #34382
2012-05-23 05:45:20 -07:00
Dan Nicholson
fd4d40b94e Drop popt usage and remove unused popt sources
With the conversion to GOption and g_shell_parse_argv, pkg-config has no
remaining usage of popt. Stop linking to libpopt and removed the bundled
sources.

Fixes Freedesktop #5326, #31700, #44843
2012-05-14 14:19:10 -07:00
Dan Nicholson
c34906923f Make sure dist is only run --with-internal-glib
Since there's no DIST_CONFIGURE_FLAGS, the best we can do to not require
glib's configure to always be run is to error on dist when we haven't
configured --with-internal-glib. This is a hack, but I think it's
slightly nicer than overriding dist and re-running configure with
different options than were specified by the user.
2012-05-10 08:40:11 -07:00
Dan Nicholson
64647b10a9 Conditionally add glib to DIST_SUBDIRS to fix distclean
The glib configure script takes a long time to run, so we want to avoid
it in the default case where we're using the system's glib.
Unfortunately, that means we can't add it unconditionally to
DIST_SUBDIRS since distclean will not always find Makefiles when it
descends into glib.

Make glib only be part of DIST_SUBDIRS when we've configured it. This
will require a different hack to make sure dist always includes glib.
2012-05-10 08:23:08 -07:00
Dan Nicholson
fb458a87b9 Revert "Make sure glib subdir is configure before dist"
This reverts commit 1860fc8036.

distclean breaks if glib is in DIST_SUBDIRS but we haven't actually
generated the glib Makefiles by running glib's configure.
2012-05-10 08:16:14 -07:00
Dan Nicholson
1860fc8036 Make sure glib subdir is configure before dist
We want to distribute the glib subdir, but we want to avoid configuring
it for the default build case where the system glib is used. Override
the standard dist target so that we can reconfigure with
--with-internal-glib if necessary. I think the target should be
compatible with the original dist.

This is pretty hacky and may need to be reverted if it breaks dist.
2012-04-21 12:48:24 -07:00
Dan Nicholson
c74da521af Use a bundled glib2 to avoid circular dependency
It's nice to say that glib is a base library and you should have it
installed to build pkg-config, but it makes bootstrapping pkg-config
really annoying since it introduces a circular dependency.

Let's be nice to our users and bundle a copy to avoid this situation.
The default is still to use the system's glib, but the internal copy
can be used by passing --with-internal-glib to configure. The latest
stable copy of glib is included and will be updated periodically with
their stable releases.

The top level autogen.sh is running recursively through glib. If this
becomes an issue, we can switch autoreconf to --no-recursive and then
descend to glib and run its autogen.sh script.

Since this is default off, its integration will probably not be tested
often. Therefore, it's forcefully turned on during distcheck to make
sure to test it out before distributing a tarball.
2012-04-21 12:46:32 -07:00
Tollef Fog Heen
097eaeb70e Run distcheck against installed popt 2011-05-15 14:32:02 +02:00
Руслан Ижбулатов
7850aeb03a Escape slashes in paths passed to mingw-gcc
Avoids Msys path mangling that turns *nix paths (such as /usr/include) into
DOS-style absolute paths (such as c:/mingw/msys/1.0/include).
Allows mingw-built pkg-config to pass check-cflags.
2011-04-14 08:19:50 +02:00
Simon McVittie
01005bbbd0 Add --with-system-include-path etc.
Instead of hard-coding /usr/include, we now use the environment variable
PKG_CONFIG_SYSTEM_INCLUDE_PATH, defaulting to the argument of
./configure --with-system-include-path, which in turn defaults to
/usr/include.

Similarly, PKG_CONFIG_SYSTEM_LIBRARY_PATH defaults to /usr/lib or
/usr/lib:/usr/lib64 as appropriate.

(As currently implemented, this causes a behaviour change on Win32 -
the option -I/usr/include will now be filtered out.)

The intended usage is for Debian to configure pkg-config with
--with-system-include-path=/usr/include/$(DEB_HOST_GNU_TYPE):/usr/include
and the corresponding library path, for multiarch support
(<http://bugs.debian.org/482884>).

Based on work by Colin Walters <walters@verbum.org>
2011-04-13 22:56:53 +02:00
Tollef Fog Heen
99964eddb5 Stop shipping an embedded glib
Drop the embedded glib, the associated patches and adjust build
scripts appropriately.
2011-04-13 20:16:23 +02:00
Dan Nicholson
68763c08de Build pkg-config before descending to check directory
To ensure that pkg-config has been built and updated before running the
test suite, complete the top directory before descending to the check
directory.
2010-06-15 06:06:16 -07:00
Tollef Fog Heen
37d59a0c44 Distcheck fixes
Various small fixes to make distcheck pass
2010-05-23 23:31:14 +02:00
Dan Nicholson
a048ace79e Optionally use an external popt library
The one imported into pkg-config has seen very little maintenance, so
let's give users the option to use the upstream version. The default is
to use the included sources, but it can search for the system library
using --with-installed-popt.
2010-05-09 10:22:02 +02:00
Dan Nicholson
aa4634eb31 Move popt to subdirectory and make a convenience library of it
This keeps a cleaner separation of the pkg-config sources and the
imported popt sources.
2010-05-09 10:22:02 +02:00
Dan Nicholson
b0fb05420c Include an introductory guide to pkg-config
The pkg-config(1) manual includes a lot of details behind pkg-config,
but not the background and usage patterns. This guide tries to provide
users and developers with a starting point for pkg-config.
2010-05-08 22:30:33 +02:00
Tollef Fog Heen
79f8ef9d51 2009-03-30 Tollef Fog Heen <tfheen@err.no>
* partial-glib.[ch]: Get rid of those, they are no longer in use.
2009-03-30 21:03:10 +02:00
Tollef Fog Heen
4fe6610368 2007-12-29 Tollef Fog Heen <tfheen@err.no>
* Update to glib 1.2.10, adjust lots of the glib patches.  Gnome
	#81847.
2007-12-29 14:40:41 +01:00
Tollef Fog Heen
3977a8299d 2007-02-25 Tollef Fog Heen <tfheen@err.no>
* Makefile.am: Add support for using the system glib.  Thanks to
	Peter Breitenlohner for the bug and the patch.  Freedesktop #9708

	* configure.in: Add support for using the system glib.

	* glib-patches/no-dist-distclean-files.diff,
	glib-patches/automake-warning.diff,
	glib-patches/autoconf-warning.diff:  Get rid of some warnings when
	configuring glib.
2007-02-25 11:05:01 +01:00
Tollef Fog Heen
4f78f8cf50 Only use -Wall and gcc-only flags with gcc.
2005-12-28  Tollef Fog Heen  <tfheen@err.no>

	* configure.in, Makefile.am: Only use -Wall and other gcc-only
	flags when we don't have a set of CFLAGS already set and we're
	using gcc.  Freedesktop #4888.
2005-12-28 14:07:04 +00:00
Tollef Fog Heen
d074ab9973 Add default CFLAGS
2005-08-27  Tollef Fog Heen  <tfheen@err.no>

	* Makefile.am (AM_CFLAGS): Add default CFLAGS
2005-08-27 09:22:34 +00:00
Arch Librarian
96d4dc19c7 2005-03-29 Tollef Fog Heen <tfheen@err.no>
Author: tfheen
Date: 2005-03-29 07:09:37 GMT
2005-03-29  Tollef Fog Heen  <tfheen@err.no>

        * check/check-cflags, check/check-define-variable,
        check/check-libs, check/common, check/Makefile.am,
        check/simple.pc:  Add simple test framework and begin writing
        tests.

        * Makefile.am, configure.in: Make in check/ as well.
2005-07-14 13:06:38 +00:00
Arch Librarian
d2080ec6d8 2005-03-18 Tollef Fog Heen <tfheen@err.no>
Author: tfheen
Date: 2005-03-26 14:59:26 GMT
 2005-03-18  Tollef Fog Heen  <tfheen@err.no>

       * main.c (main): Use add_search_dirs for both the compile-time
       defined pc_path and the run-time defined PKG_CONFIG_PATH.

       * pkg.h: Add prototype for add_search_dirs.

       * pkg.c (add_search_dirs): Add new function which takes a
       delimiter-separated list as input and add_search_dir's it.
       (package_init): Remove knowledge about which dirs should be
       initially added.  Moved this to main.c(main)

       * ChangeLog: Add emacs variables to set the date to this
       ChangeLog's standard format

       * Makefile.am (INCLUDES): Pass PKG_CONFIG_PCPATH on to main.c

       * configure.in: Add --with-pc-path to define the default search
       path for .pc files.  (Freedesktop #119, #648)
2005-07-14 13:06:23 +00:00
Arch Librarian
d793148d06 2002-09-13 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2002-09-12 20:47:07 GMT
2002-09-13  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am (USE_INSTALLED_GLIB): Seems that the automake
	version used by Havoc doesn't recognize pkg_config_CFLAGS and
	pkg_config_LDFLAGS, thus failing builds on Win32 directly from the
	tarball. Set included_glib_includes and pkg_config_LDADD instead,
	then, like in the !USE_INSTALLED_GLIB branch.

	* findme.c (X_OK): If X_OK undefined, define as 1, always, not
	only if G_OS_WIN32, which is never defined here. Fixes a corner
	case on Win32 with MSYS and mingw where configure as included in
	the release tarball for some reason doesn't find unistd.h.
2005-07-14 13:05:20 +00:00
Arch Librarian
6fe682ad4f 2001-10-21 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2001-10-21 18:40:38 GMT
2001-10-21  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am (EXTRA_DIST): Distribute README.win32.

	* README.win32: Describe the behaviour in more detail.
2005-07-14 13:04:34 +00:00
Arch Librarian
1aaee14cab 2001-09-30 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2001-09-29 21:05:25 GMT
2001-09-30  Tor Lillqvist  <tml@iki.fi>

	Changes for "pure" Win32 (without Cygwin or similar)
	support. The most important differences compared to pkg-config
	on Unix are:

	We don't use hardcoded PKGLIBDIR paths but deduce the
	installation prefix at runtime.

	Use the normal GLib DLL, not a private copy. Yes, this does
	introduce a circular dependency, but that can be worked around.

	* README.win32: New file.

	* configure.in: Check for Win32. If so, define USE_INSTALLED_GLIB,
	and don't configure in the included glib-1.2.8. Set GLIB_CFLAGS
	and GLIB_LIBS assuming that GLib is installed in the same location
	pkgconfig will be. Check for dirent.h, unistd.h and sys/wait.h
	headers.

	* Makefile.am: If USE_INSTALLED_GLIB, use the GLIB_* values set
	above, and don't make in the glib-1.2.8 subdir.

	* autogen.sh: Use perl -p -i.bak, works better on Win32 (and Cygwin).

	* *.c: Conditionalize inclusions of unistd.h and sys/wait.h.

	* findme.c: Define X_OK on Win32 if necessary.

	* parse.c
	* popthelp.c: Minor Win32 portability ifdefs.

	* parse.c: No need to include <windows.h>.

	* pkg.c: Don't hardcode PKGLIBDIR, but use
	g_win32_get_package_installation_directory() to deduce it.
	(scan_dir): Make a temp copy of dirname with potential superfluous
	trailing slash removed. The Win32 opendir implementation doesn't
	always like those.

	* pkg.h: If USE_INSTALLED_GLIB, include <glib.h> instead of
	partial-glib.h.

	* popt.c (execCommand): Don't compile on Win32.

	* poptconfig.c (configLine): Don't bother with the "exec" stuff on
	Win32, too complex to port, at least for now.
	(poptReadDefaultConfig) Don't bother compiling on Win32, this
	function isn't even called.
2005-07-14 13:04:29 +00:00
Arch Librarian
2ac96cbcc7 import
Author: hp
Date: 2001-06-05 16:39:09 GMT
import
2005-07-14 13:04:01 +00:00