2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.9.0])
5 AC_CONFIG_SRCDIR([src/mod_chxj.c])
7 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8 AC_CONFIG_HEADERS([include/config.h])
11 # Checks for programs.
19 # Checks for libraries.
20 AC_CHECK_LIB([apr-1], [main])
22 AC_ARG_WITH(apache-header, [ --with-apache-header=ARG The directory with the header file of apache2.x is specified. ])
23 #[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
24 if test "x$with_apache_header" = "x"; then
26 Please specify the --with-apache-header option.
29 if test "x$with_apache_header" = "xyes"; then
31 Please specify the --with-apache-header option. And, please specify the place of the header file.
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 AC_ARG_WITH(apr-config, [ --with-apr-config=ARG Path of apr-config program file.])
47 if test "x$with_apr_config" = "xyes" ; then
49 Please specify the --with-apr-config option. And, please specify the place of the apr-config program.
53 AC_ARG_WITH(apu-config, [ --with-apu-config=ARG Path of apu-config program file.])
54 if test "x$with_apu_config" = "xyes" ; then
56 Please specify the --with-apu-config option. And, please specify the place of the apu-config program.
61 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
62 source by the automatic operation.])
63 if test "x$enable_img_conv_f" = "xyes"; then
66 QDEFS="-DIMG_NOT_CONVERT_FILENAME"
69 AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ])
70 if test "x$enable_dump_log" = "xyes"; then
71 DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
73 if test "x$enable_dump_log" != "x" ; then
74 DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
79 if test "x$with_apxs" = "x" ; then
80 AC_PATH_PROG(APXS2, apxs2, no,
81 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
82 if test "x$APXS2" = "xno"; then
83 AC_PATH_PROG(APXS, apxs, no,
84 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
85 if test "x$APXS" = "xno" ; then
86 AC_MSG_ERROR([apxs not found.])
92 if test "x$with_apxs" != "x" ; then
96 AC_PATH_PROG(LIBTOOL, libtool, no,
97 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
98 if test "x$LIBTOOL" = "xno"; then
99 AC_MSG_ERROR([libtool not found.])
103 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
104 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
105 if test "x$WAND_CONFIG" = "xno" ; then
106 AC_MSG_ERROR([wand-config not found.])
110 if test "x$with_apr_config" = "x" ; then
111 AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
112 if test "x$APR_CONFIG" = "xno" ; then
113 AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
114 if test "x$APR_1_CONFIG" = "xno" ; then
115 AC_MSG_ERROR([apr-config and apr-1-config not found.])
117 APR_CONFIG="$APR_1_CONFIG"
121 if test "x$with_apr_config" != "x" ; then
122 APR_CONFIG=$with_apr_config
125 if test "x$with_apu_config" = "x" ; then
126 AC_PATH_PROG(APU_CONFIG, apu-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
127 if test "x$APU_CONFIG" = "xno" ; then
128 AC_PATH_PROG(APU_1_CONFIG, apu-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
129 if test "x$APU_1_CONFIG" = "xno" ; then
130 AC_MSG_ERROR([apu-config and apu-1-config not found.])
132 APU_CONFIG="$APU_1_CONFIG"
136 if test "x$with_apu_config" != "x" ; then
137 APU_CONFIG=$with_apu_config
141 #AC_ARG_WITH(iconv, [ --with-iconv=ARG specify the place of the libiconv directory.])
142 #AC_ARG_WITH(iconv_hook, [ --with-iconv_hook=ARG specify the place of the libiconv_hook directory.])
143 #if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
144 # AC_CHECK_LIB([iconv_hook], [iconv_open], [
146 # AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
147 # LIBS="${LIBS} -liconv_hook"
149 # AC_CHECK_LIB([iconv], [iconv_open], [
151 # AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
152 # LIBS="${LIBS} -liconv"
159 #if test "x$with_iconv" != "xok" ; then
160 # if test "x$with_iconv" = "xyes" ; then
162 # Please specify the --with-iconv option. And, please specify the place of the libiconv program.
165 # if test "x$with_iconv" != "x" ; then
166 # LIBS="${LIBS} -L$with_iconv -liconv "
167 # AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
170 #if test "x$with_iconv" = "x" ; then
171 # if test "x$with_iconv_hook" = "xyes" ; then
173 # Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
176 # if test "x$with_iconv_hook" != "x" ; then
177 # LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
178 # AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
180 # if test "x$with_iconv_hook" = "x" ; then
182 # Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
190 CFLAGS="${CFLAGS} -I/usr/local/include "
195 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
196 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
197 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
198 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
199 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
200 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
201 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
202 AC_SUBST(with_apache_header)
209 # Checks for header files.
211 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
212 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
213 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
214 AC_CHECK_HEADERS([apr.h])
215 AC_CHECK_HEADERS([ap_config.h])
216 AC_CHECK_HEADERS([ap_regex.h],
217 AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
222 #ifdef HAVE_AP_CONFIG_H
223 #include "ap_config.h"
227 # Checks for typedefs, structures, and compiler characteristics.
230 # Checks for library functions.
232 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
236 AC_CONFIG_FILES([Makefile src/Makefile])