-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildgdal.sh
105 lines (95 loc) · 2.05 KB
/
buildgdal.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
OLDDIR=$(pwd)
PRBROOT=$(dirname $0)
cd $PRBROOT
PRBROOT=$(pwd)
cd $OLDDIR
mkdir $PRBROOT/src/gdal
cd $PRBROOT/src/gdal/
if command -v gmake 2>/dev/null; then
MAKE=gmake
else
MAKE=make
fi
if command -v wget 2>/dev/null; then
WGET="wget -c"
else
WGET="ftp -C"
fi
# Build proj4
$WGET http://download.osgeo.org/proj/proj-4.8.0.tar.gz
$WGET https://gist.githubusercontent.com/kornholi/45465df75dd2140d261a/raw/7f93f04b185a5c24329f9e585a3c8222f4ae9be4/proj-4.8.0-gridlist.patch
rm -rf proj-4.8.0
tar xfz proj-4.8.0.tar.gz
cd proj-4.8.0
patch -p1 < ../proj-4.8.0-gridlist.patch
./configure --prefix=$PRBROOT/src/gdal/ --without-jni
$MAKE -j2
$MAKE install
# Build GDAL
cd $PRBROOT/src/gdal/
$WGET http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz
rm -rf gdal-1.11.0
tar xfz gdal-1.11.0.tar.gz
cd gdal-1.11.0/
./configure --prefix=$PRBROOT/src/gdal/ --with-libtiff=internal --with-geotiff=internal \
--with-jpeg=internal \
--with-liblzma=no \
--with-pg=no \
--with-grass=no \
--with-libgrass=no \
--with-cfitsio=no \
--with-pcraster=no \
--with-png=no \
--with-gta=no \
--with-pci-disk=no \
--with-gif=no \
--with-ogdi=no \
--with-fme=no \
--with-hdf4=no \
--with-hdf5=no \
--with-netcdf=no \
--with-jasper=no \
--with-openjpeg=no \
--with-fgdb=no \
--with-ecw=no \
--with-kakadu=no \
--with-mrsid=no \
--with-jp2mrsid=no \
--with-mrsid_lidar=no \
--with-msg=no \
--with-ingres=no \
--with-xerces=no \
--with-expat=no \
--with-libkml=no \
--with-odbc=no \
--with-dods-root=no \
--with-curl=no \
--with-xml2=no \
--with-spatialite=no \
--with-sqlite3=no \
--with-pcre=no \
--with-dwgdirect=no \
--with-idb=no \
--with-sde=no \
--with-epsilon=no \
--with-webp=no \
--with-opencl=no \
--with-freexl=no \
--with-poppler=no \
--with-podofo=no \
--with-perl=no \
--with-php=no \
--with-ruby=no \
--with-python=no \
--with-java=no \
--with-mdb=no \
--with-radaman=no \
--with-armadillo=no \
--with-libz=internal \
--with-grib=no
$MAKE -j2
$MAKE install
# Create library link if necessary
ln -s $PRBROOT/src/gdal/lib/libgdal.so.* $PRBROOT/src/gdal/lib/libgdal.so
cd $OLDDIR