]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - m4/ul.m4
agetty: Fix input of non-ASCII characters in get_logname()
[thirdparty/util-linux.git] / m4 / ul.m4
index cfd2e68fc5c154ffa91ebaf05c6be023b579757c..9b3e73d22ad2c4e440f440ace6260faf8ca3b4d1 100644 (file)
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -433,7 +433,7 @@ AC_DEFUN([UL_DEFAULT_ENABLE], [
 dnl UL_ENABLE_ALIAS(NAME, MASTERNAME)
 dnl
 dnl Initializes $enable_<name> variable according to $enable_<mastername>. This
-dnl is usefull for example if you want to use one --enable-mastername option
+dnl is useful for example if you want to use one --enable-mastername option
 dnl for group of programs.
 dnl
 AC_DEFUN([UL_ENABLE_ALIAS], [
@@ -498,3 +498,30 @@ AC_DEFUN([UL_NCURSES_CHECK], [
     AS_IF([test "x$have_[]suffix" = xyes], [NCURSES_LIBS="-l[]suffix"])
   ])
 ])
+
+dnl
+dnl UL_TINFO_CHECK(NAME)
+dnl
+dnl Initializes $have_<name>, TINFO_LIBS and TINFO_CFLAGS variables.
+dnl
+dnl The expected <name> is tinfow or tinfo.
+dnl
+AC_DEFUN([UL_TINFO_CHECK], [
+  m4_define([suffix], $1)
+  m4_define([SUFFIX], m4_toupper($1))
+
+  PKG_CHECK_MODULES(SUFFIX, [$1], [
+    dnl pkg-config success
+    have_[]suffix=yes
+    TINFO_LIBS=${SUFFIX[]_LIBS}
+    TINFO_CFLAGS=${SUFFIX[]_CFLAGS}
+    UL_PKG_STATIC([TINFO_LIBS_STATIC], [$1])
+  ],[
+    dnl If pkg-config failed, fall back to classic searching.
+    AC_CHECK_LIB([$1], [tgetent], [
+       have_[]suffix=yes
+       TINFO_LIBS="-l[]suffix"
+       TINFO_LIBS_STATIC="-l[]suffix"
+       TINFO_CFLAGS=""])
+  ])
+])