autoconf: Unset NO_STH and NEED_STH when it is detected not needed
When configure detects some NO_XXX or NEEDS_XXX is unneeded, unset this variable (actually set it to empty string). This allow autodetection to override the default set in Makefile. [jc: while at it fixed a thinko in IPv6 detection.] Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Aug 4, 2006 at 23:43 UTC
d5c31a1ccfa1195cff160bbad995c68037180570
1 file changed
+31
-16
configure.ac
+31
-16
@@ -154,31 +154,36 @@ AC_MSG_NOTICE([CHECKS for libraries])
154
#
155
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
156
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
157
-AC_CHECK_LIB([crypto], [SHA1_Init],[],
157
+AC_CHECK_LIB([crypto], [SHA1_Init],
158
+[GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)],
159
[AC_CHECK_LIB([ssl], [SHA1_Init],
159
- [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)],
160
+ [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)
161
+ GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)],
162
[GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])])
163
#
164
# Define NO_CURL if you do not have curl installed. git-http-pull and
165
# git-http-push are not built, and you cannot use http:// and https://
166
# transports.
165
-AC_CHECK_LIB([curl], [curl_global_init],[],
167
+AC_CHECK_LIB([curl], [curl_global_init],
168
+[GIT_CONF_APPEND_LINE(NO_CURL=)],
169
[GIT_CONF_APPEND_LINE(NO_CURL=YesPlease)])
170
#
171
# Define NO_EXPAT if you do not have expat installed. git-http-push is
172
# not built, and you cannot push using http:// and https:// transports.
170
-AC_CHECK_LIB([expat], [XML_ParserCreate],[],
173
+AC_CHECK_LIB([expat], [XML_ParserCreate],
174
+[GIT_CONF_APPEND_LINE(NO_EXPAT=)],
175
[GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease)])
176
#
177
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
174
-AC_CHECK_LIB([c], [iconv],[],
178
+AC_CHECK_LIB([c], [iconv],
179
+[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=)],
180
[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)])
181
#
182
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
183
# Patrick Mauritz).
179
-AC_CHECK_LIB([c], [socket],[],
180
-[AC_CHECK_LIB([socket],[socket],
181
- [GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)],[])])
184
+AC_CHECK_LIB([c], [socket],
185
+[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=)],
186
+[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)])
187
188
189
## Checks for header files.
@@ -188,25 +193,30 @@ AC_CHECK_LIB([c], [socket],[],
193
AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])
194
#
195
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
191
-AC_CHECK_MEMBER(struct dirent.d_ino,[],
196
+AC_CHECK_MEMBER(struct dirent.d_ino,
197
+[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=)],
198
[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease)],
199
[#include <dirent.h>])
200
#
201
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
202
# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
197
-AC_CHECK_MEMBER(struct dirent.d_type,[],
203
+AC_CHECK_MEMBER(struct dirent.d_type,
204
+[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=)],
205
[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease)],
206
[#include <dirent.h>])
207
#
208
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
209
# sockaddr_storage.
203
-AC_CHECK_TYPE(struct sockaddr_storage,[],
210
+AC_CHECK_TYPE(struct sockaddr_storage,
211
+[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=)],
212
[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)],
213
[#include <netinet/in.h>])
214
# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
215
AC_CHECK_TYPE([struct addrinfo],[
208
-AC_CHECK_FUNC([getaddrinfo],[],
209
-[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)])],[],[
216
+ AC_CHECK_FUNC([getaddrinfo],
217
+ [GIT_CONF_APPEND_LINE(NO_IPV6=)],
218
+ [GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)])
219
+],[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],[
220
#include <sys/types.h>
221
#include <sys/socket.h>
222
#include <netdb.h>
@@ -231,6 +241,8 @@ AC_RUN_IFELSE(
241
])
242
if test $ac_cv_c_c99_format = no; then
243
GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease)
244
+else
245
+ GIT_CONF_APPEND_LINE(NO_C99_FORMAT=)
246
fi
247
248
@@ -239,15 +251,18 @@ fi
251
AC_MSG_NOTICE([CHECKS for library functions])
252
#
253
# Define NO_STRCASESTR if you don't have strcasestr.
242
-AC_CHECK_FUNC(strcasestr,[],
254
+AC_CHECK_FUNC(strcasestr,
255
+[GIT_CONF_APPEND_LINE(NO_STRCASESTR=)],
256
[GIT_CONF_APPEND_LINE(NO_STRCASESTR=YesPlease)])
257
#
258
# Define NO_STRLCPY if you don't have strlcpy.
246
-AC_CHECK_FUNC(strlcpy,[],
259
+AC_CHECK_FUNC(strlcpy,
260
+[GIT_CONF_APPEND_LINE(NO_STRLCPY=)],
261
[GIT_CONF_APPEND_LINE(NO_STRLCPY=YesPlease)])
262
#
263
# Define NO_SETENV if you don't have setenv in the C library.
250
-AC_CHECK_FUNC(setenv,[],
264
+AC_CHECK_FUNC(setenv,
265
+[GIT_CONF_APPEND_LINE(NO_SETENV=)],
266
[GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)])
267
#
268
# Define NO_MMAP if you want to avoid mmap.