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

Preserve PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR environment variables in config.cache #6614

Closed
DorpsGek opened this issue Aug 19, 2017 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

adf88 opened the ticket and wrote:

Preserve PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR environment variables in 'config.cache' file, just like other variables CFLAGS, LDFLGS etc.

OpenTTD almost entirely moved to pkg-config utility for detecting libraries. There are two substantial environment variables that pkg-config use - PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR. They allow to deal with non-standard library locations (useful e.g. when cross-compiling). This patch will cause them to be preserved in 'config.cache' file so they are "visible" when OpenTTD re-configures itself.

Note: libraries that OpenTTD use usually also have this feature in their build systems, probably thanks to the autotools.

In addition, the patch allows these variables to be passed as options to 'configure' script (just like CFLAGS, LDFLGS etc.) e.g.

./configure PKG_CONFIG_PATH=path
./configure --PKG_CONFIG_PATH=path
./configure --PKG-CONFIG-PATH=path

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6614
@DorpsGek
Copy link
Member Author

adf88 wrote:

Now not joking ;)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6614#comment14586

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Out of interest, tested patch against vanilla OS X compile (r27896).

make clean
./configure
make run

Worked for me. I'm not the right person to comment more ;)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6614#comment14629

@DorpsGek
Copy link
Member Author

adf88 wrote:

One of ways to test the patch (without installing libraries in unusual paths):

unset PKG_CONFIG_LIBDIR # make sure it's not set
./configure

This should successfully find all libraries in their default paths (usually in /usr/lib etc.).

export PKG_CONFIG_LIBDIR=/invalidpath
make reconfigure

Searching for libraries will fail without the patch, it should succeed with the patch. The patch should cause 'reconfigure' to ignore current value of PKG_CONFIG_LIBDIR (=/invalidpath) and use one that was set during the first './configure' (it was unset so 'reconfigure' will unset it).


This comment was imported from FlySpray: https://bugs.openttd.org/task/6614#comment14650

@DorpsGek
Copy link
Member Author

adf88 closed the ticket.

Reason for closing: Implemented

In r27902


This comment was imported from FlySpray: https://bugs.openttd.org/task/6614

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Build system patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant