aboutsummaryrefslogtreecommitdiffstats
path: root/devel/capstone/files/patch-Makefile
blob: dcb85bb74c81dbafc4e737a6d96a71d3ebbd12af (plain) (blame)
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
diff -ru /Makefile /Makefile
--- Makefile    2014-03-14 17:24:44.000000000 +0100
+++ Makefile    2014-03-14 17:35:33.000000000 +0100
@@ -16,7 +16,7 @@
 STRIP = $(CROSS)strip
 endif
 
-CFLAGS += -fPIC -O3 -Wall -Iinclude
+CFLAGS += -fPIC -Wall -Iinclude
 
 ifeq ($(USE_SYS_DYN_MEM),yes)
 CFLAGS += -DUSE_SYS_DYN_MEM
@@ -39,9 +39,17 @@
 endif
 endif
 
+LIBDATADIR = $(LIBDIR)
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S), FreeBSD)
+LIBDATADIR = $(DESTDIR)$(PREFIX)/libdata
+else
+LIBDATADIR = $(LIBDIR)
+endif
+
 INSTALL_BIN ?= install
 INSTALL_DATA ?= $(INSTALL_BIN) -m0644
-INSTALL_LIBRARY ?= $(INSTALL_BIN) -m0755
+INSTALL_LIB ?= $(INSTALL_BIN) -m0755
 
 LIBNAME = capstone
 
@@ -138,8 +146,7 @@
 LIBOBJ += MCInst.o
 
 
-UNAME_S := $(shell uname -s)
-PKGCFCGDIR = $(LIBDIR)/pkgconfig
+PKGCFCGDIR = $(LIBDATADIR)/pkgconfig
 
 # OSX?
 ifeq ($(UNAME_S),Darwin)
@@ -244,7 +251,7 @@
 
 install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY)
    mkdir -p $(LIBDIR)
-   $(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(LIBDIR)
+   $(INSTALL_LIB) lib$(LIBNAME).$(EXT) $(LIBDIR)
    $(INSTALL_DATA) lib$(LIBNAME).$(AR_EXT) $(LIBDIR)
    mkdir -p $(INCDIR)/$(LIBNAME)
    $(INSTALL_DATA) include/*.h $(INCDIR)/$(LIBNAME)