summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-29 14:11:35 +0000
committerJim Meyering <jim@meyering.net>2000-01-29 14:11:35 +0000
commite446ebf6c3eb368b8117321511234a962de673f3 (patch)
treeb51b160b1c0aea919fb2514a9eb890e2bf4afc9c /m4
parent273d5d4925bee3ef3c72dbca75acd60550ae9b70 (diff)
downloadcoreutils-e446ebf6c3eb368b8117321511234a962de673f3.tar.xz
New file containing library-related checks from
fileutils and sh-utils (textutils had none).
Diffstat (limited to 'm4')
-rw-r--r--m4/lib-check.m454
1 files changed, 54 insertions, 0 deletions
diff --git a/m4/lib-check.m4 b/m4/lib-check.m4
new file mode 100644
index 000000000..bf49153df
--- /dev/null
+++ b/m4/lib-check.m4
@@ -0,0 +1,54 @@
+#serial 1
+
+dnl Misc lib-related macros for fileutils, sh-utils, textutils.
+
+AC_DEFUN(jm_MACROS,
+[
+
+ # Check for libypsec.a on Dolphin M88K machines.
+ AC_CHECK_LIB(ypsec, main)
+
+ # m88k running dgux 5.4 needs this
+ AC_CHECK_LIB(ldgc, main)
+
+ # Some programs need to link with -lm. printf does if it uses
+ # lib/strtod.c which uses pow. And seq uses the math functions,
+ # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
+
+ # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
+ # Check for these math functions used by seq.
+ ac_su_saved_lib="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_CHECK_FUNCS(floor modf rint)
+ LIBS="$ac_su_saved_lib"
+
+ AC_SUBST(SQRT_LIBM)
+ AC_CHECK_FUNCS(sqrt)
+ if test $ac_cv_func_sqrt = no; then
+ AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
+ fi
+
+ AC_SUBST(FESETROUND_LIBM)
+ AC_CHECK_FUNCS(fesetround)
+ if test $ac_cv_func_fesetround = no; then
+ AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
+ fi
+
+ # The -lsun library is required for YP support on Irix-4.0.5 systems.
+ # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
+ AC_SEARCH_LIBS(yp_match, [sun ypsec])
+
+ # SysV needs -lsec, older versions of Linux need -lshadow for
+ # shadow passwords.
+ AC_SEARCH_LIBS(getspnam, [shadow sec])
+
+ AC_EGREP_HEADER(sp_pwdp, shadow.h,
+ AC_CHECK_FUNC(getspnam, AC_DEFINE(HAVE_SHADOW_H)))
+
+ # SCO-ODT-3.0 is reported to need -lufc for crypt.
+ # NetBSD needs -lcrypt for crypt.
+ ac_su_saved_lib="$LIBS"
+ AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
+ LIBS="$ac_su_saved_lib"
+ AC_SUBST(LIB_CRYPT)
+])