# Linking with -R (rpath) not supported on Darwin

14 messages from 2007-10-03 to 2007-10-22. Participants: Benoit SIGOURE, Junio C Hamano, Brian Gernhardt, Benoit Sigoure, Steven Grimm, Shawn O. Pearce, Brian Dessent, Johannes Schindelin.
Thread: https://gitlist.dev/t/10132

## Benoit SIGOURE, 2007-10-03 21:34

Subject: Linking with -R (rpath) not supported on Darwin
Message-ID: <4D954ADB-E66E-43CA-87EE-7522FFA87370@lrde.epita.fr>
URL: https://gitlist.dev/e/4D954ADB-E66E-43CA-87EE-7522FFA87370%40lrde.epita.fr

```
Hello,
I've just compiled HEAD (1.5.3.4.209.g9e417) and saw a:
     LINK git-http-fetch
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'

It didn't harm but the build process should be more careful to not  
use options that are not supported by the compiler.  And it's not a  
matter of using -Wl,-rpath instead.

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



```

## Junio C Hamano, 2007-10-03 21:41

Subject: Re: Linking with -R (rpath) not supported on Darwin
Message-ID: <7vsl4rdgf4.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vsl4rdgf4.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <4D954ADB-E66E-43CA-87EE-7522FFA87370@lrde.epita.fr>

```
Benoit SIGOURE <tsuna@lrde.epita.fr> writes:

> It didn't harm but the build process should be more careful to not use
> options that are not supported by the compiler.  And it's not a
> matter of using -Wl,-rpath instead.

As I do not have an access to a Darwin box (nor anybody sent me
a free Mac yet), I do not have any interest in fixing it myself
nor more importantly any means to verify the result.  That makes
it _your_ build process that should be more careful ;-).

You know where -R is coming from and can find out what options
_your_ platform wants, so why not send in a patch _before_
complaining?

```

## Benoit Sigoure, 2007-10-03 22:20

Subject: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <1191450052-23619-1-git-send-email-tsuna@lrde.epita.fr>
URL: https://gitlist.dev/e/1191450052-23619-1-git-send-email-tsuna%40lrde.epita.fr
In-Reply-To: <7vsl4rdgf4.fsf@gitster.siamese.dyndns.org>

```
On Darwin for instance, there is no -R or -Wl,-rpath thing to fiddle with,
it's simply not supported by the dynamic loader.  This patch introduces a
NO_RPATH define which is enabled by default for Darwin.
---
 Makefile |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index a1fe443..7c6c453 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,9 @@ all::
 # that tells runtime paths to dynamic libraries;
 # "-Wl,-rpath=/path/lib" is used instead.
 #
+# Define NO_RPATH if your dynamic loader doesn't support runtime paths at
+# all.
+#
 # Define USE_NSEC below if you want git to care about sub-second file mtimes
 # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
 # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
@@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
 			BASIC_LDFLAGS += -L/opt/local/lib
 		endif
 	endif
+        NO_RPATH = YesPlease
 endif
 
 ifdef NO_R_TO_GCC_LINKER
@@ -521,7 +525,10 @@ ifndef NO_CURL
 	ifdef CURLDIR
 		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
 		BASIC_CFLAGS += -I$(CURLDIR)/include
-		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
+		CURL_LIBCURL = -L$(CURLDIR)/$(lib) -lcurl
+ifndef NO_RPATH
+		CURL_LIBCURL += $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
+endif
 	else
 		CURL_LIBCURL = -lcurl
 	endif
@@ -539,7 +546,10 @@ endif
 
 ifdef ZLIB_PATH
 	BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-	EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+	EXTLIBS += -L$(ZLIB_PATH)/$(lib)
+ifndef NO_RPATH
+	EXTLIBS += $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+endif
 endif
 EXTLIBS += -lz
 
@@ -547,7 +557,10 @@ ifndef NO_OPENSSL
 	OPENSSL_LIBSSL = -lssl
 	ifdef OPENSSLDIR
 		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
-		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
+		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib)
+ifndef NO_RPATH
+		OPENSSL_LINK = $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
+endif
 	else
 		OPENSSL_LINK =
 	endif
@@ -564,7 +577,10 @@ endif
 ifdef NEEDS_LIBICONV
 	ifdef ICONVDIR
 		BASIC_CFLAGS += -I$(ICONVDIR)/include
-		ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
+		ICONV_LINK = -L$(ICONVDIR)/$(lib)
+ifndef NO_RPATH
+		ICONV_LINK = $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
+endif
 	else
 		ICONV_LINK =
 	endif
-- 
1.5.3.4.209.g9e417

```

