build: update gnulib submodule to latest for fixed stdalign test
[coreutils/ericb.git] / m4 / lib-check.m4
blob48e57d55598ea974fafa22d31718cac710b66c7f
1 #serial 11
3 dnl Misc lib-related macros for coreutils.
5 # Copyright (C) 1993-1997, 2000-2001, 2003-2006, 2008-2011 Free Software
6 # Foundation, Inc.
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 # Written by Jim Meyering.
23 AC_DEFUN([cu_LIB_CHECK],
26   # Check for libypsec.a on Dolphin M88K machines.
27   AC_CHECK_LIB([ypsec], [main])
29   # m88k running dgux 5.4 needs this
30   AC_CHECK_LIB([ldgc], [main])
32   # The -lsun library is required for YP support on Irix-4.0.5 systems.
33   # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
34   AC_SEARCH_LIBS([yp_match], [sun ypsec])
36   # SysV needs -lsec, older versions of Linux need -lshadow for
37   # shadow passwords.  UnixWare 7 needs -lgen.
38   AC_SEARCH_LIBS([getspnam], [shadow sec gen])
40   AC_CHECK_HEADERS([shadow.h])
42   # Requirements for su.c.
43   shadow_includes="\
44 $ac_includes_default
45 #if HAVE_SHADOW_H
46 # include <shadow.h>
47 #endif
49   AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
50   AC_CHECK_FUNCS([getspnam])
52   # SCO-ODT-3.0 is reported to need -lufc for crypt.
53   # NetBSD needs -lcrypt for crypt.
54   LIB_CRYPT=
55   cu_saved_libs="$LIBS"
56   AC_SEARCH_LIBS([crypt], [ufc crypt],
57                  [test "$ac_cv_search_crypt" = "none required" ||
58                   LIB_CRYPT="$ac_cv_search_crypt"])
59   LIBS="$cu_saved_libs"
60   AC_SUBST([LIB_CRYPT])