pkg-config issueshttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues2024-03-12T13:37:58Zhttps://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/81Recent Xcode has -Wint-conversion issues raised as errors, breaks internal gl...2024-03-12T13:37:58ZvargolsoftRecent Xcode has -Wint-conversion issues raised as errors, breaks internal glib build.Recent Xcode has -Wint-conversionissues raised as errors, breaks internal glib build with the following errors
configured with
```
./configure --prefix="$3" --with-pc-path="$3/lib/pkgconfig" --with-internal-glib
```
```
CC libg...Recent Xcode has -Wint-conversionissues raised as errors, breaks internal glib build with the following errors
configured with
```
./configure --prefix="$3" --with-pc-path="$3/lib/pkgconfig" --with-internal-glib
```
```
CC libglib_2_0_la-gatomic.lo
gatomic.c:392:10: error: incompatible integer to pointer conversion passing 'gssize' (aka 'long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
return g_atomic_pointer_add ((volatile gpointer *) atomic, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gatomic.h:170:46: note: expanded from macro 'g_atomic_pointer_add'
(gssize) __sync_fetch_and_add ((atomic), (val)); \
^~~~~
gatomic.c:416:10: error: incompatible integer to pointer conversion passing 'gsize' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
return g_atomic_pointer_and ((volatile gpointer *) atomic, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gatomic.h:177:45: note: expanded from macro 'g_atomic_pointer_and'
(gsize) __sync_fetch_and_and ((atomic), (val)); \
^~~~~
gatomic.c:440:10: error: incompatible integer to pointer conversion passing 'gsize' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
return g_atomic_pointer_or ((volatile gpointer *) atomic, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gatomic.h:184:44: note: expanded from macro 'g_atomic_pointer_or'
(gsize) __sync_fetch_and_or ((atomic), (val)); \
^~~~~
gatomic.c:464:10: error: incompatible integer to pointer conversion passing 'gsize' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
return g_atomic_pointer_xor ((volatile gpointer *) atomic, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gatomic.h:191:45: note: expanded from macro 'g_atomic_pointer_xor'
(gsize) __sync_fetch_and_xor ((atomic), (val)); \
^~~~~
4 errors generated.
make[6]: *** [libglib_2_0_la-gatomic.lo] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
+ checkStatus 2 'build of pkg-config failed'
+ '[' 2 -ne 0 ']'
+ echo 'check failed: build of pkg-config failed'
check failed: build of pkg-config failed
+ exit 1
```
I'm currently working around this using -Wno-int-conversion
```
CFLAGS="-Wno-int-conversion" CXXFLAGS="-Wno-int-conversion" ./configure --prefix="$3" --with-pc-path="$3/lib/pkgconfig" --with-internal-glib
```
but would rather get the 'warnings' fixed.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/80Glibc critical error when listing packages2023-10-21T19:24:46ZbehinderGlibc critical error when listing packages`Pkg-config —list-all` before it list packages it gives error.
`pkg-config @0.29.2: GLib-CRITICAL **: GString *g_string_append(GString *,
const gchar *): assertion 'val != NULL' failed `
This happen only on Macports and not on homebrew...`Pkg-config —list-all` before it list packages it gives error.
`pkg-config @0.29.2: GLib-CRITICAL **: GString *g_string_append(GString *,
const gchar *): assertion 'val != NULL' failed `
This happen only on Macports and not on homebrew. Macports maintainers asked me to put issue here as they have no clue what is causing the error and how to fix it.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/79Pkg-config does not respect PKG_CONFIG_PATH2023-10-21T19:49:02ZbehinderPkg-config does not respect PKG_CONFIG_PATHOn MacOS using Mac ports I added ffmpeg6 path /opt/local/libexec/ffmpeg6/lib/pkgconfig` where pianobar and libpiano search for *.pc files and gmake cannot find those files!
Also in the variable value the defualt search paths for pkg-con...On MacOS using Mac ports I added ffmpeg6 path /opt/local/libexec/ffmpeg6/lib/pkgconfig` where pianobar and libpiano search for *.pc files and gmake cannot find those files!
Also in the variable value the defualt search paths for pkg-config should be included but on Ventura 13.6 (M2) pkg_config_path the variable was not set by default.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/78pkg-config (1.8.0) fails when `prefix` is too long2023-10-20T01:09:35ZLecrisUTpkg-config (1.8.0) fails when `prefix` is too longExample:
```pc
prefix=/opt_some_cluster/linux-debian11/somelonglonglong/path/someotherlonglonglong/path/morelongpath/23b/sandybridge/spack/opt/spack/linux-debian11-sandybridge/gcc-11.3.0/libxc-5.2.3-y773nwtisxez7xtazgeoaszuzjbx4qst
exec_...Example:
```pc
prefix=/opt_some_cluster/linux-debian11/somelonglonglong/path/someotherlonglonglong/path/morelongpath/23b/sandybridge/spack/opt/spack/linux-debian11-sandybridge/gcc-11.3.0/libxc-5.2.3-y773nwtisxez7xtazgeoaszuzjbx4qst
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libxcf03
Description: Fortran 2003 interface for library of exchange and correlation functionals to be used in DFT codes
Requires:
Requires.private: libxc = 5.2.3
Version: 5.2.3
Libs: -L${libdir} -lxcf03
Cflags: -I${includedir}
```
When it runs, it does not include the `-L` flags, e.g.:
```console
$ pkg-config --cflags --libs libxcf03
-lxcf03
```
PS: version 0.29.2 works
Apparently this also needs to have `CPATH` and `LIBRARY_PATH` set. (but with a shorter `prefix` it still includes it in the flags)https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/77Building for Windows on ARM (using CLang)2023-02-02T10:40:36ZBrecht SandersBuilding for Windows on ARM (using CLang)When building natively on Windows on ARM (aarch64-w64-mingw32) using MSYS2's CLang I ran into some issues.
My `configure` flags looke like this:
```
--host=$RUNPLATFORM --disable-shared --enable-static --with-internal-glib
```
Some iss...When building natively on Windows on ARM (aarch64-w64-mingw32) using MSYS2's CLang I ran into some issues.
My `configure` flags looke like this:
```
--host=$RUNPLATFORM --disable-shared --enable-static --with-internal-glib
```
Some issues were solved simply adding this to `./configure`:
```
CFLAGS="-Wno-int-conversion -DNVALGRIND"
```
Another issue was avoided after running this patch:
```bash
patch -ulbf glib/glib/gbacktrace.h << EOF
@@ -55,3 +55,3 @@
# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
-#elif defined (_MSC_VER)
+#elif defined (_MSC_VER) || (defined (__MINGW64__) && defined (__aarch64__))
# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END
EOF
```
After that the build succeeded, and the `file` command returns this output:
```
pkg-config.exe: PE32+ executable (console) Aarch64, for MS Windows, 7 sections
```https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/75pkg-config does not always de-duplicate flags entries, leading to potentially...2022-11-21T10:00:08ZStefano Sabatinipkg-config does not always de-duplicate flags entries, leading to potentially huge commandlinesUsing pkg-config master on Windows.
Flags de-duplication for flags is not happening. This in turn causes the generation of a huge commandline when linking a project against multiple libraries, which cause the command to fail because is ...Using pkg-config master on Windows.
Flags de-duplication for flags is not happening. This in turn causes the generation of a huge commandline when linking a project against multiple libraries, which cause the command to fail because is too long.
Example of failure on Windows:
```
The filename or extension is too long. (os error 206)
```
Minimal test case:
`foo.pc`:
```
prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: Foo
Description: foo
URL: https://foo.org/
Version: 1.0
Requires:
Conflicts:
Libs: -L${libdir} -lfoo -lbaz
Libs.private:
Cflags: -I${includedir}/foo
```
`bar.pc`:
```
prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: Bar
Description: bar
URL: https://bar.org/
Version: 2.0
Requires: foo
Requires.private:
Conflicts:
Libs: -L${libdir} -lbaz
Cflags: -I${includedir}/bar
```
Command and output:
```
$ pkg-config --libs bar
-L/usr/local/lib -lbaz -lfoo -lbaz
```
Debug command and output:
```
$ ./pkg-config --version
0.29.2
$ pkg-config --debug --libs bar
$ ./pkg-config --debug --libs bar
Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
Error printing enabled
Adding virtual 'pkg-config' package to list of known packages
Looking for package 'bar'
Looking for package 'bar-uninstalled'
Reading 'bar' from file 'test.pkgconfig/bar.pc'
Parsing package file 'test.pkgconfig/bar.pc'
line>prefix=/usr/local
Variable declaration, 'prefix' has value '/usr/local'
line>exec_prefix=${prefix}
Variable declaration, 'exec_prefix' has value '/usr/local'
line>libdir=${prefix}/lib
Variable declaration, 'libdir' has value '/usr/local/lib'
line>includedir=${prefix}/include
Variable declaration, 'includedir' has value '/usr/local/include'
line>
line>Name: Bar
line>Description: bar
line>URL: https://bar.org/
line>Version: 2.0
line>Requires: foo
line>Requires.private:
line>Conflicts:
line>Libs: -L${libdir} -lbaz
line>Cflags: -I${includedir}/bar
Path position of 'bar' is 1
Adding 'bar' to list of known packages
Searching for 'bar' requirement 'foo'
Looking for package 'foo'
Looking for package 'foo-uninstalled'
Reading 'foo' from file 'test.pkgconfig/foo.pc'
Parsing package file 'test.pkgconfig/foo.pc'
line>prefix=/usr/local
Variable declaration, 'prefix' has value '/usr/local'
line>exec_prefix=${prefix}
Variable declaration, 'exec_prefix' has value '/usr/local'
line>libdir=${prefix}/lib
Variable declaration, 'libdir' has value '/usr/local/lib'
line>includedir=${prefix}/include
Variable declaration, 'includedir' has value '/usr/local/include'
line>
line>Name: Foo
line>Description: foo
line>URL: https://foo.org/
line>Version: 1.0
line>Requires:
line>Conflicts:
line>Libs: -L${libdir} -lfoo -lbaz
line>Libs.private:
line>Cflags: -I${includedir}/foo
Path position of 'foo' is 1
Adding 'foo' to list of known packages
post-recurse: bar foo
original: bar foo
sorted: bar foo
removing duplicate "-L/usr/local/lib"
removing duplicate "-L/usr/local/lib"
adding LIBS_L string "-L/usr/local/lib "
post-recurse: bar foo
removing duplicate "-lfoo"
removing duplicate "-lbaz"
adding LIBS_OTHER | LIBS_l string "-lbaz -lfoo -lbaz "
returning flags string "-L/usr/local/lib -lbaz -lfoo -lbaz"
-L/usr/local/lib -lbaz -lfoo -lbaz
```https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/74PKG CONFIG cannoit find libXI2022-09-30T00:48:16Zwellinton-capixabaPKG CONFIG cannoit find libXII am currently executing the configure script of gtk. It tests for the presence of XInput, and it stops the execution with the error message:
`"configure: error: *** XInput2 extension not found. Check 'config.log' for more details."`...I am currently executing the configure script of gtk. It tests for the presence of XInput, and it stops the execution with the error message:
`"configure: error: *** XInput2 extension not found. Check 'config.log' for more details."`
Config.log says the same with the added line number.
So I decided to look at configure.ac and the see the detection test, which happens to be?
`if $PKG_CONFIG --exists "xi" ; then
X_PACKAGES="$X_PACKAGES xi"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
gtk_save_LIBS="$LIBS"
LIBS="$LIBS -lXi"
# Note that we also check that the XIScrollClassInfo struct is defined,
# because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), but not the XIScrollClassInfo struct.
AC_CHECK_FUNC([XIAllowTouchEvents],
[AC_CHECK_MEMBER([XIScrollClassInfo.number],
have_xinput2_2=yes
AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
have_xinput2_2=no,
[[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"
if test "x$have_xinput2_2" = "xyes"; then
X_EXTENSIONS="$X_EXTENSIONS XI2.2"
else
X_EXTENSIONS="$X_EXTENSIONS XI2"
fi
fi
AS_IF([test "x$have_xinput2" != "xyes"],
[AC_MSG_ERROR([*** XInput2 extension not found. Check 'config.log' for more details.])])`
I did some tests to detect the point where the test fails (I edited the test, added a couple of AC_MSG_ERROR) and figured out that is the first line that fails to execute, and hence all the others:
`"if $PKG_CONFIG --exists "xi" ; then"`
But why? I am passing to configure the libXi dir:
`PKG_CONFIG_PATH=:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/`
there is inside the include dir of libXi a XInput2.h file, so nothing seems wrong at first sight.
So, I would deeply appreciate if someone could shed some light in this matter.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/73RFE: add possibility to define and check non-pkg-config based dependencies2022-09-01T17:53:01ZTomasz KłoczkoRFE: add possibility to define and check non-pkg-config based dependenciesI'm basing one whole discussion under issue ticket https://github.com/fwupd/fwupd/issues/4976
**Current situaltion** meson over python/python3 module provides possibility to check presence of exact python modules in build env however no...I'm basing one whole discussion under issue ticket https://github.com/fwupd/fwupd/issues/4976
**Current situaltion** meson over python/python3 module provides possibility to check presence of exact python modules in build env however notw it is not possible to propagate those dependencies over .pc fails. fwupd example is probably one of the best examples of such issues when `gi-docgen` needs some python modules and it fails because its own dependencies have not been propagated over its .pc file.
**Proposal**: provide possibility to add `python(<module_name>)` type of dependencies which would be possible to query using `pkg-config` command and use that kind of dependencies in .pc files `Requires:`. In future this could be extended to check other dependencies like perl, R, java or any other (by use `perl(<module::name>)` R(), java() and so on).https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/72ERROR_BROKEN_PIPE undeclared2022-06-19T07:47:19ZvincentERROR_BROKEN_PIPE undeclaredWhen i use cmd "make" to bulit,the error comes out as below:
`giowin32.c: In function 'g_io_win32_fd_get_flags_internal':
giowin32.c:1805:118: error: 'ERROR_BROKEN_PIPE' undeclared (first use in this function)
(PeekNamedPipe ((HANDLE) ...When i use cmd "make" to bulit,the error comes out as below:
`giowin32.c: In function 'g_io_win32_fd_get_flags_internal':
giowin32.c:1805:118: error: 'ERROR_BROKEN_PIPE' undeclared (first use in this function)
(PeekNamedPipe ((HANDLE) _get_osfhandle (win32_channel->fd), &c, 0, &count, NULL, NULL) != 0) || GetLastError () == ERROR_BROKEN_PIPE;`
I fount the ERROR_BROKEN_PIPE is 230, So i use 230 instead of ERROR_BROKEN_PIPE in code giowin32.c. Did this modify cause other problems. why ERROR_BROKEN_PIPE not define in code?
``(PeekNamedPipe ((HANDLE) _get_osfhandle (win32_channel->fd), &c, 0, &count, NULL, NULL) != 0) || GetLastError () == 230;``https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/71Windows: don't know how to make config.h.win322022-05-14T03:50:01Zjgcodes2020Windows: don't know how to make config.h.win32I tried running `nmake` in the project's root directory, only to be greeted by an error message:
```
Microsoft (R) Program Maintenance Utility Version 14.31.31104.0
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fata...I tried running `nmake` in the project's root directory, only to be greeted by an error message:
```
Microsoft (R) Program Maintenance Utility Version 14.31.31104.0
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make 'config.h.win32'
Stop.
```
Should I manually replace variables in `config.h.win32.in` or has someone already figured this out?https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/70Update overlinking URL in guide2021-12-03T09:17:21ZAlexander TraudUpdate overlinking URL in guideCommit 29cddacd changed the hyperlink in the year 2014 already. Now, the link broke again. I found:
a) http://web.archive.org/web/20140523093421/http://wiki.mandriva.com:80/en/Overlinking
b) http://web.archive.org/web/20190921014607/...Commit 29cddacd changed the hyperlink in the year 2014 already. Now, the link broke again. I found:
a) http://web.archive.org/web/20140523093421/http://wiki.mandriva.com:80/en/Overlinking
b) http://web.archive.org/web/20190921014607/https://wiki.openmandriva.org/en/Overlinking_issues_in_packaging
c) https://wiki.mageia.org/en/Overlinking_issues_in_packaging
Not sure, which one to take, otherwise I would have created a Merge Request. By the way, the current version online should be updated afterwards, at least Commit b51cd216 is not present there yet.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/69Widespread issues with empty PKG_CONFIG2022-02-09T16:04:14ZIsmael LucenoWidespread issues with empty PKG_CONFIGToo many projects' `configure` scripts don't check for empty `PKG_CONFIG`, yet use the variable directly, resulting in weird error messages through the run, which often confuse users. It would be useful to either error-out or set `PKG_CO...Too many projects' `configure` scripts don't check for empty `PKG_CONFIG`, yet use the variable directly, resulting in weird error messages through the run, which often confuse users. It would be useful to either error-out or set `PKG_CONFIG=false`, so that calls result in a fail without bogus errors.
In order to support both scenarios, I propose the `PKG_PROG_PKG_CONFIG` macro:
* by default abort the configure script.
* take an extra (optional) argument to specify a custom action instead.
* maybe set `PKG_CONFIG=false` (this conflicts with existing checks though).https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/68Configure fails on Apple M12022-02-12T08:53:25ZJeffrey Waltonnoloader@gmail.comConfigure fails on Apple M1I'm trying to build pkg-config 0.29.2 on an Apple M1. The machine is available on the GCC compile farm at `gcc304.fsffrance.org` (port 2409).
Configure is failing. cat'ing `config.log` shows:
```
configure:3465: checking whether the C ...I'm trying to build pkg-config 0.29.2 on an Apple M1. The machine is available on the GCC compile farm at `gcc304.fsffrance.org` (port 2409).
Configure is failing. cat'ing `config.log` shows:
```
configure:3465: checking whether the C compiler works
configure:3487: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fno-common -I/Users/noloader/include -DNDEBUG -L/Users/noloader/lib conftest.c >&5
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3491: $? = 1
configure:3529: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pkg-config"
| #define PACKAGE_TARNAME "pkg-config"
| #define PACKAGE_VERSION "0.29.2"
| #define PACKAGE_STRING "pkg-config 0.29.2"
| #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config"
| #define PACKAGE_URL ""
| #define PACKAGE "pkg-config"
| #define VERSION "0.29.2"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3534: error: in `/Users/noloader/Build-Scripts/pkg-config-0.29.2':
configure:3536: error: C compiler cannot create executables
```
Attached is the full `config.log`.[config.log.zip](/uploads/25762b78c7a69ed61a919d5952477e45/config.log.zip)https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/67[--uninstalled --cflags] Error when used in combination2021-08-17T11:00:50ZAlejandro Colomaralx@kernel.org[--uninstalled --cflags] Error when used in combinationIf I use both flags in combination, which from reading the man page doesn't look like something illegal, pkg-config ignores the latter of them, with the following error messages:
```
user@sqli:~/src/alx/libalx$ pkg-config --cflags --uni...If I use both flags in combination, which from reading the man page doesn't look like something illegal, pkg-config ignores the latter of them, with the following error messages:
```
user@sqli:~/src/alx/libalx$ pkg-config --cflags --uninstalled lib/pkgconfig/libalx-npcomplete-uninstalled.pc
Ignoring incompatible output option "--uninstalled"
-isystem/usr/local/include -fopenmp -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -isystem/usr/local/include -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
```
```
user@sqli:~/src/alx/libalx$ pkg-config --uninstalled --cflags lib/pkgconfig/libalx-npcomplete-uninstalled.pc
Ignoring incompatible output option "--cflags"
```
Why wouldn't I be able to read cflags from an uninstalled .pc file? Of course I want to :)
I'm using 0.29.2 (Debian Bullseye). BTW, it is already quite old! How about doing a new release? :-)https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/66"pkg-config --cflags" incorrectly omits -I flags2022-10-12T16:02:41ZVincent Lefevre"pkg-config --cflags" incorrectly omits -I flagsWith pkg-config 0.29.2 under Debian, `pkg-config --cflags` incorrectly omits `-I` flags, potentially yielding errors, or even incorrect builds because a wrong `.h` file could be included. This happens when a `CPATH` or `C_INCLUDE_PATH` e...With pkg-config 0.29.2 under Debian, `pkg-config --cflags` incorrectly omits `-I` flags, potentially yielding errors, or even incorrect builds because a wrong `.h` file could be included. This happens when a `CPATH` or `C_INCLUDE_PATH` environment variable has the include directory in question.
Example:
```
zira% pkg-config --cflags fplll
-pthread -I/home/vinc17/opt/fplll/include
zira% CPATH=/home/vinc17/opt/fplll/include pkg-config --cflags fplll
-pthread
zira% C_INCLUDE_PATH=/home/vinc17/opt/fplll/include pkg-config --cflags fplll
-pthread
```
At least with `C_INCLUDE_PATH`, this is incorrect because this environment variable is ignored by `g++`.
Not sure about `CPATH`, but it would be safer to ignore it as well in case it would be unset or it would not be taken into account by some compiler (it is not specified by POSIX).
Bug also reported in the Debian BTS: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984504https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/65pkg-config cannot us .pc file in a dir with spaces2021-03-05T01:41:57ZTommi Pirinenpkg-config cannot us .pc file in a dir with spacesThere does not seem to be a way to escape spaces when specifying pc file by name, i.e:
```
pkg-config "dir with spaces/example.pc"
Package dir was not found in the pkg-config search path.
Perhaps you should add the directory containing ...There does not seem to be a way to escape spaces when specifying pc file by name, i.e:
```
pkg-config "dir with spaces/example.pc"
Package dir was not found in the pkg-config search path.
Perhaps you should add the directory containing `dir.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dir' found
Package with was not found in the pkg-config search path.
Perhaps you should add the directory containing `with.pc'
to the PKG_CONFIG_PATH environment variable
No package 'with' found
Failed to open 'spaces/example.pc': No such file or directory
No package 'spaces/example.pc' found
pkg-config "dir\ with\ spaces/example.pc"
...
pkg-config "dir\\ with\\ spaces/example.pc"
...
pkg-config dir\ with\ spaces/example.pc"
...
cd dir\ with\ spaces && pkg-config example.pc
0.3.0
```
this would be useful for `configure` scripts, where it is not always easy to change environment variables. pkg-conf supports a `--with-dir="PATH"` switch which seems to work around this.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/63Failed build on Solaris i86pc2022-12-05T10:08:38ZJeffrey Waltonnoloader@gmail.comFailed build on Solaris i86pcHi Everyone,
I'm working on Solaris 11.3, i86pc. I'm building pkg-config 0.29.2 from the release tarball.
Configure is failing with:
```bash
libtool: compile: /bin/gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. "-DG_LOG_D...Hi Everyone,
I'm working on Solaris 11.3, i86pc. I'm building pkg-config 0.29.2 from the release tarball.
Configure is failing with:
```bash
libtool: compile: /bin/gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. "-DG_LOG_DOMAIN=\"GLib\"" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -I/usr/local/include -DNDEBUG -D_REENTRANT -D_PTHREADS -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format=2 -Werror=missing-include-dirs -fvisibility=hidden -g2 -O2 -m64 -march=native -fPIC -pthread -MT libglib_2_0_la-ggettext.lo -MD -MP -MF .deps/libglib_2_0_la-ggettext.Tpo -c ggettext.c -o libglib_2_0_la-ggettext.o
In file included from ggettext.c:30:0:
/usr/include/libintl.h:45:14: error: expected identifier or '(' before 'const'
extern char *dcgettext(const char *, const char *, const int);
^
/usr/include/libintl.h:46:14: error: expected identifier or '(' before 'const'
extern char *dgettext(const char *, const char *);
^
/usr/include/libintl.h:47:14: error: expected identifier or '(' before 'const'
extern char *gettext(const char *);
^
/usr/include/libintl.h:48:14: error: expected identifier or '(' before 'const'
extern char *textdomain(const char *);
^
glibintl.h:32:38: error: expected ')' before '?' token
#define textdomain(String) ((String) ? (String) : "messages")
^
/usr/include/libintl.h:49:14: error: expected identifier or '(' before 'const'
extern char *bindtextdomain(const char *, const char *);
^
/usr/include/libintl.h:57:14: error: expected identifier or '(' before 'unsigned'
extern char *dngettext(const char *, const char *,
^
glibintl.h:36:50: error: expected ')' before '==' token
#define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2))
^
In file included from /usr/include/locale.h:12:0,
from ggettext.c:44:
/usr/include/libintl.h:60:65: error: expected identifier or '(' before ';' token
extern char *bind_textdomain_codeset(const char *, const char *);
^
In file included from ggettext.c:30:0:
ggettext.c: In function 'ensure_gettext_initialized':
glibintl.h:37:42: warning: statement with no effect [-Wunused-value]
#define bindtextdomain(Domain,Directory) (Domain)
^
ggettext.c:109:7: note: in expansion of macro 'bindtextdomain'
bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
^
gmake[6]: *** [libglib_2_0_la-ggettext.lo] Error 1
gmake[6]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2/glib/glib'
gmake[5]: *** [all-recursive] Error 1
gmake[5]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2/glib/glib'
gmake[4]: *** [all] Error 2
gmake[4]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2/glib/glib'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2/glib'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2/glib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/export/home/jwalton/Build-Scripts/pkg-config-0.29.2'
gmake: *** [all] Error 2
```
Here is [config.log](/uploads/605c5c0a14969d9e869b940c363550bb/config.log.zip). I am not sure how helpful it is.
-----
pkg-config is unique among packages. I've learned pkg-config is one of the critical packages needed to bootstrap things. In fact, the only package more critical is Wget because that downloads a package. Once I have a working pkg-config and Wget, I can install other packages like iConv and GetText.
Here are the non-trivial `configure --help` options. I don't see an option to control the behavior.
```bash
--with-pc-path default search path for .pc files
--with-system-include-path
avoid -I flags from the given path
--with-system-library-path
avoid -L flags from the given path
--with-internal-glib use internal glib
--with-gcov gcov test coverage [default=no]
```
"Control the behavior" is a little vague. I need the build to succeed at any cost. I don't care about localization at this point. I can do things the right way later, once I have a working pkg-config and wget.https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/62pkg.m4 breaks if 'version' is defined as a macro2021-01-11T13:10:20ZAlexander Shpilkinpkg.m4 breaks if 'version' is defined as a macroIf the user defines an m4 macro called `version`, pkg.m4 outputs a broken configure script due to underquoting in `PKG_PROG_PKG_CONFIG`:
```
$ cat >configure.ac <<EOF
> AC_INIT([Test], [0.1.0])
> m4_define([version], [DEFINITION-OF-VERS...If the user defines an m4 macro called `version`, pkg.m4 outputs a broken configure script due to underquoting in `PKG_PROG_PKG_CONFIG`:
```
$ cat >configure.ac <<EOF
> AC_INIT([Test], [0.1.0])
> m4_define([version], [DEFINITION-OF-VERSION])
> PKG_PROG_PKG_CONFIG
> AC_OUTPUT
> EOF
$ autoreconf -fi
$ ./configure
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least DEFINITION-OF-VERSION 0.9.0... pkgconf: unknown option -- atleast-pkgconfig-DEFINITION-OF-VERSION
no
configure: creating ./config.status
```
(This example was run on a system that uses pkgconf and not pkg-config, but pkg.m4 is shared between the two.)https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/61Handle LD_RUN_PATH like LIBRARY_PATH, to also strip RPATH flags (-Wl,-R -Wl,-...2021-01-25T17:56:26ZThomas OrgisHandle LD_RUN_PATH like LIBRARY_PATH, to also strip RPATH flags (-Wl,-R -Wl,-rpath=)I noticed that pkg-config drops -L/foo/lib from the flags if LIBRARY_PATH contains /foo/lib. Similar for -I/foo/include.
I think it should also drop RPATH-related flags if LD_RUN_PATH is set.
The context is pkgsrc, which adds -Wl,-R$pr...I noticed that pkg-config drops -L/foo/lib from the flags if LIBRARY_PATH contains /foo/lib. Similar for -I/foo/include.
I think it should also drop RPATH-related flags if LD_RUN_PATH is set.
The context is pkgsrc, which adds -Wl,-R$prefix/lib into its .pc files. This normally is sensible, but in our case of an HPC installation that manages user's access to software and build environments via environment modules, it creates some conflict.
With the environment modules, we manage PATH, CPATH/C_INCLUDE_PATH, LIBRARY_PATH as well as LD_RUN_PATH to make builds do the right thing to use the currently chosen tools and libraries, also with correct RPATH written to the binaries. We avoid using LD_LIBRARY_PATH.
The peculiar nature of LD_RUN_PATH is that any present -Wl,-R completely neuters LD_RUN_PATH. So, it would be nice if pkg-config stripped those too if they are in LD_RUN_PATH. If they're not, then my LD_RUN_PATH will be useless but it's my fault for not including some needed path in it and I can fix that. One could decide to make pkg-config drop all RPATH-related flags in the presence of any LD_RUN_PATH in the environment, though. The intention of the user is not totally obvious in that case.
Any of those two solutions would be fine by me. What's your take? I could have prepared a patch, but it would be rather direct copy and paste from the -L flag handling (so some refactoring might be more useful). I'd like to have the general idea settled first, anyway.
So, shall pkg-config also handle LD_RUN_PATH and filter RPATH-related linker flags?https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/60--define-prefix is broken in distros that install in multi-arch directories2020-12-28T23:16:00ZLuca Boccassi--define-prefix is broken in distros that install in multi-arch directoriesIn 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.
EG:
```
$ pkg-config --define-prefix --cflags blkid
-I/usr/lib/include/blkid
```
This is obviously wrong and causes build failures, as there's no such directory.
An "hacky" fix was proposed in https://gitlab.freedesktop.org/pkg-config/pkg-config/-/merge_requests/4 but never went anywhere. It would be great if this bug could be looked at.
Thanks!