3 dnl These are the prerequisite macros for files in the lib/
4 dnl directories of the fileutils, sh-utils, and textutils packages.
20 jm_PREREQ_TEMPNAME # called by mkstemp
23 AC_DEFUN(jm_PREREQ_ADDEXT,
26 AC_SYS_LONG_FILE_NAMES
27 AC_CHECK_FUNCS(pathconf)
28 AC_CHECK_HEADERS(limits.h string.h unistd.h)
31 AC_DEFUN(jm_PREREQ_CANON_HOST,
33 dnl Add any libraries as early as possible.
34 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
35 dnl so we have to add -lnsl to LIBS before checking for that function.
36 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
38 dnl These come from -lnsl on Solaris5.5.1.
39 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
41 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
42 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
43 netinet/in.h arpa/inet.h)
46 AC_DEFUN(jm_PREREQ_DIRNAME,
49 AC_CHECK_HEADERS(string.h)
52 AC_DEFUN(jm_PREREQ_GETPAGESIZE,
54 AC_CHECK_FUNCS(getpagesize)
55 AC_CHECK_HEADERS(OS.h unistd.h)
58 AC_DEFUN(jm_PREREQ_HASH,
60 AC_CHECK_HEADERS(stdlib.h stdbool.h)
61 AC_REQUIRE([jm_CHECK_DECLS])
64 # If you use human.c, you need the following files:
65 # uintmax_t.m4 inttypes_h.m4 ulonglong.m4
66 AC_DEFUN(jm_PREREQ_HUMAN,
68 AC_CHECK_HEADERS(limits.h stdlib.h string.h)
69 AC_CHECK_DECLS([getenv])
70 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
71 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
74 AC_DEFUN(jm_PREREQ_MEMCHR,
76 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
79 AC_DEFUN(jm_PREREQ_QUOTEARG,
81 AC_CHECK_FUNCS(isascii iswprint)
83 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
90 AC_DEFUN(jm_PREREQ_READUTMP,
93 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
94 AC_CHECK_FUNCS(utmpname)
95 AC_CHECK_FUNCS(utmpxname)
98 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
108 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
109 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
110 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
111 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
116 AC_DEFUN(jm_PREREQ_REGEX,
118 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
119 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
121 AC_CHECK_FUNCS(bzero bcopy isascii btowc)
122 AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
127 AC_DEFUN(jm_PREREQ_TEMPNAME,
131 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
132 AC_CHECK_FUNCS(__secure_getenv gettimeofday)