@matheusbsbs / matheus-bagliano / commits / ebdf53210c
Fork 0

autoconf: Checks for libraries

./configure script checks now if the following libraries are present: * -lssl for SHA1_Init (NO_OPENSSL) * -lcurl for curl_easy_setopt (NO_CURL) * -lexpat for XML_ParserCreate (NO_EXPAT) It also checks if adding the following libraries are needed: * -lcrypto for SHA1_Init (NEEDS_SSL_WITH_CRYPTO) * -liconv for iconv (NEEDS_LIBICONV) * -lsocket for socket (NEEDS_SOCKET) Policy: we check also if NEEDS_LIBRARY libraries are present, even if there is no NO_LIBRARY variable. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Jul 8, 2006 at 23:07 UTC ebdf53210ca30eaaa6cf5f555200678bf5f256ac
1 file changed +21 -7
configure.ac
+21 -7
@@ -26,22 +26,36 @@ AC_DEFUN([GIT_CONF_APPEND_LINE],
26
27
28 ## Checks for libraries.
29 +AC_MSG_NOTICE([CHECKS for libraries])
30 +
31 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
30 -# This also implies MOZILLA_SHA1.
31 -#
32 +# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
33 +AC_CHECK_LIB([ssl], [SHA1_Init],[],
34 +[AC_CHECK_LIB([crypto], [SHA1_INIT],
35 + GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease),
36 + GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease))])
37 +
38 # Define NO_CURL if you do not have curl installed. git-http-pull and
39 # git-http-push are not built, and you cannot use http:// and https://
40 # transports.
35 -#
41 +AC_CHECK_LIB([curl], [curl_global_init],[],
42 +GIT_CONF_APPEND_LINE(NO_CURL=YesPlease))
43 +
44 # Define NO_EXPAT if you do not have expat installed. git-http-push is
45 # not built, and you cannot push using http:// and https:// transports.
38 -#
39 -# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
40 -#
46 +AC_CHECK_LIB([expat], [XML_ParserCreate],[],
47 +GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease))
48 +
49 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
42 -#
50 +AC_CHECK_LIB([c], [iconv],[],
51 +[AC_CHECK_LIB([iconv],[iconv],
52 + GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease),[])])
53 +
54 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
55 # Patrick Mauritz).
56 +AC_CHECK_LIB([c], [socket],[],
57 +[AC_CHECK_LIB([socket],[socket],
58 + GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease),[])])
59
60
61 ## Checks for header files.