2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.8.8-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.
55 AC_ARG_WITH(pcre-config, [ --with-pcre-config=ARG Path of pcre-config program file.])
56 if test "x$with_pcre_config" = "xyes" ; then
58 Please specify the --with-pcre-config option. And, please specify the place of the pcre-config program.
63 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
64 source by the automatic operation.])
65 if test "x$enable_img_conv_f" = "xyes"; then
68 QDEFS="-DIMG_NOT_CONVERT_FILENAME"
71 AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ])
72 if test "x$enable_dump_log" = "xyes"; then
73 DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
75 if test "x$enable_dump_log" != "x" ; then
76 DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
81 if test "x$with_apxs" = "x" ; then
82 AC_PATH_PROG(APXS2, apxs2, no,
83 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
84 if test "x$APXS2" = "xno"; then
85 AC_PATH_PROG(APXS, apxs, no,
86 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
87 if test "x$APXS" = "xno" ; then
88 AC_MSG_ERROR([apxs not found.])
94 if test "x$with_apxs" != "x" ; then
98 AC_PATH_PROG(LIBTOOL, libtool, no,
99 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
100 if test "x$LIBTOOL" = "xno"; then
101 AC_MSG_ERROR([libtool not found.])
105 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
106 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
107 if test "x$WAND_CONFIG" = "xno" ; then
108 AC_MSG_ERROR([wand-config not found.])
111 if test "x$with_apr_config" = "x" ; then
112 AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
113 if test "x$APR_CONFIG" = "xno" ; then
114 AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
115 if test "x$APR_1_CONFIG" = "xno" ; then
116 AC_MSG_ERROR([apr-config and apr-1-config not found.])
118 APR_CONFIG="$APR_1_CONFIG"
122 if test "x$with_apr_config" != "x" ; then
123 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
143 CFLAGS="${CFLAGS} -I/usr/local/include "
147 if test "x${with_apache_header}" = "x" ; then
148 with_apache_header=`${APXS} -q includedir`
151 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
152 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
153 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
154 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
155 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
156 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
157 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
159 # Checks for header files.
161 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
162 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
163 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
164 AC_CHECK_HEADERS([apr.h])
165 AC_CHECK_HEADERS([ap_config.h])
166 #AC_CHECK_HEADERS([ap_regex.h],
167 # AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
172 ##ifdef HAVE_AP_CONFIG_H
173 ##include "ap_config.h"
176 AC_CHECK_HEADERS([ap_regex.h],use_pcre_flag="no",use_pcre_flag="yes")
177 if test "x$use_pcre_flag" = "xyes" ; then
178 if test "x$with_pcre_config" = "x" ; then
179 AC_PATH_PROG(PCRE_CONFIG, pcre-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
180 if test "x$PCRE_CONFIG" = "xno" ; then
181 AC_PATH_PROG(PCRE_1_CONFIG, pcre-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
182 if test "x$PCRE_1_CONFIG" = "xno" ; then
183 AC_MSG_ERROR([pcre-config and pcre-1-config not found.])
185 PCRE_CONFIG="$PCRE_1_CONFIG"
189 if test "x$with_pcre_config" != "x" ; then
190 PCRE_CONFIG=$with_pcre_config
192 CFLAGS="${CFLAGS} `${PCRE_CONFIG} --cflags`"
194 AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.])
197 # Checks for typedefs, structures, and compiler characteristics.
200 # Checks for library functions.
202 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
204 AC_SUBST(with_apache_header)
212 AC_CONFIG_FILES([Makefile src/Makefile])