forked from libyal/libcstring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acinclude.m4
164 lines (138 loc) · 3.87 KB
/
acinclude.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
dnl Functions for libcstring
dnl
dnl Version: 20141014
dnl Function to detect if libcstring dependencies are available
AC_DEFUN([AX_LIBCSTRING_CHECK_LOCAL],
[dnl Headers included in libcstring/libcstring_narrow_string.h
AC_CHECK_HEADERS([stdlib.h string.h])
dnl Headers included in libcstring/libcstring_wide.h
AC_CHECK_HEADERS([wchar.h wctype.h])
dnl Narrow character string functions used in libcstring/libcstring_narrow_string.h
AC_CHECK_FUNCS([fgets memchr memcmp memcpy memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf])
AS_IF(
[test "x$ac_cv_func_fgets" != xyes],
[AC_MSG_FAILURE(
[Missing function: fgets],
[1])
])
AS_IF(
[test "x$ac_cv_func_memchr" != xyes && test "x$ac_cv_func_strchr" != xyes],
[AC_MSG_FAILURE(
[Missing functions: memchr and strchr],
[1])
])
AS_IF(
[test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes],
[AC_MSG_FAILURE(
[Missing functions: memcmp and strncmp],
[1])
])
AS_IF(
[test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes],
[AC_MSG_FAILURE(
[Missing functions: memcpy and strncpy],
[1])
])
AS_IF(
[test "x$ac_cv_func_memrchr" = xyes],
[AC_CHECK_DECLS([memrchr])
AS_IF(
[test "x$ac_cv_decl_memrchr" != xyes],
[ac_cv_func_memrchr=no])
])
AS_IF(
[test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes],
[AC_MSG_FAILURE(
[Missing functions: strrchr and memrchr],
[1])
])
AS_IF(
[test "x$ac_cv_func_snprintf" != xyes],
[AC_MSG_FAILURE(
[Missing function: snprintf],
[1])
])
AS_IF(
[test "x$ac_cv_func_sscanf" != xyes],
[AC_MSG_FAILURE(
[Missing function: sscanf],
[1])
])
AS_IF(
[test "x$ac_cv_func_strlen" != xyes],
[AC_MSG_FAILURE(
[Missing function: strlen],
[1])
])
AS_IF(
[test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes],
[AC_MSG_FAILURE(
[Missing functions: strncasecmp, strcasecmp and strnicmp],
[1])
])
AS_IF(
[test "x$ac_cv_func_strstr" != xyes],
[AC_MSG_FAILURE(
[Missing function: strstr],
[1])
])
AS_IF(
[test "x$ac_cv_func_strstr" != xyes],
[AC_MSG_FAILURE(
[Missing function: vsnprintf],
[1])
])
dnl Wide character string functions used in libcstring/libcstring_wide_string.h
AS_IF(
[test "x$ac_cv_enable_wide_character_type" != xno],
[AC_CHECK_FUNCS([swprintf towlower wcscasecmp wcschr wcslen wcsncasecmp wcsncmp wcsncpy wcsnicmp wcsrchr wcsstr wmemchr wmemcmp wmemcpy wmemrchr])
AS_IF(
[test "x$ac_cv_func_swprintf" != xyes],
[AC_MSG_FAILURE(
[Missing function: swprintf],
[1])
])
AS_IF(
[test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes],
[AC_MSG_FAILURE(
[Missing functions: wmemchr and wcschr],
[1])
])
AS_IF(
[test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes],
[AC_MSG_FAILURE(
[Missing functions: wmemcmp and wcsncmp],
[1])
])
AS_IF(
[test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes],
[AC_MSG_FAILURE(
[Missing functions: wmemcpy and wcsncpy],
[1])
])
AS_IF(
[test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes],
[AC_MSG_FAILURE(
[Missing functions: wmemrchr and wcsrchr],
[1])
])
AS_IF(
[test "x$ac_cv_func_wcslen" != xyes],
[AC_MSG_FAILURE(
[Missing function: wcslen],
[1])
])
AS_IF(
[test "x$ac_cv_func_wcsncasecmp" != xyes && test "x$ac_cv_func_wcscasecmp" != xyes && test "x$ac_cv_func_wcsnicmp" != xyes && test "x$ac_cv_func_towlower" != xyes],
[AC_MSG_FAILURE(
[Missing functions: wcsncasecmp, wcscasecmp, wcsnicmp and towlower],
[1])
])
AS_IF(
[test "x$ac_cv_func_wcsstr" != xyes],
[AC_MSG_FAILURE(
[Missing function: wcsstr],
[1])
])
])
])