source: proiecte/HadoopJUnit/hadoop-0.20.1/src/contrib/fuse-dfs/acinclude.m4 @ 176

Last change on this file since 176 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 6.1 KB
Line 
1#
2# Copyright 2005 The Apache Software Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16AC_DEFUN([FUSE_DFS_INITIALIZE],
17[
18AM_INIT_AUTOMAKE([ foreign 1.9.5 no-define ])
19if test "x$1" = "xlocalinstall"; then
20wdir=`pwd`
21# To use $wdir undef quote.
22#
23##########
24AC_PREFIX_DEFAULT([`pwd`/install])
25echo
26fi
27AC_PROG_CC
28AC_PROG_CXX
29AC_PROG_RANLIB(RANLIB, ranlib)
30AC_PATH_PROGS(BASH, bash)
31AC_PATH_PROGS(PERL, perl)
32AC_PATH_PROGS(PYTHON, python)
33AC_PATH_PROGS(AR, ar)
34AC_PATH_PROGS(ANT, ant)
35PRODUCT_MK=""
36])
37
38AC_DEFUN([FUSE_DFS_WITH_EXTERNAL_PATH],
39[
40cdir=`pwd`
41AC_MSG_CHECKING([Checking EXTERNAL_PATH set to])
42AC_ARG_WITH([externalpath],
43  [ --with-externalpath=DIR User specified path to external fuse dfs components.],
44  [
45    if test "x${EXTERNAL_PATH}" != "x"; then
46       echo ""
47       echo "ERROR: You have already set EXTERNAL_PATH in your environment"
48       echo "Cannot override it using --with-externalpath. Unset EXTERNAL_PATH to use this option"
49       exit 1
50    fi
51    EXTERNAL_PATH=$withval
52  ],
53  [
54    if test "x${EXTERNAL_PATH}" = "x"; then
55       EXTERNAL_PATH=$1
56    fi
57  ]
58)
59if test "x${EXTERNAL_PATH}" = "x"; then
60   export EXTERNAL_PATH="$cdir/external"
61   GLOBAL_HEADER_MK="include ${EXTERNAL_PATH}/global_header.mk"
62   GLOBAL_FOOTER_MK="include ${EXTERNAL_PATH}/global_footer.mk"
63else
64   export EXTERNAL_PATH
65   GLOBAL_HEADER_MK="include ${EXTERNAL_PATH}/global_header.mk"
66   GLOBAL_FOOTER_MK="include ${EXTERNAL_PATH}/global_footer.mk"
67fi
68AC_MSG_RESULT($EXTERNAL_PATH)
69if test ! -d ${EXTERNAL_PATH}; then
70       echo ""
71       echo "ERROR: EXTERNAL_PATH set to an nonexistent directory ${EXTERNAL_PATH}"
72       exit 1
73fi
74AC_SUBST(EXTERNAL_PATH)
75AC_SUBST(GLOBAL_HEADER_MK)
76AC_SUBST(GLOBAL_FOOTER_MK)
77])
78
79# Set option to enable shared mode. Set DEBUG and OPT for use in Makefile.am.
80AC_DEFUN([FUSE_DFS_ENABLE_DEFAULT_OPT_BUILD],
81[
82AC_MSG_CHECKING([whether to enable optimized build])
83AC_ARG_ENABLE([opt],
84  [  --disable-opt     Set up debug mode.],
85  [
86     ENABLED_OPT=$enableval
87  ],
88  [
89     ENABLED_OPT="yes"
90  ]
91)
92if test "$ENABLED_OPT" = "yes"
93then
94     CFLAGS="-Wall -O3"
95     CXXFLAGS="-Wall -O3"
96else
97     CFLAGS="-Wall -g"
98     CXXFLAGS="-Wall -g"
99fi
100AC_MSG_RESULT($ENABLED_OPT)
101AM_CONDITIONAL([OPT], [test "$ENABLED_OPT" = yes])
102AM_CONDITIONAL([DEBUG], [test "$ENABLED_OPT" = no])
103])
104
105# Set option to enable debug mode. Set DEBUG and OPT for use in Makefile.am.
106AC_DEFUN([FUSE_DFS_ENABLE_DEFAULT_DEBUG_BUILD],
107[
108AC_MSG_CHECKING([whether to enable debug build])
109AC_ARG_ENABLE([debug],
110  [  --disable-debug     Set up opt mode.],
111  [
112     ENABLED_DEBUG=$enableval
113  ],
114  [
115     ENABLED_DEBUG="yes"
116  ]
117)
118if test "$ENABLED_DEBUG" = "yes"
119then
120     CFLAGS="-Wall -g"
121     CXXFLAGS="-Wall -g"
122else
123     CFLAGS="-Wall -O3"
124     CXXFLAGS="-Wall -O3"
125fi
126AC_MSG_RESULT($ENABLED_DEBUG)
127AM_CONDITIONAL([DEBUG], [test "$ENABLED_DEBUG" = yes])
128AM_CONDITIONAL([OPT], [test "$ENABLED_DEBUG" = no])
129])
130
131# Set option to enable static libs.
132AC_DEFUN([FUSE_DFS_ENABLE_DEFAULT_STATIC],
133[
134SHARED=""
135STATIC=""
136AC_MSG_CHECKING([whether to enable static mode])
137AC_ARG_ENABLE([static],
138  [  --disable-static     Set up shared mode.],
139  [
140     ENABLED_STATIC=$enableval
141  ],
142  [
143     ENABLED_STATIC="yes"
144  ]
145)
146if test "$ENABLED_STATIC" = "yes"
147then
148     LTYPE=".a"
149else
150     LTYPE=".so"
151     SHARED_CXXFLAGS="-fPIC"
152     SHARED_CFLAGS="-fPIC"
153     SHARED_LDFLAGS="-shared -fPIC"
154     AC_SUBST(SHARED_CXXFLAGS)
155     AC_SUBST(SHARED_CFLAGS)
156     AC_SUBST(SHARED_LDFLAGS)
157fi
158AC_MSG_RESULT($ENABLED_STATIC)
159AC_SUBST(LTYPE)
160AM_CONDITIONAL([STATIC], [test "$ENABLED_STATIC" = yes])
161AM_CONDITIONAL([SHARED], [test "$ENABLED_STATIC" = no])
162])
163
164# Set option to enable shared libs.
165AC_DEFUN([FUSE_DFS_ENABLE_DEFAULT_SHARED],
166[
167SHARED=""
168STATIC=""
169AC_MSG_CHECKING([whether to enable shared mode])
170AC_ARG_ENABLE([shared],
171  [  --disable-shared     Set up static mode.],
172  [
173    ENABLED_SHARED=$enableval
174  ],
175  [
176     ENABLED_SHARED="yes"
177  ]
178)
179if test "$ENABLED_SHARED" = "yes"
180then
181     LTYPE=".so"
182     SHARED_CXXFLAGS="-fPIC"
183     SHARED_CFLAGS="-fPIC"
184     SHARED_LDFLAGS="-shared -fPIC"
185     AC_SUBST(SHARED_CXXFLAGS)
186     AC_SUBST(SHARED_CFLAGS)
187     AC_SUBST(SHARED_LDFLAGS)
188else
189     LTYPE=".a"
190fi
191AC_MSG_RESULT($ENABLED_SHARED)
192AC_SUBST(LTYPE)
193AM_CONDITIONAL([SHARED], [test "$ENABLED_SHARED" = yes])
194AM_CONDITIONAL([STATIC], [test "$ENABLED_SHARED" = no])
195])
196
197# Generates define flags and conditionals as specified by user.
198# This gets enabled *only* if user selects --enable-<FEATURE> otion.
199AC_DEFUN([FUSE_DFS_ENABLE_FEATURE],
200[
201ENABLE=""
202flag="$1"
203value="$3"
204AC_MSG_CHECKING([whether to enable $1])
205AC_ARG_ENABLE([$2],
206  [  --enable-$2     Enable $2.],
207  [
208     ENABLE=$enableval
209  ],
210  [
211     ENABLE="no"
212  ]
213)
214AM_CONDITIONAL([$1], [test "$ENABLE" = yes])
215if test "$ENABLE" = "yes"
216then
217   if test "x${value}" = "x"
218   then
219       AC_DEFINE([$1])
220   else
221       AC_DEFINE_UNQUOTED([$1], [$value])
222   fi
223fi
224AC_MSG_RESULT($ENABLE)
225])
226
227
228# can also use eval $2=$withval;AC_SUBST($2)
229AC_DEFUN([FUSE_DFS_WITH_PATH],
230[
231USRFLAG=""
232USRFLAG=$1
233AC_MSG_CHECKING([Checking $1 set to])
234AC_ARG_WITH([$2],
235  [ --with-$2=DIR User specified path.],
236  [
237    LOC=$withval
238    eval $USRFLAG=$withval
239  ],
240  [
241    LOC=$3
242    eval $USRFLAG=$3
243  ]
244)
245AC_SUBST([$1])
246AC_MSG_RESULT($LOC)
247])
248
249AC_DEFUN([FUSE_DFS_SET_FLAG_VALUE],
250[
251SETFLAG=""
252AC_MSG_CHECKING([Checking $1 set to])
253SETFLAG=$1
254eval $SETFLAG=\"$2\"
255AC_SUBST([$SETFLAG])
256AC_MSG_RESULT($2)
257])
258
259# NOTES
260# if using if else bourne stmt you must have more than a macro in it.
261# EX1 is not correct. EX2 is correct
262# EX1: if test "$XX" = "yes"; then
263#        AC_SUBST(xx)
264#      fi
265# EX2: if test "$XX" = "yes"; then
266#        xx="foo"
267#        AC_SUBST(xx)
268#      fi
Note: See TracBrowser for help on using the repository browser.