@matheusbsbs / matheus-bagliano / commits / 310386f07b
Fork 0

configure: wrap some library tests with GIT_STASH_FLAGS

Libraries that can have user specificed base paths are wrapped with GIT_STASH_FLAGS/GIT_UNSTASH_FLAGS to ensure that the proper versions on the system are tested. This ensures, for example, that the zlib tests for deflateUnbound are done with the version of zlib requested by the user. This is most useful in the absence of good settings for CPPFLAGS and/or LDFLAGS. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ben Walton committed Mar 12, 2009 at 15:20 UTC 310386f07b5ef3dc337db1be37345fbd8d7a3af8
1 file changed +35 -1
configure.ac
+35 -1
@@ -315,33 +315,57 @@ AC_MSG_NOTICE([CHECKS for libraries])
315 #
316 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
317 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
318 +
319 +GIT_STASH_FLAGS($OPENSSLDIR)
320 +
321 AC_CHECK_LIB([crypto], [SHA1_Init],
322 [NEEDS_SSL_WITH_CRYPTO=],
323 [AC_CHECK_LIB([ssl], [SHA1_Init],
324 [NEEDS_SSL_WITH_CRYPTO=YesPlease
325 NEEDS_SSL_WITH_CRYPTO=],
326 [NO_OPENSSL=YesPlease])])
327 +
328 +GIT_UNSTASH_FLAGS($OPENSSLDIR)
329 +
330 AC_SUBST(NEEDS_SSL_WITH_CRYPTO)
331 AC_SUBST(NO_OPENSSL)
332 +
333 #
334 # Define NO_CURL if you do not have libcurl installed. git-http-pull and
335 # git-http-push are not built, and you cannot use http:// and https://
336 # transports.
337 +
338 +GIT_STASH_FLAGS($CURLDIR)
339 +
340 AC_CHECK_LIB([curl], [curl_global_init],
341 [NO_CURL=],
342 [NO_CURL=YesPlease])
343 +
344 +GIT_UNSTASH_FLAGS($CURLDIR)
345 +
346 AC_SUBST(NO_CURL)
347 +
348 #
349 # Define NO_EXPAT if you do not have expat installed. git-http-push is
350 # not built, and you cannot push using http:// and https:// transports.
351 +
352 +GIT_STASH_FLAGS($EXPATDIR)
353 +
354 AC_CHECK_LIB([expat], [XML_ParserCreate],
355 [NO_EXPAT=],
356 [NO_EXPAT=YesPlease])
357 +
358 +GIT_UNSTASH_FLAGS($EXPATDIR)
359 +
360 AC_SUBST(NO_EXPAT)
361 +
362 #
363 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin and
364 # some Solaris installations).
365 # Define NO_ICONV if neither libc nor libiconv support iconv.
366 +
367 +GIT_STASH_FLAGS($ICONVDIR)
368 +
369 AC_DEFUN([ICONVTEST_SRC], [
370 #include <iconv.h>
371
@@ -365,11 +389,17 @@ AC_LINK_IFELSE(ICONVTEST_SRC,
389 [AC_MSG_RESULT([no])
390 NO_ICONV=YesPlease])
391 LIBS="$old_LIBS"])
392 +
393 +GIT_UNSTASH_FLAGS($ICONVDIR)
394 +
395 AC_SUBST(NEEDS_LIBICONV)
396 AC_SUBST(NO_ICONV)
370 -test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv"
397 +
398 #
399 # Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.
400 +
401 +GIT_STASH_FLAGS($ZLIB_PATH)
402 +
403 AC_DEFUN([ZLIBTEST_SRC], [
404 #include <zlib.h>
405
@@ -387,7 +417,11 @@ AC_LINK_IFELSE(ZLIBTEST_SRC,
417 [AC_MSG_RESULT([no])
418 NO_DEFLATE_BOUND=yes])
419 LIBS="$old_LIBS"
420 +
421 +GIT_UNSTASH_FLAGS($ZLIB_PATH)
422 +
423 AC_SUBST(NO_DEFLATE_BOUND)
424 +
425 #
426 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
427 # Patrick Mauritz).