## Brian Gernhardt, 2007-10-03 22:39

Subject: Re: Linking with -R (rpath) not supported on Darwin
Message-ID: <ECAD7CED-FFA0-46F2-8094-2FDE47CB5D54@silverinsanity.com>
URL: https://gitlist.dev/e/ECAD7CED-FFA0-46F2-8094-2FDE47CB5D54%40silverinsanity.com
In-Reply-To: <4D954ADB-E66E-43CA-87EE-7522FFA87370@lrde.epita.fr>

```

On Oct 3, 2007, at 5:34 PM, Benoit SIGOURE wrote:

> Hello,
> I've just compiled HEAD (1.5.3.4.209.g9e417) and saw a:
>     LINK git-http-fetch
> i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'
>
> It didn't harm but the build process should be more careful to not  
> use options that are not supported by the compiler.  And it's not a  
> matter of using -Wl,-rpath instead.

I compile git very regularly on my MacBook Pro and have never seen  
this error.  Do you have the most recent copy of Xcode?  I've seen  
odd errors on one of the not very old versions of the developer's  
tools.  For me, `gcc -v` reports "gcc version 4.0.1 (Apple Computer,  
Inc. build 5367)".

~~ Brian

```

## Steven Grimm, 2007-10-03 22:49

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <47041C7A.9090003@midwinter.com>
URL: https://gitlist.dev/e/47041C7A.9090003%40midwinter.com
In-Reply-To: <1191450052-23619-1-git-send-email-tsuna@lrde.epita.fr>

```
Benoit Sigoure wrote:
> On Darwin for instance, there is no -R or -Wl,-rpath thing to fiddle with,
> it's simply not supported by the dynamic loader.  This patch introduces a
> NO_RPATH define which is enabled by default for Darwin.
>   

I compile git on a MacBook Pro (OS X 10.4, gcc 4.0.1 build 5367 from the 
normal Xcode install that comes on the OS install DVD) on a regular 
basis. The makefile works fine for me. I suspect there's something else 
going on here.

-Steve

```

## Benoit SIGOURE, 2007-10-03 22:58

Subject: Re: Linking with -R (rpath) not supported on Darwin
Message-ID: <3BF85D94-84E2-4D56-82FC-E8108E28468D@lrde.epita.fr>
URL: https://gitlist.dev/e/3BF85D94-84E2-4D56-82FC-E8108E28468D%40lrde.epita.fr
In-Reply-To: <ECAD7CED-FFA0-46F2-8094-2FDE47CB5D54@silverinsanity.com>

```
On Oct 4, 2007, at 12:39 AM, Brian Gernhardt wrote:

> On Oct 3, 2007, at 5:34 PM, Benoit SIGOURE wrote:
>
>> Hello,
>> I've just compiled HEAD (1.5.3.4.209.g9e417) and saw a:
>>     LINK git-http-fetch
>> i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'
>>
>> It didn't harm but the build process should be more careful to not  
>> use options that are not supported by the compiler.  And it's not  
>> a matter of using -Wl,-rpath instead.
>
> I compile git very regularly on my MacBook Pro and have never seen  
> this error.  Do you have the most recent copy of Xcode?  I've seen  
> odd errors on one of the not very old versions of the developer's  
> tools.  For me, `gcc -v` reports "gcc version 4.0.1 (Apple  
> Computer, Inc. build 5367)".
>
> ~~ Brian

$ gcc -v
[...]
gcc version 4.0.1 (Apple Computer, Inc. build 5367)

I've seen this message for the 1st time when compiling Git after my  
nightly git pull today.  Anyways, this should be done because there  
is no point in trying to use a feature that doesn't exist, even  
though GCC is being nice by simply issuing a warning instead of an  
error.

See:
http://developer.apple.com/releasenotes/DeveloperTools/RN-dyld/ 
index.html

In the section "Known Issues" it clearly states "No rpath support".

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



```

