Develop and Download Open Source Software

Browse CVS Repository

Contents of /mod-uploader/mod_uploader/acinclude.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.61 - (show annotations) (download)
Sun Feb 8 01:59:46 2009 UTC (15 years, 2 months ago) by kimata
Branch: MAIN
CVS Tags: release-3_1_1_0902081100, HEAD
Changes since 1.60: +0 -0 lines
*** empty log message ***

1 ###############################################################################
2 # Copyright (C) 2006 Tetsuya Kimata <kimata@acapulco.dyndns.org>
3 #
4 # All rights reserved.
5 #
6 # This software is provided 'as-is', without any express or implied
7 # warranty. In no event will the authors be held liable for any
8 # damages arising from the use of this software.
9 #
10 # Permission is granted to anyone to use this software for any
11 # purpose, including commercial applications, and to alter it and
12 # redistribute it freely, subject to the following restrictions:
13 #
14 # 1. The origin of this software must not be misrepresented; you must
15 # not claim that you wrote the original software. If you use this
16 # software in a product, an acknowledgment in the product
17 # documentation would be appreciated but is not required.
18 #
19 # 2. Altered source versions must be plainly marked as such, and must
20 # not be misrepresented as being the original software.
21 #
22 # 3. This notice may not be removed or altered from any source
23 # distribution.
24 #
25 # $Id: acinclude.m4 1012 2006-04-11 15:32:28Z svn $
26 ###############################################################################
27
28 AC_DEFUN([AC_CHECK_MCPU], [
29 AC_ARG_WITH(mcpu,
30 [ --with-mcpu=CPU Set optimization target (ie: pentium4, athlon-xp, ...)],
31 [MCPU=${withval}], [MCPU='no'])
32 AC_MSG_CHECKING([for optimization target])
33 if test "$MCPU" = no; then
34 AC_MSG_RESULT(no)
35 else
36 CFLAGS_OLD=$CFLAGS
37 CFLAGS="-mcpu=$MCPU"
38 AC_LANG(C)
39 AC_COMPILE_IFELSE([int i = 0;], , [MCPU='no'])
40 if test "$MCPU" = no; then
41 AC_MSG_RESULT([ignored])
42 else
43 AC_MSG_RESULT($MCPU)
44 MCPU_OPT="-mcpu=$MCPU"
45 fi
46 CFLAGS=$CFLAGS_OLD
47 fi
48 AC_SUBST(MCPU_OPT)
49 ])
50
51 AC_DEFUN([AC_CHECK_MARCH], [
52 AC_ARG_WITH(march,
53 [ --with-march=CPU Set CPU type (ie: pentium4, athlon-xp, ...)],
54 [MARCH=${withval}], [MARCH='no'])
55 AC_MSG_CHECKING([for CPU type])
56 if test "$MARCH" = no; then
57 AC_MSG_RESULT(no)
58 else
59 CFLAGS_OLD=$CFLAGS
60 CFLAGS="$CFLAGS -march=$MARCH"
61 AC_LANG(C)
62 AC_COMPILE_IFELSE([int i = 0;], , [MARCH='no'])
63 if test "$MARCH" = no; then
64 AC_MSG_RESULT([ignored])
65 else
66 AC_MSG_RESULT($MARCH)
67 MARCH_OPT="-march=$MARCH"
68 fi
69 CFLAGS=$CFLAGS_OLD
70 fi
71 AC_SUBST(MARCH_OPT)
72 ])
73
74 AC_DEFUN([AC_CHECK_LIBTOOL], [
75 AC_ARG_WITH(libtool,
76 [ --with-libtool=LIBTOOL Set path to libtool program],
77 [LIBTOOL=${withval}], [LIBTOOL='no'])
78 if test "$LIBTOOL" = no; then
79 AC_PATH_PROG(GLIBTOOL, glibtool, no, /sw/bin:/usr/bin:/usr/local/bin)
80 LIBTOOL=$GLIBTOOL
81
82 if test "$LIBTOOL" = no; then
83 AC_PATH_PROG(LIBTOOL, libtool, no, /sw/bin:/usr/bin:/usr/local/bin)
84 fi
85 fi
86 if [ ! test -x $LIBTOOL ]; then
87 AC_MSG_ERROR([libtool is required. Try --with-libtool option.])
88 fi
89 ])
90
91 AC_DEFUN([AC_CHECK_APXS], [
92 AC_ARG_WITH(apxs,
93 [ --with-apxs=APXS Set path to apxs program],
94 [APXS=${withval}], [APXS='no'])
95 if test "$APXS" = no; then
96 AC_PATH_PROG(APXS2, apxs2, no,
97 /usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin)
98 APXS=$APXS2
99 if test "$APXS" = no; then
100 AC_PATH_PROG(APXS1, apxs, no,
101 /usr/pkg/sbin:/sw/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin)
102 APXS=$APXS1
103 fi
104 fi
105 if test ! -x $APXS; then
106 AC_MSG_ERROR([apxs is required. Try --with-apxs option.])
107 fi
108 AP_BUILD_DIR=`env GREP_OPTIONS= grep installbuilddir $APXS | head -n 1 | awk -F '"' '{print $(2)}'`
109 AC_SUBST(AP_BUILD_DIR)
110 ])
111
112 AC_DEFUN([AC_CHECK_APACHE_VERSION], [
113 AC_ARG_ENABLE(apache13,
114 [ --enable-apache13 Use Apache 1.3.x],
115 [APACHE_REQ_VERSION=1], [APACHE_REQ_VERSION=2])
116 AC_MSG_CHECKING([target Apache version])
117 if test "$APACHE_REQ_VERSION" = 1; then
118 AC_MSG_RESULT([1.3.x])
119 else
120 AC_MSG_RESULT([2.x])
121 fi
122
123 APACHE_BIN=`$APXS -q SBINDIR`/`$APXS -q TARGET`
124 APACHE_VERSION=`$APACHE_BIN -v | head -n 1 | awk -F '/' '{print $(2)}'`
125 APACHE_MAJOR_VERSION=`echo $APACHE_VERSION | awk -F '.' '{print $(1)}'`
126 APACHE_MINOR_VERSION=`echo $APACHE_VERSION | awk -F '.' '{print $(2)}'`
127 AC_MSG_CHECKING([for Apache version])
128 if test "$APACHE_MAJOR_VERSION" = $APACHE_REQ_VERSION; then
129 AC_MSG_RESULT([ok])
130 if test $APACHE_REQ_VERSION = 1; then
131 ACCESS_MODULE_NAME=access
132 else
133 if test "$APACHE_MINOR_VERSION" = 0; then
134 ACCESS_MODULE_NAME=access
135 else
136 ACCESS_MODULE_NAME=authz_host
137 fi
138 fi
139 else
140 AC_MSG_ERROR([Apache HTTP Server $APACHE_REQ_VERSION.x is required.])
141 fi
142 AC_SUBST(APXS)
143 AC_SUBST(APACHE_BIN)
144 AC_SUBST(APACHE_VERSION)
145 AC_SUBST(ACCESS_MODULE_NAME)
146 ])
147
148 AC_DEFUN([AC_CHECK_APACHE_MOD_DSO], [
149 APACHE_BIN=`$APXS -q SBINDIR`/`$APXS -q TARGET`
150 AC_MSG_CHECKING([for DSO enabled])
151 if test `$APACHE_BIN -l | env GREP_OPTIONS= grep mod_so.c`; then
152 AC_MSG_RESULT([ok])
153 else
154 AC_MSG_ERROR([DSO is disabled.])
155 fi
156 ])
157
158 AC_DEFUN([AC_CHECK_APACHECTL], [
159 AC_ARG_WITH(apctl,
160 [ --with-apctl=APCTL Set path to apachectl program],
161 [APACHECTL=${withval}], [APACHECTL='no'])
162 if test "$APACHECTL" = no; then
163 AC_PATH_PROG(APACHE2CTL, apache2ctl, no,
164 /usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin)
165 APACHECTL=$APACHE2CTL
166 if test "$APACHECTL" = no; then
167 AC_PATH_PROG(APACHE1CTL, apachectl, no,
168 /usr/pkg/sbin:/sw/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin)
169 APACHECTL=$APACHE1CTL
170 fi
171 fi
172 if test ! -x $APACHECTL; then
173 AC_MSG_ERROR([apachectl is required. Try --with-apctl option.])
174 fi
175 ])
176
177 AC_DEFUN([AC_CHECK_APRCONF], [
178 AC_ARG_WITH(aprconf,
179 [ --with-aprconf=APRCONF Set path to apr-config program],
180 [APRCONF=${withval}], [APRCONF='no'])
181 if test "$APRCONF" = no; then
182 AC_PATH_PROG(APRCONF, apr-1-config, no,
183 /usr/pkg/bin:/sw/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin:/usr/local/lib/apache2)
184 fi
185 if test "$APRCONF" = no; then
186 AC_PATH_PROG(APRCONF, apr-config, no,
187 /usr/pkg/bin:/sw/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/local/apache2/bin:/usr/local/lib/apache2)
188 fi
189 if test ! -x $APRCONF; then
190 AC_MSG_ERROR([apr-config is required. Try --with-aprconf option.])
191 fi
192 ])
193
194 AC_DEFUN([AC_CHECK_LIGHTTPD], [
195 AC_ARG_WITH(lighttpd,
196 [ --with-lighttpd=LIGHTTPD Set path to lighttpd program],
197 [LIGHTTPD=${withval}], [LIGHTTPD='no'])
198 if test "$LIGHTTPD" = no; then
199 AC_PATH_PROG(LIGHTTPD, lighttpd, no, /sw/sbin:/usr/sbin:/usr/local/sbin)
200 fi
201 ])
202
203 AC_DEFUN([AC_CHECK_MAGICKCONF], [
204 AC_ARG_WITH(mconf,
205 [ --with-mconf=MCONF Set path to Magick++-config program],
206 [MCONF=${withval}], [MCONF='no'])
207 if test "$MCONF" = no; then
208 AC_PATH_PROG(MCONF, Magick++-config, no, /sw/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin)
209 fi
210 if test ! -x $MCONF; then
211 AC_MSG_ERROR([Magick++-config is required. Try --with-mconf option.])
212 fi
213 ])
214
215 AC_DEFUN([AC_CHECK_ICONV_2ND_ARG_TYPE], [
216 AC_MSG_CHECKING([for type of iconv 2nd argument])
217 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
218 [[
219 #include <stdio.h>
220 #include <string.h>
221 #include <iconv.h>
222 ]],
223 [[
224 char buffer[256];
225 iconv_t cd;
226 char *inbuf;
227 size_t inbytesleft;
228 char *outbuf;
229 size_t outbytesleft;
230
231 inbuf = "����������";
232 inbytesleft = strlen(inbuf);
233 outbuf = buffer;
234 outbytesleft = sizeof(buffer);
235
236 if ((cd = iconv_open("EUC-JP", "EUC-JP")) == (iconv_t)-1) {
237 return -1;
238 }
239 iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
240 iconv_close(cd);
241
242 printf("%s -> %s\n", inbuf, outbuf);
243 ]])], [ICONV_2ND_ARG_TYPE='char *'], [ICONV_2ND_ARG_TYPE='const char *'])
244 AC_MSG_RESULT($ICONV_2ND_ARG_TYPE)
245 AC_SUBST(ICONV_2ND_ARG_TYPE)
246 AC_DEFINE_UNQUOTED(ICONV_2ND_ARG_TYPE, $ICONV_2ND_ARG_TYPE, [iconv ��������������])
247 ])
248
249 AC_DEFUN([AC_CHECK_GCC_ATOMIC_BUILTINS], [
250 AC_ARG_ENABLE(atomic-builtins,
251 [ --enable-atomic-builtins Use GCC Atomic Builtins],
252 [ATOMIC_BUILTINS=on], [ATOMIC_BUILTINS=off])
253 AC_MSG_CHECKING([for whether to use GCC Atomic Builtins])
254 if test "$ATOMIC_BUILTINS" = on; then
255 AC_MSG_RESULT(yes)
256 AC_MSG_CHECKING([for GCC Atomic Builtins available])
257 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
258 [[
259 #include <stdint.h>
260 ]],
261 [[
262 int *memory;
263 int with;
264 int compare;
265
266 __sync_val_compare_and_swap(memory, compare, with);
267 ]])], [GCC_ATOMIC_BUILTINS=on], [GCC_ATOMIC_BUILTINS=off])
268 if test "$GCC_ATOMIC_BUILTINS" = on; then
269 AC_MSG_RESULT(yes)
270 AC_DEFINE(GCC_ATOMIC_BUILTINS, "on", [GCC Atomic Builts ������������������])
271 else
272 AC_MSG_RESULT(no)
273 fi
274 else
275 AC_MSG_RESULT(no)
276 fi
277 ])
278
279 # Local Variables:
280 # mode: autoconf
281 # coding: euc-japan-unix
282 # End:

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26