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

Fix compilation errors for downstream projects caused by incorrect pkconfig paths #493

Merged
merged 1 commit into from Jul 8, 2016

Conversation

zorun
Copy link

@zorun zorun commented Jul 7, 2016

Recent commit 911e2b0 ("By default use relative paths when
installing") introduced relative install paths in CMake. But this
interacts badly with commit e6f1cff from a year ago: now, the paths in
pkgconfig/jsoncpp.pc are relative, which is incorrect.

Before 911e2b0 (1.7.2 on Archlinux), this was correct:

$ head -4 /usr/lib/pkgconfig/jsoncpp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib
includedir=/usr/include

After 911e2b0 (1.7.3 on Archlinux), this is now incorrect:

$ head -4 /usr/lib/pkgconfig/jsoncpp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=lib
includedir=include

This change causes hard-to-debug compilation errors for projects that
depend on jsoncpp, for instance:

CXXLD    libring.la
/tmp/ring-daemon/src/ring-daemon/src/../libtool: line 7486: cd: lib: No such file or directory
libtool:   error: cannot determine absolute directory name of 'lib'
make[3]: *** [Makefile:679: libring.la] Error 1

This is because jsoncpp contributes -Llib -ljsoncpp to the LDFLAGS, via
the pkg-config machinery. Notice the relative path in -Llib.

To fix this, simply revert commit e6f1cff ("Fix custom includedir &
libdir substitution in pkg-config"). The change in 911e2b0 should have
the same effect.

See #279, #470 for references.

…gconfig paths

Recent commit 911e2b0 ("By default use <prefix> relative paths when
installing") introduced relative install paths in CMake.  But this
interacts badly with commit e6f1cff from a year ago: now, the paths in
`pkgconfig/jsoncpp.pc` are relative, which is incorrect.

Before 911e2b0 (1.7.2 on Archlinux), this was correct:

    $ head -4 /usr/lib/pkgconfig/jsoncpp.pc
    prefix=/usr
    exec_prefix=${prefix}
    libdir=/usr/lib
    includedir=/usr/include

After 911e2b0 (1.7.3 on Archlinux), this is now incorrect:

    $ head -4 /usr/lib/pkgconfig/jsoncpp.pc
    prefix=/usr
    exec_prefix=${prefix}
    libdir=lib
    includedir=include

This change causes hard-to-debug compilation errors for projects that
depend on jsoncpp, for instance:

    CXXLD    libring.la
    /tmp/ring-daemon/src/ring-daemon/src/../libtool: line 7486: cd: lib: No such file or directory
    libtool:   error: cannot determine absolute directory name of 'lib'
    make[3]: *** [Makefile:679: libring.la] Error 1

This is because jsoncpp contributes `-Llib -ljsoncpp` to the LDFLAGS, via
the pkg-config machinery.  Notice the relative path in `-Llib`.

To fix this, simply revert commit e6f1cff ("Fix custom includedir &
libdir substitution in pkg-config").  The change in 911e2b0 should have
the same effect.

See open-source-parsers#279, open-source-parsers#470 for references.
@cdunn2001 cdunn2001 merged commit 772e257 into open-source-parsers:master Jul 8, 2016
@cdunn2001
Copy link
Contributor

Thanks!

@zorun
Copy link
Author

zorun commented Jul 8, 2016

Great, thanks for the merge!

Would you mind spinning up a new release with this fix?

@cdunn2001 cdunn2001 self-assigned this Jul 8, 2016
@cdunn2001
Copy link
Contributor

Done:

A "pre-release" for now. If anybody reports a problem, we might need your help to address it.

@cdunn2001
Copy link
Contributor

Could you comment on #497? We might need to revert.

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.

None yet

2 participants