summaryrefslogtreecommitdiff
path: root/makefiledir/Makefile.libdetection
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-03-23 23:54:43 +0000
committerbjarni <bjarni@openttd.org>2006-03-23 23:54:43 +0000
commit10936e70345e4d462517e35511f0e56b69c444e9 (patch)
tree6ffab345b4e5937c329ed5663a3b4bd2a268b369 /makefiledir/Makefile.libdetection
parent541703a2f6687fcb7d9f4d1453f84d80b67cd58c (diff)
downloadopenttd-10936e70345e4d462517e35511f0e56b69c444e9.tar.xz
(svn r4074) -Feature: [Makefile] the makefile can now detect if iconv is present in the system
if detected, WITH_ICONV will be defined in the C code WITH_ICONV is also added to Makefile.config OSX do not use this flag setting in Makefile.config, as it is set at compile time based on target OS version the actual C code is not changed as the current iconv code is hardcoded for OSX and would break if any other OS got iconv This detection system is by request of Darkvater
Diffstat (limited to 'makefiledir/Makefile.libdetection')
-rw-r--r--makefiledir/Makefile.libdetection9
1 files changed, 9 insertions, 0 deletions
diff --git a/makefiledir/Makefile.libdetection b/makefiledir/Makefile.libdetection
index 237c02f98..47d8edee1 100644
--- a/makefiledir/Makefile.libdetection
+++ b/makefiledir/Makefile.libdetection
@@ -121,3 +121,12 @@ WITH_PNG:=
endif
endif
+
+ifeq ($(shell expr $(CONFIG_VERSION) \< 10), 1)
+# we need to test if iconv is present on the current system
+# even though we test on OSX, the read data is actually not used since it relies on target OS and this flag will be overwritten later
+
+$(shell $(CC) -liconv -o makefiledir/iconv_detector makefiledir/iconv_detector.c 2>/dev/null)
+WITH_ICONV:=$(shell makefiledir/iconv_detector 2>/dev/null)
+$(shell rm makefiledir/iconv_detector 2>/dev/null)
+endif