Newer
Older
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
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# $Id$
###########################################################################
dnl CHECK_NEED_REENTRANT_STRERROR_R
dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition
dnl makes function strerror_r compiler visible.
AC_DEFUN([CHECK_NEED_REENTRANT_STRERROR_R], [
#
AC_MSG_NOTICE([DEBUG:])
AC_MSG_NOTICE([DEBUG:])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strerror_r])
],[
AC_MSG_NOTICE([DEBUG: strerror_r links... yes])
tmp_strerror_r="yes"
],[
AC_MSG_NOTICE([DEBUG: strerror_r links... no])
tmp_strerror_r="no"
])
#
if test "$tmp_strerror_r" = "yes"; then
AC_EGREP_CPP([strerror_r],[
#include <sys/types.h>
#include <string.h>
],[
AC_MSG_NOTICE([DEBUG: strerror_r proto... without our definition])
tmp_strerror_r="proto_wout_def"
],[
AC_EGREP_CPP([strerror_r],[
#define _REENTRANT
#include <sys/types.h>
#include <string.h>
],[
AC_MSG_NOTICE([DEBUG: strerror_r proto... with our _reentrant])
tmp_strerror_r="proto_with_def"
],[
AC_MSG_NOTICE([DEBUG: strerror_r proto... not found])
])
])
fi
#
if test "$tmp_strerror_r" = "proto_wout_def"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <string.h>
]],[[
strerror_r(0, 0, 0);
]])
],[
AC_MSG_NOTICE([DEBUG: strerror_r proto wout finds... 3 args])
tmp_strerror_r="done"
])
fi
#
if test "$tmp_strerror_r" = "proto_with_def"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#define _REENTRANT
#include <sys/types.h>
#include <string.h>
]],[[
strerror_r(0, 0, 0);
]])
],[
AC_MSG_NOTICE([DEBUG: strerror_r proto with finds... 3 args])
tmp_strerror_r="needs_reentrant"
])
fi
#
if test "$tmp_strerror_r" = "needs_reentrant"; then
ac_cv_need_reentrant="yes"
fi
])
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
164
165
166
167
168
169
170
171
172
173
174
dnl CHECK_NEED_REENTRANT_STRTOK_R
dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition
dnl makes function strtok_r compiler visible.
AC_DEFUN([CHECK_NEED_REENTRANT_STRTOK_R], [
#
AC_MSG_NOTICE([DEBUG:])
AC_MSG_NOTICE([DEBUG:])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strtok_r])
],[
AC_MSG_NOTICE([DEBUG: strtok_r links... yes])
tmp_strtok_r="yes"
],[
AC_MSG_NOTICE([DEBUG: strtok_r links... no])
tmp_strtok_r="no"
])
#
if test "$tmp_strtok_r" = "yes"; then
AC_EGREP_CPP([strtok_r],[
#include <sys/types.h>
#include <string.h>
],[
AC_MSG_NOTICE([DEBUG: strtok_r proto... without our definition])
tmp_strtok_r="proto_wout_def"
],[
AC_EGREP_CPP([strtok_r],[
#define _REENTRANT
#include <sys/types.h>
#include <string.h>
],[
AC_MSG_NOTICE([DEBUG: strtok_r proto... with our _reentrant])
tmp_strtok_r="proto_with_def"
],[
AC_MSG_NOTICE([DEBUG: strtok_r proto... not found])
])
])
fi
#
if test "$tmp_strtok_r" = "proto_wout_def"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <string.h>
]],[[
strtok_r(0, 0, 0);
]])
],[
AC_MSG_NOTICE([DEBUG: strtok_r proto wout finds... 3 args])
tmp_strtok_r="done"
])
fi
#
if test "$tmp_strtok_r" = "proto_with_def"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#define _REENTRANT
#include <sys/types.h>
#include <string.h>
]],[[
strtok_r(0, 0, 0);
]])
],[
AC_MSG_NOTICE([DEBUG: strtok_r proto with finds... 3 args])
tmp_strtok_r="needs_reentrant"
])
fi
#
if test "$tmp_strtok_r" = "needs_reentrant"; then
ac_cv_need_reentrant="yes"
fi
])
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
dnl CHECK_NEED_REENTRANT_LOCALTIME_R
dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition
dnl makes function localtime_r compiler visible.
AC_DEFUN([CHECK_NEED_REENTRANT_LOCALTIME_R], [
#
AC_MSG_NOTICE([DEBUG:])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([localtime_r])
],[
AC_MSG_NOTICE([DEBUG: localtime_r links... yes])
tmp_localtime_r="yes"
],[
AC_MSG_NOTICE([DEBUG: localtime_r links... no])
tmp_localtime_r="no"
])
#
if test "$tmp_localtime_r" = "yes"; then
AC_EGREP_CPP([localtime_r],[
#include <sys/types.h>
#include <time.h>
],[
AC_MSG_NOTICE([DEBUG: localtime_r proto... without our definition])
tmp_localtime_r="proto_wout_def"
],[
Loading
Loading full blame…