Bug 696528 - ijs-config and pkg-config report different CFLAGS for ijs
Summary: ijs-config and pkg-config report different CFLAGS for ijs
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 15:13 UTC by Brian Norris
Modified: 2016-01-22 03:36 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
[PATCH] kill off ijs-config (6.39 KB, patch)
2016-01-21 09:58 UTC, Brian Norris
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Norris 2016-01-20 15:13:31 UTC
ijs-config and pkg-config are two different tools for generating the compiler and linker flags required for the IJS library. One would expect them to give equivalent results, so packagers and distributions can use either one interchangeably, depending on whichever suits them best. However I note that the provided source files (ijs/ijs.pc.in and ijs/ijs-config.in) have notably different results.

On an example Ubuntu system:

$ pkg-config --cflags ijs
 
## Note: above result is a blank line, because
## -I/usr/include is just the default system path
$ ijs-config --cflags
-I/usr/include/ijs

Or on a local build of the current ghostpdl.git repo:

$ cd ijs
$ ./configure
...
$ make
...
$ ./ijs-config --cflags
-I/usr/local/include/ijs
$ PKG_CONFIG_PATH=. pkg-config --cflags ijs
-I/usr/local/include  


In either case, note that the "ijs" subdirectory is added to the CFLAGS for ijs-config, but not for pkg-config.

Altogether, this discrepancy means that client source code using (e.g.) ijs.h needs to know which tool is going to be used: pkg-config or ijs-config. Is this discrepancy intentional? Seems like a bug to me, but I don't know how many client packages have grown to assume this discrepancy. Maybe we just have to live with it?

Side note: I noticed this when trying to fix up issues in gutenprint, which currently uses ijs-config, and #include <ijs.h>.
Comment 1 Chris Liddell (chrisl) 2016-01-21 06:02:58 UTC
TBH, I've no idea. The IJS stuff long predates my involvement, and the engineer who was involved moved on some time ago.

Worse, we really don't have any history on the sources, and I haven't been able to find any.

My feeling that they should be the same (since the purpose of the two is the same).

My *guess* is that the ijs-config script predates pkg-config.

My inclination is to remove ijs-config, but willing to take suggestions.
Comment 2 Mike Frysinger 2016-01-21 08:31:28 UTC
i strongly encourage deleting of custom xxx-config scripts and only installing .pc files for pkg-config :)
Comment 3 Brian Norris 2016-01-21 09:58:24 UTC
Created attachment 12251 [details]
[PATCH] kill off ijs-config
Comment 4 Brian Norris 2016-01-21 10:00:19 UTC
(In reply to Mike Frysinger from comment #2)
> i strongly encourage deleting of custom xxx-config scripts and only
> installing .pc files for pkg-config :)

SGTM! Patch uploaded. (Because autoconf files are checked in, running autoreconf on the git repo afterward would be wise.)
Comment 5 Chris Liddell (chrisl) 2016-01-22 03:36:09 UTC
Patch applied (with the addition of the autogen'ed files):
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=0c176a91


Thank you!

FWIW, IJS is an oddity - I don't know at what point we became the "upstream" source for it, but it looks like it was only at some point after the 0.35 IJS release, so we have no real history before that.