Skip to content

Commit 345d1db

Browse files
author
Homme Zwaagstra
committed
Add support for the GRASS driver to the GDAL build.
1 parent e269cac commit 345d1db

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ netcdf-bin libnetcdf-dev
5353
GRASS := /usr/local/bin/grass
5454
GDAL_CONFIG := /usr/local/bin/gdal_config
5555
BUILD_ESSENTIAL := /usr/share/build-essential
56+
MAN := /usr/bin/man
5657

5758
# Build tools.
5859
SVN := /usr/bin/svn
5960
GIT := /usr/bin/git
6061

61-
# The number of processors available.
62-
NPROC := $(shell nproc)
63-
6462
install: $(GRASS)
6563

66-
$(GRASS): /tmp/grass $(BUILD_ESSENTIAL) $(GDAL_CONFIG)
64+
$(GRASS): /tmp/grass $(BUILD_ESSENTIAL) $(GDAL_CONFIG) $(MAN)
6765
cd /tmp/grass/ \
6866
&& CFLAGS="-O2 -Wall" LDFLAGS="-s" ./configure \
6967
--enable-largefile=yes \
@@ -83,11 +81,15 @@ $(GRASS): /tmp/grass $(BUILD_ESSENTIAL) $(GDAL_CONFIG)
8381
--with-odbc=yes \
8482
--with-netcdf=yes \
8583
--with-liblas=yes \
86-
&& make -j$(NPROC) \
84+
&& make -j$$(nproc) \
8785
&& make install \
86+
&& export WITH_GRASS=/usr/local/grass-$$(head -3 /tmp/grass/include/VERSION | tr "\n" . | sed 's/\.$$//') \
87+
&& echo "$${WITH_GRASS}/lib" > /etc/ld.so.conf.d/grass.conf \
8888
&& ldconfig \
8989
&& ln -fs /usr/local/bin/grass$$(head -2 /tmp/grass/include/VERSION | tr -d "\n") $(GRASS) \
90-
&& touch -c $(GRASS)
90+
&& touch -c -r /tmp/apt-updated $(GDAL_CONFIG) \
91+
&& make -C /usr/local/src/gdal-docker install WITH_GRASS=$$WITH_GRASS \
92+
&& touch -c $(GDAL_CONFIG) $(GRASS)
9193

9294
$(GDAL_CONFIG): /usr/local/src/gdal-docker
9395
make -C /usr/local/src/gdal-docker install \
@@ -100,6 +102,9 @@ $(GDAL_CONFIG): /usr/local/src/gdal-docker
100102
$(SVN) checkout --quiet "http://svn.osgeo.org/grass/grass/$(GRASS_VERSION)/" /tmp/grass/ \
101103
&& touch -c /tmp/grass
102104

105+
$(MAN): /tmp/apt-updated
106+
apt-get install -y man && touch -c $(MAN)
107+
103108
$(SVN): /tmp/apt-updated
104109
apt-get install -y subversion && touch -c $(SVN)
105110

0 commit comments

Comments
 (0)