pkg-config merge requestshttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests2023-09-19T08:49:52Zhttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/21Improve NMake Makefiles (later Visual Studio vesions, ARM64 support, building...2023-09-19T08:49:52ZChun-wei FanImprove NMake Makefiles (later Visual Studio vesions, ARM64 support, building bundled GLib, etc)Hi,
This attempts to improve the NMake Makefiles in the following ways:
* Make the build artifacts and results separated by Visual Studio versions as well, and ensure that building with different compiler versions and target platform ...Hi,
This attempts to improve the NMake Makefiles in the following ways:
* Make the build artifacts and results separated by Visual Studio versions as well, and ensure that building with different compiler versions and target platform won't clash if they are run at the same time.
* Split out portions of the NMake Makefiles in regards to build rules and source/object listing collection
* Allow configuring where the existing GLib installation can be found
* Improve support for later Visual Studio versions (up to 2022), and support ARM64 builds out-of-the-box.
* Support building the bundled GLib sources with NMake builds, which is now the default; the former method of using an existing GLib installation can be done by passing `HAVE_GLIB=1` in the NMake commandline. Notice that the bundled GLib was updated a bit to support newer Visual Studio versions and 64-bit builds better, incorporating relevant changes that were made upstream.
With blessings, thank you!https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/20guide: add references to autoconf-archive, CMake and Meson2023-01-06T17:09:02Zswilmetguide: add references to autoconf-archive, CMake and MesonThe guide already contains information for use with Autotools.
Nowadays autoconf-archive contains additional macros for pkg-config
(don't list them all, because the list could change, just a link to the
autoconf-archive project should b...The guide already contains information for use with Autotools.
Nowadays autoconf-archive contains additional macros for pkg-config
(don't list them all, because the list could change, just a link to the
autoconf-archive project should be enough).
Add also information about CMake and Meson.
In alphabetical order:
- Autotools
- CMake
- Mesonhttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/19pkg: reintroduce less aggressive flags deduplication2022-11-21T10:00:47ZStefano Sabatinipkg: reintroduce less aggressive flags deduplicationStripping non-consecutives options was dropped in 9adfd9ebfcb8a, in
order to prevent the alteration of the command semantics.
To mitigate cases when the generated flags list is too long, the
deduplication is reintroduced but limited onl...Stripping non-consecutives options was dropped in 9adfd9ebfcb8a, in
order to prevent the alteration of the command semantics.
To mitigate cases when the generated flags list is too long, the
deduplication is reintroduced but limited only to a few cases (-L, -l,
-I) for which semantics is not altered by a repetition of the same
flag.
Address issue:
https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/75https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/18Use the -l:lib syntax when pkg-config is called with --static2022-10-30T10:34:43ZNicolas CaramelliUse the -l:lib syntax when pkg-config is called with --staticLibraries from Requires.private and Libs.private will only be included when static linking. So, for static linking, pkg-config is used with the --static option.
cc \`pkg-config --static --cflags --libs name\` -o myapp myapp.c
We expe...Libraries from Requires.private and Libs.private will only be included when static linking. So, for static linking, pkg-config is used with the --static option.
cc \`pkg-config --static --cflags --libs name\` -o myapp myapp.c
We expect that the static version of the libraries are used during the link of myapp (libname.a as well as the .a libraries from Requires.private and Libs.private). But if both versions of the libraries (static and dynamic) are available, the dynamic version (.so) is preferred by the linker.
This change proposes to replace the -l part for libraries using the -l:lib syntax when pkg-config is called with the --static option (-lname is replaced by -l:libname.a). So a static link is done as expected, even if a dynamic version of the libraries is available.
The current implementation of this change is certainly not perfect, but is deliberately as simple as possible to focus on the principle of the proposal.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/17Don't append NULL when a variable doesn't exist2022-05-28T16:05:01ZAdam SampsonDon't append NULL when a variable doesn't existThis caused a glib warning when the following was encountered in
`xml2po.pc` (and `PYTHON_PREFIX` wasn't defined):
```
modesdir=${PYTHON_PREFIX}/lib/python2.7/site-packages/xml2po
```This caused a glib warning when the following was encountered in
`xml2po.pc` (and `PYTHON_PREFIX` wasn't defined):
```
modesdir=${PYTHON_PREFIX}/lib/python2.7/site-packages/xml2po
```https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/16Draft: Master2022-05-07T13:51:48ZZachary Thomas Stolzzachstolz20@icloud.comDraft: Masterhttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/15Fix build2021-12-06T21:51:22ZMohamed AkramFix buildI had to make this change to run `autogen.sh`.I had to make this change to run `autogen.sh`.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/14pkg.m4.in: PKG_CHECK_MODULES provides modversion2021-10-04T12:34:23ZMattias Hanssonpkg.m4.in: PKG_CHECK_MODULES provides modversionProjects using PKG_CHECK_MODULES wants to add compilation information to
their binaries, as part of the compilation information the projects
wants to disclose dependency versions. Currently, the projects have to
resolve dependency versio...Projects using PKG_CHECK_MODULES wants to add compilation information to
their binaries, as part of the compilation information the projects
wants to disclose dependency versions. Currently, the projects have to
resolve dependency versions themselves when using pkg-config.
With this patch PKG_CHECK_MODULES now defines a $PKG_VERSION variable
that represents `--modversion`.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/13Add Cflags.private field — required for linking on Windows2021-12-06T21:52:41ZOnericAdd Cflags.private field — required for linking on WindowsAdd `Cflags.private` field. This field is required dor linking on Windows for all libraries exposing variables, since Windows requires a special `__declspec(dllimport)` attribute to be set on declaration of variables defined in shared li...Add `Cflags.private` field. This field is required dor linking on Windows for all libraries exposing variables, since Windows requires a special `__declspec(dllimport)` attribute to be set on declaration of variables defined in shared libraries; if this attribute is set but the variable is actually defined in a static lib or it's not set and it is defined in a shared lib the linker errors out.
With this flag affected libraries can define a macro in `Cflags.private` and hide the `dllimport` attribute behind an `#ifdef` in their public headers.
This was originally brought up in #38 (or [FDBugs#47996](https://bugs.freedesktop.org/show_bug.cgi?id=47996) to be more accurate) and as the comments there indicate is already supported by pkgconf. At the time it was considered to first introduce a way to control/check the version of the pc-file syntax. While I agree this would have been a good idea to be implemented first *back then*, the situation now is different since the field is already supported for years by pkgconf and in use by several affected libraries since they simply have no other option to correctly link on Windows. Thus I think adding it as is now does much good but no (longer any additional) harm.
To give some perspective on the existing usage: just from the libraries which happen to be installed on my local machine [libarchive](https://github.com/libarchive/libarchive/blob/d3ae4163e1d51b1b0c039fd2140e9f3aae4c6559/build/pkgconfig/libarchive.pc.in#L10), [twolame](https://github.com/njh/twolame/blob/8c474016a5eddb0237a562e7a8bfa319203c30ad/twolame.pc.in#L13), [FriBidi](https://github.com/fribidi/fribidi/blob/e42e70e87cd6e81303b9cf62f847af894d5ffc96/fribidi.pc.in) and [xmlsec](https://github.com/lsh123/xmlsec/blob/689b8af9614244fa56426ba681b47cf9c72e8ef8/xmlsec-gnutls.pc.in#L11) are affected and already use `Cflags.private`. Considerig that ""only"" libraries exposing variables (functions don't need the attribute) are affected this seems like a lot, though it is ofc in no way representative.
As currently there simply is no way with standard pc-files to solve this, I think a way should definitely be added to pkg-config. And since `Cflags.private` is adequate for the challenge of mutating public headers based on linkage-mode and has already somewhat established itself *(to the limits of how established a non-standard pc-file extension can be)*, adopting it in pkg-config seems like the obvious solution
I kept the implementation simple, matching the existing implementation of `Libs.private`.
--------
Note that since building from git is currently broken with newer automake/autoconf I had to either first apply [my other merge request](https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/12) dropping the interal glib copy, or alternatively update the internal glib copy to the latest release, **but not specify `--with-internal-glib`** as that is then broken instead *(see other MR)* in order to build this.
--------
Finally a small question: I noticed that unlike all other fields the existing `Cflags` field can also be spelled `CFlags` *(with a capital `F`)*; I mirrored that behaviour for `Cflags.private`/`CFlags.private`, but I wonder if you instead might prefer to keep this exception local to plain `CFlags` only?https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/11pkg.m4: Abort by default if no pkg-config2021-08-26T18:26:59ZIsmael Lucenopkg.m4: Abort by default if no pkg-configProvide a second optional argument to PKG_PROG_PKG_CONFIG with an action to
take if pkg-config isn't found, and default to aborting.
Too many configure scripts in the wild don't handle an empty PKG_CONFIG,
resulting in weird error messa...Provide a second optional argument to PKG_PROG_PKG_CONFIG with an action to
take if pkg-config isn't found, and default to aborting.
Too many configure scripts in the wild don't handle an empty PKG_CONFIG,
resulting in weird error messages through the run, which often confuse
users.
Authors wishing to fallback to other methods can either return to the old
behavior by specifying [:] as an action, or use [PKG_CONFIG=false] and call
pkg-config macros normally, handling the fallback as any other failure.
Users can override PKG_CONFIG in the command line so this implies no
regressions.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/10Typos found by codespell2021-08-08T08:47:44ZDimitri Papadopoulos OrfanosTypos found by codespellhttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/9man: Update URL for bug reporting2021-03-05T13:49:17ZVincent Lefevreman: Update URL for bug reportinghttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/8Add Require.internal field2020-08-29T20:13:11ZXavier Claessensxclaesse@gmail.comAdd Require.internal field This field is to be used for purely internal dependencies that are not
exposed into the API at all. Those packages are there only for static
link.
https://bugs.freedesktop.org/show_bug.cgi?id=105572 This field is to be used for purely internal dependencies that are not
exposed into the API at all. Those packages are there only for static
link.
https://bugs.freedesktop.org/show_bug.cgi?id=105572https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/7Add PKG_CONFIG_SYSROOT_MAP support2020-08-29T20:21:30ZXavier Claessensxclaesse@gmail.comAdd PKG_CONFIG_SYSROOT_MAP supportSimilar to PKG_CONFIG_SYSROOT_DIR, but instead of prepending the same
sysroot path to all flags, prepend the sysroot corresponding to the
location where the pc file was found.
e.g. `PKG_CONFIG_SYSROOT_MAP=/sdk/usr/lib/pkgconfig:/sdk` wi...Similar to PKG_CONFIG_SYSROOT_DIR, but instead of prepending the same
sysroot path to all flags, prepend the sysroot corresponding to the
location where the pc file was found.
e.g. `PKG_CONFIG_SYSROOT_MAP=/sdk/usr/lib/pkgconfig:/sdk` will prepend
/sdk only to flags from pc files found in /sdk/usr/lib/pkgconfig and not
those found in /usr.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/6pkg.m4.in: Check if $pkg_cv_[]$1[]_LIBS works2020-07-28T13:49:40ZH.J. Lupkg.m4.in: Check if $pkg_cv_[]$1[]_LIBS worksIt is quite normal to have headers without library on multilib OSes.
Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
works.It is quite normal to have headers without library on multilib OSes.
Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
works.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/5Fix tests under FreeBSD.2020-05-01T11:06:20Zdave-shawleyFix tests under FreeBSD.*check-debug*, *check-path*, and *check-system-flags* used the following pattern which fails under FreeBSD's `/bin/sh`
VAR_NAME=value run_test --args
When this is run `VAR_NAME` is not exported to `run_test` so I changed this patte...*check-debug*, *check-path*, and *check-system-flags* used the following pattern which fails under FreeBSD's `/bin/sh`
VAR_NAME=value run_test --args
When this is run `VAR_NAME` is not exported to `run_test` so I changed this pattern to:
VAR_NAME=value
export VAR_NAME
run_test --args
Also added `unset` in a few cases where it would/could make a difference.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/4define-prefix: skip one level if it ends up in /lib2020-12-28T23:16:01ZLuca Boccassidefine-prefix: skip one level if it ends up in /libIn Debian and Ubuntu the multiarch filesystem layout looks as follows:
/usr/lib/x86_64-linux-gnu/pkgconfig/
/usr/lib/i386-linux-gnu/pkgconfig/
Which means when --define-prefix skips to the grand-parent
directory of pkgconfig, it ends u...In Debian and Ubuntu the multiarch filesystem layout looks as follows:
/usr/lib/x86_64-linux-gnu/pkgconfig/
/usr/lib/i386-linux-gnu/pkgconfig/
Which means when --define-prefix skips to the grand-parent
directory of pkgconfig, it ends up in /usr/lib rather than
/usr as it's supposed to.
This causes for example the include path to be printed as:
/usr/lib/include
which is wrong and breaks applications.
Check if the new directory is 'lib' and if it is go one step
above. A new series of unit tests is added with this layout.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/3Fix "FAIL: check-system-flags"2019-06-08T06:14:00ZSENOO, KenFix "FAIL: check-system-flags"pkg-config strips system include and lib.
For passing the test, enable system include and lib by appending PKG_CONFIG_ALLOW_SYSTEM_CFLAGS and PKG_CONFIG_ALLOW_SYSTEM_LIBS environment variable.
Related #51.pkg-config strips system include and lib.
For passing the test, enable system include and lib by appending PKG_CONFIG_ALLOW_SYSTEM_CFLAGS and PKG_CONFIG_ALLOW_SYSTEM_LIBS environment variable.
Related #51.