@@ -1706,7 +1706,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
1706
1706
' -DGIT_MAN_PATH="$(mandir_SQ)"' \
1707
1707
' -DGIT_INFO_PATH="$(infodir_SQ)"'
1708
1708
1709
- git$X : git.o $(BUILTIN_OBJS ) $(GITLIBS )
1709
+ git$X : git.o GIT-LDFLAGS $(BUILTIN_OBJS ) $(GITLIBS )
1710
1710
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ git.o \
1711
1711
$(BUILTIN_OBJS ) $(ALL_LDFLAGS ) $(LIBS )
1712
1712
@@ -2004,17 +2004,17 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
2004
2004
-DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
2005
2005
endif
2006
2006
2007
- git-% $X : % .o $(GITLIBS )
2007
+ git-% $X : % .o GIT-LDFLAGS $(GITLIBS )
2008
2008
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) $(LIBS )
2009
2009
2010
- git-imap-send$X : imap-send.o $(GITLIBS )
2010
+ git-imap-send$X : imap-send.o GIT-LDFLAGS $(GITLIBS )
2011
2011
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) \
2012
2012
$(LIBS ) $(OPENSSL_LINK ) $(OPENSSL_LIBSSL ) $(LIB_4_CRYPTO )
2013
2013
2014
- git-http-fetch$X : revision.o http.o http-walker.o http-fetch.o $(GITLIBS )
2014
+ git-http-fetch$X : revision.o http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS )
2015
2015
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) \
2016
2016
$(LIBS ) $(CURL_LIBCURL )
2017
- git-http-push$X : revision.o http.o http-push.o $(GITLIBS )
2017
+ git-http-push$X : revision.o http.o http-push.o GIT-LDFLAGS $(GITLIBS )
2018
2018
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) \
2019
2019
$(LIBS ) $(CURL_LIBCURL ) $(EXPAT_LIBEXPAT )
2020
2020
@@ -2024,7 +2024,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
2024
2024
ln -s $< $@ 2> /dev/null || \
2025
2025
cp $< $@
2026
2026
2027
- $(REMOTE_CURL_PRIMARY ) : remote-curl.o http.o http-walker.o $(GITLIBS )
2027
+ $(REMOTE_CURL_PRIMARY ) : remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS )
2028
2028
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) \
2029
2029
$(LIBS ) $(CURL_LIBCURL ) $(EXPAT_LIBEXPAT )
2030
2030
@@ -2094,6 +2094,15 @@ GIT-CFLAGS: FORCE
2094
2094
echo " $$ FLAGS" > GIT-CFLAGS; \
2095
2095
fi
2096
2096
2097
+ TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS ) )
2098
+
2099
+ GIT-LDFLAGS : FORCE
2100
+ @FLAGS=' $(TRACK_LDFLAGS)' ; \
2101
+ if test x" $$ FLAGS" ! = x" ` cat GIT-LDFLAGS 2> /dev/null` " ; then \
2102
+ echo 1>&2 " * new link flags" ; \
2103
+ echo " $$ FLAGS" > GIT-LDFLAGS; \
2104
+ fi
2105
+
2097
2106
# We need to apply sq twice, once to protect from the shell
2098
2107
# that runs GIT-BUILD-OPTIONS, and then again to protect it
2099
2108
# and the first level quoting from the shell that runs "echo".
@@ -2165,7 +2174,7 @@ test-svn-fe$X: vcs-svn/lib.a
2165
2174
2166
2175
.PRECIOUS : $(TEST_OBJS )
2167
2176
2168
- test-% $X : test-% .o $(GITLIBS )
2177
+ test-% $X : test-% .o GIT-LDFLAGS $(GITLIBS )
2169
2178
$(QUIET_LINK )$(CC ) $(ALL_CFLAGS ) -o $@ $(ALL_LDFLAGS ) $(filter % .o,$^ ) $(filter % .a,$^ ) $(LIBS )
2170
2179
2171
2180
check-sha1 :: test-sha1$X
@@ -2375,7 +2384,7 @@ ifndef NO_TCLTK
2375
2384
$(MAKE) -C gitk-git clean
2376
2385
$(MAKE) -C git-gui clean
2377
2386
endif
2378
- $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
2387
+ $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT- GUI-VARS GIT-BUILD-OPTIONS
2379
2388
2380
2389
.PHONY : all install clean strip
2381
2390
.PHONY : shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
0 commit comments