summaryrefslogtreecommitdiff
blob: 4f72e022e3456322f1533223dd32972b3fe489eb (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
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
From eb88a598f46f835782ba93bfbde68761cb159f4c Mon Sep 17 00:00:00 2001
Message-Id: <eb88a598f46f835782ba93bfbde68761cb159f4c.1323853429.git.jlec@gentoo.org>
From: Justin Lecher <jlec@gentoo.org>
Date: Wed, 14 Dec 2011 09:50:42 +0100
Subject: [PATCH 1/2] gentoo.patch

Conflicts:

	Makefile
---
 Makefile |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 5c92d8b..859363e 100644
--- a/Makefile
+++ b/Makefile
@@ -52,11 +52,10 @@ RELEASE = 3.1
 #
-CC	= gcc
 ifneq ($(MSYSTEM),MINGW32)
-CFLAGS  = -g -O2  -Wall  -ansi -pedantic -DCNEARTREE_SAFE_TRIANG=1
+CFLAGS  += -ansi -DCNEARTREE_SAFE_TRIANG=1
 TIME = time
 else
-CFLAGS  = -g -O2 -Wall  -DCNEARTREE_SAFE_TRIANG=1
-TIME = 
+CFLAGS  += -DCNEARTREE_SAFE_TRIANG=1
+TIME =
 endif
 
 #
@@ -76,8 +76,8 @@ endif
 # Uncomment the next two lines if CVector is installed locally in $(HOME)/include
 # and $(HOME)/lib
 #
-#CVECTOR_INCLUDE = -I$(HOME)/include 
-#CVECTOR_LIBLOC = -L$(HOME)/lib
+CVECTOR_INCLUDE = -I/usr/include
+CVECTOR_LIBLOC = -L/usr/GENTOOLIBDIR
 
 #
 # Directories
@@ -90,7 +90,7 @@ INC      = $(ROOT)
 EXAMPLES = $(ROOT)
 TESTDATA = $(ROOT)
 ifndef INSTALL_PREFIX
-INSTALL_PREFIX = /usr/local
+INSTALL_PREFIX = $(DESTDIR)/usr
 #INSTALL_PREFIX  = $(HOME)
 endif
 
@@ -115,10 +115,10 @@ CPPLIBRARIES = -lm
 CLIBRARIES = $(CVECTOR_LIBLOC) -lCVector -lm
 
 COMPILE_COMMAND        =  $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c
-CPPCOMPILE_COMMAND     =  $(LIBTOOL) --mode=compile $(CXX) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c
-LIBRARY_LINK_COMMAND   =  $(LIBTOOL) --mode=link $(CC) -version-info $(VERSION) -no-undefined -rpath $(INSTALL_PREFIX)/lib
+CPPCOMPILE_COMMAND     =  $(LIBTOOL) --mode=compile $(CXX) $(CXXFLAGS) $(INCLUDES) $(WARNINGS) -c
+LIBRARY_LINK_COMMAND   =  $(LIBTOOL) --mode=link  $(CC) -version-info $(VERSION) -release $(RELEASE) -no-undefined -rpath $(INSTALL_PREFIX)/GENTOOLIBDIR $(LDFLAGS)
 BUILD_COMMAND_LOCAL    =  $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(INCLUDES)
-CPPBUILD_COMMAND_LOCAL =  $(LIBTOOL) --mode=link $(CXX) -no-undefined $(CFLAGS) $(INCLUDES)
+CPPBUILD_COMMAND_LOCAL =  $(LIBTOOL) --mode=link $(CXX) -no-undefined $(CXXFLAGS) $(INCLUDES)
 BUILD_COMMAND_DYNAMIC  =  $(LIBTOOL) --mode=link $(CC) -no-undefined $(CFLAGS) -shared -I$(INSTALL_PREFIX)/include
 BUILD_COMMAND_STATIC   =  $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -static-libtool-libs -I$(INSTALL_PREFIX)/include
 INSTALL_COMMAND        =  $(LIBTOOL) --mode=install cp
@@ -223,13 +223,13 @@ endif
 #
 all:	$(LIB) $(BIN) $(SOURCE) $(HEADERS) \
 		$(LIB)/libCNearTree.$(LIB_EXT) \
-		$(BIN)/CPPMain $(BIN)/CMain $(BIN)/CPPNearTreeTest $(BIN)/CNearTreeTest $(BIN)/CNearTreeTestInst 
+		$(BIN)/CPPMain $(BIN)/CMain $(BIN)/CPPNearTreeTest $(BIN)/CNearTreeTest
 		
-install:  all $(INSTALL_PREFIX) $(INSTALL_PREFIX)/lib $(INSTALL_PREFIX)/include \
+install:  all $(INSTALL_PREFIX) $(INSTALL_PREFIX)/GENTOOLIBDIR $(INSTALL_PREFIX)/include \
           $(INC) $(LIB)/libCNearTree.$(LIB_EXT)  $(INC)/TNear.h $(INC)/CNearTree.h \
 		  $(INC)/rhrand.h $(INC)/triple.h
-		  $(INSTALL_COMMAND) $(LIB)/libCNearTree.$(LIB_EXT) $(INSTALL_PREFIX)/lib/libCNearTree.$(LIB_EXT)
-		  $(INSTALL_FINISH_COMMAND) $(INSTALL_PREFIX)/lib/libCNearTree.$(LIB_EXT)
+		  $(INSTALL_COMMAND) $(LIB)/libCNearTree.$(LIB_EXT) $(INSTALL_PREFIX)/GENTOOLIBDIR/libCNearTree.$(LIB_EXT)
+		  $(INSTALL_FINISH_COMMAND) $(INSTALL_PREFIX)/GENTOOLIBDIR/libCNearTree.$(LIB_EXT)
 		  -cp $(INSTALL_PREFIX)/include/TNear.h $(INSTALL_PREFIX)/include/TNear_old.h
 		  -cp $(INSTALL_PREFIX)/include/CNearTree.h $(INSTALL_PREFIX)/include/CNearTree_old.h
 		  cp $(INC)/TNear.h $(INSTALL_PREFIX)/include/TNear.h
@@ -257,8 +257,8 @@ install:  all $(INSTALL_PREFIX) $(INSTALL_PREFIX)/lib $(INSTALL_PREFIX)/include
 $(INSTALL_PREFIX):
 	mkdir -p $(INSTALL_PREFIX)
 
-$(INSTALL_PREFIX)/lib:  $(INSTALL_PREFIX)
-	mkdir -p $(INSTALL_PREFIX)/lib
+$(INSTALL_PREFIX)/GENTOOLIBDIR:  $(INSTALL_PREFIX)
+	mkdir -p $(INSTALL_PREFIX)/GENTOOLIBDIR
 
 $(INSTALL_PREFIX)/bin:  $(INSTALL_PREFIX)
 	mkdir -p $(INSTALL_PREFIX)/bin
-- 
1.7.8