fixes makefiles
[platform/upstream/libpinyin.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4
5 AC_PREREQ(2.60)
6 AC_INIT(libpinyin, 0.2.99, alexepico@gmail.com)
7 AM_INIT_AUTOMAKE
8 AC_CONFIG_SRCDIR([config.h.in])
9 AC_CONFIG_HEADER([config.h])
10
11 # Checks for programs.
12 AC_PROG_CXX
13 AC_PROG_CC
14 AC_PROG_CPP
15 AC_PROG_INSTALL
16 AC_PROG_LN_S
17 AC_PROG_MAKE_SET
18
19 AC_GNU_SOURCE
20
21 # Init libtool
22 AC_LIBTOOL_WIN32_DLL
23 AC_LIBTOOL_DLOPEN
24 AC_PROG_LIBTOOL
25 AC_LIB_LTDL
26 AC_SUBST(LIBTOOL_DEPS)
27
28 # libtool option to control which symbols are exported
29 # right now, symbols starting with _ are not exported
30 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
31 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
32
33 # Checks for libraries.
34 PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= 2.4.0])
35
36 GLIB2_CPPFLAGS=`$PKG_CONFIG --cflags glib-2.0`
37
38 AC_SUBST(GLIB2_CPPFLAGS)
39
40 GLIB2_LDFLAGS=`$PKG_CONFIG --libs glib-2.0`
41
42 AC_SUBST(GLIB2_LDFLAGS)
43
44 # Checks for header files.
45 AC_HEADER_STDC
46 AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
47
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_HEADER_STDBOOL
50 AC_C_CONST
51 AC_C_INLINE
52 AC_TYPE_SIZE_T
53 AC_HEADER_TIME
54
55 # Checks for library functions.
56 AC_FUNC_MALLOC
57 AC_FUNC_MEMCMP
58 AC_FUNC_REALLOC
59 AC_FUNC_STAT
60 AC_CHECK_FUNCS([gettimeofday memmove memset setlocale])
61
62 AC_CHECK_HEADERS([libintl.h string.h])
63
64 AC_CHECK_HEADER([db.h], [], AC_MSG_ERROR([Cannot find Berkeley DB library version 4]))
65
66 AC_SEARCH_LIBS([db_create], [db], [], AC_MSG_ERROR([Cannot find Berkeley DB library version 4]))
67
68
69 AC_CONFIG_FILES([Makefile 
70                  src/Makefile
71                  src/include/Makefile
72                  src/storage/Makefile
73                  src/lookup/Makefile
74                  tests/Makefile
75                  tests/include/Makefile
76                  tests/storage/Makefile
77                  tests/lookup/Makefile
78                  utils/Makefile
79                  utils/storage/Makefile
80                  utils/segment/Makefile
81                  utils/training/Makefile
82 ])
83
84 AC_OUTPUT