-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
158 lines (137 loc) · 4.03 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([geonlp], [1.3.0], [[email protected]])
AM_INIT_AUTOMAKE([geonlp], [1.3.0])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADER([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
# library version
LIB_VERSION_INFO='1.3.0'
AC_SUBST(LIB_VERSION_INFO)
# basename of resource file
AC_DEFINE([GEONLP_RESOURCE_FILENAME], ["geonlp.rc"], [Resource filename])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
# Checks for libraries.
AC_HAVE_LIBRARY([boost_system-mt],
LIBBOOST_SYSTEM_LIB="-lboost_system-mt",
AC_HAVE_LIBRARY([boost_system],
LIBBOOST_SYSTEM_LIB="-lboost_system",
AC_MSG_ERROR(*** BOOST_SYSTEM/BOOST_SYSTEM-MT library not found ***)
)
)
AC_SUBST(LIBBOOST_SYSTEM_LIB)
AC_HAVE_LIBRARY([boost_filesystem-mt],
LIBBOOST_FILESYSTEM_LIB="-lboost_filesystem-mt",
AC_HAVE_LIBRARY([boost_filesystem],
LIBBOOST_FILESYSTEM_LIB="-lboost_filesystem",
AC_MSG_ERROR(*** BOOST_FILESYSTEM/BOOST_FILESYSTEM-MT library not found ***)
)
)
AC_SUBST(LIBBOOST_FILESYSTEM_LIB)
AC_HAVE_LIBRARY([boost_regex-mt],
LIBBOOST_REGEX_LIB="-lboost_regex-mt",
AC_HAVE_LIBRARY([boost_regex],
LIBBOOST_REGEX_LIB="-lboost_regex",
AC_MSG_ERROR(*** BOOST_REGEX/BOOST_REGEX-MT library not found ***)
)
)
AC_SUBST(LIBBOOST_REGEX_LIB)
AC_HAVE_LIBRARY([boost_thread-mt],
LIBBOOST_THREAD_LIB="-lboost_thread-mt",
AC_HAVE_LIBRARY([boost_thread],
LIBBOOST_THREAD_LIB="-lboost_thread",
AC_MSG_ERROR(*** BOOST_THREAD/BOOST_THREAD-MT library not found ***)
)
)
AC_SUBST(LIBBOOST_THREAD_LIB)
# MeCab installation settings
AC_HAVE_LIBRARY([mecab],
LIBMECAB_LIB="-lmecab",
AC_MSG_ERROR(*** MECAB library not found ***)
)
AC_SUBST(LIBMECAB_LIB)
AC_ARG_WITH(
mecab-config,
[ --with-mecab-config=PATH set mecab-config location [search path]],
AC_MSG_RESULT(using $with_mecab_config for mecab-config)
MECAB_CONFIG=$with_mecab_config,
[AC_PATH_PROGS(MECAB_CONFIG, mecab-config, no)]
)
if test $MECAB_CONFIG = "no";
then
AC_MSG_ERROR(mecab-config is not found in your system)
fi
AC_SUBST(MECAB_CONFIG)
MECAB_DICT_INDEX="`$MECAB_CONFIG --libexecdir`/mecab-dict-index"
AC_SUBST(MECAB_DICT_INDEX)
AC_DEFINE_UNQUOTED(MECAB_DICT_INDEX, "$MECAB_DICT_INDEX", "mecab-dict-index")
# DAMS installation settings
AC_ARG_WITH(
[dams],
[ --with-dams=PATH set geocoder dams install path],
[with_dams=$with_dams],
[with_dams=yes]
)
LIBDAMS_LIB=""
DAMS_INC_FLAGS=""
AS_IF([test "x$with_dams" != xyes],
[AS_IF([test "x$with_dams" != xno],
[AC_DEFINE([HAVE_LIBDAMS], [1], [Define if you have libdams]),
LIBDAMS_LIB="-L${with_dams}/lib -ldams"
DAMS_INC_FLAGS="-I${with_dams}/include"],
[LIBDAMS_LIB=""]
)],
[AC_HAVE_LIBRARY([dams],
[LIBDAMS_LIB="-ldams"
AC_DEFINE([HAVE_LIBDAMS], [1], [use dams])],
[LIBDAMS_LIB=""])
]
)
AC_SUBST(LIBDAMS_LIB)
AC_SUBST(DAMS_INC_FLAGS)
# misc libraries
AC_CHECK_LIB([iconv], [iconv_open])
AC_HAVE_LIBRARY([sqlite3],
LIBSQLITE3_LIB="-lsqlite3",
AC_MSG_ERROR(*** Sqlite3 library not found ***)
)
AC_SUBST(LIBSQLITE3_LIB)
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h, sqlite3.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset])
# Checks for enable/disable Options
#AC_ARG_ENABLE([dams],
# [AS_HELP_STRING([--enable-dams],
# [use dams geocoder (default is yes)])],
# [disable_dams=yes],
# [disable_dams=no]
#)
#
#AS_IF([test "x$disable_dams" != xyes],
# [AC_DEFINE([USE_DAMS], [1], [dams support])]
#)
# List of target config files
AC_CONFIG_FILES([Makefile
include/Makefile
libgeonlp/Makefile
src/Makefile
etc/Makefile
geonlp_ma_makedic/Makefile
php-extension/Makefile
etc/geonlp.rc
etc/geonlp_ma_makedic.rc])
AC_OUTPUT