## Junio C Hamano, 2007-10-03 23:18

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <7vejgbdbyn.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vejgbdbyn.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1191450052-23619-1-git-send-email-tsuna@lrde.epita.fr>

```
Benoit Sigoure <tsuna@lrde.epita.fr> writes:

> diff --git a/Makefile b/Makefile
> index a1fe443..7c6c453 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -100,6 +100,9 @@ all::
>  # that tells runtime paths to dynamic libraries;
>  # "-Wl,-rpath=/path/lib" is used instead.
>  #
> +# Define NO_RPATH if your dynamic loader doesn't support runtime paths at
> +# all.
> +#
>  # Define USE_NSEC below if you want git to care about sub-second file mtimes
>  # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
>  # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely

Thanks for this part;

> @@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
>  			BASIC_LDFLAGS += -L/opt/local/lib
>  		endif
>  	endif
> +        NO_RPATH = YesPlease
>  endif

I'll let Darwin users to fight the defaults for this part out.

> @@ -521,7 +525,10 @@ ifndef NO_CURL
>  	ifdef CURLDIR
>  		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
>  		BASIC_CFLAGS += -I$(CURLDIR)/include
> -		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
> +		CURL_LIBCURL = -L$(CURLDIR)/$(lib) -lcurl
> +ifndef NO_RPATH
> +		CURL_LIBCURL += $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
> +endif
>  	else
>  		CURL_LIBCURL = -lcurl
>  	endif

> @@ -539,7 +546,10 @@ endif
>  
>  ifdef ZLIB_PATH
>  	BASIC_CFLAGS += -I$(ZLIB_PATH)/include
> -	EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
> +	EXTLIBS += -L$(ZLIB_PATH)/$(lib)
> +ifndef NO_RPATH
> +	EXTLIBS += $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
> +endif
>  endif
>  EXTLIBS += -lz
>  

While these parts are ugly but correct, I think...

> @@ -547,7 +557,10 @@ ifndef NO_OPENSSL
>  	OPENSSL_LIBSSL = -lssl
>  	ifdef OPENSSLDIR
>  		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
> -		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
> +		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib)
> +ifndef NO_RPATH
> +		OPENSSL_LINK = $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
> +endif
>  	else
>  		OPENSSL_LINK =
>  	endif

this and the ICONV one are missing s/=/+=/.

If we do not care about supporting too old GNU make, we can do
this by first adding this near the top:

        ifndef NO_RPATH
        LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
        else
        LINKER_PATH = -L$(1)
        endif

and then doing something like:

	CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
	OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))

to make it easier to read and less error prone.

```

## Brian Gernhardt, 2007-10-04 01:08

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <FC9DDD6F-14A5-4B73-9192-042EA107ED77@silverinsanity.com>
URL: https://gitlist.dev/e/FC9DDD6F-14A5-4B73-9192-042EA107ED77%40silverinsanity.com
In-Reply-To: <47041C7A.9090003@midwinter.com>

```

On Oct 3, 2007, at 6:49 PM, Steven Grimm wrote:

> Benoit Sigoure wrote:
>> On Darwin for instance, there is no -R or -Wl,-rpath thing to  
>> fiddle with,
>> it's simply not supported by the dynamic loader.  This patch  
>> introduces a
>> NO_RPATH define which is enabled by default for Darwin.
>>
>
> I compile git on a MacBook Pro (OS X 10.4, gcc 4.0.1 build 5367  
> from the normal Xcode install that comes on the OS install DVD) on  
> a regular basis. The makefile works fine for me. I suspect there's  
> something else going on here.

The rpath code is only used if you define one of the following options:

CURLDIR
ZLIB_PATH
OPENSSLDIR
ICONVDIR

The default Darwin options don't define any of these, it just relies  
on finding those libraries in the library path (including /sw or /opt/ 
local if you have them installed).

~~ Brian G.

```

