]> Dogcows Code - chaz/tar/blob - m4/prereq.m4
Documented --pax-option
[chaz/tar] / m4 / prereq.m4
1 #serial 21
2
3 dnl These are the prerequisite macros for files in the lib/
4 dnl directories of the fileutils, sh-utils, and textutils packages.
5
6 AC_DEFUN([jm_PREREQ],
7 [
8 jm_PREREQ_ADDEXT
9 jm_PREREQ_CANON_HOST
10 jm_PREREQ_DIRNAME
11 jm_PREREQ_ERROR
12 jm_PREREQ_EXCLUDE
13 jm_PREREQ_GETPAGESIZE
14 jm_PREREQ_HASH
15 jm_PREREQ_HUMAN
16 jm_PREREQ_MBSWIDTH
17 jm_PREREQ_MEMCHR
18 jm_PREREQ_QUOTEARG
19 jm_PREREQ_READUTMP
20 jm_PREREQ_REGEX
21 jm_PREREQ_TEMPNAME # called by mkstemp
22 ])
23
24 AC_DEFUN([jm_PREREQ_ADDEXT],
25 [
26 dnl For addext.c.
27 AC_SYS_LONG_FILE_NAMES
28 AC_CHECK_FUNCS(pathconf)
29 AC_CHECK_HEADERS(limits.h string.h unistd.h)
30 ])
31
32 AC_DEFUN([jm_PREREQ_CANON_HOST],
33 [
34 dnl Add any libraries as early as possible.
35 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
36 dnl so we have to add -lnsl to LIBS before checking for that function.
37 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
38
39 dnl These come from -lnsl on Solaris5.5.1.
40 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
41
42 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
43 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
44 netinet/in.h arpa/inet.h)
45 ])
46
47 AC_DEFUN([jm_PREREQ_DIRNAME],
48 [
49 AC_HEADER_STDC
50 AC_CHECK_HEADERS(string.h)
51 ])
52
53 AC_DEFUN([jm_PREREQ_EXCLUDE],
54 [
55 jm_FUNC_FNMATCH
56 AC_CHECK_HEADERS(stdbool.h)
57 ])
58
59 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
60 [
61 AC_CHECK_FUNCS(getpagesize)
62 AC_CHECK_HEADERS(OS.h unistd.h)
63 ])
64
65 AC_DEFUN([jm_PREREQ_HASH],
66 [
67 AC_CHECK_HEADERS(stdlib.h stdbool.h)
68 AC_REQUIRE([jm_CHECK_DECLS])
69 ])
70
71 # If you use human.c, you need the following files:
72 # inttypes.m4 ulonglong.m4
73 AC_DEFUN([jm_PREREQ_HUMAN],
74 [
75 AC_CHECK_HEADERS(limits.h stdlib.h string.h)
76 AC_CHECK_DECLS([getenv])
77 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
78 ])
79
80 AC_DEFUN([jm_PREREQ_MEMCHR],
81 [
82 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
83 ])
84
85 AC_DEFUN([jm_PREREQ_QUOTEARG],
86 [
87 AC_CHECK_FUNCS(isascii iswprint)
88 jm_FUNC_MBRTOWC
89 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
90 AC_HEADER_STDC
91 AC_C_BACKSLASH_A
92 AC_MBSTATE_T
93 AM_C_PROTOTYPES
94 ])
95
96 AC_DEFUN([jm_PREREQ_READUTMP],
97 [
98 AC_HEADER_STDC
99 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
100 AC_CHECK_FUNCS(utmpname)
101 AC_CHECK_FUNCS(utmpxname)
102 AM_C_PROTOTYPES
103
104 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
105 utmp_includes="\
106 $ac_includes_default
107 #ifdef HAVE_UTMPX_H
108 # include <utmpx.h>
109 #endif
110 #ifdef HAVE_UTMP_H
111 # include <utmp.h>
112 #endif
113 "
114 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
115 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
116 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
117 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
118 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
119 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
120 AC_LIBOBJ(readutmp)
121 fi
122 ])
123
124 AC_DEFUN([jm_PREREQ_REGEX],
125 [
126 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
127 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
128 dnl to get them.
129 AC_CHECK_FUNCS(bzero bcopy isascii btowc)
130 AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
131 AC_HEADER_STDC
132 AC_FUNC_ALLOCA
133 ])
134
135 AC_DEFUN([jm_PREREQ_TEMPNAME],
136 [
137 AC_HEADER_STDC
138 AC_HEADER_STAT
139 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
140 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
141 ])
This page took 0.043168 seconds and 4 git commands to generate.