diff options
author | bjarni <bjarni@openttd.org> | 2006-03-23 23:54:43 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-03-23 23:54:43 +0000 |
commit | 10936e70345e4d462517e35511f0e56b69c444e9 (patch) | |
tree | 6ffab345b4e5937c329ed5663a3b4bd2a268b369 /makefiledir/iconv_detector.c | |
parent | 541703a2f6687fcb7d9f4d1453f84d80b67cd58c (diff) | |
download | openttd-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/iconv_detector.c')
-rw-r--r-- | makefiledir/iconv_detector.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/makefiledir/iconv_detector.c b/makefiledir/iconv_detector.c new file mode 100644 index 000000000..709656cb9 --- /dev/null +++ b/makefiledir/iconv_detector.c @@ -0,0 +1,18 @@ +/* $Id$ */ + +#include <stdlib.h> +#include <iconv.h> +#include <stdio.h> + +/* this is a pretty simple app, that will return 1 if it manages to compile and execute + * This means that it can be used by the makefile to detect if iconv is present on the current system + * no iconv means this file fails and will return nothing */ + +int main () +{ + iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + printf("1\n"); + return 0; +} |