4140
4679
AC_SUBST(XMMS_EFFECT_PLUGIN_DIR)
4682
# iconv.m4 serial AM4 (gettext-0.11.3)
4683
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4684
dnl This file is free software, distributed under the terms of the GNU
4685
dnl General Public License. As a special exception to the GNU General
4686
dnl Public License, this file may be distributed as part of a program
4687
dnl that contains a configuration script generated by Autoconf, under
4688
dnl the same distribution terms as the rest of that program.
4690
dnl From Bruno Haible.
4692
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4694
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4695
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4696
AC_REQUIRE([AC_LIB_RPATH])
4698
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4700
AC_LIB_LINKFLAGS_BODY([iconv])
4703
AC_DEFUN([AM_ICONV_LINK],
4705
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4706
dnl those with the standalone portable GNU libiconv installed).
4708
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4710
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4712
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4713
dnl because if the user has installed libiconv and not disabled its use
4714
dnl via --without-libiconv-prefix, he wants to use it. The first
4715
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4716
am_save_CPPFLAGS="$CPPFLAGS"
4717
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4719
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4720
am_cv_func_iconv="no, consider installing GNU libiconv"
4722
AC_TRY_LINK([#include <stdlib.h>
4723
#include <iconv.h>],
4724
[iconv_t cd = iconv_open("","");
4725
iconv(cd,NULL,NULL,NULL,NULL);
4727
am_cv_func_iconv=yes)
4728
if test "$am_cv_func_iconv" != yes; then
4729
am_save_LIBS="$LIBS"
4730
LIBS="$LIBS $LIBICONV"
4731
AC_TRY_LINK([#include <stdlib.h>
4732
#include <iconv.h>],
4733
[iconv_t cd = iconv_open("","");
4734
iconv(cd,NULL,NULL,NULL,NULL);
4737
am_cv_func_iconv=yes)
4738
LIBS="$am_save_LIBS"
4741
if test "$am_cv_func_iconv" = yes; then
4742
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4744
if test "$am_cv_lib_iconv" = yes; then
4745
AC_MSG_CHECKING([how to link with libiconv])
4746
AC_MSG_RESULT([$LIBICONV])
4748
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4750
CPPFLAGS="$am_save_CPPFLAGS"
4755
AC_SUBST(LTLIBICONV)
4758
AC_DEFUN([AM_ICONV],
4761
if test "$am_cv_func_iconv" = yes; then
4762
AC_MSG_CHECKING([for iconv declaration])
4763
AC_CACHE_VAL(am_cv_proto_iconv, [
4771
#if defined(__STDC__) || defined(__cplusplus)
4772
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4776
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4777
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);"])
4778
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4779
AC_MSG_RESULT([$]{ac_t:-
4780
}[$]am_cv_proto_iconv)
4781
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4782
[Define as const if the declaration of iconv() needs const.])
4786
# lib-prefix.m4 serial 1 (gettext-0.11)
4787
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4788
dnl This file is free software, distributed under the terms of the GNU
4789
dnl General Public License. As a special exception to the GNU General
4790
dnl Public License, this file may be distributed as part of a program
4791
dnl that contains a configuration script generated by Autoconf, under
4792
dnl the same distribution terms as the rest of that program.
4794
dnl From Bruno Haible.
4796
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
4797
dnl to access previously installed libraries. The basic assumption is that
4798
dnl a user will want packages to use other packages he previously installed
4799
dnl with the same --prefix option.
4800
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
4801
dnl libraries, but is otherwise very convenient.
4802
AC_DEFUN([AC_LIB_PREFIX],
4804
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4805
AC_REQUIRE([AC_PROG_CC])
4806
AC_REQUIRE([AC_CANONICAL_HOST])
4807
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4808
dnl By default, look in $includedir and $libdir.
4810
AC_LIB_WITH_FINAL_PREFIX([
4811
eval additional_includedir=\"$includedir\"
4812
eval additional_libdir=\"$libdir\"
4814
AC_ARG_WITH([lib-prefix],
4815
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
4816
--without-lib-prefix don't search for libraries in includedir and libdir],
4818
if test "X$withval" = "Xno"; then
4821
if test "X$withval" = "X"; then
4822
AC_LIB_WITH_FINAL_PREFIX([
4823
eval additional_includedir=\"$includedir\"
4824
eval additional_libdir=\"$libdir\"
4827
additional_includedir="$withval/include"
4828
additional_libdir="$withval/lib"
4832
if test $use_additional = yes; then
4833
dnl Potentially add $additional_includedir to $CPPFLAGS.
4834
dnl But don't add it
4835
dnl 1. if it's the standard /usr/include,
4836
dnl 2. if it's already present in $CPPFLAGS,
4837
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
4838
dnl 4. if it doesn't exist as a directory.
4839
if test "X$additional_includedir" != "X/usr/include"; then
4841
for x in $CPPFLAGS; do
4842
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4843
if test "X$x" = "X-I$additional_includedir"; then
4848
if test -z "$haveit"; then
4849
if test "X$additional_includedir" = "X/usr/local/include"; then
4850
if test -n "$GCC"; then
4852
linux*) haveit=yes;;
4856
if test -z "$haveit"; then
4857
if test -d "$additional_includedir"; then
4858
dnl Really add $additional_includedir to $CPPFLAGS.
4859
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
4864
dnl Potentially add $additional_libdir to $LDFLAGS.
4865
dnl But don't add it
4866
dnl 1. if it's the standard /usr/lib,
4867
dnl 2. if it's already present in $LDFLAGS,
4868
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
4869
dnl 4. if it doesn't exist as a directory.
4870
if test "X$additional_libdir" != "X/usr/lib"; then
4872
for x in $LDFLAGS; do
4873
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4874
if test "X$x" = "X-L$additional_libdir"; then
4879
if test -z "$haveit"; then
4880
if test "X$additional_libdir" = "X/usr/local/lib"; then
4881
if test -n "$GCC"; then
4883
linux*) haveit=yes;;
4887
if test -z "$haveit"; then
4888
if test -d "$additional_libdir"; then
4889
dnl Really add $additional_libdir to $LDFLAGS.
4890
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
4898
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
4899
dnl acl_final_exec_prefix, containing the values to which $prefix and
4900
dnl $exec_prefix will expand at the end of the configure script.
4901
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
4903
dnl Unfortunately, prefix and exec_prefix get only finally determined
4904
dnl at the end of configure.
4905
if test "X$prefix" = "XNONE"; then
4906
acl_final_prefix="$ac_default_prefix"
4908
acl_final_prefix="$prefix"
4910
if test "X$exec_prefix" = "XNONE"; then
4911
acl_final_exec_prefix='${prefix}'
4913
acl_final_exec_prefix="$exec_prefix"
4915
acl_save_prefix="$prefix"
4916
prefix="$acl_final_prefix"
4917
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
4918
prefix="$acl_save_prefix"
4921
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
4922
dnl variables prefix and exec_prefix bound to the values they will have
4923
dnl at the end of the configure script.
4924
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
4926
acl_save_prefix="$prefix"
4927
prefix="$acl_final_prefix"
4928
acl_save_exec_prefix="$exec_prefix"
4929
exec_prefix="$acl_final_exec_prefix"
4931
exec_prefix="$acl_save_exec_prefix"
4932
prefix="$acl_save_prefix"
4935
# lib-link.m4 serial 3 (gettext-0.11.3)
4936
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4937
dnl This file is free software, distributed under the terms of the GNU
4938
dnl General Public License. As a special exception to the GNU General
4939
dnl Public License, this file may be distributed as part of a program
4940
dnl that contains a configuration script generated by Autoconf, under
4941
dnl the same distribution terms as the rest of that program.
4943
dnl From Bruno Haible.
4945
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
4946
dnl the libraries corresponding to explicit and implicit dependencies.
4947
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
4948
dnl augments the CPPFLAGS variable.
4949
AC_DEFUN([AC_LIB_LINKFLAGS],
4951
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4952
AC_REQUIRE([AC_LIB_RPATH])
4953
define([Name],[translit([$1],[./-], [___])])
4954
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4955
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4956
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
4957
AC_LIB_LINKFLAGS_BODY([$1], [$2])
4958
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
4959
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
4960
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
4962
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
4963
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
4964
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
4965
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4967
AC_SUBST([LTLIB]NAME)
4968
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
4969
dnl results of this search when this library appears as a dependency.
4975
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
4976
dnl searches for libname and the libraries corresponding to explicit and
4977
dnl implicit dependencies, together with the specified include files and
4978
dnl the ability to compile and link the specified testcode. If found, it
4979
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
4980
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
4981
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
4982
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
4983
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
4985
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4986
AC_REQUIRE([AC_LIB_RPATH])
4987
define([Name],[translit([$1],[./-], [___])])
4988
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4989
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4991
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
4993
AC_LIB_LINKFLAGS_BODY([$1], [$2])
4995
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
4996
dnl because if the user has installed lib[]Name and not disabled its use
4997
dnl via --without-lib[]Name-prefix, he wants to use it.
4998
ac_save_CPPFLAGS="$CPPFLAGS"
4999
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5001
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5002
ac_save_LIBS="$LIBS"
5003
LIBS="$LIBS $LIB[]NAME"
5004
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5005
LIBS="$ac_save_LIBS"
5007
if test "$ac_cv_lib[]Name" = yes; then
5009
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5010
AC_MSG_CHECKING([how to link with lib[]$1])
5011
AC_MSG_RESULT([$LIB[]NAME])
5014
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5015
dnl $INC[]NAME either.
5016
CPPFLAGS="$ac_save_CPPFLAGS"
5020
AC_SUBST([HAVE_LIB]NAME)
5022
AC_SUBST([LTLIB]NAME)
5027
dnl Determine the platform dependent parameters needed to use rpath:
5028
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5029
dnl hardcode_direct, hardcode_minus_L,
5030
dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5031
AC_DEFUN([AC_LIB_RPATH],
5033
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
5034
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
5035
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
5036
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5037
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5038
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5039
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5045
libext="$acl_cv_libext"
5046
shlibext="$acl_cv_shlibext"
5047
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5048
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5049
hardcode_direct="$acl_cv_hardcode_direct"
5050
hardcode_minus_L="$acl_cv_hardcode_minus_L"
5051
sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5052
sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5053
dnl Determine whether the user wants rpath handling at all.
5054
AC_ARG_ENABLE(rpath,
5055
[ --disable-rpath do not hardcode runtime library paths],
5056
:, enable_rpath=yes)
5059
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5060
dnl the libraries corresponding to explicit and implicit dependencies.
5061
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5062
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5064
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5065
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5066
dnl By default, look in $includedir and $libdir.
5068
AC_LIB_WITH_FINAL_PREFIX([
5069
eval additional_includedir=\"$includedir\"
5070
eval additional_libdir=\"$libdir\"
5072
AC_ARG_WITH([lib$1-prefix],
5073
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
5074
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
5076
if test "X$withval" = "Xno"; then
5079
if test "X$withval" = "X"; then
5080
AC_LIB_WITH_FINAL_PREFIX([
5081
eval additional_includedir=\"$includedir\"
5082
eval additional_libdir=\"$libdir\"
5085
additional_includedir="$withval/include"
5086
additional_libdir="$withval/lib"
5090
dnl Search the library and its dependencies in $additional_libdir and
5091
dnl $LDFLAGS. Using breadth-first-seach.
5097
names_already_handled=
5098
names_next_round='$1 $2'
5099
while test -n "$names_next_round"; do
5100
names_this_round="$names_next_round"
5102
for name in $names_this_round; do
5104
for n in $names_already_handled; do
5105
if test "$n" = "$name"; then
5110
if test -z "$already_handled"; then
5111
names_already_handled="$names_already_handled $name"
5112
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5113
dnl or AC_LIB_HAVE_LINKFLAGS call.
5114
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5115
eval value=\"\$HAVE_LIB$uppername\"
5116
if test -n "$value"; then
5117
if test "$value" = yes; then
5118
eval value=\"\$LIB$uppername\"
5119
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5120
eval value=\"\$LTLIB$uppername\"
5121
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5123
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5124
dnl that this library doesn't exist. So just drop it.
5128
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5129
dnl and the already constructed $LIBNAME/$LTLIBNAME.
5134
if test $use_additional = yes; then
5135
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5136
found_dir="$additional_libdir"
5137
found_so="$additional_libdir/lib$name.$shlibext"
5138
if test -f "$additional_libdir/lib$name.la"; then
5139
found_la="$additional_libdir/lib$name.la"
5142
if test -f "$additional_libdir/lib$name.$libext"; then
5143
found_dir="$additional_libdir"
5144
found_a="$additional_libdir/lib$name.$libext"
5145
if test -f "$additional_libdir/lib$name.la"; then
5146
found_la="$additional_libdir/lib$name.la"
5151
if test "X$found_dir" = "X"; then
5152
for x in $LDFLAGS $LTLIB[]NAME; do
5153
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5156
dir=`echo "X$x" | sed -e 's/^X-L//'`
5157
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5159
found_so="$dir/lib$name.$shlibext"
5160
if test -f "$dir/lib$name.la"; then
5161
found_la="$dir/lib$name.la"
5164
if test -f "$dir/lib$name.$libext"; then
5166
found_a="$dir/lib$name.$libext"
5167
if test -f "$dir/lib$name.la"; then
5168
found_la="$dir/lib$name.la"
5174
if test "X$found_dir" != "X"; then
5179
if test "X$found_dir" != "X"; then
5180
dnl Found the library.
5181
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5182
if test "X$found_so" != "X"; then
5183
dnl Linking with a shared library. We attempt to hardcode its
5184
dnl directory into the executable's runpath, unless it's the
5185
dnl standard /usr/lib.
5186
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5187
dnl No hardcoding is needed.
5188
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5190
dnl Use an explicit option to hardcode DIR into the resulting
5192
dnl Potentially add DIR to ltrpathdirs.
5193
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5195
for x in $ltrpathdirs; do
5196
if test "X$x" = "X$found_dir"; then
5201
if test -z "$haveit"; then
5202
ltrpathdirs="$ltrpathdirs $found_dir"
5204
dnl The hardcoding into $LIBNAME is system dependent.
5205
if test "$hardcode_direct" = yes; then
5206
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5207
dnl resulting binary.
5208
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5210
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5211
dnl Use an explicit option to hardcode DIR into the resulting
5213
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5214
dnl Potentially add DIR to rpathdirs.
5215
dnl The rpathdirs will be appended to $LIBNAME at the end.
5217
for x in $rpathdirs; do
5218
if test "X$x" = "X$found_dir"; then
5223
if test -z "$haveit"; then
5224
rpathdirs="$rpathdirs $found_dir"
5227
dnl Rely on "-L$found_dir".
5228
dnl But don't add it if it's already contained in the LDFLAGS
5229
dnl or the already constructed $LIBNAME
5231
for x in $LDFLAGS $LIB[]NAME; do
5232
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5233
if test "X$x" = "X-L$found_dir"; then
5238
if test -z "$haveit"; then
5239
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5241
if test "$hardcode_minus_L" != no; then
5242
dnl FIXME: Not sure whether we should use
5243
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5245
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5247
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5248
dnl here, because this doesn't fit in flags passed to the
5249
dnl compiler. So give up. No hardcoding. This affects only
5250
dnl very old systems.
5251
dnl FIXME: Not sure whether we should use
5252
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5254
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5260
if test "X$found_a" != "X"; then
5261
dnl Linking with a static library.
5262
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5264
dnl We shouldn't come here, but anyway it's good to have a
5266
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5269
dnl Assume the include files are nearby.
5270
additional_includedir=
5271
case "$found_dir" in
5273
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5274
additional_includedir="$basedir/include"
5277
if test "X$additional_includedir" != "X"; then
5278
dnl Potentially add $additional_includedir to $INCNAME.
5279
dnl But don't add it
5280
dnl 1. if it's the standard /usr/include,
5281
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
5282
dnl 3. if it's already present in $CPPFLAGS or the already
5283
dnl constructed $INCNAME,
5284
dnl 4. if it doesn't exist as a directory.
5285
if test "X$additional_includedir" != "X/usr/include"; then
5287
if test "X$additional_includedir" = "X/usr/local/include"; then
5288
if test -n "$GCC"; then
5290
linux*) haveit=yes;;
5294
if test -z "$haveit"; then
5295
for x in $CPPFLAGS $INC[]NAME; do
5296
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5297
if test "X$x" = "X-I$additional_includedir"; then
5302
if test -z "$haveit"; then
5303
if test -d "$additional_includedir"; then
5304
dnl Really add $additional_includedir to $INCNAME.
5305
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5311
dnl Look for dependencies.
5312
if test -n "$found_la"; then
5313
dnl Read the .la file. It defines the variables
5314
dnl dlname, library_names, old_library, dependency_libs, current,
5315
dnl age, revision, installed, dlopen, dlpreopen, libdir.
5316
save_libdir="$libdir"
5318
*/* | *\\*) . "$found_la" ;;
5319
*) . "./$found_la" ;;
5321
libdir="$save_libdir"
5322
dnl We use only dependency_libs.
5323
for dep in $dependency_libs; do
5326
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5327
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5328
dnl But don't add it
5329
dnl 1. if it's the standard /usr/lib,
5330
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
5331
dnl 3. if it's already present in $LDFLAGS or the already
5332
dnl constructed $LIBNAME,
5333
dnl 4. if it doesn't exist as a directory.
5334
if test "X$additional_libdir" != "X/usr/lib"; then
5336
if test "X$additional_libdir" = "X/usr/local/lib"; then
5337
if test -n "$GCC"; then
5339
linux*) haveit=yes;;
5343
if test -z "$haveit"; then
5345
for x in $LDFLAGS $LIB[]NAME; do
5346
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5347
if test "X$x" = "X-L$additional_libdir"; then
5352
if test -z "$haveit"; then
5353
if test -d "$additional_libdir"; then
5354
dnl Really add $additional_libdir to $LIBNAME.
5355
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5359
for x in $LDFLAGS $LTLIB[]NAME; do
5360
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5361
if test "X$x" = "X-L$additional_libdir"; then
5366
if test -z "$haveit"; then
5367
if test -d "$additional_libdir"; then
5368
dnl Really add $additional_libdir to $LTLIBNAME.
5369
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5376
dir=`echo "X$dep" | sed -e 's/^X-R//'`
5377
if test "$enable_rpath" != no; then
5378
dnl Potentially add DIR to rpathdirs.
5379
dnl The rpathdirs will be appended to $LIBNAME at the end.
5381
for x in $rpathdirs; do
5382
if test "X$x" = "X$dir"; then
5387
if test -z "$haveit"; then
5388
rpathdirs="$rpathdirs $dir"
5390
dnl Potentially add DIR to ltrpathdirs.
5391
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5393
for x in $ltrpathdirs; do
5394
if test "X$x" = "X$dir"; then
5399
if test -z "$haveit"; then
5400
ltrpathdirs="$ltrpathdirs $dir"
5405
dnl Handle this in the next round.
5406
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5409
dnl Handle this in the next round. Throw away the .la's
5410
dnl directory; it is already contained in a preceding -L
5412
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5415
dnl Most likely an immediate library name.
5416
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5417
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5423
dnl Didn't find the library; assume it is in the system directories
5424
dnl known to the linker and runtime loader. (All the system
5425
dnl directories known to the linker should also be known to the
5426
dnl runtime loader, otherwise the system is severely misconfigured.)
5427
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5428
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5434
if test "X$rpathdirs" != "X"; then
5435
if test -n "$hardcode_libdir_separator"; then
5436
dnl Weird platform: only the last -rpath option counts, the user must
5437
dnl pass all path elements in one option. We can arrange that for a
5438
dnl single library, but not when more than one $LIBNAMEs are used.
5440
for found_dir in $rpathdirs; do
5441
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5443
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5444
acl_save_libdir="$libdir"
5446
eval flag=\"$hardcode_libdir_flag_spec\"
5447
libdir="$acl_save_libdir"
5448
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5450
dnl The -rpath options are cumulative.
5451
for found_dir in $rpathdirs; do
5452
acl_save_libdir="$libdir"
5454
eval flag=\"$hardcode_libdir_flag_spec\"
5455
libdir="$acl_save_libdir"
5456
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5460
if test "X$ltrpathdirs" != "X"; then
5461
dnl When using libtool, the option that works for both libraries and
5462
dnl executables is -R. The -R options are cumulative.
5463
for found_dir in $ltrpathdirs; do
5464
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5469
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5470
dnl unless already present in VAR.
5471
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5472
dnl contains two or three consecutive elements that belong together.
5473
AC_DEFUN([AC_LIB_APPENDTOVAR],
5475
for element in [$2]; do
5478
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5479
if test "X$x" = "X$element"; then
5484
if test -z "$haveit"; then
5485
[$1]="${[$1]}${[$1]:+ }$element"
5490
# lib-ld.m4 serial 1 (gettext-0.11)
5491
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5492
dnl This file is free software, distributed under the terms of the GNU
5493
dnl General Public License. As a special exception to the GNU General
5494
dnl Public License, this file may be distributed as part of a program
5495
dnl that contains a configuration script generated by Autoconf, under
5496
dnl the same distribution terms as the rest of that program.
5498
dnl Subroutines of libtool.m4,
5499
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5500
dnl with libtool.m4.
5502
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5503
AC_DEFUN([AC_LIB_PROG_LD_GNU],
5504
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5505
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5506
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5507
acl_cv_prog_gnu_ld=yes
5509
acl_cv_prog_gnu_ld=no
5511
with_gnu_ld=$acl_cv_prog_gnu_ld
5514
dnl From libtool-1.4. Sets the variable LD.
5515
AC_DEFUN([AC_LIB_PROG_LD],
5516
[AC_ARG_WITH(gnu-ld,
5517
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5518
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5519
AC_REQUIRE([AC_PROG_CC])dnl
5520
AC_REQUIRE([AC_CANONICAL_HOST])dnl
5522
if test "$GCC" = yes; then
5523
# Check if gcc -print-prog-name=ld gives a path.
5524
AC_MSG_CHECKING([for ld used by GCC])
5527
# gcc leaves a trailing carriage return which upsets mingw
5528
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5530
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5533
# Accept absolute paths.
5534
[[\\/]* | [A-Za-z]:[\\/]*)]
5535
[re_direlt='/[^/][^/]*/\.\./']
5536
# Canonicalize the path of ld
5537
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5538
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5539
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5541
test -z "$LD" && LD="$ac_prog"
5544
# If it fails, then pretend we aren't using GCC.
5548
# If it is relative, then search for the first ld in PATH.
5552
elif test "$with_gnu_ld" = yes; then
5553
AC_MSG_CHECKING([for GNU ld])
5555
AC_MSG_CHECKING([for non-GNU ld])
5557
AC_CACHE_VAL(acl_cv_path_LD,
5558
[if test -z "$LD"; then
5559
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5560
for ac_dir in $PATH; do
5561
test -z "$ac_dir" && ac_dir=.
5562
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5563
acl_cv_path_LD="$ac_dir/$ac_prog"
5564
# Check to see if the program is GNU ld. I'd rather use --version,
5565
# but apparently some GNU ld's only accept -v.
5566
# Break only if it was the GNU/non-GNU ld that we prefer.
5567
if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5568
test "$with_gnu_ld" != no && break
5570
test "$with_gnu_ld" != yes && break
5576
acl_cv_path_LD="$LD" # Let the user override the test with a path.
5578
LD="$acl_cv_path_LD"
5579
if test -n "$LD"; then
5584
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5588
# codeset.m4 serial AM1 (gettext-0.10.40)
5589
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5590
dnl This file is free software, distributed under the terms of the GNU
5591
dnl General Public License. As a special exception to the GNU General
5592
dnl Public License, this file may be distributed as part of a program
5593
dnl that contains a configuration script generated by Autoconf, under
5594
dnl the same distribution terms as the rest of that program.
5596
dnl From Bruno Haible.
5598
AC_DEFUN([AM_LANGINFO_CODESET],
5600
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
5601
[AC_TRY_LINK([#include <langinfo.h>],
5602
[char* cs = nl_langinfo(CODESET);],
5603
am_cv_langinfo_codeset=yes,
5604
am_cv_langinfo_codeset=no)
5606
if test $am_cv_langinfo_codeset = yes; then
5607
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
5608
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
5612
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
5614
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
5616
# This program is free software; you can redistribute it and/or modify
5617
# it under the terms of the GNU General Public License as published by
5618
# the Free Software Foundation; either version 2, or (at your option)
5619
# any later version.
5621
# This program is distributed in the hope that it will be useful,
5622
# but WITHOUT ANY WARRANTY; without even the implied warranty of
5623
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5624
# GNU General Public License for more details.
5626
# You should have received a copy of the GNU General Public License
5627
# along with this program; if not, write to the Free Software
5628
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
5635
# When config.status generates a header, we must update the stamp-h file.
5636
# This file resides in the same directory as the config header
5637
# that is generated. We must strip everything past the first ":",
5638
# and everything past the last "/".
5642
# Like AS_DIRNAME, only do it during macro expansion
5643
AC_DEFUN([_AM_DIRNAME],
5644
[m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
5645
m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
5646
m4_if(regexp([$1], [^/.*]), -1,
5648
patsubst([$1], [^\(/\).*], [\1])),
5649
patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
5650
patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
5654
# The stamp files are numbered to have different names.
5655
# We could number them on a directory basis, but that's additional
5656
# complications, let's have a unique counter.
5657
m4_define([_AM_STAMP_Count], [0])
5662
# The name of the stamp file for HEADER.
5663
AC_DEFUN([_AM_STAMP],
5664
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
5665
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
5666
[:.*])))/stamp-h[]_AM_STAMP_Count])
5669
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
5670
# ------------------------------------------------------------
5671
# We used to try to get a real timestamp in stamp-h. But the fear is that
5672
# that will cause unnecessary cvs conflicts.
5673
AC_DEFUN([_AM_CONFIG_HEADER],
5674
[# Add the stamp file to the list of files AC keeps track of,
5675
# along with our hook.
5676
AC_CONFIG_HEADERS([$1],
5677
[# update the timestamp
5678
echo 'timestamp for $1' >"_AM_STAMP([$1])"
5681
])# _AM_CONFIG_HEADER
5684
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
5685
# --------------------------------------------------------------
5686
AC_DEFUN([AM_CONFIG_HEADER],
5687
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
5688
])# AM_CONFIG_HEADER