Salome HOME
merge from master
[tools/sat_salome.git] / products / patches / gdal.0002-GNUmakefile-tooLongLine.patch
1 --- gdal-2.4.0-ref/gdal/GNUmakefile     2022-01-10 21:48:46.000000000 +0100
2 +++ gdal-2.4.0-new/gdal/GNUmakefile     2022-03-31 18:23:13.203131414 +0200
3 @@ -59,9 +59,18 @@
4         $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LDFLAGS) $(LIBS) \
5                 -o $(GDAL_SLIB)
6  
7 +#  split potentially long lines
8 +SORTED  := $(sort $(wildcard $(GDAL_OBJ:.o=.lo)))
9 +NSORTED := $(words $(SORTED))
10 +#  mid left and right indices
11 +MIDL := $(shell echo $$(( $(NSORTED) / 2 )) )
12 +MIDR := $(shell echo $$(( $(MIDL) + 1 )) )
13 +
14  $(LIBGDAL):    $(GDAL_OBJ:.o=.lo)
15 -       $(LD) $(LDFLAGS) $(LIBS) -o $@ $(sort $(wildcard $(GDAL_OBJ:.o=.lo))) \
16 -           -rpath $(INST_LIB) \
17 +       $(LD) $(LDFLAGS) $(LIBS) -o $@ \
18 +       $(wordlist 1,$(MIDL),$(SORTED)) \
19 +       $(wordlist $(MIDR),$(words $(SORTED)),$(SORTED)) \
20 +       -rpath $(INST_LIB) \
21             -no-undefined \
22             -version-info $(LIBGDAL_CURRENT):$(LIBGDAL_REVISION):$(LIBGDAL_AGE)
23  ifeq ($(MACOSX_FRAMEWORK),yes)