## Brian Gernhardt, 2007-10-04 01:10

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <3620711B-6F47-4F84-83A0-78F5BF9CBE88@silverinsanity.com>
URL: https://gitlist.dev/e/3620711B-6F47-4F84-83A0-78F5BF9CBE88%40silverinsanity.com
In-Reply-To: <7vejgbdbyn.fsf@gitster.siamese.dyndns.org>

```

On Oct 3, 2007, at 7:18 PM, Junio C Hamano wrote:

> Benoit Sigoure <tsuna@lrde.epita.fr> writes:
>
>> @@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
>>  			BASIC_LDFLAGS += -L/opt/local/lib
>>  		endif
>>  	endif
>> +        NO_RPATH = YesPlease
>>  endif
>
> I'll let Darwin users to fight the defaults for this part out.

It makes sense, since Apple's gcc/ld/dyld doesn't use rpath.

~~ Brian

```

## Benoit SIGOURE, 2007-10-04 15:59

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <34DAC3CA-E226-4488-8B03-FC45A6A95F78@lrde.epita.fr>
URL: https://gitlist.dev/e/34DAC3CA-E226-4488-8B03-FC45A6A95F78%40lrde.epita.fr
In-Reply-To: <7vejgbdbyn.fsf@gitster.siamese.dyndns.org>

```
On Oct 4, 2007, at 1:18 AM, Junio C Hamano wrote:

> Benoit Sigoure <tsuna@lrde.epita.fr> writes:
>
>> diff --git a/Makefile b/Makefile
>> index a1fe443..7c6c453 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -100,6 +100,9 @@ all::
>>  # that tells runtime paths to dynamic libraries;
>>  # "-Wl,-rpath=/path/lib" is used instead.
>>  #
>> +# Define NO_RPATH if your dynamic loader doesn't support runtime  
>> paths at
>> +# all.
>> +#
>>  # Define USE_NSEC below if you want git to care about sub-second  
>> file mtimes
>>  # and ctimes. Note that you need recent glibc (at least 2.2.4)  
>> for this, and
>>  # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it  
>> will likely
>
> Thanks for this part;
>
>> @@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
>>  			BASIC_LDFLAGS += -L/opt/local/lib
>>  		endif
>>  	endif
>> +        NO_RPATH = YesPlease
>>  endif
>
> I'll let Darwin users to fight the defaults for this part out.

No more replies on this thread, and the Apple documentation confirms  
that there is no rpath support in the dynamic loader of OSX 10.4 and  
before.  I don't know about the soon-to-be-released 10.5 aka Leopard.

>> @@ -521,7 +525,10 @@ ifndef NO_CURL
>>  	ifdef CURLDIR
>>  		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
>>  		BASIC_CFLAGS += -I$(CURLDIR)/include
>> -		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$ 
>> (lib) -lcurl
>> +		CURL_LIBCURL = -L$(CURLDIR)/$(lib) -lcurl
>> +ifndef NO_RPATH
>> +		CURL_LIBCURL += $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
>> +endif
>>  	else
>>  		CURL_LIBCURL = -lcurl
>>  	endif
>
>> @@ -539,7 +546,10 @@ endif
>>
>>  ifdef ZLIB_PATH
>>  	BASIC_CFLAGS += -I$(ZLIB_PATH)/include
>> -	EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$ 
>> (lib)
>> +	EXTLIBS += -L$(ZLIB_PATH)/$(lib)
>> +ifndef NO_RPATH
>> +	EXTLIBS += $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
>> +endif
>>  endif
>>  EXTLIBS += -lz
>>
>
> While these parts are ugly but correct, I think...
>
>> @@ -547,7 +557,10 @@ ifndef NO_OPENSSL
>>  	OPENSSL_LIBSSL = -lssl
>>  	ifdef OPENSSLDIR
>>  		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
>> -		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$ 
>> (OPENSSLDIR)/$(lib)
>> +		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib)
>> +ifndef NO_RPATH
>> +		OPENSSL_LINK = $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
>> +endif
>>  	else
>>  		OPENSSL_LINK =
>>  	endif
>
> this and the ICONV one are missing s/=/+=/.

You're right, sorry.

>
> If we do not care about supporting too old GNU make, we can do
> this by first adding this near the top:
>
>         ifndef NO_RPATH
>         LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
>         else
>         LINKER_PATH = -L$(1)
>         endif
>
> and then doing something like:
>
> 	CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
> 	OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))
>
> to make it easier to read and less error prone.
>

Yes.  I can rework the patch, but the question is: do you care about  
old GNU make?  Can I rewrite the patch with this feature?

Thanks.

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



```

