Lines 1-4
Link Here
|
1 |
dnl $Id: acinclude.m4,v 1.9 2004/10/10 23:55:35 vadz Exp $ |
1 |
dnl $Id: acinclude.m4,v 1.11 2006/08/25 15:38:28 vadz Exp $ |
2 |
dnl local macro definitions for M's configure.in |
2 |
dnl local macro definitions for M's configure.in |
3 |
|
3 |
|
4 |
dnl package,message,variable,default,helpmessage |
4 |
dnl package,message,variable,default,helpmessage |
Lines 170-432
Link Here
|
170 |
] |
170 |
] |
171 |
) |
171 |
) |
172 |
|
172 |
|
173 |
|
173 |
dnl M_GCC_OPTION(OPTION, ACTION-IF-SUPPORTED, ACTION-IF-NOT-SUPPORTED) |
174 |
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- |
|
|
175 |
## Copyright (C) 1996-1998 Free Software Foundation, Inc. |
176 |
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
177 |
## |
178 |
## This program is free software; you can redistribute it and/or modify |
179 |
## it under the terms of the GNU General Public License as published by |
180 |
## the Free Software Foundation; either version 2 of the License, or |
181 |
## (at your option) any later version. |
182 |
## |
183 |
## This program is distributed in the hope that it will be useful, but |
184 |
## WITHOUT ANY WARRANTY; without even the implied warranty of |
185 |
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
186 |
## General Public License for more details. |
187 |
## |
188 |
## You should have received a copy of the GNU General Public License |
189 |
## along with this program; if not, write to the Free Software |
190 |
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
191 |
## |
192 |
## As a special exception to the GNU General Public License, if you |
193 |
## distribute this file as part of a program that contains a |
194 |
## configuration script generated by Autoconf, you may include it under |
195 |
## the same distribution terms that you use for the rest of that program. |
196 |
|
197 |
# serial 24 AM_PROG_LIBTOOL |
198 |
AC_DEFUN([AM_PROG_LIBTOOL], |
199 |
[AC_REQUIRE([AM_ENABLE_SHARED])dnl |
200 |
AC_REQUIRE([AM_ENABLE_STATIC])dnl |
201 |
AC_REQUIRE([AC_CANONICAL_HOST])dnl |
202 |
AC_REQUIRE([AC_PROG_RANLIB])dnl |
203 |
AC_REQUIRE([AC_PROG_CC])dnl |
204 |
AC_REQUIRE([AM_PROG_LD])dnl |
205 |
AC_REQUIRE([AM_PROG_NM])dnl |
206 |
AC_REQUIRE([AC_PROG_LN_S])dnl |
207 |
dnl |
174 |
dnl |
208 |
# Always use our own libtool. |
175 |
dnl Check if gcc supports the given option (fails if compiler is not gcc) |
209 |
LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
176 |
AC_DEFUN([M_GCC_OPTION], [ |
210 |
AC_SUBST(LIBTOOL)dnl |
177 |
AC_REQUIRE([AC_PROG_CC]) |
211 |
|
178 |
if test "x$GCC" = "xyes"; then |
212 |
# Check for any special flags to pass to ltconfig. |
179 |
echo 'void f(){}' >conftest.c |
213 |
libtool_flags= |
180 |
case "`$CC $1 -c conftest.c 2>&1`" in |
214 |
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" |
181 |
'') ifelse([$2], , :, [$2]) ;; |
215 |
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" |
182 |
*) ifelse([$3], , :, [$3]) ;; |
216 |
test "$silent" = yes && libtool_flags="$libtool_flags --silent" |
183 |
esac |
217 |
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" |
184 |
rm -f conftest.* |
218 |
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" |
185 |
else |
219 |
|
186 |
ifelse([$3], , :, [$3]) |
220 |
# Some flags need to be propagated to the compiler or linker for good |
187 |
fi |
221 |
# libtool support. |
|
|
222 |
case "$host" in |
223 |
*-*-irix6*) |
224 |
# Find out which ABI we are using. |
225 |
echo '[#]line __oline__ "configure"' > conftest.$ac_ext |
226 |
if AC_TRY_EVAL(ac_compile); then |
227 |
case "`/usr/bin/file conftest.o`" in |
228 |
*32-bit*) |
229 |
LD="${LD-ld} -32" |
230 |
;; |
231 |
*N32*) |
232 |
LD="${LD-ld} -n32" |
233 |
;; |
234 |
*64-bit*) |
235 |
LD="${LD-ld} -64" |
236 |
;; |
237 |
esac |
238 |
fi |
239 |
rm -rf conftest* |
240 |
;; |
241 |
|
242 |
*-*-sco3.2v5*) |
243 |
# On SCO OpenServer 5, we need -belf to get full-featured binaries. |
244 |
CFLAGS="$CFLAGS -belf" |
245 |
;; |
246 |
esac |
247 |
|
248 |
# Actually configure libtool. ac_aux_dir is where install-sh is found. |
249 |
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ |
250 |
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ |
251 |
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ |
252 |
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ |
253 |
|| AC_MSG_ERROR([libtool configure failed]) |
254 |
]) |
255 |
|
256 |
# AM_ENABLE_SHARED - implement the --enable-shared flag |
257 |
# Usage: AM_ENABLE_SHARED[(DEFAULT)] |
258 |
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
259 |
# `yes'. |
260 |
AC_DEFUN([AM_ENABLE_SHARED], |
261 |
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl |
262 |
AC_ARG_ENABLE(shared, |
263 |
changequote(<<, >>)dnl |
264 |
<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT] |
265 |
changequote([, ])dnl |
266 |
[ --enable-shared=PKGS only build shared libraries if the current package |
267 |
appears as an element in the PKGS list], |
268 |
[p=${PACKAGE-default} |
269 |
case "$enableval" in |
270 |
yes) enable_shared=yes ;; |
271 |
no) enable_shared=no ;; |
272 |
*) |
273 |
enable_shared=no |
274 |
# Look at the argument we got. We use all the common list separators. |
275 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
276 |
for pkg in $enableval; do |
277 |
if test "X$pkg" = "X$p"; then |
278 |
enable_shared=yes |
279 |
fi |
280 |
done |
281 |
IFS="$ac_save_ifs" |
282 |
;; |
283 |
esac], |
284 |
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl |
285 |
]) |
286 |
|
287 |
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared |
288 |
AC_DEFUN([AM_DISABLE_SHARED], |
289 |
[AM_ENABLE_SHARED(no)]) |
290 |
|
291 |
# AM_DISABLE_STATIC - set the default static flag to --disable-static |
292 |
AC_DEFUN([AM_DISABLE_STATIC], |
293 |
[AM_ENABLE_STATIC(no)]) |
294 |
|
295 |
# AM_ENABLE_STATIC - implement the --enable-static flag |
296 |
# Usage: AM_ENABLE_STATIC[(DEFAULT)] |
297 |
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
298 |
# `yes'. |
299 |
AC_DEFUN([AM_ENABLE_STATIC], |
300 |
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl |
301 |
AC_ARG_ENABLE(static, |
302 |
changequote(<<, >>)dnl |
303 |
<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT] |
304 |
changequote([, ])dnl |
305 |
[ --enable-static=PKGS only build shared libraries if the current package |
306 |
appears as an element in the PKGS list], |
307 |
[p=${PACKAGE-default} |
308 |
case "$enableval" in |
309 |
yes) enable_static=yes ;; |
310 |
no) enable_static=no ;; |
311 |
*) |
312 |
enable_static=no |
313 |
# Look at the argument we got. We use all the common list separators. |
314 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
315 |
for pkg in $enableval; do |
316 |
if test "X$pkg" = "X$p"; then |
317 |
enable_static=yes |
318 |
fi |
319 |
done |
320 |
IFS="$ac_save_ifs" |
321 |
;; |
322 |
esac], |
323 |
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl |
324 |
]) |
325 |
|
326 |
|
327 |
# AM_PROG_LD - find the path to the GNU or non-GNU linker |
328 |
AC_DEFUN([AM_PROG_LD], |
329 |
[AC_ARG_WITH(gnu-ld, |
330 |
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
331 |
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
332 |
AC_REQUIRE([AC_PROG_CC]) |
333 |
ac_prog=ld |
334 |
if test "$ac_cv_prog_gcc" = yes; then |
335 |
# Check if gcc -print-prog-name=ld gives a path. |
336 |
AC_MSG_CHECKING([for ld used by GCC]) |
337 |
ac_prog=`($CC -print-prog-name=ld) 2>&5` |
338 |
case "$ac_prog" in |
339 |
# Accept absolute paths. |
340 |
/* | [A-Za-z]:\\*) |
341 |
test -z "$LD" && LD="$ac_prog" |
342 |
;; |
343 |
"") |
344 |
# If it fails, then pretend we aren't using GCC. |
345 |
ac_prog=ld |
346 |
;; |
347 |
*) |
348 |
# If it is relative, then search for the first ld in PATH. |
349 |
with_gnu_ld=unknown |
350 |
;; |
351 |
esac |
352 |
elif test "$with_gnu_ld" = yes; then |
353 |
AC_MSG_CHECKING([for GNU ld]) |
354 |
else |
355 |
AC_MSG_CHECKING([for non-GNU ld]) |
356 |
fi |
357 |
AC_CACHE_VAL(ac_cv_path_LD, |
358 |
[if test -z "$LD"; then |
359 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
360 |
for ac_dir in $PATH; do |
361 |
test -z "$ac_dir" && ac_dir=. |
362 |
if test -f "$ac_dir/$ac_prog"; then |
363 |
ac_cv_path_LD="$ac_dir/$ac_prog" |
364 |
# Check to see if the program is GNU ld. I'd rather use --version, |
365 |
# but apparently some GNU ld's only accept -v. |
366 |
# Break only if it was the GNU/non-GNU ld that we prefer. |
367 |
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
368 |
test "$with_gnu_ld" != no && break |
369 |
else |
370 |
test "$with_gnu_ld" != yes && break |
371 |
fi |
372 |
fi |
373 |
done |
374 |
IFS="$ac_save_ifs" |
375 |
else |
376 |
ac_cv_path_LD="$LD" # Let the user override the test with a path. |
377 |
fi]) |
378 |
LD="$ac_cv_path_LD" |
379 |
if test -n "$LD"; then |
380 |
AC_MSG_RESULT($LD) |
381 |
else |
382 |
AC_MSG_RESULT(no) |
383 |
fi |
384 |
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
385 |
AC_SUBST(LD) |
386 |
AM_PROG_LD_GNU |
387 |
]) |
388 |
|
389 |
AC_DEFUN([AM_PROG_LD_GNU], |
390 |
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, |
391 |
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
392 |
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then |
393 |
ac_cv_prog_gnu_ld=yes |
394 |
else |
395 |
ac_cv_prog_gnu_ld=no |
396 |
fi]) |
397 |
]) |
398 |
|
399 |
# AM_PROG_NM - find the path to a BSD-compatible name lister |
400 |
AC_DEFUN([AM_PROG_NM], |
401 |
[AC_MSG_CHECKING([for BSD-compatible nm]) |
402 |
AC_CACHE_VAL(ac_cv_path_NM, |
403 |
[case "$NM" in |
404 |
/* | [A-Za-z]:\\*) |
405 |
ac_cv_path_NM="$NM" # Let the user override the test with a path. |
406 |
;; |
407 |
*) |
408 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
409 |
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do |
410 |
test -z "$ac_dir" && ac_dir=. |
411 |
if test -f $ac_dir/nm; then |
412 |
# Check to see if the nm accepts a BSD-compat flag. |
413 |
# Adding the `sed 1q' prevents false positives on HP-UX, which says: |
414 |
# nm: unknown option "B" ignored |
415 |
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
416 |
ac_cv_path_NM="$ac_dir/nm -B" |
417 |
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
418 |
ac_cv_path_NM="$ac_dir/nm -p" |
419 |
else |
420 |
ac_cv_path_NM="$ac_dir/nm" |
421 |
fi |
422 |
break |
423 |
fi |
424 |
done |
425 |
IFS="$ac_save_ifs" |
426 |
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm |
427 |
;; |
428 |
esac]) |
429 |
NM="$ac_cv_path_NM" |
430 |
AC_MSG_RESULT([$NM]) |
431 |
AC_SUBST(NM) |
432 |
]) |
188 |
]) |