Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgconfig: Add '-I${includedir}' to Cflags #57

Conversation

michaelweghorn
Copy link
Contributor

Don't just specify -I${includedir}/cupsfilters,
but also -I${includedir} in the Cflags
in the pkgconfig file.

This way, includes prefixed with the "cupsfilters/" directory path also work.

This e.g. makes the libppd build work when
libcupsfilters is installed in a non-default path
(e.g. configured with --prefix=$HOME/temp/cpdb)
and libppd is configured to use that one
(e.g. by setting env variable
PKG_CONFIG_PATH=$HOME/temp/cpdb/lib/pkgconfig/
during configure).

Without this commit, libppd's configure would
succeed in the above scenario, but the actual build using make would then fail to find the cupsfilters headers:

make  all-recursive
make[1]: Entering directory '/home/michi/development/git/libppd'
make[2]: Entering directory '/home/michi/development/git/libppd'
  CC       ppd/libppd_la-ppd-attr.lo
In file included from ppd/ppd-attr.c:16:
./ppd/ppd.h:26:12: fatal error: cupsfilters/log.h: No such file or directory
   26 | #  include <cupsfilters/log.h>
      |            ^~~~~~~~~~~~~~~~~~~
compilation terminated.

(This is with libppd [1] git master as of commit
327b61cf5ec3bc74677e3b56fde4c8c4e9acdcb7).

[1] https://github.com/OpenPrinting/libppd

Don't just specify `-I${includedir}/cupsfilters`,
but also `-I${includedir}` in the Cflags
in the pkgconfig file.

This way, includes prefixed with the "cupsfilters/"
directory path also work.

This e.g. makes the libppd build work when
libcupsfilters is installed in a non-default path
(e.g. configured with `--prefix=$HOME/temp/cpdb`)
and libppd is configured to use that one
(e.g. by setting env variable
`PKG_CONFIG_PATH=$HOME/temp/cpdb/lib/pkgconfig/`
during configure).

Without this commit, libppd's configure would
succeed in the above scenario, but the actual build
using `make` would then fail to find the cupsfilters
headers:

    make  all-recursive
    make[1]: Entering directory '/home/michi/development/git/libppd'
    make[2]: Entering directory '/home/michi/development/git/libppd'
      CC       ppd/libppd_la-ppd-attr.lo
    In file included from ppd/ppd-attr.c:16:
    ./ppd/ppd.h:26:12: fatal error: cupsfilters/log.h: No such file or directory
       26 | #  include <cupsfilters/log.h>
          |            ^~~~~~~~~~~~~~~~~~~
    compilation terminated.

(This is with libppd [1] git master as of commit
327b61cf5ec3bc74677e3b56fde4c8c4e9acdcb7).

[1] https://github.com/OpenPrinting/libppd
@tillkamppeter tillkamppeter merged commit 449ac63 into OpenPrinting:master Jul 4, 2024
@michaelweghorn michaelweghorn deleted the michaelweghorn/pkgconfig_add_includedir branch July 4, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants