summaryrefslogtreecommitdiff
blob: f2746bdf5e309dc66c67dfbfe8bbd5cefa27feb3 (plain)
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
Set SONAME and unbreak compilation on Darwin

Author: Fabian Groffen <grobian@gentoo.org>
Author: Dennis Schridde <devurandom@gmx.net>

--- old/GDALmake.opt.in.orig	2008-02-02 18:25:48.000000000 -0800
+++ new/GDALmake.opt.in	2008-02-02 18:54:53.000000000 -0800
@@ -97,6 +97,14 @@
 GDAL_SLIB	=	$(GDAL_ROOT)/libgdal.$(SO_EXT)
 GDAL_SLIB_LINK	=	-L$(GDAL_ROOT) -lgdal
 
+# for building without libtool
+GDAL_SLIB_SO_VER =	$(GDAL_VERSION_MAJOR).$(LIBGDAL_CURRENT).$(LIBGDAL_REVISION)
+ifeq ("$(shell uname -s)", "Darwin")
+GDAL_SLIB_SONAME =	-install_name $(INST_LIB)/libgdal.$(GDAL_VERSION_MAJOR).$(SO_EXT)
+else
+GDAL_SLIB_SONAME =	-Wl,-soname,libgdal.$(SO_EXT).$(GDAL_VERSION_MAJOR)
+endif
+
 # Mac OS X Framework definition
 MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
 
--- gdal-2.0.3.old/GNUmakefile
+++ gdal-2.0.3/GNUmakefile
@@ -208,7 +208,7 @@ else
 
 ifeq ($(HAVE_LD_SHARED),yes)
 
-GDAL_SLIB_B	=	$(notdir $(GDAL_SLIB))
+GDAL_SLIB_B	=	libgdal
 
 install-lib:
 
@@ -216,14 +216,14 @@ install-lib:
 ifeq ($(MACOSX_FRAMEWORK),yes)
 	$(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/GDAL
 else
-	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B)
-	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR)
-	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
-	$(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
+	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(SO_EXT)
+	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).$(SO_EXT)
+	rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER).$(SO_EXT)
+	$(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER).$(SO_EXT)
 	(cd $(DESTDIR)$(INST_LIB) ; \
-	 ln -s $(GDAL_SLIB_B).$(GDAL_VER) $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR))
+	 ln -s $(GDAL_SLIB_B).$(GDAL_VER).$(SO_EXT) $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).$(SO_EXT))
 	(cd $(DESTDIR)$(INST_LIB) ; \
-	 ln -s $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR) $(GDAL_SLIB_B))
+	 ln -s $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).$(SO_EXT) $(GDAL_SLIB_B).$(SO_EXT))
 	$(INSTALL_DIR) $(DESTDIR)$(INST_LIB)/gdalplugins
 endif