2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.8.2-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.
16 # Checks for libraries.
17 AC_CHECK_LIB([apr-0], [main])
19 AC_ARG_WITH(apache-header, [ --with-apache-header=ARG The directory with the header file of apache2.0 is specified. ])
20 #[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
21 if test "x$with_apache_header" = "x"; then
23 Please specify the --with-apache-header option.
26 if test "x$with_apache_header" = "xyes"; then
28 Please specify the --with-apache-header option. And, please specify the place of the header file.
33 AC_ARG_WITH(apxs, [ --with-apxs=ARG Path of apxs program file.])
34 if test "x$with_apxs" = "x" ; then
37 if test "x$with_apxs" = "xyes" ; then
39 Please specify the --with-apxs option. And, please specify the place of the apxs program.
43 AC_ARG_WITH(apr-config, [ --with-apr-config=ARG Path of apr-config program file.])
44 if test "x$with_apr_config" = "xyes" ; then
46 Please specify the --with-apr-config option. And, please specify the place of the apr-config program.
50 AC_ARG_WITH(apu-config, [ --with-apu-config=ARG Path of apu-config program file.])
51 if test "x$with_apu_config" = "xyes" ; then
53 Please specify the --with-apu-config option. And, please specify the place of the apu-config program.
58 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
59 source by the automatic operation.])
60 if test "x$enable_img_conv_f" = "xyes"; then
63 QDEFS="-DIMG_NOT_CONVERT_FILENAME"
66 AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ])
67 if test "x$enable_dump_log" = "xyes"; then
68 DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\""
70 if test "x$enable_dump_log" != "x" ; then
71 DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
76 if test "x$with_apxs" = "x" ; then
77 AC_PATH_PROG(APXS, apxs, no,
78 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/apache/bin)
79 if test "x$APXS" = "xno"; then
80 AC_MSG_ERROR([apxs not found.])
83 if test "x$with_apxs" != "x" ; then
87 AC_PATH_PROG(LIBTOOL, libtool, no,
88 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
89 if test "x$LIBTOOL" = "xno"; then
90 AC_MSG_ERROR([libtool not found.])
94 AC_PATH_PROG(WAND_CONFIG, Wand-config, no,
95 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
96 if test "x$WAND_CONFIG" = "xno" ; then
97 AC_MSG_ERROR([wand-config not found.])
100 if test "x$with_apr_config" = "x" ; then
101 AC_PATH_PROG(APR_CONFIG, apr-config, no,
102 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
103 if test "x$APR_CONFIG" = "xno" ; then
104 AC_MSG_ERROR([apr-config not found.])
107 if test "x$with_apr_config" != "x" ; then
108 APR_CONFIG=$with_apr_config
110 if test "x$with_apu_config" = "x" ; then
111 AC_PATH_PROG(APU_CONFIG, apu-config, no,
112 /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
113 if test "x$APU_CONFIG" = "xno" ; then
114 AC_MSG_ERROR([apu-config not found.])
117 if test "x$with_apu_config" != "x" ; then
118 APU_CONFIG=$with_apu_config
121 AC_ARG_WITH(iconv, [ --with-iconv=ARG specify the place of the libiconv directory.])
122 AC_ARG_WITH(iconv_hook, [ --with-iconv_hook=ARG specify the place of the libiconv_hook directory.])
123 if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
124 AC_CHECK_LIB([iconv_hook], [iconv_open], [
126 AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
127 LIBS="${LIBS} -liconv_hook"
129 AC_CHECK_LIB([iconv], [iconv_open], [
131 AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
132 LIBS="${LIBS} -liconv"
139 if test "x$with_iconv" != "xok" ; then
140 if test "x$with_iconv" = "xyes" ; then
142 Please specify the --with-iconv option. And, please specify the place of the libiconv program.
145 if test "x$with_iconv" != "x" ; then
146 LIBS="${LIBS} -L$with_iconv -liconv "
147 AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
150 if test "x$with_iconv" = "x" ; then
151 if test "x$with_iconv_hook" = "xyes" ; then
153 Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
156 if test "x$with_iconv_hook" != "x" ; then
157 LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
158 AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
160 if test "x$with_iconv_hook" = "x" ; then
162 Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
170 CFLAGS="${CFLAGS} -I/usr/local/include "
175 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
176 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
177 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
178 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
179 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
180 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
181 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
182 AC_SUBST(with_apache_header)
189 # Checks for header files.
191 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
192 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
193 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
194 AC_CHECK_HEADERS([apr.h])
195 AC_CHECK_HEADERS([ap_config.h])
196 AC_CHECK_HEADERS([ap_regex.h],
197 AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
202 #ifdef HAVE_AP_CONFIG_H
203 #include "ap_config.h"
207 # Checks for typedefs, structures, and compiler characteristics.
210 # Checks for library functions.
212 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
216 AC_CONFIG_FILES([Makefile src/Makefile])