OSDN Git Service

*
[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.8-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 AC_ARG_WITH(pcre-config, [  --with-pcre-config=ARG  Path of pcre-config program file.])
56 if test "x$with_pcre_config" = "xyes" ; then
57     AC_MSG_ERROR([
58 Please specify the --with-pcre-config option. And, please specify the place of the pcre-config program.
59 ])
60 fi
61
62
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
66   QDEFS=""
67 else
68   QDEFS="-DIMG_NOT_CONVERT_FILENAME"
69 fi
70
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\\\""
74 else
75     if test "x$enable_dump_log" != "x" ; then
76         DDEFS="-DDUMP_LOG=\\\"${enable_dump_log}\\\""
77     fi
78 fi
79
80
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.])
89     fi
90   else
91     APXS="$APXS2"
92   fi
93 fi
94 if test "x$with_apxs" != "x" ; then
95   APXS=$with_apxs
96 fi 
97
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.])
102 fi
103
104
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.])
109 fi
110
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.])
117     else
118       APR_CONFIG="$APR_1_CONFIG"
119     fi
120   fi
121 fi
122 if test "x$with_apr_config" != "x" ; then
123   APR_CONFIG=$with_apr_config
124 fi
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 case $host_os in
142   freebsd*)
143     CFLAGS="${CFLAGS} -I/usr/local/include "
144     ;;
145 esac
146
147 if test "x${with_apache_header}" = "x" ; then
148   with_apache_header=`${APXS} -q includedir`
149 fi
150
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}"
158
159 # Checks for header files.
160 AC_HEADER_STDC
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.]),[],
168 #[[
169 ##ifdef HAVE_APR_H
170 ##include "apr.h"
171 ##endif
172 ##ifdef HAVE_AP_CONFIG_H
173 ##include "ap_config.h"
174 ##endif
175 #]])
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.])
184       else
185         PCRE_CONFIG="$PCRE_1_CONFIG"
186       fi
187     fi
188   fi
189   if test "x$with_pcre_config" != "x" ; then
190     PCRE_CONFIG=$with_pcre_config
191   fi
192   CFLAGS="${CFLAGS} `${PCRE_CONFIG} --cflags`"
193 else
194   AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.])
195 fi
196
197 # Checks for typedefs, structures, and compiler characteristics.
198 AC_C_CONST
199
200 # Checks for library functions.
201 AC_FUNC_MALLOC
202 AC_CHECK_FUNCS([open mmap close memset memcpy strcasecmp strncasecmp strstr])
203
204 AC_SUBST(with_apache_header)
205 AC_SUBST(CC)
206 AC_SUBST(QDEFS)
207 AC_SUBST(DDEFS)
208 AC_SUBST(LIBS)
209 AC_SUBST(CFLAGS)
210
211
212 AC_CONFIG_FILES([Makefile src/Makefile])
213 AC_OUTPUT