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.m417
1 files changed, 10 insertions, 7 deletions
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index fcd3391..2144203 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
1# lib-link.m4 serial 18 (gettext-0.18) 1# lib-link.m4 serial 19 (gettext-0.18)
2dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2009 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,
@@ -43,12 +43,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
43 popdef([Name]) 43 popdef([Name])
44]) 44])
45 45
46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) 46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
47dnl searches for libname and the libraries corresponding to explicit and 47dnl searches for libname and the libraries corresponding to explicit and
48dnl implicit dependencies, together with the specified include files and 48dnl implicit dependencies, together with the specified include files and
49dnl the ability to compile and link the specified testcode. If found, it 49dnl the ability to compile and link the specified testcode. The missing-message
50dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and 50dnl defaults to 'no' and may contain additional hints for the user.
51dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and 51dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
52dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
52dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs 53dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
53dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. 54dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
54dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 55dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
@@ -74,12 +75,14 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
74 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
75 ac_save_LIBS="$LIBS" 76 ac_save_LIBS="$LIBS"
76 LIBS="$LIBS $LIB[]NAME" 77 LIBS="$LIBS $LIB[]NAME"
77 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) 78 AC_TRY_LINK([$3], [$4],
79 [ac_cv_lib[]Name=yes],
80 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
78 LIBS="$ac_save_LIBS" 81 LIBS="$ac_save_LIBS"
79 ]) 82 ])
80 if test "$ac_cv_lib[]Name" = yes; then 83 if test "$ac_cv_lib[]Name" = yes; then
81 HAVE_LIB[]NAME=yes 84 HAVE_LIB[]NAME=yes
82 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) 85 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib[]$1 library.])
83 AC_MSG_CHECKING([how to link with lib[]$1]) 86 AC_MSG_CHECKING([how to link with lib[]$1])
84 AC_MSG_RESULT([$LIB[]NAME]) 87 AC_MSG_RESULT([$LIB[]NAME])
85 else 88 else