## Benoit SIGOURE, 2007-10-21 21:56

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <09169ECD-19E1-44D1-8539-71EBBA3826A8@lrde.epita.fr>
URL: https://gitlist.dev/e/09169ECD-19E1-44D1-8539-71EBBA3826A8%40lrde.epita.fr
In-Reply-To: <34DAC3CA-E226-4488-8B03-FC45A6A95F78@lrde.epita.fr>

```
On Oct 4, 2007, at 5:59 PM, Benoit SIGOURE wrote:

> On Oct 4, 2007, at 1:18 AM, Junio C Hamano wrote:
>
>> Benoit Sigoure <tsuna@lrde.epita.fr> writes:
>>
>>> diff --git a/Makefile b/Makefile
>>> index a1fe443..7c6c453 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -100,6 +100,9 @@ all::
>>>  # that tells runtime paths to dynamic libraries;
>>>  # "-Wl,-rpath=/path/lib" is used instead.
>>>  #
>>> +# Define NO_RPATH if your dynamic loader doesn't support runtime  
>>> paths at
>>> +# all.
>>> +#
>>>  # Define USE_NSEC below if you want git to care about sub-second  
>>> file mtimes
>>>  # and ctimes. Note that you need recent glibc (at least 2.2.4)  
>>> for this, and
>>>  # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using  
>>> it will likely
>>
>> Thanks for this part;
>>
>>> @@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
>>>  			BASIC_LDFLAGS += -L/opt/local/lib
>>>  		endif
>>>  	endif
>>> +        NO_RPATH = YesPlease
>>>  endif
>>
>> I'll let Darwin users to fight the defaults for this part out.
>
> No more replies on this thread, and the Apple documentation  
> confirms that there is no rpath support in the dynamic loader of  
> OSX 10.4 and before.  I don't know about the soon-to-be-released  
> 10.5 aka Leopard.
>
>>> @@ -521,7 +525,10 @@ ifndef NO_CURL
>>>  	ifdef CURLDIR
>>>  		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
>>>  		BASIC_CFLAGS += -I$(CURLDIR)/include
>>> -		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$ 
>>> (lib) -lcurl
>>> +		CURL_LIBCURL = -L$(CURLDIR)/$(lib) -lcurl
>>> +ifndef NO_RPATH
>>> +		CURL_LIBCURL += $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
>>> +endif
>>>  	else
>>>  		CURL_LIBCURL = -lcurl
>>>  	endif
>>
>>> @@ -539,7 +546,10 @@ endif
>>>
>>>  ifdef ZLIB_PATH
>>>  	BASIC_CFLAGS += -I$(ZLIB_PATH)/include
>>> -	EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$ 
>>> (lib)
>>> +	EXTLIBS += -L$(ZLIB_PATH)/$(lib)
>>> +ifndef NO_RPATH
>>> +	EXTLIBS += $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
>>> +endif
>>>  endif
>>>  EXTLIBS += -lz
>>>
>>
>> While these parts are ugly but correct, I think...
>>
>>> @@ -547,7 +557,10 @@ ifndef NO_OPENSSL
>>>  	OPENSSL_LIBSSL = -lssl
>>>  	ifdef OPENSSLDIR
>>>  		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
>>> -		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$ 
>>> (OPENSSLDIR)/$(lib)
>>> +		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib)
>>> +ifndef NO_RPATH
>>> +		OPENSSL_LINK = $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
>>> +endif
>>>  	else
>>>  		OPENSSL_LINK =
>>>  	endif
>>
>> this and the ICONV one are missing s/=/+=/.
>
> You're right, sorry.
>
>>
>> If we do not care about supporting too old GNU make, we can do
>> this by first adding this near the top:
>>
>>         ifndef NO_RPATH
>>         LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
>>         else
>>         LINKER_PATH = -L$(1)
>>         endif
>>
>> and then doing something like:
>>
>> 	CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
>> 	OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))
>>
>> to make it easier to read and less error prone.
>>
>
> Yes.  I can rework the patch, but the question is: do you care  
> about old GNU make?  Can I rewrite the patch with this feature?

I know Junio is still offline but maybe someone else has an objection  
against this?

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



```

