summaryrefslogtreecommitdiff
path: root/libraries/FreeImage/Makefile.gnu.DESTDIR.diff
blob: 07d2579cf937e77f812bff3cc89f1fa3e285c67e (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
--- FreeImage/Makefile.gnu.orig	2009-09-07 01:09:57.000000000 -0500
+++ FreeImage/Makefile.gnu	2009-09-07 01:27:41.000000000 -0500
@@ -15,16 +15,11 @@
 
 MODULES = $(SRCS:.c=.o)
 MODULES := $(MODULES:.cpp=.o)
-CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
+CFLAGS ?= -fPIC -fexceptions -fvisibility=hidden
 CFLAGS += $(INCLUDE)
-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
+CXXFLAGS ?= -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
 CXXFLAGS += $(INCLUDE)
 
-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
-	CFLAGS += -fPIC
-	CXXFLAGS += -fPIC
-endif
-
 TARGET  = freeimage
 STATICLIB = lib$(TARGET).a
 SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
@@ -61,10 +56,13 @@
 	$(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
 
 install:
-	install -d $(INCDIR) $(INSTALLDIR)
-	install -m 644 -o root -g root $(HEADER) $(INCDIR)
-	install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
-	install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
+	install -d 755 $(DESTDIR)/$(INCDIR)
+	install -m 644 $(HEADER) $(DESTDIR)/$(INCDIR)
+	install -d 755 $(DESTDIR)/$(INSTALLDIR)
+	install -m 644 $(STATICLIB) $(DESTDIR)/$(INSTALLDIR)
+	install -m 755 $(SHAREDLIB) $(DESTDIR)/$(INSTALLDIR)
+	cd $(DESTDIR)/$(INSTALLDIR) ; ln -sf $(SHAREDLIB) $(VERLIBNAME)
+	cd $(DESTDIR)/$(INSTALLDIR) ; ln -sf $(VERLIBNAME) $(LIBNAME)   
 
 clean:
 	rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)