summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2015-08-09 12:42:21 +0000
committerrubidium <rubidium@openttd.org>2015-08-09 12:42:21 +0000
commitd5810e5d6550057660e06be6a514c5236e1efa33 (patch)
tree47f65df7263fba54aed67c9b2c803bbf9aed77ac
parent95ccddd6fe3c9e06a7717103b29a5d2f8da7ae16 (diff)
downloadopenttd-d5810e5d6550057660e06be6a514c5236e1efa33.tar.xz
(svn r27374) -Codechange: make zlib detection and configuration make use of pkg-config
-rw-r--r--config.lib16
1 files changed, 9 insertions, 7 deletions
diff --git a/config.lib b/config.lib
index 4dbf85800..e697bd64e 100644
--- a/config.lib
+++ b/config.lib
@@ -791,7 +791,7 @@ check_params() {
pre_detect_with_zlib=$with_zlib
detect_zlib
- if [ "$with_zlib" = "0" ] || [ -z "$zlib" ]; then
+ if [ "$with_zlib" = "0" ] || [ -z "$zlib-config" ]; then
log 1 "WARNING: zlib was not detected or disabled"
log 1 "WARNING: OpenTTD doesn't require zlib, but it does mean that many features"
log 1 "WARNING: (like loading most old savegames/scenarios, loading heightmaps,"
@@ -1657,12 +1657,13 @@ make_cflags_and_ldflags() {
fi
if [ "$with_zlib" != "0" ]; then
- if [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then
- LIBS="$LIBS $zlib"
+ CFLAGS="$CFLAGS -DWITH_ZLIB"
+ CFLAGS="$CFLAGS `$zlib_config --cflags | tr '\n\r' ' '`"
+ if [ "$enable_static" != "0" ]; then
+ LIBS="$LIBS `$zlib_config --libs --static | tr '\n\r' ' '`"
else
- LIBS="$LIBS -lz"
+ LIBS="$LIBS `$zlib_config --libs | tr '\n\r' ' '`"
fi
- CFLAGS="$CFLAGS -DWITH_ZLIB"
fi
if [ -n "$lzma_config" ]; then
@@ -2660,7 +2661,7 @@ detect_library() {
}
detect_zlib() {
- detect_library "$with_zlib" "zlib" "libz.a" "" "zlib.h"
+ detect_pkg_config "$with_zlib" "zlib" "zlib_config" "1.2"
}
detect_lzo2() {
@@ -3537,7 +3538,8 @@ showhelp() {
echo " enables Allegro video driver support"
echo " --with-cocoa enables COCOA video driver (OSX ONLY)"
echo " --with-sdl[=\"pkg-config sdl\"] enables SDL video driver support"
- echo " --with-zlib[=zlib.a] enables zlib support"
+ echo " --with-zlib[=\"pkg-config zlib\"]"
+ echo " enables zlib support"
echo " --with-liblzma[=\"pkg-config liblzma\"]"
echo " enables liblzma support"
echo " --with-liblzo2[=liblzo2.a] enables liblzo2 support"