79
79
#
80
80
# Define NO_ICONV if your libc does not properly support iconv.
81
81
#
82
+ # Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
83
+ # tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
84
+ # is used instead.
85
+ #
82
86
# Define USE_NSEC below if you want git to care about sub-second file mtimes
83
87
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
84
88
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
@@ -422,11 +426,19 @@ ifeq ($(uname_S),Darwin)
422
426
endif
423
427
endif
424
428
429
+ ifdef NO_R_TO_GCC_LINKER
430
+ # Some gcc does not accept and pass -R to the linker to specify
431
+ # the runtime dynamic library path.
432
+ CC_LD_DYNPATH = -Wl,-rpath=
433
+ else
434
+ CC_LD_DYNPATH = -R
435
+ endif
436
+
425
437
ifndef NO_CURL
426
438
ifdef CURLDIR
427
- # This is still problematic -- gcc does not always want -R .
439
+ # Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case .
428
440
BASIC_CFLAGS += -I$(CURLDIR)/include
429
- CURL_LIBCURL = -L$(CURLDIR)/lib -R $(CURLDIR)/lib -lcurl
441
+ CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH) $(CURLDIR)/lib -lcurl
430
442
else
431
443
CURL_LIBCURL = -lcurl
432
444
endif
@@ -445,9 +457,8 @@ endif
445
457
ifndef NO_OPENSSL
446
458
OPENSSL_LIBSSL = -lssl
447
459
ifdef OPENSSLDIR
448
- # Again this may be problematic -- gcc does not always want -R.
449
460
BASIC_CFLAGS += -I$(OPENSSLDIR)/include
450
- OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R $(OPENSSLDIR)/lib
461
+ OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH) $(OPENSSLDIR)/lib
451
462
else
452
463
OPENSSL_LINK =
453
464
endif
463
474
endif
464
475
ifdef NEEDS_LIBICONV
465
476
ifdef ICONVDIR
466
- # Again this may be problematic -- gcc does not always want -R.
467
477
BASIC_CFLAGS += -I$(ICONVDIR)/include
468
- ICONV_LINK = -L$(ICONVDIR)/lib -R $(ICONVDIR)/lib
478
+ ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH) $(ICONVDIR)/lib
469
479
else
470
480
ICONV_LINK =
471
481
endif
0 commit comments