2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.12.31],[konn@users.sourceforge.jp])
5 AC_CONFIG_SRCDIR([src/mod_chxj.c])
7 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8 AM_CONFIG_HEADER(include/config.h)
11 # Checks for programs.
17 AC_SUBST(LIBTOOL_DEPS)
20 # Checks for libraries.
21 AC_CHECK_LIB([apr-1], [main])
23 AC_ARG_WITH(apache-header, [ --with-apache-header=ARG The directory with the header file of apache2.0 is specified. ])
24 if test "x$with_apache_header" = "xyes"; then
26 Please specify the --with-apache-header option. And, please specify the place of the header file.
31 dnl ==================================================
35 dnl ==================================================
36 AC_ARG_WITH(apxs, [ --with-apxs=ARG Path of apxs program file.])
37 if test "x$with_apxs" = "x" ; then
40 if test "x$with_apxs" = "xyes" ; then
42 Please specify the --with-apxs option. And, please specify the place of the apxs program.
46 dnl ==================================================
50 dnl ==================================================
51 AC_ARG_WITH(apr-config, [ --with-apr-config=ARG Path of apr-config program file.])
52 if test "x$with_apr_config" = "xyes" ; then
54 Please specify the --with-apr-config option. And, please specify the place of the apr-config program.
58 dnl ==================================================
62 dnl ==================================================
63 AC_ARG_WITH(apu-config, [ --with-apu-config=ARG Path of apu-config program file.])
64 if test "x$with_apu_config" = "xyes" ; then
66 Please specify the --with-apu-config option. And, please specify the place of the apu-config program.
70 AC_ARG_WITH(pcre-config, [ --with-pcre-config=ARG Path of pcre-config program file.])
71 if test "x$with_pcre_config" = "xyes" ; then
73 Please specify the --with-pcre-config option. And, please specify the place of the pcre-config program.
77 dnl ==================================================
79 dnl filename in img tag convertion.
81 dnl ==================================================
82 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
83 source by the automatic operation.])
84 if test "x$enable_img_conv_f" = "xyes"; then
87 QDEFS="-DIMG_NOT_CONVERT_FILENAME"
91 dnl ==================================================
93 dnl SAVE COOKIE to memcached Mode
95 dnl ==================================================
96 AC_ARG_ENABLE(memcache-cookie, [ --enable-memcache-cookie Please specify it when you save Cookie in memcached. ])
97 AC_ARG_ENABLE(memcached-static, [ --enable-memcached-static use static link. ])
98 AC_ARG_WITH(memcached-header, [ --with-memcached-header Path of "memcached.h"])
99 AC_ARG_WITH(memcached-lib-dir, [ --with-memcached-lib-dir Path of "libmemcached.so"])
100 if test "x$enable_memcache_cookie" = "xyes" ; then
101 dnl ======================================
102 dnl use MEMCACHE COOKIE
103 dnl ======================================
104 if test "x${with_memcached_header}" = "x" -o "x${with_memcached_header}" = "xyes" ; then
106 Please specify the --with-memcached-header And, please specify the place of the "memcached.h" header file directory.
109 if test "x${with_memcached_lib_dir}" = "x" -o "x${with_memcached_lib_dir}" = "xyes" ; then
111 Please specify the --with-memcached-lib-dir And, please specify the place of libmemcached library directory.
114 if test "x$enable_memcached_static" = "xyes" ; then
115 MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
116 MEMCACHE_COOKIE_LIBS=" ${with_memcached_lib_dir}/libmemcached.a "
118 MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
119 MEMCACHE_COOKIE_LIBS="-L${with_memcached_lib_dir} -lmemcached "
122 dnl ======================================
123 dnl no use MEMCACHE COOKIE
124 dnl ======================================
125 MEMCACHE_COOKIE_DEFS=""
126 MEMCACHE_COOKIE_LIBS=""
128 dnl ==================================================
130 dnl SAVE COOKIE to MySQL Mode
132 dnl ==================================================
133 AC_ARG_ENABLE(mysql-cookie, [ --enable-mysql-cookie Please specify it when you save Cookie in MySQL. ])
134 AC_ARG_WITH(mysql-header, [ --with-mysql-header=ARG Path of "mysql.h"])
135 AC_ARG_WITH(mysql-lib-dir, [ --with-mysql-lib-dir=ARG Path of libmysqlclient])
136 if test "x$enable_mysql_cookie" = "xyes"; then
137 dnl ======================================
139 dnl ======================================
140 if test "x$with_mysql_header" = "x" -o "x$with_mysql_header" = "xyes" ; then
142 Please specify the --with-mysql-header And, please specify the place of the "mysql.h" header file.
145 if test "x$with_mysql_lib_dir" = "x" -o "x$with_mysql_lib_dir" = "xyes" ; then
147 Please specify the --with-mysql-lib-dir And, please specify the place of mysql library directory.
150 MYSQL_COOKIE_DEFS="-DUSE_MYSQL_COOKIE -I${with_mysql_header}"
151 MYSQL_COOKIE_LIBS="-L${with_mysql_lib_dir} -lmysqlclient_r"
153 dnl ======================================
154 dnl no use MYSQL COOKIE
155 dnl ======================================
160 dnl ==================================================
162 dnl dump log for DEBUG
164 dnl ==================================================
165 AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ])
166 if test "x$enable_dump_log" = "xyes"; then
167 DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
169 if test "x$enable_dump_log" != "x" ; then
170 DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
175 if test "x$with_apxs" = "x" ; then
176 AC_PATH_PROG(APXS2, apxs2, no,
177 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
178 if test "x$APXS2" = "xno"; then
179 AC_PATH_PROG(APXS, apxs, no,
180 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
181 if test "x$APXS" = "xno" ; then
182 AC_MSG_ERROR([apxs not found.])
188 if test "x$with_apxs" != "x" ; then
192 AC_PATH_PROG(LIBTOOL, libtool, no,
193 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
194 if test "x$LIBTOOL" = "xno"; then
195 AC_MSG_ERROR([libtool not found.])
199 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
200 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
201 if test "x$WAND_CONFIG" = "xno" ; then
202 AC_MSG_ERROR([wand-config not found.])
205 if test "x$with_apr_config" = "x" ; then
206 AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
207 if test "x$APR_CONFIG" = "xno" ; then
208 AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
209 if test "x$APR_1_CONFIG" = "xno" ; then
210 AC_MSG_ERROR([apr-config and apr-1-config not found.])
212 APR_CONFIG="$APR_1_CONFIG"
216 if test "x$with_apr_config" != "x" ; then
217 APR_CONFIG=$with_apr_config
219 if test "x$with_apu_config" = "x" ; then
220 AC_PATH_PROG(APU_CONFIG, apu-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
221 if test "x$APU_CONFIG" = "xno" ; then
222 AC_PATH_PROG(APU_1_CONFIG, apu-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
223 if test "x$APU_1_CONFIG" = "xno" ; then
224 AC_MSG_ERROR([apu-config and apu-1-config not found.])
226 APU_CONFIG="$APU_1_CONFIG"
230 if test "x$with_apu_config" != "x" ; then
231 APU_CONFIG=$with_apu_config
237 CFLAGS="${CFLAGS} -I/usr/local/include "
241 if test "x${with_apache_header}" = "x" ; then
242 with_apache_header=`${APXS} -q includedir`
245 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
246 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
247 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
248 LIBS="${LIBS} ${MYSQL_COOKIE_LIBS}"
249 LIBS="${LIBS} ${MEMCACHE_COOKIE_LIBS} "
250 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
251 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
252 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
253 CFLAGS="${CFLAGS} ${MYSQL_COOKIE_DEFS}"
254 CFLAGS="${CFLAGS} ${MEMCACHE_COOKIE_DEFS}"
255 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
256 CPPFLAGS="${CPPFLAGS} ${MYSQL_COOKIE_DEFS}"
257 CPPFLAGS="${CPPFLAGS} ${MEMCACHE_COOKIE_DEFS}"
259 # Checks for header files.
261 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
262 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
263 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
264 AC_CHECK_HEADERS([apr.h])
265 AC_CHECK_HEADERS([ap_config.h])
266 #AC_CHECK_HEADERS([ap_regex.h],
267 # AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
272 ##ifdef HAVE_AP_CONFIG_H
273 ##include "ap_config.h"
276 AC_CHECK_HEADERS([ap_regex.h],use_pcre_flag="no",use_pcre_flag="yes")
277 if test "x$use_pcre_flag" = "xyes" ; then
278 if test "x$with_pcre_config" = "x" ; then
279 AC_PATH_PROG(PCRE_CONFIG, pcre-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
280 if test "x$PCRE_CONFIG" = "xno" ; then
281 AC_PATH_PROG(PCRE_1_CONFIG, pcre-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
282 if test "x$PCRE_1_CONFIG" = "xno" ; then
283 AC_MSG_ERROR([pcre-config and pcre-1-config not found.])
285 PCRE_CONFIG="$PCRE_1_CONFIG"
289 if test "x$with_pcre_config" != "x" ; then
290 PCRE_CONFIG=$with_pcre_config
292 CFLAGS="${CFLAGS} `${PCRE_CONFIG} --cflags`"
294 AC_DEFINE([HAVE_AP_REGEX_H], [1], [Define to 1 if you have the <ap_regex.h> header file.])
297 # Checks for typedefs, structures, and compiler characteristics.
300 # Checks for library functions.
302 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
304 AC_SUBST(with_apache_header)
312 AC_CONFIG_FILES([Makefile src/Makefile support/centos/mod-chxj.spec])