## Shawn O. Pearce, 2007-10-22 06:44

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <20071022064454.GV14735@spearce.org>
URL: https://gitlist.dev/e/20071022064454.GV14735%40spearce.org
In-Reply-To: <09169ECD-19E1-44D1-8539-71EBBA3826A8@lrde.epita.fr>

```
Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> >On Oct 4, 2007, at 1:18 AM, Junio C Hamano wrote:
> >>Benoit Sigoure <tsuna@lrde.epita.fr> writes:
> >>
> >>If we do not care about supporting too old GNU make, we can do
> >>this by first adding this near the top:
> >>
> >>        ifndef NO_RPATH
> >>        LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
> >>        else
> >>        LINKER_PATH = -L$(1)
> >>        endif
> >>
> >>and then doing something like:
> >>
> >>	CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
> >>	OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))
> >>
> >>to make it easier to read and less error prone.
> >
> >Yes.  I can rework the patch, but the question is: do you care  
> >about old GNU make?  Can I rewrite the patch with this feature?
> 
> I know Junio is still offline but maybe someone else has an objection  
> against this?

How old of a GNU make are talking about here?  The above is certainly
a lot nicer to read, but I'd hate to suddenly ship a new Git that
someone cannot compile because their GNU make is too old.

GNU make is fortunately pretty easy to compile, so it shouldn't be
that difficult for someone to build a newer version if they had to,
but why make them go through all that extra work just to install
a new Git?

What about using a small helper shell script and using $(shell)
instead of $(call)?

So I guess in short I think I was in agreement with Junio a while
ago on this, which was that I don't want to require a newer GNU
make than we already require our users to have.

-- 
Shawn.

```

## Brian Dessent, 2007-10-22 06:52

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <471C48A2.136B9B96@dessent.net>
URL: https://gitlist.dev/e/471C48A2.136B9B96%40dessent.net
In-Reply-To: <20071022064454.GV14735@spearce.org>

```
"Shawn O. Pearce" wrote:

> How old of a GNU make are talking about here?  The above is certainly

According to the NEWS file, $(call) was added to GNU make v3.78,
released 1999-09-22.

Brian

```

## Johannes Schindelin, 2007-10-22 10:52

Subject: Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
Message-ID: <Pine.LNX.4.64.0710221149530.25221@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710221149530.25221%40racer.site
In-Reply-To: <20071022064454.GV14735@spearce.org>

```
Hi,

On Mon, 22 Oct 2007, Shawn O. Pearce wrote:

> Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> > >On Oct 4, 2007, at 1:18 AM, Junio C Hamano wrote:
> > >>Benoit Sigoure <tsuna@lrde.epita.fr> writes:
> > >>
> > >>If we do not care about supporting too old GNU make, we can do
> > >>this by first adding this near the top:
> > >>
> > >>        ifndef NO_RPATH
> > >>        LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
> > >>        else
> > >>        LINKER_PATH = -L$(1)
> > >>        endif
> > >>
> > >>and then doing something like:
> > >>
> > >>	CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
> > >>	OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))
> > >>
> > >>to make it easier to read and less error prone.
> > >
> > >Yes.  I can rework the patch, but the question is: do you care  
> > >about old GNU make?  Can I rewrite the patch with this feature?
> > 
> > I know Junio is still offline but maybe someone else has an objection 
> > against this?
> 
> How old of a GNU make are talking about here?  The above is certainly a 
> lot nicer to read, but I'd hate to suddenly ship a new Git that someone 
> cannot compile because their GNU make is too old.

I seem to remember remember that we had some shell quoting in the 
Makefile, and it was "call"ed.  That broke some setups, so we got rid of 
it.

*starting "git log -Scall Makefile"*: yep.  It even was me fixing it, in 
39c015c556f285106931e0500f301de462b0e46e.

Ciao,
Dscho

```
