2 # Process this file with autoconf to produce a configure script.
6 AC_INIT(libpinyin, 0.4.92, alexepico@gmail.com)
8 AC_CONFIG_SRCDIR([config.h.in])
9 AC_CONFIG_HEADER([config.h])
11 # Define a string for binary compatibility
12 LIBPINYIN_BINARY_VERSION=0.3
13 AC_SUBST(LIBPINYIN_BINARY_VERSION)
15 # Checks for programs.
30 AC_SUBST(LIBTOOL_DEPS)
32 # libtool option to control which symbols are exported
33 # right now, symbols starting with _ are not exported
34 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
35 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
37 # Checks for libraries.
38 PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= 2.4.0])
40 GLIB2_CPPFLAGS=`$PKG_CONFIG --cflags glib-2.0`
42 AC_SUBST(GLIB2_CPPFLAGS)
44 GLIB2_LDFLAGS=`$PKG_CONFIG --libs glib-2.0`
46 AC_SUBST(GLIB2_LDFLAGS)
48 # Checks for header files.
50 AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
52 # Checks for typedefs, structures, and compiler characteristics.
59 # Checks for library functions.
64 AC_CHECK_FUNCS([gettimeofday memmove memset setlocale])
66 AC_CHECK_HEADERS([libintl.h string.h])
68 AC_CHECK_HEADER([db.h], [], AC_MSG_ERROR([Cannot find Berkeley DB library version 4]))
70 AC_SEARCH_LIBS([db_create], [db], [], AC_MSG_ERROR([Cannot find Berkeley DB library version 4]))
73 AC_CONFIG_FILES([libpinyin.pc
82 tests/include/Makefile
83 tests/storage/Makefile
86 utils/storage/Makefile
87 utils/segment/Makefile
88 utils/training/Makefile
96 Install prefix $prefix