2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(libdatrie, 0.2.10, theppitak@gmail.com)
6 AC_CONFIG_SRCDIR([datrie/trie.h])
7 AC_CONFIG_HEADER([config.h])
8 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE(dist-xz no-dist-gzip)
13 # Library code modified: REVISION++
14 # Interfaces added: CURRENT++ REVISION=0 AGE++
15 # Interfaces changed/removed: CURRENT++ REVISION=0 AGE=0
25 # Checks for programs.
33 # Whether linker support --version-script option
34 echo '{global:hello; local:*;};' > conftest.ver
35 AC_LIBTOOL_LINKER_OPTION(
36 [whether linker supports -version-script],
37 datrie_cv_have_version_script,
38 [-Wl,-version-script -Wl,conftest.ver])
40 AM_CONDITIONAL(LD_HAS_VERSION_SCRIPT,
41 test "$datrie_cv_have_version_script" = "yes")
43 # Checks for libraries.
49 # Check in the C library first
50 AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
51 # Check if we have GNU libiconv
52 if test $found_iconv = "no"; then
53 AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
55 # Check if we have a iconv in -liconv, possibly from vendor
56 if test $found_iconv = "no"; then
57 AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
59 if test $found_iconv = "no"; then
60 AC_MSG_ERROR([*** No usable iconv() implementation found])
63 case $with_libiconv in
71 # Checks for locale_charset() and nl_langinfo(CODESET)
73 AC_CHECK_LIB(iconv, locale_charset,
74 [have_locale_charset=yes], [have_locale_charset=no])
75 if test x$have_locale_charset = xyes; then
76 AC_DEFINE(HAVE_LOCALE_CHARSET,1,[Have locale_charset()])
79 [for nl_langinfo (CODESET)], datrie_cv_langinfo_codeset,
80 [AC_TRY_COMPILE([#include <langinfo.h>],
81 [char *codeset = nl_langinfo (CODESET);],
82 [datrie_cv_langinfo_codeset=yes],
83 [datrie_cv_langinfo_codeset=no])]
85 if test x$datrie_cv_langinfo_codeset = xyes; then
86 AC_DEFINE(HAVE_LANGINFO_CODESET,1,[Have nl_langinfo (CODESET)])
88 if test x$have_locale_charset = xno && test x$datrie_cv_langinfo_codeset = xno
90 AC_MSG_ERROR([*** No locale_charset() nor nl_langinfo(CODESET) found.
91 Please consider installing GNU libiconv.])
95 # Checks for header files.
97 AC_CHECK_HEADERS([limits.h stdlib.h stdio.h string.h])
99 # Checks for typedefs, structures, and compiler characteristics.
103 dnl Disable doc generation with doxygen option
104 AC_ARG_ENABLE(doxygen-doc,
105 [AC_HELP_STRING([--disable-doxygen-doc],
106 [disable document generation with doxygen])],
107 , enable_doxygen_doc="yes")
109 if test "x$enable_doxygen_doc" = "xyes"; then
110 AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no)
111 if test "x$DOXYGEN" = "xno"; then
112 enable_doxygen_doc="no"
114 AC_MSG_CHECKING([doxygen >= $DOXYGEN_REQ_VER])
115 DOXYGEN_VER=$($DOXYGEN --version)
116 AX_COMPARE_VERSION([$DOXYGEN_VER],[ge],[DOXYGEN_REQ_VER],
117 [AC_MSG_RESULT([$DOXYGEN_VER, yes])],
118 [AC_MSG_RESULT([$DOXYGEN_VER, no, documentation disabled]); enable_doxygen_doc="no"])
122 dnl where to install the doxygen-generated HTML doc
123 AC_ARG_WITH(html-docdir,
124 [AC_HELP_STRING([--with-html-docdir=DIR],
125 [where to install the doxyten-generated HTML doc [PREFIX/share/doc/datrie/html]])],
126 [htmldocdir="$withval"], [htmldocdir=\$\{prefix\}/share/doc/datrie/html])
129 AM_CONDITIONAL(ENABLE_DOXYGEN_DOC,test "x$enable_doxygen_doc" = "xyes")
131 # Checks for library functions.
134 AC_CONFIG_FILES([Makefile