| 352 |
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. |
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. |
| 353 |
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) |
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) |
| 354 |
|
|
| 355 |
|
# iconv.m4 serial AM4 (gettext-0.11.3) |
| 356 |
|
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. |
| 357 |
|
dnl This file is free software, distributed under the terms of the GNU |
| 358 |
|
dnl General Public License. As a special exception to the GNU General |
| 359 |
|
dnl Public License, this file may be distributed as part of a program |
| 360 |
|
dnl that contains a configuration script generated by Autoconf, under |
| 361 |
|
dnl the same distribution terms as the rest of that program. |
| 362 |
|
|
| 363 |
|
dnl From Bruno Haible. |
| 364 |
|
|
| 365 |
|
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], |
| 366 |
|
[ |
| 367 |
|
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. |
| 368 |
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 369 |
|
AC_REQUIRE([AC_LIB_RPATH]) |
| 370 |
|
|
| 371 |
|
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 372 |
|
dnl accordingly. |
| 373 |
|
AC_LIB_LINKFLAGS_BODY([iconv]) |
| 374 |
|
]) |
| 375 |
|
|
| 376 |
|
AC_DEFUN([AM_ICONV_LINK], |
| 377 |
|
[ |
| 378 |
|
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
| 379 |
|
dnl those with the standalone portable GNU libiconv installed). |
| 380 |
|
|
| 381 |
|
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 382 |
|
dnl accordingly. |
| 383 |
|
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
| 384 |
|
|
| 385 |
|
dnl Add $INCICONV to CPPFLAGS before performing the following checks, |
| 386 |
|
dnl because if the user has installed libiconv and not disabled its use |
| 387 |
|
dnl via --without-libiconv-prefix, he wants to use it. The first |
| 388 |
|
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. |
| 389 |
|
am_save_CPPFLAGS="$CPPFLAGS" |
| 390 |
|
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) |
| 391 |
|
|
| 392 |
|
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ |
| 393 |
|
am_cv_func_iconv="no, consider installing GNU libiconv" |
| 394 |
|
am_cv_lib_iconv=no |
| 395 |
|
AC_TRY_LINK([#include <stdlib.h> |
| 396 |
|
#include <iconv.h>], |
| 397 |
|
[iconv_t cd = iconv_open("",""); |
| 398 |
|
iconv(cd,NULL,NULL,NULL,NULL); |
| 399 |
|
iconv_close(cd);], |
| 400 |
|
am_cv_func_iconv=yes) |
| 401 |
|
if test "$am_cv_func_iconv" != yes; then |
| 402 |
|
am_save_LIBS="$LIBS" |
| 403 |
|
LIBS="$LIBS $LIBICONV" |
| 404 |
|
AC_TRY_LINK([#include <stdlib.h> |
| 405 |
|
#include <iconv.h>], |
| 406 |
|
[iconv_t cd = iconv_open("",""); |
| 407 |
|
iconv(cd,NULL,NULL,NULL,NULL); |
| 408 |
|
iconv_close(cd);], |
| 409 |
|
am_cv_lib_iconv=yes |
| 410 |
|
am_cv_func_iconv=yes) |
| 411 |
|
LIBS="$am_save_LIBS" |
| 412 |
|
fi |
| 413 |
|
]) |
| 414 |
|
if test "$am_cv_func_iconv" = yes; then |
| 415 |
|
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) |
| 416 |
|
fi |
| 417 |
|
if test "$am_cv_lib_iconv" = yes; then |
| 418 |
|
AC_MSG_CHECKING([how to link with libiconv]) |
| 419 |
|
AC_MSG_RESULT([$LIBICONV]) |
| 420 |
|
else |
| 421 |
|
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV |
| 422 |
|
dnl either. |
| 423 |
|
CPPFLAGS="$am_save_CPPFLAGS" |
| 424 |
|
LIBICONV= |
| 425 |
|
LTLIBICONV= |
| 426 |
|
fi |
| 427 |
|
AC_SUBST(LIBICONV) |
| 428 |
|
AC_SUBST(LTLIBICONV) |
| 429 |
|
]) |
| 430 |
|
|
| 431 |
|
AC_DEFUN([AM_ICONV], |
| 432 |
|
[ |
| 433 |
|
AM_ICONV_LINK |
| 434 |
|
if test "$am_cv_func_iconv" = yes; then |
| 435 |
|
AC_MSG_CHECKING([for iconv declaration]) |
| 436 |
|
AC_CACHE_VAL(am_cv_proto_iconv, [ |
| 437 |
|
AC_TRY_COMPILE([ |
| 438 |
|
#include <stdlib.h> |
| 439 |
|
#include <iconv.h> |
| 440 |
|
extern |
| 441 |
|
#ifdef __cplusplus |
| 442 |
|
"C" |
| 443 |
|
#endif |
| 444 |
|
#if defined(__STDC__) || defined(__cplusplus) |
| 445 |
|
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
| 446 |
|
#else |
| 447 |
|
size_t iconv(); |
| 448 |
|
#endif |
| 449 |
|
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") |
| 450 |
|
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) |
| 451 |
|
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
| 452 |
|
AC_MSG_RESULT([$]{ac_t:- |
| 453 |
|
}[$]am_cv_proto_iconv) |
| 454 |
|
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, |
| 455 |
|
[Define as const if the declaration of iconv() needs const.]) |
| 456 |
|
fi |
| 457 |
|
]) |
| 458 |
|
|
| 459 |
# Do all the work for Automake. -*- Autoconf -*- |
# Do all the work for Automake. -*- Autoconf -*- |
| 460 |
|
|
| 461 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
| 605 |
rmdir .tst 2>/dev/null |
rmdir .tst 2>/dev/null |
| 606 |
AC_SUBST([am__leading_dot])]) |
AC_SUBST([am__leading_dot])]) |
| 607 |
|
|
| 608 |
|
# lib-ld.m4 serial 2 (gettext-0.12) |
| 609 |
|
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. |
| 610 |
|
dnl This file is free software, distributed under the terms of the GNU |
| 611 |
|
dnl General Public License. As a special exception to the GNU General |
| 612 |
|
dnl Public License, this file may be distributed as part of a program |
| 613 |
|
dnl that contains a configuration script generated by Autoconf, under |
| 614 |
|
dnl the same distribution terms as the rest of that program. |
| 615 |
|
|
| 616 |
|
dnl Subroutines of libtool.m4, |
| 617 |
|
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision |
| 618 |
|
dnl with libtool.m4. |
| 619 |
|
|
| 620 |
|
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. |
| 621 |
|
AC_DEFUN([AC_LIB_PROG_LD_GNU], |
| 622 |
|
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, |
| 623 |
|
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
| 624 |
|
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then |
| 625 |
|
acl_cv_prog_gnu_ld=yes |
| 626 |
|
else |
| 627 |
|
acl_cv_prog_gnu_ld=no |
| 628 |
|
fi]) |
| 629 |
|
with_gnu_ld=$acl_cv_prog_gnu_ld |
| 630 |
|
]) |
| 631 |
|
|
| 632 |
|
dnl From libtool-1.4. Sets the variable LD. |
| 633 |
|
AC_DEFUN([AC_LIB_PROG_LD], |
| 634 |
|
[AC_ARG_WITH(gnu-ld, |
| 635 |
|
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
| 636 |
|
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
| 637 |
|
AC_REQUIRE([AC_PROG_CC])dnl |
| 638 |
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 639 |
|
# Prepare PATH_SEPARATOR. |
| 640 |
|
# The user is always right. |
| 641 |
|
if test "${PATH_SEPARATOR+set}" != set; then |
| 642 |
|
echo "#! /bin/sh" >conf$$.sh |
| 643 |
|
echo "exit 0" >>conf$$.sh |
| 644 |
|
chmod +x conf$$.sh |
| 645 |
|
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then |
| 646 |
|
PATH_SEPARATOR=';' |
| 647 |
|
else |
| 648 |
|
PATH_SEPARATOR=: |
| 649 |
|
fi |
| 650 |
|
rm -f conf$$.sh |
| 651 |
|
fi |
| 652 |
|
ac_prog=ld |
| 653 |
|
if test "$GCC" = yes; then |
| 654 |
|
# Check if gcc -print-prog-name=ld gives a path. |
| 655 |
|
AC_MSG_CHECKING([for ld used by GCC]) |
| 656 |
|
case $host in |
| 657 |
|
*-*-mingw*) |
| 658 |
|
# gcc leaves a trailing carriage return which upsets mingw |
| 659 |
|
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
| 660 |
|
*) |
| 661 |
|
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
| 662 |
|
esac |
| 663 |
|
case $ac_prog in |
| 664 |
|
# Accept absolute paths. |
| 665 |
|
[[\\/]* | [A-Za-z]:[\\/]*)] |
| 666 |
|
[re_direlt='/[^/][^/]*/\.\./'] |
| 667 |
|
# Canonicalize the path of ld |
| 668 |
|
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
| 669 |
|
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
| 670 |
|
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
| 671 |
|
done |
| 672 |
|
test -z "$LD" && LD="$ac_prog" |
| 673 |
|
;; |
| 674 |
|
"") |
| 675 |
|
# If it fails, then pretend we aren't using GCC. |
| 676 |
|
ac_prog=ld |
| 677 |
|
;; |
| 678 |
|
*) |
| 679 |
|
# If it is relative, then search for the first ld in PATH. |
| 680 |
|
with_gnu_ld=unknown |
| 681 |
|
;; |
| 682 |
|
esac |
| 683 |
|
elif test "$with_gnu_ld" = yes; then |
| 684 |
|
AC_MSG_CHECKING([for GNU ld]) |
| 685 |
|
else |
| 686 |
|
AC_MSG_CHECKING([for non-GNU ld]) |
| 687 |
|
fi |
| 688 |
|
AC_CACHE_VAL(acl_cv_path_LD, |
| 689 |
|
[if test -z "$LD"; then |
| 690 |
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
| 691 |
|
for ac_dir in $PATH; do |
| 692 |
|
test -z "$ac_dir" && ac_dir=. |
| 693 |
|
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
| 694 |
|
acl_cv_path_LD="$ac_dir/$ac_prog" |
| 695 |
|
# Check to see if the program is GNU ld. I'd rather use --version, |
| 696 |
|
# but apparently some GNU ld's only accept -v. |
| 697 |
|
# Break only if it was the GNU/non-GNU ld that we prefer. |
| 698 |
|
if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
| 699 |
|
test "$with_gnu_ld" != no && break |
| 700 |
|
else |
| 701 |
|
test "$with_gnu_ld" != yes && break |
| 702 |
|
fi |
| 703 |
|
fi |
| 704 |
|
done |
| 705 |
|
IFS="$ac_save_ifs" |
| 706 |
|
else |
| 707 |
|
acl_cv_path_LD="$LD" # Let the user override the test with a path. |
| 708 |
|
fi]) |
| 709 |
|
LD="$acl_cv_path_LD" |
| 710 |
|
if test -n "$LD"; then |
| 711 |
|
AC_MSG_RESULT($LD) |
| 712 |
|
else |
| 713 |
|
AC_MSG_RESULT(no) |
| 714 |
|
fi |
| 715 |
|
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
| 716 |
|
AC_LIB_PROG_LD_GNU |
| 717 |
|
]) |
| 718 |
|
|
| 719 |
|
# lib-link.m4 serial 4 (gettext-0.12) |
| 720 |
|
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. |
| 721 |
|
dnl This file is free software, distributed under the terms of the GNU |
| 722 |
|
dnl General Public License. As a special exception to the GNU General |
| 723 |
|
dnl Public License, this file may be distributed as part of a program |
| 724 |
|
dnl that contains a configuration script generated by Autoconf, under |
| 725 |
|
dnl the same distribution terms as the rest of that program. |
| 726 |
|
|
| 727 |
|
dnl From Bruno Haible. |
| 728 |
|
|
| 729 |
|
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and |
| 730 |
|
dnl the libraries corresponding to explicit and implicit dependencies. |
| 731 |
|
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and |
| 732 |
|
dnl augments the CPPFLAGS variable. |
| 733 |
|
AC_DEFUN([AC_LIB_LINKFLAGS], |
| 734 |
|
[ |
| 735 |
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 736 |
|
AC_REQUIRE([AC_LIB_RPATH]) |
| 737 |
|
define([Name],[translit([$1],[./-], [___])]) |
| 738 |
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 739 |
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 740 |
|
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
| 741 |
|
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 742 |
|
ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
| 743 |
|
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
| 744 |
|
ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
| 745 |
|
]) |
| 746 |
|
LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
| 747 |
|
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
| 748 |
|
INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
| 749 |
|
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 750 |
|
AC_SUBST([LIB]NAME) |
| 751 |
|
AC_SUBST([LTLIB]NAME) |
| 752 |
|
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the |
| 753 |
|
dnl results of this search when this library appears as a dependency. |
| 754 |
|
HAVE_LIB[]NAME=yes |
| 755 |
|
undefine([Name]) |
| 756 |
|
undefine([NAME]) |
| 757 |
|
]) |
| 758 |
|
|
| 759 |
|
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) |
| 760 |
|
dnl searches for libname and the libraries corresponding to explicit and |
| 761 |
|
dnl implicit dependencies, together with the specified include files and |
| 762 |
|
dnl the ability to compile and link the specified testcode. If found, it |
| 763 |
|
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and |
| 764 |
|
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and |
| 765 |
|
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs |
| 766 |
|
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. |
| 767 |
|
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
| 768 |
|
[ |
| 769 |
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 770 |
|
AC_REQUIRE([AC_LIB_RPATH]) |
| 771 |
|
define([Name],[translit([$1],[./-], [___])]) |
| 772 |
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 773 |
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 774 |
|
|
| 775 |
|
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME |
| 776 |
|
dnl accordingly. |
| 777 |
|
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 778 |
|
|
| 779 |
|
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, |
| 780 |
|
dnl because if the user has installed lib[]Name and not disabled its use |
| 781 |
|
dnl via --without-lib[]Name-prefix, he wants to use it. |
| 782 |
|
ac_save_CPPFLAGS="$CPPFLAGS" |
| 783 |
|
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 784 |
|
|
| 785 |
|
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
| 786 |
|
ac_save_LIBS="$LIBS" |
| 787 |
|
LIBS="$LIBS $LIB[]NAME" |
| 788 |
|
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
| 789 |
|
LIBS="$ac_save_LIBS" |
| 790 |
|
]) |
| 791 |
|
if test "$ac_cv_lib[]Name" = yes; then |
| 792 |
|
HAVE_LIB[]NAME=yes |
| 793 |
|
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
| 794 |
|
AC_MSG_CHECKING([how to link with lib[]$1]) |
| 795 |
|
AC_MSG_RESULT([$LIB[]NAME]) |
| 796 |
|
else |
| 797 |
|
HAVE_LIB[]NAME=no |
| 798 |
|
dnl If $LIB[]NAME didn't lead to a usable library, we don't need |
| 799 |
|
dnl $INC[]NAME either. |
| 800 |
|
CPPFLAGS="$ac_save_CPPFLAGS" |
| 801 |
|
LIB[]NAME= |
| 802 |
|
LTLIB[]NAME= |
| 803 |
|
fi |
| 804 |
|
AC_SUBST([HAVE_LIB]NAME) |
| 805 |
|
AC_SUBST([LIB]NAME) |
| 806 |
|
AC_SUBST([LTLIB]NAME) |
| 807 |
|
undefine([Name]) |
| 808 |
|
undefine([NAME]) |
| 809 |
|
]) |
| 810 |
|
|
| 811 |
|
dnl Determine the platform dependent parameters needed to use rpath: |
| 812 |
|
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, |
| 813 |
|
dnl hardcode_direct, hardcode_minus_L. |
| 814 |
|
AC_DEFUN([AC_LIB_RPATH], |
| 815 |
|
[ |
| 816 |
|
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS |
| 817 |
|
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld |
| 818 |
|
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host |
| 819 |
|
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir |
| 820 |
|
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
| 821 |
|
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
| 822 |
|
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
| 823 |
|
. ./conftest.sh |
| 824 |
|
rm -f ./conftest.sh |
| 825 |
|
acl_cv_rpath=done |
| 826 |
|
]) |
| 827 |
|
wl="$acl_cv_wl" |
| 828 |
|
libext="$acl_cv_libext" |
| 829 |
|
shlibext="$acl_cv_shlibext" |
| 830 |
|
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
| 831 |
|
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
| 832 |
|
hardcode_direct="$acl_cv_hardcode_direct" |
| 833 |
|
hardcode_minus_L="$acl_cv_hardcode_minus_L" |
| 834 |
|
dnl Determine whether the user wants rpath handling at all. |
| 835 |
|
AC_ARG_ENABLE(rpath, |
| 836 |
|
[ --disable-rpath do not hardcode runtime library paths], |
| 837 |
|
:, enable_rpath=yes) |
| 838 |
|
]) |
| 839 |
|
|
| 840 |
|
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and |
| 841 |
|
dnl the libraries corresponding to explicit and implicit dependencies. |
| 842 |
|
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. |
| 843 |
|
AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
| 844 |
|
[ |
| 845 |
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 846 |
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 847 |
|
dnl By default, look in $includedir and $libdir. |
| 848 |
|
use_additional=yes |
| 849 |
|
AC_LIB_WITH_FINAL_PREFIX([ |
| 850 |
|
eval additional_includedir=\"$includedir\" |
| 851 |
|
eval additional_libdir=\"$libdir\" |
| 852 |
|
]) |
| 853 |
|
AC_LIB_ARG_WITH([lib$1-prefix], |
| 854 |
|
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
| 855 |
|
--without-lib$1-prefix don't search for lib$1 in includedir and libdir], |
| 856 |
|
[ |
| 857 |
|
if test "X$withval" = "Xno"; then |
| 858 |
|
use_additional=no |
| 859 |
|
else |
| 860 |
|
if test "X$withval" = "X"; then |
| 861 |
|
AC_LIB_WITH_FINAL_PREFIX([ |
| 862 |
|
eval additional_includedir=\"$includedir\" |
| 863 |
|
eval additional_libdir=\"$libdir\" |
| 864 |
|
]) |
| 865 |
|
else |
| 866 |
|
additional_includedir="$withval/include" |
| 867 |
|
additional_libdir="$withval/lib" |
| 868 |
|
fi |
| 869 |
|
fi |
| 870 |
|
]) |
| 871 |
|
dnl Search the library and its dependencies in $additional_libdir and |
| 872 |
|
dnl $LDFLAGS. Using breadth-first-seach. |
| 873 |
|
LIB[]NAME= |
| 874 |
|
LTLIB[]NAME= |
| 875 |
|
INC[]NAME= |
| 876 |
|
rpathdirs= |
| 877 |
|
ltrpathdirs= |
| 878 |
|
names_already_handled= |
| 879 |
|
names_next_round='$1 $2' |
| 880 |
|
while test -n "$names_next_round"; do |
| 881 |
|
names_this_round="$names_next_round" |
| 882 |
|
names_next_round= |
| 883 |
|
for name in $names_this_round; do |
| 884 |
|
already_handled= |
| 885 |
|
for n in $names_already_handled; do |
| 886 |
|
if test "$n" = "$name"; then |
| 887 |
|
already_handled=yes |
| 888 |
|
break |
| 889 |
|
fi |
| 890 |
|
done |
| 891 |
|
if test -z "$already_handled"; then |
| 892 |
|
names_already_handled="$names_already_handled $name" |
| 893 |
|
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
| 894 |
|
dnl or AC_LIB_HAVE_LINKFLAGS call. |
| 895 |
|
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
| 896 |
|
eval value=\"\$HAVE_LIB$uppername\" |
| 897 |
|
if test -n "$value"; then |
| 898 |
|
if test "$value" = yes; then |
| 899 |
|
eval value=\"\$LIB$uppername\" |
| 900 |
|
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
| 901 |
|
eval value=\"\$LTLIB$uppername\" |
| 902 |
|
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
| 903 |
|
else |
| 904 |
|
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined |
| 905 |
|
dnl that this library doesn't exist. So just drop it. |
| 906 |
|
: |
| 907 |
|
fi |
| 908 |
|
else |
| 909 |
|
dnl Search the library lib$name in $additional_libdir and $LDFLAGS |
| 910 |
|
dnl and the already constructed $LIBNAME/$LTLIBNAME. |
| 911 |
|
found_dir= |
| 912 |
|
found_la= |
| 913 |
|
found_so= |
| 914 |
|
found_a= |
| 915 |
|
if test $use_additional = yes; then |
| 916 |
|
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then |
| 917 |
|
found_dir="$additional_libdir" |
| 918 |
|
found_so="$additional_libdir/lib$name.$shlibext" |
| 919 |
|
if test -f "$additional_libdir/lib$name.la"; then |
| 920 |
|
found_la="$additional_libdir/lib$name.la" |
| 921 |
|
fi |
| 922 |
|
else |
| 923 |
|
if test -f "$additional_libdir/lib$name.$libext"; then |
| 924 |
|
found_dir="$additional_libdir" |
| 925 |
|
found_a="$additional_libdir/lib$name.$libext" |
| 926 |
|
if test -f "$additional_libdir/lib$name.la"; then |
| 927 |
|
found_la="$additional_libdir/lib$name.la" |
| 928 |
|
fi |
| 929 |
|
fi |
| 930 |
|
fi |
| 931 |
|
fi |
| 932 |
|
if test "X$found_dir" = "X"; then |
| 933 |
|
for x in $LDFLAGS $LTLIB[]NAME; do |
| 934 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 935 |
|
case "$x" in |
| 936 |
|
-L*) |
| 937 |
|
dir=`echo "X$x" | sed -e 's/^X-L//'` |
| 938 |
|
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then |
| 939 |
|
found_dir="$dir" |
| 940 |
|
found_so="$dir/lib$name.$shlibext" |
| 941 |
|
if test -f "$dir/lib$name.la"; then |
| 942 |
|
found_la="$dir/lib$name.la" |
| 943 |
|
fi |
| 944 |
|
else |
| 945 |
|
if test -f "$dir/lib$name.$libext"; then |
| 946 |
|
found_dir="$dir" |
| 947 |
|
found_a="$dir/lib$name.$libext" |
| 948 |
|
if test -f "$dir/lib$name.la"; then |
| 949 |
|
found_la="$dir/lib$name.la" |
| 950 |
|
fi |
| 951 |
|
fi |
| 952 |
|
fi |
| 953 |
|
;; |
| 954 |
|
esac |
| 955 |
|
if test "X$found_dir" != "X"; then |
| 956 |
|
break |
| 957 |
|
fi |
| 958 |
|
done |
| 959 |
|
fi |
| 960 |
|
if test "X$found_dir" != "X"; then |
| 961 |
|
dnl Found the library. |
| 962 |
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
| 963 |
|
if test "X$found_so" != "X"; then |
| 964 |
|
dnl Linking with a shared library. We attempt to hardcode its |
| 965 |
|
dnl directory into the executable's runpath, unless it's the |
| 966 |
|
dnl standard /usr/lib. |
| 967 |
|
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then |
| 968 |
|
dnl No hardcoding is needed. |
| 969 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 970 |
|
else |
| 971 |
|
dnl Use an explicit option to hardcode DIR into the resulting |
| 972 |
|
dnl binary. |
| 973 |
|
dnl Potentially add DIR to ltrpathdirs. |
| 974 |
|
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 975 |
|
haveit= |
| 976 |
|
for x in $ltrpathdirs; do |
| 977 |
|
if test "X$x" = "X$found_dir"; then |
| 978 |
|
haveit=yes |
| 979 |
|
break |
| 980 |
|
fi |
| 981 |
|
done |
| 982 |
|
if test -z "$haveit"; then |
| 983 |
|
ltrpathdirs="$ltrpathdirs $found_dir" |
| 984 |
|
fi |
| 985 |
|
dnl The hardcoding into $LIBNAME is system dependent. |
| 986 |
|
if test "$hardcode_direct" = yes; then |
| 987 |
|
dnl Using DIR/libNAME.so during linking hardcodes DIR into the |
| 988 |
|
dnl resulting binary. |
| 989 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 990 |
|
else |
| 991 |
|
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then |
| 992 |
|
dnl Use an explicit option to hardcode DIR into the resulting |
| 993 |
|
dnl binary. |
| 994 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 995 |
|
dnl Potentially add DIR to rpathdirs. |
| 996 |
|
dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 997 |
|
haveit= |
| 998 |
|
for x in $rpathdirs; do |
| 999 |
|
if test "X$x" = "X$found_dir"; then |
| 1000 |
|
haveit=yes |
| 1001 |
|
break |
| 1002 |
|
fi |
| 1003 |
|
done |
| 1004 |
|
if test -z "$haveit"; then |
| 1005 |
|
rpathdirs="$rpathdirs $found_dir" |
| 1006 |
|
fi |
| 1007 |
|
else |
| 1008 |
|
dnl Rely on "-L$found_dir". |
| 1009 |
|
dnl But don't add it if it's already contained in the LDFLAGS |
| 1010 |
|
dnl or the already constructed $LIBNAME |
| 1011 |
|
haveit= |
| 1012 |
|
for x in $LDFLAGS $LIB[]NAME; do |
| 1013 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1014 |
|
if test "X$x" = "X-L$found_dir"; then |
| 1015 |
|
haveit=yes |
| 1016 |
|
break |
| 1017 |
|
fi |
| 1018 |
|
done |
| 1019 |
|
if test -z "$haveit"; then |
| 1020 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
| 1021 |
|
fi |
| 1022 |
|
if test "$hardcode_minus_L" != no; then |
| 1023 |
|
dnl FIXME: Not sure whether we should use |
| 1024 |
|
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1025 |
|
dnl here. |
| 1026 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1027 |
|
else |
| 1028 |
|
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH |
| 1029 |
|
dnl here, because this doesn't fit in flags passed to the |
| 1030 |
|
dnl compiler. So give up. No hardcoding. This affects only |
| 1031 |
|
dnl very old systems. |
| 1032 |
|
dnl FIXME: Not sure whether we should use |
| 1033 |
|
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1034 |
|
dnl here. |
| 1035 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1036 |
|
fi |
| 1037 |
|
fi |
| 1038 |
|
fi |
| 1039 |
|
fi |
| 1040 |
|
else |
| 1041 |
|
if test "X$found_a" != "X"; then |
| 1042 |
|
dnl Linking with a static library. |
| 1043 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
| 1044 |
|
else |
| 1045 |
|
dnl We shouldn't come here, but anyway it's good to have a |
| 1046 |
|
dnl fallback. |
| 1047 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
| 1048 |
|
fi |
| 1049 |
|
fi |
| 1050 |
|
dnl Assume the include files are nearby. |
| 1051 |
|
additional_includedir= |
| 1052 |
|
case "$found_dir" in |
| 1053 |
|
*/lib | */lib/) |
| 1054 |
|
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` |
| 1055 |
|
additional_includedir="$basedir/include" |
| 1056 |
|
;; |
| 1057 |
|
esac |
| 1058 |
|
if test "X$additional_includedir" != "X"; then |
| 1059 |
|
dnl Potentially add $additional_includedir to $INCNAME. |
| 1060 |
|
dnl But don't add it |
| 1061 |
|
dnl 1. if it's the standard /usr/include, |
| 1062 |
|
dnl 2. if it's /usr/local/include and we are using GCC on Linux, |
| 1063 |
|
dnl 3. if it's already present in $CPPFLAGS or the already |
| 1064 |
|
dnl constructed $INCNAME, |
| 1065 |
|
dnl 4. if it doesn't exist as a directory. |
| 1066 |
|
if test "X$additional_includedir" != "X/usr/include"; then |
| 1067 |
|
haveit= |
| 1068 |
|
if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1069 |
|
if test -n "$GCC"; then |
| 1070 |
|
case $host_os in |
| 1071 |
|
linux*) haveit=yes;; |
| 1072 |
|
esac |
| 1073 |
|
fi |
| 1074 |
|
fi |
| 1075 |
|
if test -z "$haveit"; then |
| 1076 |
|
for x in $CPPFLAGS $INC[]NAME; do |
| 1077 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1078 |
|
if test "X$x" = "X-I$additional_includedir"; then |
| 1079 |
|
haveit=yes |
| 1080 |
|
break |
| 1081 |
|
fi |
| 1082 |
|
done |
| 1083 |
|
if test -z "$haveit"; then |
| 1084 |
|
if test -d "$additional_includedir"; then |
| 1085 |
|
dnl Really add $additional_includedir to $INCNAME. |
| 1086 |
|
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
| 1087 |
|
fi |
| 1088 |
|
fi |
| 1089 |
|
fi |
| 1090 |
|
fi |
| 1091 |
|
fi |
| 1092 |
|
dnl Look for dependencies. |
| 1093 |
|
if test -n "$found_la"; then |
| 1094 |
|
dnl Read the .la file. It defines the variables |
| 1095 |
|
dnl dlname, library_names, old_library, dependency_libs, current, |
| 1096 |
|
dnl age, revision, installed, dlopen, dlpreopen, libdir. |
| 1097 |
|
save_libdir="$libdir" |
| 1098 |
|
case "$found_la" in |
| 1099 |
|
*/* | *\\*) . "$found_la" ;; |
| 1100 |
|
*) . "./$found_la" ;; |
| 1101 |
|
esac |
| 1102 |
|
libdir="$save_libdir" |
| 1103 |
|
dnl We use only dependency_libs. |
| 1104 |
|
for dep in $dependency_libs; do |
| 1105 |
|
case "$dep" in |
| 1106 |
|
-L*) |
| 1107 |
|
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
| 1108 |
|
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. |
| 1109 |
|
dnl But don't add it |
| 1110 |
|
dnl 1. if it's the standard /usr/lib, |
| 1111 |
|
dnl 2. if it's /usr/local/lib and we are using GCC on Linux, |
| 1112 |
|
dnl 3. if it's already present in $LDFLAGS or the already |
| 1113 |
|
dnl constructed $LIBNAME, |
| 1114 |
|
dnl 4. if it doesn't exist as a directory. |
| 1115 |
|
if test "X$additional_libdir" != "X/usr/lib"; then |
| 1116 |
|
haveit= |
| 1117 |
|
if test "X$additional_libdir" = "X/usr/local/lib"; then |
| 1118 |
|
if test -n "$GCC"; then |
| 1119 |
|
case $host_os in |
| 1120 |
|
linux*) haveit=yes;; |
| 1121 |
|
esac |
| 1122 |
|
fi |
| 1123 |
|
fi |
| 1124 |
|
if test -z "$haveit"; then |
| 1125 |
|
haveit= |
| 1126 |
|
for x in $LDFLAGS $LIB[]NAME; do |
| 1127 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1128 |
|
if test "X$x" = "X-L$additional_libdir"; then |
| 1129 |
|
haveit=yes |
| 1130 |
|
break |
| 1131 |
|
fi |
| 1132 |
|
done |
| 1133 |
|
if test -z "$haveit"; then |
| 1134 |
|
if test -d "$additional_libdir"; then |
| 1135 |
|
dnl Really add $additional_libdir to $LIBNAME. |
| 1136 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
| 1137 |
|
fi |
| 1138 |
|
fi |
| 1139 |
|
haveit= |
| 1140 |
|
for x in $LDFLAGS $LTLIB[]NAME; do |
| 1141 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1142 |
|
if test "X$x" = "X-L$additional_libdir"; then |
| 1143 |
|
haveit=yes |
| 1144 |
|
break |
| 1145 |
|
fi |
| 1146 |
|
done |
| 1147 |
|
if test -z "$haveit"; then |
| 1148 |
|
if test -d "$additional_libdir"; then |
| 1149 |
|
dnl Really add $additional_libdir to $LTLIBNAME. |
| 1150 |
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
| 1151 |
|
fi |
| 1152 |
|
fi |
| 1153 |
|
fi |
| 1154 |
|
fi |
| 1155 |
|
;; |
| 1156 |
|
-R*) |
| 1157 |
|
dir=`echo "X$dep" | sed -e 's/^X-R//'` |
| 1158 |
|
if test "$enable_rpath" != no; then |
| 1159 |
|
dnl Potentially add DIR to rpathdirs. |
| 1160 |
|
dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 1161 |
|
haveit= |
| 1162 |
|
for x in $rpathdirs; do |
| 1163 |
|
if test "X$x" = "X$dir"; then |
| 1164 |
|
haveit=yes |
| 1165 |
|
break |
| 1166 |
|
fi |
| 1167 |
|
done |
| 1168 |
|
if test -z "$haveit"; then |
| 1169 |
|
rpathdirs="$rpathdirs $dir" |
| 1170 |
|
fi |
| 1171 |
|
dnl Potentially add DIR to ltrpathdirs. |
| 1172 |
|
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 1173 |
|
haveit= |
| 1174 |
|
for x in $ltrpathdirs; do |
| 1175 |
|
if test "X$x" = "X$dir"; then |
| 1176 |
|
haveit=yes |
| 1177 |
|
break |
| 1178 |
|
fi |
| 1179 |
|
done |
| 1180 |
|
if test -z "$haveit"; then |
| 1181 |
|
ltrpathdirs="$ltrpathdirs $dir" |
| 1182 |
|
fi |
| 1183 |
|
fi |
| 1184 |
|
;; |
| 1185 |
|
-l*) |
| 1186 |
|
dnl Handle this in the next round. |
| 1187 |
|
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
| 1188 |
|
;; |
| 1189 |
|
*.la) |
| 1190 |
|
dnl Handle this in the next round. Throw away the .la's |
| 1191 |
|
dnl directory; it is already contained in a preceding -L |
| 1192 |
|
dnl option. |
| 1193 |
|
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
| 1194 |
|
;; |
| 1195 |
|
*) |
| 1196 |
|
dnl Most likely an immediate library name. |
| 1197 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
| 1198 |
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
| 1199 |
|
;; |
| 1200 |
|
esac |
| 1201 |
|
done |
| 1202 |
|
fi |
| 1203 |
|
else |
| 1204 |
|
dnl Didn't find the library; assume it is in the system directories |
| 1205 |
|
dnl known to the linker and runtime loader. (All the system |
| 1206 |
|
dnl directories known to the linker should also be known to the |
| 1207 |
|
dnl runtime loader, otherwise the system is severely misconfigured.) |
| 1208 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1209 |
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
| 1210 |
|
fi |
| 1211 |
|
fi |
| 1212 |
|
fi |
| 1213 |
|
done |
| 1214 |
|
done |
| 1215 |
|
if test "X$rpathdirs" != "X"; then |
| 1216 |
|
if test -n "$hardcode_libdir_separator"; then |
| 1217 |
|
dnl Weird platform: only the last -rpath option counts, the user must |
| 1218 |
|
dnl pass all path elements in one option. We can arrange that for a |
| 1219 |
|
dnl single library, but not when more than one $LIBNAMEs are used. |
| 1220 |
|
alldirs= |
| 1221 |
|
for found_dir in $rpathdirs; do |
| 1222 |
|
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" |
| 1223 |
|
done |
| 1224 |
|
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. |
| 1225 |
|
acl_save_libdir="$libdir" |
| 1226 |
|
libdir="$alldirs" |
| 1227 |
|
eval flag=\"$hardcode_libdir_flag_spec\" |
| 1228 |
|
libdir="$acl_save_libdir" |
| 1229 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1230 |
|
else |
| 1231 |
|
dnl The -rpath options are cumulative. |
| 1232 |
|
for found_dir in $rpathdirs; do |
| 1233 |
|
acl_save_libdir="$libdir" |
| 1234 |
|
libdir="$found_dir" |
| 1235 |
|
eval flag=\"$hardcode_libdir_flag_spec\" |
| 1236 |
|
libdir="$acl_save_libdir" |
| 1237 |
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1238 |
|
done |
| 1239 |
|
fi |
| 1240 |
|
fi |
| 1241 |
|
if test "X$ltrpathdirs" != "X"; then |
| 1242 |
|
dnl When using libtool, the option that works for both libraries and |
| 1243 |
|
dnl executables is -R. The -R options are cumulative. |
| 1244 |
|
for found_dir in $ltrpathdirs; do |
| 1245 |
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
| 1246 |
|
done |
| 1247 |
|
fi |
| 1248 |
|
]) |
| 1249 |
|
|
| 1250 |
|
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, |
| 1251 |
|
dnl unless already present in VAR. |
| 1252 |
|
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes |
| 1253 |
|
dnl contains two or three consecutive elements that belong together. |
| 1254 |
|
AC_DEFUN([AC_LIB_APPENDTOVAR], |
| 1255 |
|
[ |
| 1256 |
|
for element in [$2]; do |
| 1257 |
|
haveit= |
| 1258 |
|
for x in $[$1]; do |
| 1259 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1260 |
|
if test "X$x" = "X$element"; then |
| 1261 |
|
haveit=yes |
| 1262 |
|
break |
| 1263 |
|
fi |
| 1264 |
|
done |
| 1265 |
|
if test -z "$haveit"; then |
| 1266 |
|
[$1]="${[$1]}${[$1]:+ }$element" |
| 1267 |
|
fi |
| 1268 |
|
done |
| 1269 |
|
]) |
| 1270 |
|
|
| 1271 |
|
# lib-prefix.m4 serial 2 (gettext-0.12) |
| 1272 |
|
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. |
| 1273 |
|
dnl This file is free software, distributed under the terms of the GNU |
| 1274 |
|
dnl General Public License. As a special exception to the GNU General |
| 1275 |
|
dnl Public License, this file may be distributed as part of a program |
| 1276 |
|
dnl that contains a configuration script generated by Autoconf, under |
| 1277 |
|
dnl the same distribution terms as the rest of that program. |
| 1278 |
|
|
| 1279 |
|
dnl From Bruno Haible. |
| 1280 |
|
|
| 1281 |
|
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and |
| 1282 |
|
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't |
| 1283 |
|
dnl require excessive bracketing. |
| 1284 |
|
ifdef([AC_HELP_STRING], |
| 1285 |
|
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], |
| 1286 |
|
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) |
| 1287 |
|
|
| 1288 |
|
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed |
| 1289 |
|
dnl to access previously installed libraries. The basic assumption is that |
| 1290 |
|
dnl a user will want packages to use other packages he previously installed |
| 1291 |
|
dnl with the same --prefix option. |
| 1292 |
|
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate |
| 1293 |
|
dnl libraries, but is otherwise very convenient. |
| 1294 |
|
AC_DEFUN([AC_LIB_PREFIX], |
| 1295 |
|
[ |
| 1296 |
|
AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
| 1297 |
|
AC_REQUIRE([AC_PROG_CC]) |
| 1298 |
|
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 1299 |
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 1300 |
|
dnl By default, look in $includedir and $libdir. |
| 1301 |
|
use_additional=yes |
| 1302 |
|
AC_LIB_WITH_FINAL_PREFIX([ |
| 1303 |
|
eval additional_includedir=\"$includedir\" |
| 1304 |
|
eval additional_libdir=\"$libdir\" |
| 1305 |
|
]) |
| 1306 |
|
AC_LIB_ARG_WITH([lib-prefix], |
| 1307 |
|
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib |
| 1308 |
|
--without-lib-prefix don't search for libraries in includedir and libdir], |
| 1309 |
|
[ |
| 1310 |
|
if test "X$withval" = "Xno"; then |
| 1311 |
|
use_additional=no |
| 1312 |
|
else |
| 1313 |
|
if test "X$withval" = "X"; then |
| 1314 |
|
AC_LIB_WITH_FINAL_PREFIX([ |
| 1315 |
|
eval additional_includedir=\"$includedir\" |
| 1316 |
|
eval additional_libdir=\"$libdir\" |
| 1317 |
|
]) |
| 1318 |
|
else |
| 1319 |
|
additional_includedir="$withval/include" |
| 1320 |
|
additional_libdir="$withval/lib" |
| 1321 |
|
fi |
| 1322 |
|
fi |
| 1323 |
|
]) |
| 1324 |
|
if test $use_additional = yes; then |
| 1325 |
|
dnl Potentially add $additional_includedir to $CPPFLAGS. |
| 1326 |
|
dnl But don't add it |
| 1327 |
|
dnl 1. if it's the standard /usr/include, |
| 1328 |
|
dnl 2. if it's already present in $CPPFLAGS, |
| 1329 |
|
dnl 3. if it's /usr/local/include and we are using GCC on Linux, |
| 1330 |
|
dnl 4. if it doesn't exist as a directory. |
| 1331 |
|
if test "X$additional_includedir" != "X/usr/include"; then |
| 1332 |
|
haveit= |
| 1333 |
|
for x in $CPPFLAGS; do |
| 1334 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1335 |
|
if test "X$x" = "X-I$additional_includedir"; then |
| 1336 |
|
haveit=yes |
| 1337 |
|
break |
| 1338 |
|
fi |
| 1339 |
|
done |
| 1340 |
|
if test -z "$haveit"; then |
| 1341 |
|
if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1342 |
|
if test -n "$GCC"; then |
| 1343 |
|
case $host_os in |
| 1344 |
|
linux*) haveit=yes;; |
| 1345 |
|
esac |
| 1346 |
|
fi |
| 1347 |
|
fi |
| 1348 |
|
if test -z "$haveit"; then |
| 1349 |
|
if test -d "$additional_includedir"; then |
| 1350 |
|
dnl Really add $additional_includedir to $CPPFLAGS. |
| 1351 |
|
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" |
| 1352 |
|
fi |
| 1353 |
|
fi |
| 1354 |
|
fi |
| 1355 |
|
fi |
| 1356 |
|
dnl Potentially add $additional_libdir to $LDFLAGS. |
| 1357 |
|
dnl But don't add it |
| 1358 |
|
dnl 1. if it's the standard /usr/lib, |
| 1359 |
|
dnl 2. if it's already present in $LDFLAGS, |
| 1360 |
|
dnl 3. if it's /usr/local/lib and we are using GCC on Linux, |
| 1361 |
|
dnl 4. if it doesn't exist as a directory. |
| 1362 |
|
if test "X$additional_libdir" != "X/usr/lib"; then |
| 1363 |
|
haveit= |
| 1364 |
|
for x in $LDFLAGS; do |
| 1365 |
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1366 |
|
if test "X$x" = "X-L$additional_libdir"; then |
| 1367 |
|
haveit=yes |
| 1368 |
|
break |
| 1369 |
|
fi |
| 1370 |
|
done |
| 1371 |
|
if test -z "$haveit"; then |
| 1372 |
|
if test "X$additional_libdir" = "X/usr/local/lib"; then |
| 1373 |
|
if test -n "$GCC"; then |
| 1374 |
|
case $host_os in |
| 1375 |
|
linux*) haveit=yes;; |
| 1376 |
|
esac |
| 1377 |
|
fi |
| 1378 |
|
fi |
| 1379 |
|
if test -z "$haveit"; then |
| 1380 |
|
if test -d "$additional_libdir"; then |
| 1381 |
|
dnl Really add $additional_libdir to $LDFLAGS. |
| 1382 |
|
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" |
| 1383 |
|
fi |
| 1384 |
|
fi |
| 1385 |
|
fi |
| 1386 |
|
fi |
| 1387 |
|
fi |
| 1388 |
|
]) |
| 1389 |
|
|
| 1390 |
|
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, |
| 1391 |
|
dnl acl_final_exec_prefix, containing the values to which $prefix and |
| 1392 |
|
dnl $exec_prefix will expand at the end of the configure script. |
| 1393 |
|
AC_DEFUN([AC_LIB_PREPARE_PREFIX], |
| 1394 |
|
[ |
| 1395 |
|
dnl Unfortunately, prefix and exec_prefix get only finally determined |
| 1396 |
|
dnl at the end of configure. |
| 1397 |
|
if test "X$prefix" = "XNONE"; then |
| 1398 |
|
acl_final_prefix="$ac_default_prefix" |
| 1399 |
|
else |
| 1400 |
|
acl_final_prefix="$prefix" |
| 1401 |
|
fi |
| 1402 |
|
if test "X$exec_prefix" = "XNONE"; then |
| 1403 |
|
acl_final_exec_prefix='${prefix}' |
| 1404 |
|
else |
| 1405 |
|
acl_final_exec_prefix="$exec_prefix" |
| 1406 |
|
fi |
| 1407 |
|
acl_save_prefix="$prefix" |
| 1408 |
|
prefix="$acl_final_prefix" |
| 1409 |
|
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" |
| 1410 |
|
prefix="$acl_save_prefix" |
| 1411 |
|
]) |
| 1412 |
|
|
| 1413 |
|
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the |
| 1414 |
|
dnl variables prefix and exec_prefix bound to the values they will have |
| 1415 |
|
dnl at the end of the configure script. |
| 1416 |
|
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], |
| 1417 |
|
[ |
| 1418 |
|
acl_save_prefix="$prefix" |
| 1419 |
|
prefix="$acl_final_prefix" |
| 1420 |
|
acl_save_exec_prefix="$exec_prefix" |
| 1421 |
|
exec_prefix="$acl_final_exec_prefix" |
| 1422 |
|
$1 |
| 1423 |
|
exec_prefix="$acl_save_exec_prefix" |
| 1424 |
|
prefix="$acl_save_prefix" |
| 1425 |
|
]) |
| 1426 |
|
|
| 1427 |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
| 1428 |
|
|
| 1429 |
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. |
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. |