summaryrefslogtreecommitdiff
path: root/makefiledir/iconv_detector.c
diff options
context:
space:
mode:
Diffstat (limited to 'makefiledir/iconv_detector.c')
-rw-r--r--makefiledir/iconv_detector.c18
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;
+}