git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] Allow configure to override CC_LD_DYNPATH

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2008, 04:56 UTC
Message-ID
<7vwsig9r47.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1218891667-6014-1-git-send-email-gafunchal@gmail.com>
Giovanni Funchal <gafunchal@gmail.com> writes:
Show 27 quoted lines
> @@ -689,7 +689,6 @@ ifeq ($(uname_S),NetBSD)
>  	endif
>  	BASIC_CFLAGS += -I/usr/pkg/include
>  	BASIC_LDFLAGS += -L/usr/pkg/lib
> -	ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
>  endif
>  ifeq ($(uname_S),AIX)
>  	NO_STRCASESTR=YesPlease
> @@ -763,9 +762,21 @@ ifneq (,$(findstring arm,$(uname_M)))
>  	ARM_SHA1 = YesPlease
>  endif
>  
> +# Runtime dynamic library path switch
> +ifdef NO_R_TO_GCC_LINKER
> +	# Some linkers use -Wl,-rpath,
> +	CC_LD_DYNPATH = -Wl,-rpath,
> +else
> +	# Some others need -R
> +	CC_LD_DYNPATH = -R
> +endif
> +
>  -include config.mak.autogen
>  -include config.mak
>  
> +ifeq ($(uname_S),NetBSD)
> +	ALL_LDFLAGS += $(CC_LD_DYNPATH)/usr/pkg/lib
> +endif
I think this NetBSD change might be a good idea.

By moving "ifdef" before where we "include config.mak", however, you broke existing setups that use NO_R_TO_GCC_LINKER to cause "-Wl,-rpath=" to be used.

How about doing it the way the attached patch does instead? Then the autoconf can configure CC_LD_DYNPATH to be used that may even be different from "-Wl,-rpath=" (e.g. the one with double-dash "-Wl,--rpath").

 Makefile |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 53ab4b5..264ede3 100644
--- a/Makefile
+++ b/Makefile
@@ -688,8 +688,7 @@ ifeq ($(uname_S),NetBSD)
 		NEEDS_LIBICONV = YesPlease
 	endif
 	BASIC_CFLAGS += -I/usr/pkg/include
-	BASIC_LDFLAGS += -L/usr/pkg/lib
-	ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
+	BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
 endif
 ifeq ($(uname_S),AIX)
 	NO_STRCASESTR=YesPlease
@@ -781,12 +780,14 @@ ifeq ($(uname_S),Darwin)
 	endif
 endif
 
-ifdef NO_R_TO_GCC_LINKER
-	# Some gcc does not accept and pass -R to the linker to specify
-	# the runtime dynamic library path.
-	CC_LD_DYNPATH = -Wl,-rpath=
-else
-	CC_LD_DYNPATH = -R
+ifndef CC_LD_DYNPATH
+	ifdef NO_R_TO_GCC_LINKER
+		# Some gcc does not accept and pass -R to the linker to specify
+		# the runtime dynamic library path.
+		CC_LD_DYNPATH = -Wl,-rpath,
+	else
+		CC_LD_DYNPATH = -R
+	endif
 endif
 
 ifdef NO_CURL
Previous: Giovanni Funchal
Message 2 of 2 in “Allow configure to override CC_LD_DYNPATH”
  1. 1/2 Allow configure to override CC_LD_DYNPATHGiovanni Funchal, Aug 16, 2008
  2. Junio C HamanoAug 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.