OSDN Git Service

* Fixed bug
[modchxj/mod_chxj.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([mod_chxj],[0.8.7-1])
4 AC_PREREQ(2.59)
5 AC_CONFIG_SRCDIR([src/mod_chxj.c])
6 AC_CANONICAL_TARGET
7 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8 AM_CONFIG_HEADER(include/config.h)
9
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_INSTALL
14
15
16 AM_PROG_LIBTOOL
17 AC_SUBST(LIBTOOL_DEPS)
18
19
20 # Checks for libraries.
21 AC_CHECK_LIB([apr-1],  [main])
22
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
25     AC_MSG_ERROR([
26 Please specify the --with-apache-header option. And, please specify the place of the header file. 
27
28 ])
29 fi
30
31 AC_ARG_WITH(apxs, [  --with-apxs=ARG Path of apxs program file.])
32 if test "x$with_apxs" = "x" ; then
33   APXS=""
34 fi
35 if test "x$with_apxs" = "xyes" ; then
36     AC_MSG_ERROR([
37 Please specify the --with-apxs option. And, please specify the place of the apxs program. 
38 ])
39 fi
40
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
43     AC_MSG_ERROR([
44 Please specify the --with-apr-config option. And, please specify the place of the apr-config program. 
45 ])
46 fi
47
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
50     AC_MSG_ERROR([
51 Please specify the --with-apu-config option. And, please specify the place of the apu-config program. 
52 ])
53 fi
54
55
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
59   QDEFS=""
60 else
61   QDEFS="-DIMG_NOT_CONVERT_FILENAME"
62 fi
63
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\\\""
67 else
68     if test "x$enable_dump_log" != "x" ; then
69         DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
70     fi
71 fi
72
73
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.])
82     fi
83   else
84     APXS="$APXS2"
85   fi
86 fi
87 if test "x$with_apxs" != "x" ; then
88   APXS=$with_apxs
89 fi 
90
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.])
95 fi
96
97
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.])
102 fi
103
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.])
110     else
111       APR_CONFIG="$APR_1_CONFIG"
112     fi
113   fi
114 fi
115 if test "x$with_apr_config" != "x" ; then
116   APR_CONFIG=$with_apr_config
117 fi
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.])
124     else
125       APU_CONFIG="$APU_1_CONFIG"
126     fi
127   fi
128 fi
129 if test "x$with_apu_config" != "x" ; then
130   APU_CONFIG=$with_apu_config
131 fi
132
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], [
137       with_iconv="ok"
138       AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
139       LIBS="${LIBS} -liconv_hook"
140   ],[
141     AC_CHECK_LIB([iconv], [iconv_open], [
142       with_iconv="ok"
143       AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
144       LIBS="${LIBS} -liconv"
145   ], [
146       witn_iconv=""
147   ],[])
148   ],[])
149 fi
150
151 if test "x$with_iconv" != "xok" ; then
152   if test "x$with_iconv" = "xyes" ; then
153       AC_MSG_ERROR([
154   Please specify the --with-iconv option. And, please specify the place of the libiconv program. 
155   ])
156   fi
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.])
160   fi
161 fi
162 if test "x$with_iconv" = "x" ; then
163   if test "x$with_iconv_hook" = "xyes" ; then
164       AC_MSG_ERROR([
165   Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
166   ])
167   fi
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.])
171   fi
172   if test "x$with_iconv_hook" = "x" ; then
173       AC_MSG_ERROR([
174   Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
175   ])
176   fi
177 fi
178
179
180 case $host_os in
181   freebsd*)
182     CFLAGS="${CFLAGS} -I/usr/local/include "
183     ;;
184 esac
185
186 if test "x${with_apache_header}" = "x" ; then
187   with_apache_header=`${APXS} -q includedir`
188 fi
189
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)
198 AC_SUBST(CC)
199 AC_SUBST(QDEFS)
200 AC_SUBST(DDEFS)
201 AC_SUBST(LIBS)
202 AC_SUBST(CFLAGS)
203
204 # Checks for header files.
205 AC_HEADER_STDC
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.]),[],
213 [[
214 #ifdef HAVE_APR_H
215 #include "apr.h"
216 #endif
217 #ifdef HAVE_AP_CONFIG_H
218 #include "ap_config.h"
219 #endif
220 ]])
221
222 # Checks for typedefs, structures, and compiler characteristics.
223 AC_C_CONST
224
225 # Checks for library functions.
226 AC_FUNC_MALLOC
227 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
228
229
230
231 AC_CONFIG_FILES([Makefile src/Makefile])
232 AC_OUTPUT