2 # Process this file with autoconf to produce a configure script.
6 m4_esyscmd([build-aux/git-version-gen]),
8 AC_CONFIG_SRCDIR([datrie/trie.h])
9 AC_CONFIG_HEADER([config.h])
10 AC_CONFIG_AUX_DIR(build-aux)
11 AC_CONFIG_MACRO_DIR([m4])
13 AM_INIT_AUTOMAKE(dist-xz no-dist-gzip)
16 # Library code modified: REVISION++
17 # Interfaces added: CURRENT++ REVISION=0 AGE++
18 # Interfaces changed/removed: CURRENT++ REVISION=0 AGE=0
28 # Checks for programs.
36 # Whether linker support --version-script option
37 echo '{global:hello; local:*;};' > conftest.ver
38 AC_LIBTOOL_LINKER_OPTION(
39 [whether linker supports -version-script],
40 datrie_cv_have_version_script,
41 [-Wl,-version-script -Wl,conftest.ver])
43 AM_CONDITIONAL(LD_HAS_VERSION_SCRIPT,
44 test "$datrie_cv_have_version_script" = "yes")
46 # Checks for libraries.
52 # Check in the C library first
53 AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
54 # Check if we have GNU libiconv
55 if test $found_iconv = "no"; then
56 AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
58 # Check if we have a iconv in -liconv, possibly from vendor
59 if test $found_iconv = "no"; then
60 AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
62 if test $found_iconv = "no"; then
63 AC_MSG_ERROR([*** No usable iconv() implementation found])
66 case $with_libiconv in
74 # Checks for locale_charset() and nl_langinfo(CODESET)
76 AC_CHECK_LIB(iconv, locale_charset,
77 [have_locale_charset=yes], [have_locale_charset=no])
78 if test x$have_locale_charset = xyes; then
79 AC_DEFINE(HAVE_LOCALE_CHARSET,1,[Have locale_charset()])
82 [for nl_langinfo (CODESET)], datrie_cv_langinfo_codeset,
83 [AC_TRY_COMPILE([#include <langinfo.h>],
84 [char *codeset = nl_langinfo (CODESET);],
85 [datrie_cv_langinfo_codeset=yes],
86 [datrie_cv_langinfo_codeset=no])]
88 if test x$datrie_cv_langinfo_codeset = xyes; then
89 AC_DEFINE(HAVE_LANGINFO_CODESET,1,[Have nl_langinfo (CODESET)])
91 if test x$have_locale_charset = xno && test x$datrie_cv_langinfo_codeset = xno
93 AC_MSG_ERROR([*** No locale_charset() nor nl_langinfo(CODESET) found.
94 Please consider installing GNU libiconv.])
98 # Checks for header files.
100 AC_CHECK_HEADERS([limits.h stdlib.h stdio.h string.h])
102 # Checks for typedefs, structures, and compiler characteristics.
106 dnl Disable doc generation with doxygen option
107 AC_ARG_ENABLE(doxygen-doc,
108 [AC_HELP_STRING([--disable-doxygen-doc],
109 [disable document generation with doxygen])],
110 , enable_doxygen_doc="yes")
112 if test "x$enable_doxygen_doc" = "xyes"; then
113 AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no)
114 if test "x$DOXYGEN" = "xno"; then
115 enable_doxygen_doc="no"
117 AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER])
118 DOXYGEN_VER=$($DOXYGEN --version)
119 AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
120 [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
121 [AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"])
125 dnl where to install the doxygen-generated HTML doc
126 AC_ARG_WITH(html-docdir,
127 [AC_HELP_STRING([--with-html-docdir=DIR],
128 [where to install the doxyten-generated HTML doc [PREFIX/share/doc/datrie/html]])],
129 [htmldocdir="$withval"], [htmldocdir=\$\{prefix\}/share/doc/datrie/html])
132 AM_CONDITIONAL(ENABLE_DOXYGEN_DOC,test "x$enable_doxygen_doc" = "xyes")
134 # Checks for library functions.
137 AC_CONFIG_FILES([Makefile