Merge branch 'jk/curl-ldflags'
The way -lcurl library gets linked has been simplified by taking advantage of the fact that we can just ask curl-config command how. * jk/curl-ldflags: build: link with curl-defined linker flagsmaint
						commit
						fa2f2f085e
					
				
							
								
								
									
										30
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										30
									
								
								Makefile
								
								
								
								
							|  | @ -59,6 +59,13 @@ all:: | ||||||
| # Define CURL_CONFIG to curl's configuration program that prints information | # Define CURL_CONFIG to curl's configuration program that prints information | ||||||
| # about the library (e.g., its version number).  The default is 'curl-config'. | # about the library (e.g., its version number).  The default is 'curl-config'. | ||||||
| # | # | ||||||
|  | # Define CURL_LDFLAGS to specify flags that you need to link when using libcurl, | ||||||
|  | # if you do not want to rely on the libraries provided by CURL_CONFIG.  The | ||||||
|  | # default value is a result of `curl-config --libs`.  An example value for | ||||||
|  | # CURL_LDFLAGS is as follows: | ||||||
|  | # | ||||||
|  | #     CURL_LDFLAGS=-lcurl | ||||||
|  | # | ||||||
| # Define NO_EXPAT if you do not have expat installed.  git-http-push is | # Define NO_EXPAT if you do not have expat installed.  git-http-push is | ||||||
| # not built, and you cannot push using http:// and https:// transports (dumb). | # not built, and you cannot push using http:// and https:// transports (dumb). | ||||||
| # | # | ||||||
|  | @ -183,10 +190,6 @@ all:: | ||||||
| # | # | ||||||
| # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin). | # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin). | ||||||
| # | # | ||||||
| # Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix). |  | ||||||
| # |  | ||||||
| # Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix). |  | ||||||
| # |  | ||||||
| # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). | ||||||
| # | # | ||||||
| # Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv. | # Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv. | ||||||
|  | @ -1309,20 +1312,17 @@ else | ||||||
| 	ifdef CURLDIR | 	ifdef CURLDIR | ||||||
| 		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. | 		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. | ||||||
| 		BASIC_CFLAGS += -I$(CURLDIR)/include | 		BASIC_CFLAGS += -I$(CURLDIR)/include | ||||||
| 		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl | 		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) | ||||||
| 	else | 	else | ||||||
| 		CURL_LIBCURL = -lcurl | 		CURL_LIBCURL = | ||||||
| 	endif |  | ||||||
| 	ifdef NEEDS_SSL_WITH_CURL |  | ||||||
| 		CURL_LIBCURL += -lssl |  | ||||||
| 		ifdef NEEDS_CRYPTO_WITH_SSL |  | ||||||
| 			CURL_LIBCURL += -lcrypto |  | ||||||
| 		endif |  | ||||||
| 	endif |  | ||||||
| 	ifdef NEEDS_IDN_WITH_CURL |  | ||||||
| 		CURL_LIBCURL += -lidn |  | ||||||
| 	endif | 	endif | ||||||
|  |  | ||||||
|  | ifdef CURL_LDFLAGS | ||||||
|  | 	CURL_LIBCURL += $(CURL_LDFLAGS) | ||||||
|  | else | ||||||
|  | 	CURL_LIBCURL += $(shell $(CURL_CONFIG) --libs) | ||||||
|  | endif | ||||||
|  |  | ||||||
| 	REMOTE_CURL_PRIMARY = git-remote-http$X | 	REMOTE_CURL_PRIMARY = git-remote-http$X | ||||||
| 	REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X | 	REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X | ||||||
| 	REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES) | 	REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES) | ||||||
|  |  | ||||||
|  | @ -430,8 +430,6 @@ ifeq ($(uname_S),Minix) | ||||||
| 	NO_NSEC = YesPlease | 	NO_NSEC = YesPlease | ||||||
| 	NEEDS_LIBGEN = | 	NEEDS_LIBGEN = | ||||||
| 	NEEDS_CRYPTO_WITH_SSL = YesPlease | 	NEEDS_CRYPTO_WITH_SSL = YesPlease | ||||||
| 	NEEDS_IDN_WITH_CURL = YesPlease |  | ||||||
| 	NEEDS_SSL_WITH_CURL = YesPlease |  | ||||||
| 	NEEDS_RESOLV = | 	NEEDS_RESOLV = | ||||||
| 	NO_HSTRERROR = YesPlease | 	NO_HSTRERROR = YesPlease | ||||||
| 	NO_MMAP = YesPlease | 	NO_MMAP = YesPlease | ||||||
|  | @ -457,7 +455,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL) | ||||||
| 	# Missdetected, hence commented out, see below. | 	# Missdetected, hence commented out, see below. | ||||||
| 	#NO_CURL = YesPlease | 	#NO_CURL = YesPlease | ||||||
| 	# Added manually, see above. | 	# Added manually, see above. | ||||||
| 	NEEDS_SSL_WITH_CURL = YesPlease |  | ||||||
| 	HAVE_LIBCHARSET_H = YesPlease | 	HAVE_LIBCHARSET_H = YesPlease | ||||||
| 	HAVE_STRINGS_H = YesPlease | 	HAVE_STRINGS_H = YesPlease | ||||||
| 	NEEDS_LIBICONV = YesPlease | 	NEEDS_LIBICONV = YesPlease | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								configure.ac
								
								
								
								
							
							
						
						
									
										17
									
								
								configure.ac
								
								
								
								
							|  | @ -600,17 +600,14 @@ AC_CHECK_PROG([CURL_CONFIG], [curl-config], | ||||||
|  |  | ||||||
| if test $CURL_CONFIG != no; then | if test $CURL_CONFIG != no; then | ||||||
|     GIT_CONF_SUBST([CURL_CONFIG]) |     GIT_CONF_SUBST([CURL_CONFIG]) | ||||||
|     if test -z "${NO_OPENSSL}"; then |  | ||||||
|       AC_MSG_CHECKING([if Curl supports SSL]) |     if test -z "$CURL_CONFIG_OPTS"; then | ||||||
|       if test $(curl-config --features|grep SSL) = SSL; then |         CURL_CONFIG_OPTS="--libs" | ||||||
|          NEEDS_SSL_WITH_CURL=YesPlease |  | ||||||
|          AC_MSG_RESULT([yes]) |  | ||||||
|       else |  | ||||||
|          NEEDS_SSL_WITH_CURL= |  | ||||||
|          AC_MSG_RESULT([no]) |  | ||||||
|       fi |  | ||||||
|       GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL]) |  | ||||||
|     fi |     fi | ||||||
|  |  | ||||||
|  |     CURL_LDFLAGS=$($CURL_CONFIG $CURL_CONFIG_OPTS) | ||||||
|  |     AC_MSG_NOTICE([Setting CURL_LDFLAGS to '$CURL_LDFLAGS']) | ||||||
|  |     GIT_CONF_SUBST([CURL_LDFLAGS], [$CURL_LDFLAGS]) | ||||||
| fi | fi | ||||||
|  |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Junio C Hamano
						Junio C Hamano