summaryrefslogtreecommitdiffstats
path: root/gl/m4/lib-link.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/lib-link.m4')
-rw-r--r--gl/m4/lib-link.m446
1 files changed, 28 insertions, 18 deletions
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index 90e1ac91..59b367df 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
1# lib-link.m4 serial 20 (gettext-0.18) 1# lib-link.m4 serial 23 (gettext-0.18.2)
2dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
18[ 18[
19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20 AC_REQUIRE([AC_LIB_RPATH]) 20 AC_REQUIRE([AC_LIB_RPATH])
21 pushdef([Name],[translit([$1],[./-], [___])]) 21 pushdef([Name],[m4_translit([$1],[./+-], [____])])
22 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 22 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ 24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 25 AC_LIB_LINKFLAGS_BODY([$1], [$2])
26 ac_cv_lib[]Name[]_libs="$LIB[]NAME" 26 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
58[ 58[
59 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 59 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
60 AC_REQUIRE([AC_LIB_RPATH]) 60 AC_REQUIRE([AC_LIB_RPATH])
61 pushdef([Name],[translit([$1],[./-], [___])]) 61 pushdef([Name],[m4_translit([$1],[./+-], [____])])
62 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 62 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
63 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 63 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
64 64
65 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME 65 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
66 dnl accordingly. 66 dnl accordingly.
@@ -74,7 +74,17 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
74 74
75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
76 ac_save_LIBS="$LIBS" 76 ac_save_LIBS="$LIBS"
77 LIBS="$LIBS $LIB[]NAME" 77 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
78 dnl because these -l options might require -L options that are present in
79 dnl LIBS. -l options benefit only from the -L options listed before it.
80 dnl Otherwise, add it to the front of LIBS, because it may be a static
81 dnl library that depends on another static library that is present in LIBS.
82 dnl Static libraries benefit only from the static libraries listed after
83 dnl it.
84 case " $LIB[]NAME" in
85 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
86 *) LIBS="$LIB[]NAME $LIBS" ;;
87 esac
78 AC_TRY_LINK([$3], [$4], 88 AC_TRY_LINK([$3], [$4],
79 [ac_cv_lib[]Name=yes], 89 [ac_cv_lib[]Name=yes],
80 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) 90 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
@@ -147,13 +157,13 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
147dnl macro call that searches for libname. 157dnl macro call that searches for libname.
148AC_DEFUN([AC_LIB_FROMPACKAGE], 158AC_DEFUN([AC_LIB_FROMPACKAGE],
149[ 159[
150 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 160 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
151 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 161 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
152 define([acl_frompackage_]NAME, [$2]) 162 define([acl_frompackage_]NAME, [$2])
153 popdef([NAME]) 163 popdef([NAME])
154 pushdef([PACK],[$2]) 164 pushdef([PACK],[$2])
155 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], 165 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
156 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 166 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
157 define([acl_libsinpackage_]PACKUP, 167 define([acl_libsinpackage_]PACKUP,
158 m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) 168 m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
159 popdef([PACKUP]) 169 popdef([PACKUP])
@@ -168,14 +178,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
168AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 178AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
169[ 179[
170 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 180 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
171 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 181 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
172 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 182 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
173 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) 183 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
174 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], 184 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
175 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 185 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
176 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) 186 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
177 dnl Autoconf >= 2.61 supports dots in --with options. 187 dnl Autoconf >= 2.61 supports dots in --with options.
178 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) 188 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
179 dnl By default, look in $includedir and $libdir. 189 dnl By default, look in $includedir and $libdir.
180 use_additional=yes 190 use_additional=yes
181 AC_LIB_WITH_FINAL_PREFIX([ 191 AC_LIB_WITH_FINAL_PREFIX([
@@ -232,7 +242,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
232 names_already_handled="$names_already_handled $name" 242 names_already_handled="$names_already_handled $name"
233 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS 243 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
234 dnl or AC_LIB_HAVE_LINKFLAGS call. 244 dnl or AC_LIB_HAVE_LINKFLAGS call.
235 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` 245 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
236 eval value=\"\$HAVE_LIB$uppername\" 246 eval value=\"\$HAVE_LIB$uppername\"
237 if test -n "$value"; then 247 if test -n "$value"; then
238 if test "$value" = yes; then 248 if test "$value" = yes; then