Changeset - r22194:e712fdb99452
[Not reviewed]
master
0 1 0
rubidium - 9 years ago 2015-08-09 12:42:21
rubidium@openttd.org
(svn r27374) -Codechange: make zlib detection and configuration make use of pkg-config
1 file changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -788,13 +788,13 @@ check_params() {
 
		log 1 "checking assert... disabled"
 
	fi
 

	
 
	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,"
 
		log 1 "WARNING: using PNG, or using fonts, ...) will be disabled."
 
		if [ "$pre_detect_with_zlib" = "0" ]; then
 
			log 1 "WARNING: We strongly suggest you to install zlib."
 
@@ -1654,18 +1654,19 @@ make_cflags_and_ldflags() {
 
		if [ "$enable_cocoa_quickdraw" != "0" ]; then
 
			CFLAGS="$CFLAGS -DENABLE_COCOA_QUICKDRAW"
 
		fi
 
	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
 
		CFLAGS="$CFLAGS -DWITH_LZMA"
 
		CFLAGS="$CFLAGS `$lzma_config --cflags | tr '\n\r' '  '`"
 

	
 
@@ -2657,13 +2658,13 @@ detect_library() {
 
	log 2 "  trying $res... found"
 

	
 
	log 1 "checking $2... found"
 
}
 

	
 
detect_zlib() {
 
	detect_library "$with_zlib" "zlib" "libz.a" "" "zlib.h"
 
	detect_pkg_config "$with_zlib" "zlib" "zlib_config" "1.2"
 
}
 

	
 
detect_lzo2() {
 
	detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h"
 
}
 

	
 
@@ -3534,13 +3535,14 @@ showhelp() {
 
	echo "                                 midi-player"
 
	echo "  --with-libtimidity             enables libtimidity support"
 
	echo "  --with-allegro[=\"pkg-config allegro\"]"
 
	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"
 
	echo "  --with-png[=libpng-config]     enables libpng support"
 
	echo "  --with-freetype[=\"pkg-config freetype2\"]"
 
	echo "                                 enables libfreetype support"
0 comments (0 inline, 0 general)