3 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
5 AC_DEFUN([jm_LIB_CHECK],
8 # Check for libypsec.a on Dolphin M88K machines.
9 AC_CHECK_LIB(ypsec, main)
11 # m88k running dgux 5.4 needs this
12 AC_CHECK_LIB(ldgc, main)
14 # Some programs need to link with -lm. printf does if it uses
15 # lib/strtod.c which uses pow. And seq uses the math functions,
16 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
18 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
19 # Check for these math functions used by seq.
20 ac_su_saved_lib="$LIBS"
22 AC_CHECK_FUNCS(floor modf rint)
23 LIBS="$ac_su_saved_lib"
27 if test $ac_cv_func_sqrt = no; then
28 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
31 AC_SUBST(FESETROUND_LIBM)
32 AC_CHECK_FUNCS(fesetround)
33 if test $ac_cv_func_fesetround = no; then
34 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
37 # The -lsun library is required for YP support on Irix-4.0.5 systems.
38 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
39 AC_SEARCH_LIBS(yp_match, [sun ypsec])
41 # SysV needs -lsec, older versions of Linux need -lshadow for
42 # shadow passwords. UnixWare 7 needs -lgen.
43 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
45 AC_CHECK_HEADERS(shadow.h)
47 # Requirements for su.c.
54 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
55 AC_CHECK_FUNCS(getspnam)
57 # SCO-ODT-3.0 is reported to need -lufc for crypt.
58 # NetBSD needs -lcrypt for crypt.
59 ac_su_saved_lib="$LIBS"
60 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
61 LIBS="$ac_su_saved_lib"