2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.8.6-1])
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 AC_ARG_WITH(apxs, [ --with-apxs=ARG Path of apxs program file.])
32 if test "x$with_apxs" = "x" ; then
35 if test "x$with_apxs" = "xyes" ; then
37 Please specify the --with-apxs option. And, please specify the place of the apxs program.
41 AC_ARG_WITH(apr-config, [ --with-apr-config=ARG Path of apr-config program file.])
42 if test "x$with_apr_config" = "xyes" ; then
44 Please specify the --with-apr-config option. And, please specify the place of the apr-config program.
48 AC_ARG_WITH(apu-config, [ --with-apu-config=ARG Path of apu-config program file.])
49 if test "x$with_apu_config" = "xyes" ; then
51 Please specify the --with-apu-config option. And, please specify the place of the apu-config program.
56 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
57 source by the automatic operation.])
58 if test "x$enable_img_conv_f" = "xyes"; then
61 QDEFS="-DIMG_NOT_CONVERT_FILENAME"
64 AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ])
65 if test "x$enable_dump_log" = "xyes"; then
66 DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
68 if test "x$enable_dump_log" != "x" ; then
69 DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
74 if test "x$with_apxs" = "x" ; then
75 AC_PATH_PROG(APXS2, apxs2, no,
76 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
77 if test "x$APXS2" = "xno"; then
78 AC_PATH_PROG(APXS, apxs, no,
79 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
80 if test "x$APXS" = "xno" ; then
81 AC_MSG_ERROR([apxs not found.])
87 if test "x$with_apxs" != "x" ; then
91 AC_PATH_PROG(LIBTOOL, libtool, no,
92 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
93 if test "x$LIBTOOL" = "xno"; then
94 AC_MSG_ERROR([libtool not found.])
98 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
99 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
100 if test "x$WAND_CONFIG" = "xno" ; then
101 AC_MSG_ERROR([wand-config not found.])
104 if test "x$with_apr_config" = "x" ; then
105 AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
106 if test "x$APR_CONFIG" = "xno" ; then
107 AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
108 if test "x$APR_1_CONFIG" = "xno" ; then
109 AC_MSG_ERROR([apr-config and apr-1-config not found.])
111 APR_CONFIG="$APR_1_CONFIG"
115 if test "x$with_apr_config" != "x" ; then
116 APR_CONFIG=$with_apr_config
118 if test "x$with_apu_config" = "x" ; then
119 AC_PATH_PROG(APU_CONFIG, apu-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
120 if test "x$APU_CONFIG" = "xno" ; then
121 AC_PATH_PROG(APU_1_CONFIG, apu-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
122 if test "x$APU_1_CONFIG" = "xno" ; then
123 AC_MSG_ERROR([apu-config and apu-1-config not found.])
125 APU_CONFIG="$APU_1_CONFIG"
129 if test "x$with_apu_config" != "x" ; then
130 APU_CONFIG=$with_apu_config
133 AC_ARG_WITH(iconv, [ --with-iconv=ARG specify the place of the libiconv directory.])
134 AC_ARG_WITH(iconv_hook, [ --with-iconv_hook=ARG specify the place of the libiconv_hook directory.])
135 if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
136 AC_CHECK_LIB([iconv_hook], [iconv_open], [
138 AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
139 LIBS="${LIBS} -liconv_hook"
141 AC_CHECK_LIB([iconv], [iconv_open], [
143 AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
144 LIBS="${LIBS} -liconv"
151 if test "x$with_iconv" != "xok" ; then
152 if test "x$with_iconv" = "xyes" ; then
154 Please specify the --with-iconv option. And, please specify the place of the libiconv program.
157 if test "x$with_iconv" != "x" ; then
158 LIBS="${LIBS} -L$with_iconv -liconv "
159 AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
162 if test "x$with_iconv" = "x" ; then
163 if test "x$with_iconv_hook" = "xyes" ; then
165 Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
168 if test "x$with_iconv_hook" != "x" ; then
169 LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
170 AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
172 if test "x$with_iconv_hook" = "x" ; then
174 Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
182 CFLAGS="${CFLAGS} -I/usr/local/include "
186 if test "x${with_apache_header}" = "x" ; then
187 with_apache_header=`${APXS} -q includedir`
190 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
191 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
192 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
193 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
194 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
195 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
196 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
197 AC_SUBST(with_apache_header)
204 # Checks for header files.
206 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
207 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
208 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
209 AC_CHECK_HEADERS([apr.h])
210 AC_CHECK_HEADERS([ap_config.h])
211 AC_CHECK_HEADERS([ap_regex.h],
212 AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
217 #ifdef HAVE_AP_CONFIG_H
218 #include "ap_config.h"
222 # Checks for typedefs, structures, and compiler characteristics.
225 # Checks for library functions.
227 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
231 AC_CONFIG_FILES([Makefile src/Makefile])