OSDN Git Service

*** empty log message ***
[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.4-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 AM_PROG_LIBTOOL
15
16 # Checks for libraries.
17 AC_CHECK_LIB([apr-1],  [main])
18
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
22     AC_MSG_ERROR([
23 Please specify the --with-apache-header option.
24 ])
25 fi
26 if test "x$with_apache_header" = "xyes"; then
27     AC_MSG_ERROR([
28 Please specify the --with-apache-header option. And, please specify the place of the header file. 
29
30 ])
31 fi
32
33 AC_ARG_WITH(apxs, [  --with-apxs=ARG Path of apxs program file.])
34 if test "x$with_apxs" = "x" ; then
35   APXS=""
36 fi
37 if test "x$with_apxs" = "xyes" ; then
38     AC_MSG_ERROR([
39 Please specify the --with-apxs option. And, please specify the place of the apxs program. 
40 ])
41 fi
42
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
45     AC_MSG_ERROR([
46 Please specify the --with-apr-config option. And, please specify the place of the apr-config program. 
47 ])
48 fi
49
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
52     AC_MSG_ERROR([
53 Please specify the --with-apu-config option. And, please specify the place of the apu-config program. 
54 ])
55 fi
56
57
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
61   QDEFS=""
62 else
63   QDEFS="-DIMG_NOT_CONVERT_FILENAME"
64 fi
65
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\\\""
69 else
70     if test "x$enable_dump_log" != "x" ; then
71         DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
72     fi
73 fi
74
75
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.])
81   fi
82 fi
83 if test "x$with_apxs" != "x" ; then
84   APXS=$with_apxs
85 fi 
86
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.])
91 fi
92
93
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.])
98 fi
99
100 if test "x$with_apr_config" = "x" ; then
101   AC_PATH_PROG(APR_CONFIG, apr-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
102   if test "x$APR_CONFIG" = "xno" ; then
103     AC_PATH_PROG(APR_1_CONFIG, apr-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
104     if test "x$APR_1_CONFIG" = "xno" ; then
105       AC_MSG_ERROR([apr-config and apr-1-config not found.])
106     else
107       APR_CONFIG="$APR_1_CONFIG"
108     fi
109   fi
110 fi
111 if test "x$with_apr_config" != "x" ; then
112   APR_CONFIG=$with_apr_config
113 fi
114 if test "x$with_apu_config" = "x" ; then
115   AC_PATH_PROG(APU_CONFIG, apu-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
116   if test "x$APU_CONFIG" = "xno" ; then
117     AC_PATH_PROG(APU_1_CONFIG, apu-1-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
118     if test "x$APU_1_CONFIG" = "xno" ; then
119       AC_MSG_ERROR([apu-config and apu-1-config not found.])
120     else
121       APU_CONFIG="$APU_1_CONFIG"
122     fi
123   fi
124 fi
125 if test "x$with_apu_config" != "x" ; then
126   APU_CONFIG=$with_apu_config
127 fi
128
129 AC_ARG_WITH(iconv, [  --with-iconv=ARG  specify the place of the libiconv directory.])
130 AC_ARG_WITH(iconv_hook, [  --with-iconv_hook=ARG  specify the place of the libiconv_hook directory.])
131 if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
132   AC_CHECK_LIB([iconv_hook], [iconv_open], [
133       with_iconv="ok"
134       AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
135       LIBS="${LIBS} -liconv_hook"
136   ],[
137     AC_CHECK_LIB([iconv], [iconv_open], [
138       with_iconv="ok"
139       AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
140       LIBS="${LIBS} -liconv"
141   ], [
142       witn_iconv=""
143   ],[])
144   ],[])
145 fi
146
147 if test "x$with_iconv" != "xok" ; then
148   if test "x$with_iconv" = "xyes" ; then
149       AC_MSG_ERROR([
150   Please specify the --with-iconv option. And, please specify the place of the libiconv program. 
151   ])
152   fi
153   if test "x$with_iconv" != "x" ; then
154     LIBS="${LIBS} -L$with_iconv -liconv "
155     AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
156   fi
157 fi
158 if test "x$with_iconv" = "x" ; then
159   if test "x$with_iconv_hook" = "xyes" ; then
160       AC_MSG_ERROR([
161   Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
162   ])
163   fi
164   if test "x$with_iconv_hook" != "x" ; then
165     LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
166     AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
167   fi
168   if test "x$with_iconv_hook" = "x" ; then
169       AC_MSG_ERROR([
170   Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program. 
171   ])
172   fi
173 fi
174
175
176 case $host_os in
177   freebsd*)
178     CFLAGS="${CFLAGS} -I/usr/local/include "
179     ;;
180 esac
181
182
183 LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
184 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
185 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
186 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
187 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
188 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
189 CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
190 AC_SUBST(with_apache_header)
191 AC_SUBST(CC)
192 AC_SUBST(QDEFS)
193 AC_SUBST(DDEFS)
194 AC_SUBST(LIBS)
195 AC_SUBST(CFLAGS)
196
197 # Checks for header files.
198 AC_HEADER_STDC
199 AC_CHECK_HEADERS([string.h strings.h unistd.h fcntl.h sys/types.h sys/stat.h sys/mman.h libgen.h])
200 APR_HEADER_DIR="`${APR_CONFIG} --includes | sed -e 's/-I//g' | sed -e 's/ //g'`"
201 AC_CHECK_HEADERS([apr_shm.h apr_global_mutex.h])
202 AC_CHECK_HEADERS([apr.h])
203 AC_CHECK_HEADERS([ap_config.h])
204 AC_CHECK_HEADERS([ap_regex.h],
205   AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.]),[],
206 [[
207 #ifdef HAVE_APR_H
208 #include "apr.h"
209 #endif
210 #ifdef HAVE_AP_CONFIG_H
211 #include "ap_config.h"
212 #endif
213 ]])
214
215 # Checks for typedefs, structures, and compiler characteristics.
216 AC_C_CONST
217
218 # Checks for library functions.
219 AC_FUNC_MALLOC
220 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
221
222
223
224 AC_CONFIG_FILES([Makefile src/Makefile])
225 AC_OUTPUT