OSDN Git Service

* merge from 0.8.0 branch.
[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.9.0])
4 AC_PREREQ(2.61)
5 AC_CONFIG_SRCDIR([src/mod_chxj.c])
6 AC_CANONICAL_TARGET
7 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8 AC_CONFIG_HEADERS([include/config.h])
9
10
11 # Checks for programs.
12 AC_PROG_CPP
13 AC_PROG_CC
14 AC_PROG_INSTALL
15 AC_PROG_LIBTOOL
16
17 AC_LANG(C)
18
19 # Checks for libraries.
20 AC_CHECK_LIB([apr-1],  [main])
21
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
25     AC_MSG_ERROR([
26 Please specify the --with-apache-header option.
27 ])
28 fi
29 if test "x$with_apache_header" = "xyes"; then
30     AC_MSG_ERROR([
31 Please specify the --with-apache-header option. And, please specify the place of the header file. 
32
33 ])
34 fi
35
36 AC_ARG_WITH(apxs, [  --with-apxs=ARG Path of apxs program file.])
37 if test "x$with_apxs" = "x" ; then
38   APXS=""
39 fi
40 if test "x$with_apxs" = "xyes" ; then
41     AC_MSG_ERROR([
42 Please specify the --with-apxs option. And, please specify the place of the apxs program. 
43 ])
44 fi
45
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
48     AC_MSG_ERROR([
49 Please specify the --with-apr-config option. And, please specify the place of the apr-config program. 
50 ])
51 fi
52
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
55     AC_MSG_ERROR([
56 Please specify the --with-apu-config option. And, please specify the place of the apu-config program. 
57 ])
58 fi
59
60
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
64   QDEFS=""
65 else
66   QDEFS="-DIMG_NOT_CONVERT_FILENAME"
67 fi
68
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\\\""
72 else
73     if test "x$enable_dump_log" != "x" ; then
74         DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
75     fi
76 fi
77
78
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.])
87       fi
88   else
89     APXS="$APXS2"
90   fi
91 fi
92 if test "x$with_apxs" != "x" ; then
93   APXS=$with_apxs
94 fi 
95
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.])
100 fi
101
102
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.])
107 fi
108
109
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.])
116     else
117       APR_CONFIG="$APR_1_CONFIG"
118     fi
119   fi
120 fi
121 if test "x$with_apr_config" != "x" ; then
122   APR_CONFIG=$with_apr_config
123 fi
124
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.])
131     else
132       APU_CONFIG="$APU_1_CONFIG"
133     fi
134   fi
135 fi
136 if test "x$with_apu_config" != "x" ; then
137   APU_CONFIG=$with_apu_config
138 fi
139
140
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], [
145 #      with_iconv="ok"
146 #      AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
147 #      LIBS="${LIBS} -liconv_hook"
148 #  ],[
149 #    AC_CHECK_LIB([iconv], [iconv_open], [
150 #      with_iconv="ok"
151 #      AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
152 #      LIBS="${LIBS} -liconv"
153 #  ], [
154 #      witn_iconv=""
155 #  ],[])
156 #  ],[])
157 #fi
158 #
159 #if test "x$with_iconv" != "xok" ; then
160 #  if test "x$with_iconv" = "xyes" ; then
161 #      AC_MSG_ERROR([
162 #  Please specify the --with-iconv option. And, please specify the place of the libiconv program. 
163 #  ])
164 #  fi
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.])
168 #  fi
169 #fi
170 #if test "x$with_iconv" = "x" ; then
171 #  if test "x$with_iconv_hook" = "xyes" ; then
172 #      AC_MSG_ERROR([
173 #  Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
174 #  ])
175 #  fi
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.])
179 #  fi
180 #  if test "x$with_iconv_hook" = "x" ; then
181 #      AC_MSG_ERROR([
182 #  Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
183 #  ])
184 #  fi
185 #fi
186
187
188 case $host_os in
189   freebsd*)
190     CFLAGS="${CFLAGS} -I/usr/local/include "
191     ;;
192 esac
193
194
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)
203 AC_SUBST(CC)
204 AC_SUBST(QDEFS)
205 AC_SUBST(DDEFS)
206 AC_SUBST(LIBS)
207 AC_SUBST(CFLAGS)
208
209 # Checks for header files.
210 AC_HEADER_STDC
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.]),[],
218 [[
219 #ifdef HAVE_APR_H
220 #include "apr.h"
221 #endif
222 #ifdef HAVE_AP_CONFIG_H
223 #include "ap_config.h"
224 #endif
225 ]])
226
227 # Checks for typedefs, structures, and compiler characteristics.
228 AC_C_CONST
229
230 # Checks for library functions.
231 AC_FUNC_MALLOC
232 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
233
234
235
236 AC_CONFIG_FILES([Makefile src/Makefile])
237 AC_OUTPUT