1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (C) 2002, 2003, 2004 Simon Josefsson.
5 dnl This file is part of GNU Libidn.
7 dnl GNU Libidn is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU Lesser General Public License as
9 dnl published by the Free Software Foundation; either version 2.1 of
10 dnl the License, or (at your option) any later version.
12 dnl GNU Libidn is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU Lesser General Public License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public
18 dnl License along with GNU Libidn; if not, write to the Free Software
19 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 AC_INIT([libidn], [0.5.1], [bug-libidn@gnu.org])
23 # Library code modified: REVISION++
24 # Interfaces changed/added/removed: CURRENT++ REVISION=0
25 # Interfaces added: AGE++
26 # Interfaces removed: AGE=0
35 AM_INIT_AUTOMAKE([1.8 gnits])
36 AC_CONFIG_HEADERS(config.h)
38 # Checks for programs.
39 AM_GNU_GETTEXT(external)
40 AM_GNU_GETTEXT_VERSION(0.14.1)
43 AM_MISSING_PROG(PERL, perl, $missing_dir)
44 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
48 # Checks for header files.
50 AC_CHECK_HEADERS(unistd.h errno.h)
52 # Checks for typedefs, structures, and compiler characteristics.
53 AX_CREATE_STDINT_H(lib/idn-int.h, sys/types.h)
57 AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
58 AC_CHECK_FUNCS([getopt_long_only], [],
62 AC_DEFINE([optarg], [rpl_optarg],
63 [Define to rpl_optarg if the replacement variable should be used.])
64 AC_DEFINE([optind], [rpl_optind],
65 [Define to rpl_optind if the replacement variable should be used.])
66 AC_DEFINE([optopt], [rpl_optopt],
67 [Define to rpl_optopt if the replacement variable should be used.])
68 AC_DEFINE([getopt], [rpl_getopt],
69 [Define to rpl_getopt if the replacement function should be used.])
70 AC_DEFINE([getopt_long], [rpl_getopt_long],
71 [Define to rpl_getopt_long if the replacement function should be used.])
72 AC_DEFINE([getopt_long_only], [rpl_getopt_long_only],
73 [Define to rpl_getopt_long_only if the replacement function should be used.])])
76 # Check if locale stuff works
77 AC_CACHE_CHECK([if setlocale() and nl_langinfo() works],
79 AC_RUN_IFELSE([AC_LANG_SOURCE([[
85 setlocale(LC_CTYPE, "");
86 cs = nl_langinfo(CODESET);
89 ]])],[ac_cv_locale_works=yes],[ac_cv_locale_works=no],[ac_cv_locale_works=no])
91 if test "$ac_cv_locale_works" = "yes"; then
92 AC_DEFINE(LOCALE_WORKS, 1, [Define if setlocale() and nl_langinfo() works.])
95 # Make it possible to disable TLD code.
96 AC_ARG_ENABLE(tld, AC_HELP_STRING([--disable-tld], [disable TLD code]),
97 enable_tld=$enableval, enable_tld=yes)
98 AM_CONDITIONAL(TLD, test "$enable_tld" != "no")
99 if test "$enable_tld" != "no"; then
100 AC_DEFINE(WITH_TLD, 1, [Define to 1 if you want TLD code.])
102 AC_MSG_CHECKING([if TLD API for specific TLD rules should be built])
103 AC_MSG_RESULT($enable_tld)
109 AC_ARG_ENABLE(java, AC_HELP_STRING([--enable-java], [enable Java API]),,
111 if test "$enable_java" != "no"; then
116 AM_CONDITIONAL(JAVA, test "$enable_java" != "no")
117 AC_MSG_CHECKING([if implementation in Java should be built])
118 AC_MSG_RESULT($enable_java)
120 AC_CONFIG_FILES([Makefile libidn.pc doc/reference/Makefile doc/java/Makefile \
121 lib/stringprep.h contrib/doxygen/Doxyfile \
122 doc/Makefile doc/specifications/Makefile doc/tld/Makefile \
123 lib/Makefile src/Makefile tests/Makefile examples/Makefile \
124 java/Makefile java/gnu/Makefile java/gnu/inet/Makefile \
125 java/gnu/inet/encoding/Makefile java/misc/Makefile \