OSDN Git Service

* temp commit.
[modchxj/mod_chxj.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 <<<<<<< HEAD:configure.ac
4 AC_INIT([mod_chxj],[1.0.0-1])
5 =======
6 AC_INIT([mod_chxj],[0.12.0-1])
7 >>>>>>>   * updated new trunk.:configure.ac
8 AC_PREREQ(2.59)
9 AC_CONFIG_SRCDIR([src/mod_chxj.c])
10 AC_CANONICAL_TARGET
11 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
12 AM_CONFIG_HEADER(include/config.h)
13
14
15 # Checks for programs.
16 AC_PROG_CC
17 AC_PROG_INSTALL
18 <<<<<<< HEAD:configure.ac
19 =======
20
21
22 >>>>>>>   * updated new trunk.:configure.ac
23 AM_PROG_LIBTOOL
24 <<<<<<< HEAD:configure.ac
25 AC_LANG(C)
26 =======
27 >>>>>>>   * updated new trunk.:configure.ac
28 AC_SUBST(LIBTOOL_DEPS)
29
30
31 # Checks for libraries.
32 AC_CHECK_LIB([apr-1],  [main])
33
34 <<<<<<< HEAD:configure.ac
35 AC_ARG_WITH(apache-header, [  --with-apache-header=ARG The directory with the header file of apache2.x is specified. ]) 
36 =======
37 AC_ARG_WITH(apache-header, [  --with-apache-header=ARG The directory with the header file of apache2.0 is specified. ]) 
38 >>>>>>>   * updated new trunk.:configure.ac
39 if test "x$with_apache_header" = "xyes"; then
40     AC_MSG_ERROR([
41 Please specify the --with-apache-header option. And, please specify the place of the header file. 
42
43 ])
44 fi
45
46 dnl ==================================================
47 dnl
48 dnl apxs
49 dnl
50 dnl ==================================================
51 AC_ARG_WITH(apxs, [  --with-apxs=ARG Path of apxs program file.])
52 if test "x$with_apxs" = "x" ; then
53   APXS=""
54 fi
55 if test "x$with_apxs" = "xyes" ; then
56     AC_MSG_ERROR([
57 Please specify the --with-apxs option. And, please specify the place of the apxs program. 
58 ])
59 fi
60
61 dnl ==================================================
62 dnl
63 dnl apr-config
64 dnl
65 dnl ==================================================
66 AC_ARG_WITH(apr-config, [  --with-apr-config=ARG  Path of apr-config program file.])
67 if test "x$with_apr_config" = "xyes" ; then
68     AC_MSG_ERROR([
69 Please specify the --with-apr-config option. And, please specify the place of the apr-config program. 
70 ])
71 fi
72
73 dnl ==================================================
74 dnl
75 dnl apu-config
76 dnl
77 dnl ==================================================
78 AC_ARG_WITH(apu-config, [  --with-apu-config=ARG  Path of apu-config program file.])
79 if test "x$with_apu_config" = "xyes" ; then
80     AC_MSG_ERROR([
81 Please specify the --with-apu-config option. And, please specify the place of the apu-config program. 
82 ])
83 fi
84
85 AC_ARG_WITH(pcre-config, [  --with-pcre-config=ARG  Path of pcre-config program file.])
86 if test "x$with_pcre_config" = "xyes" ; then
87     AC_MSG_ERROR([
88 Please specify the --with-pcre-config option. And, please specify the place of the pcre-config program.
89 ])
90 fi
91
92 dnl ==================================================
93 dnl
94 dnl filename in img tag convertion.
95 dnl
96 dnl ==================================================
97 AC_ARG_ENABLE(img-conv-f, [  --enable-img-conv-f      Please specify it when you change the file name of the image being written in the 
98 source by the automatic operation.])
99 if test "x$enable_img_conv_f" = "xyes"; then
100   QDEFS=""
101 else
102   QDEFS="-DIMG_NOT_CONVERT_FILENAME"
103 fi
104
105
106 dnl ==================================================
107 dnl
108 dnl SAVE COOKIE to memcached Mode
109 dnl
110 dnl ==================================================
111 AC_ARG_ENABLE(memcache-cookie,   [  --enable-memcache-cookie Please specify it when you save Cookie in memcached. ])
112 AC_ARG_ENABLE(memcached-static,  [  --enable-memcached-static use static link. ])
113 AC_ARG_WITH(memcached-header,    [  --with-memcached-header Path of "memcached.h"])
114 AC_ARG_WITH(memcached-lib-dir,   [  --with-memcached-lib-dir Path of "libmemcached.so"])
115 if test "x$enable_memcache_cookie" = "xyes" ; then
116   dnl ======================================
117   dnl use MEMCACHE COOKIE
118   dnl ======================================
119   if test "x${with_memcached_header}" = "x" -o "x${with_memcached_header}" = "xyes" ; then
120     AC_MSG_ERROR([
121 Please specify the --with-memcached-header And, please specify the place of the "memcached.h" header file directory. 
122 ])
123   fi
124   if test "x${with_memcached_lib_dir}" = "x" -o "x${with_memcached_lib_dir}" = "xyes" ; then
125     AC_MSG_ERROR([
126 Please specify the --with-memcached-lib-dir And, please specify the place of libmemcached library directory. 
127 ])
128   fi
129   if test "x$enable_memcached_static" = "xyes" ; then
130     MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
131     MEMCACHE_COOKIE_LIBS=" ${with_memcached_lib_dir}/libmemcached.a "
132   else
133     MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
134     MEMCACHE_COOKIE_LIBS="-L${with_memcached_lib_dir} -lmemcached "
135   fi
136 else
137   dnl ======================================
138   dnl no use MEMCACHE COOKIE
139   dnl ======================================
140   MEMCACHE_COOKIE_DEFS=""
141   MEMCACHE_COOKIE_LIBS=""
142 fi
143 dnl ==================================================
144 dnl
145 dnl SAVE COOKIE to MySQL Mode
146 dnl
147 dnl ==================================================
148 AC_ARG_ENABLE(mysql-cookie, [  --enable-mysql-cookie    Please specify it when you save Cookie in MySQL. ])
149 AC_ARG_WITH(mysql-header,   [  --with-mysql-header=ARG  Path of "mysql.h"])
150 AC_ARG_WITH(mysql-lib-dir,  [  --with-mysql-lib-dir=ARG Path of libmysqlclient])
151 if test "x$enable_mysql_cookie" = "xyes"; then
152   dnl ======================================
153   dnl use MYSQL COOKIE
154   dnl ======================================
155   if test "x$with_mysql_header" = "x" -o "x$with_mysql_header" = "xyes" ; then
156     AC_MSG_ERROR([
157 Please specify the --with-mysql-header And, please specify the place of the "mysql.h" header file. 
158 ])
159   fi
160   if test "x$with_mysql_lib_dir" = "x" -o "x$with_mysql_lib_dir" = "xyes" ; then
161     AC_MSG_ERROR([
162 Please specify the --with-mysql-lib-dir And, please specify the place of mysql library directory. 
163 ])
164   fi
165   MYSQL_COOKIE_DEFS="-DUSE_MYSQL_COOKIE -I${with_mysql_header}"
166   MYSQL_COOKIE_LIBS="-L${with_mysql_lib_dir} -lmysqlclient_r"
167 else
168   dnl ======================================
169   dnl no use MYSQL COOKIE
170   dnl ======================================
171   MYSQL_COOKIE_DEFS=""
172   MYSQL_COOKIE_LIBS=""
173 fi
174
175 dnl ==================================================
176 dnl
177 dnl dump log for DEBUG
178 dnl
179 dnl ==================================================
180 AC_ARG_ENABLE(dump-log, [  --enable-dump-log   When the log of conversion is output, it specifies it with the output file. ])
181 if test "x$enable_dump_log" = "xyes"; then
182   DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
183 else
184     if test "x$enable_dump_log" != "x" ; then
185         DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
186     fi
187 fi
188
189
190 if test "x$with_apxs" = "x" ; then
191   AC_PATH_PROG(APXS2, apxs2, no,
192       /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
193   if test "x$APXS2" = "xno"; then
194     AC_PATH_PROG(APXS, apxs, no,
195       /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
196     if test "x$APXS" = "xno" ; then
197       AC_MSG_ERROR([apxs not found.])
198     fi
199   else
200     APXS="$APXS2"
201   fi
202 fi
203 if test "x$with_apxs" != "x" ; then
204   APXS=$with_apxs
205 fi 
206
207 AC_PATH_PROG(LIBTOOL, libtool, no,
208     /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
209 if test "x$LIBTOOL" = "xno"; then
210     AC_MSG_ERROR([libtool not found.])
211 fi
212
213
214 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
215    /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
216 if test "x$WAND_CONFIG" = "xno" ; then
217     AC_MSG_ERROR([wand-config not found.])
218 fi
219
220 if test "x$with_apr_config" = "x" ; then
221   AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
222   if test "x$APR_CONFIG" = "xno" ; then
223     AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
224     if test "x$APR_1_CONFIG" = "xno" ; then
225       AC_MSG_ERROR([apr-config and apr-1-config not found.])
226     else
227       APR_CONFIG="$APR_1_CONFIG"
228     fi
229   fi
230 fi
231 if test "x$with_apr_config" != "x" ; then
232   APR_CONFIG=$with_apr_config
233 fi
234 if test "x$with_apu_config" = "x" ; then
235   AC_PATH_PROG(APU_CONFIG, apu-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
236   if test "x$APU_CONFIG" = "xno" ; then
237     AC_PATH_PROG(APU_1_CONFIG, apu-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
238     if test "x$APU_1_CONFIG" = "xno" ; then
239       AC_MSG_ERROR([apu-config and apu-1-config not found.])
240     else
241       APU_CONFIG="$APU_1_CONFIG"
242     fi
243   fi
244 fi
245 if test "x$with_apu_config" != "x" ; then
246   APU_CONFIG=$with_apu_config
247 fi
248
249 <<<<<<< HEAD:configure.ac
250 =======
251
252 >>>>>>>   * updated new trunk.:configure.ac
253 case $host_os in
254   freebsd*)
255     CFLAGS="${CFLAGS} -I/usr/local/include "
256     ;;
257 esac
258
259 if test "x${with_apache_header}" = "x" ; then
260   with_apache_header=`${APXS} -q includedir`
261 fi
262 <<<<<<< HEAD:configure.ac
263
264
265 =======
266 >>>>>>>   * updated new trunk.:configure.ac
267
268 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
269 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
270 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
271 LIBS="${LIBS} ${MYSQL_COOKIE_LIBS}"
272 LIBS="${LIBS} ${MEMCACHE_COOKIE_LIBS} "
273 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
274 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
275 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
276 CFLAGS="${CFLAGS} ${MYSQL_COOKIE_DEFS}"
277 CFLAGS="${CFLAGS} ${MEMCACHE_COOKIE_DEFS}"
278 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
279 CPPFLAGS="${CPPFLAGS} ${MYSQL_COOKIE_DEFS}"
280 CPPFLAGS="${CPPFLAGS} ${MEMCACHE_COOKIE_DEFS}"
281
282 # Checks for header files.
283 AC_HEADER_STDC
284 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
285 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
286 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
287 AC_CHECK_HEADERS([apr.h])
288 AC_CHECK_HEADERS([ap_config.h])
289 #AC_CHECK_HEADERS([ap_regex.h],
290 #  AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
291 #[[
292 ##ifdef HAVE_APR_H
293 ##include "apr.h"
294 ##endif
295 ##ifdef HAVE_AP_CONFIG_H
296 ##include "ap_config.h"
297 ##endif
298 #]])
299 AC_CHECK_HEADERS([ap_regex.h],use_pcre_flag="no",use_pcre_flag="yes")
300 if test "x$use_pcre_flag" = "xyes" ; then
301   if test "x$with_pcre_config" = "x" ; then
302     AC_PATH_PROG(PCRE_CONFIG, pcre-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
303     if test "x$PCRE_CONFIG" = "xno" ; then
304       AC_PATH_PROG(PCRE_1_CONFIG, pcre-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
305       if test "x$PCRE_1_CONFIG" = "xno" ; then
306         AC_MSG_ERROR([pcre-config and pcre-1-config not found.])
307       else
308         PCRE_CONFIG="$PCRE_1_CONFIG"
309       fi
310     fi
311   fi
312   if test "x$with_pcre_config" != "x" ; then
313     PCRE_CONFIG=$with_pcre_config
314   fi
315   CFLAGS="${CFLAGS} `${PCRE_CONFIG} --cflags`"
316 else
317   AC_DEFINE([HAVE_AP_REGEX_H], [1], [Define to 1 if you have the <ap_regex.h> header file.])
318 fi
319
320 # Checks for typedefs, structures, and compiler characteristics.
321 AC_C_CONST
322
323 # Checks for library functions.
324 AC_FUNC_MALLOC
325 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
326
327 AC_SUBST(with_apache_header)
328 AC_SUBST(CC)
329 AC_SUBST(QDEFS)
330 AC_SUBST(DDEFS)
331 AC_SUBST(LIBS)
332 AC_SUBST(CFLAGS)
333
334
335 AC_CONFIG_FILES([Makefile src/Makefile])
336 AC_OUTPUT