aboutsummaryrefslogtreecommitdiff
path: root/databases/fastdb/files/patch-makefile
blob: a9bafe47d0b3287cb07b440128e4905ce7cdae91 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- makefile.orig	Mon Oct 28 19:50:00 2002
+++ makefile	Sun Nov  3 09:09:41 2002
@@ -4,13 +4,13 @@
 FAULT_TOLERANT=0
 
 # Place where to copy GastDB header files
-INCSPATH=/usr/local/include/fastdb
+INCSPATH=${PREFIX}/include/fastdb
 
 #Place where to copy Fastdb library
-LIBSPATH=/usr/local/lib
+LIBSPATH=${PREFIX}/lib
 
 #Place where to copy Fastdb subsql utility
-BINSPATH=/usr/local/bin
+BINSPATH=${PREFIX}/bin
 
 OBJS = class.o compiler.o database.o hashtab.o file.o symtab.o ttree.o \
 	cursor.o query.o wwwapi.o unisock.o sync.o localcli.o
@@ -29,8 +29,8 @@
 SUFF=
 else
 ifneq (,$(findstring freebsd,$(OSTYPE)))
-TFLAGS=-pthread
-THRLIBS=
+TFLAGS=-D_REENTRANT ${PTHREAD_CFLAGS}
+THRLIBS=${PTHREAD_LIBS}
 else 
 TFLAGS=-D_REENTRANT -D_THREAD_SAFE
 THRLIBS=-lpthread
@@ -62,7 +62,6 @@
 
 WEB_EXAMPLES = cgistub bugdb clidb
 
-CC = g++
 
 # Possible FastDB compile time parameters (-Dxxx should be added to DEFS macro):
 # 1. USE_LOCALE_SETTING - use C locale for string comparison operations
@@ -98,13 +97,13 @@
 DEFS = -DUSE_QUEUE_MANAGER -DUSE_LOCALE_SETTINGS
 
 #CFLAGS = $(TFLAGS) -c -Wall -O5 -g $(DEFS) 
-CFLAGS = -c -Wall -O0 -g $(DEFS) $(TFLAGS)
+CFLAGS += -c $(DEFS) $(TFLAGS)
 #CFLAGS = -c -Wall -O0 -DDEBUG=DEBUG_TRACE -g $(DEFS) $(TFLAGS)
-SHFLAGS=-shared
+SHFLAGS=-shared -Wl,-soname,$@
 
 
 LD = $(CC)
-LDFLAGS = -g $(TFLAGS)
+LDFLAGS = $(TFLAGS)
 
 AR = ar
 ARFLAGS = -cru
@@ -314,14 +313,13 @@
 
 install: subsql installlib
 	mkdir -p $(BINSPATH)
-	cp subsql $(BINSPATH)
-	strip $(BINSPATH)/subsql
+	${BSD_INSTALL_PROGRAM} subsql $(BINSPATH)
 
 installlib: $(FASTDB_LIB) $(CLI_LIB) $(FASTDB_SHARED) $(CLI_SHARED)
 	mkdir -p $(INCSPATH)
-	cp $(INCS) $(INCSPATH)
+	${BSD_INSTALL_DATA} $(INCS) $(INCSPATH)
 	mkdir -p $(LIBSPATH)
-	cp $(FASTDB_LIB) $(CLI_LIB) $(FASTDB_SHARED) $(CLI_SHARED) $(LIBSPATH)
+	${BSD_INSTALL_DATA} $(FASTDB_LIB) $(CLI_LIB) $(FASTDB_SHARED) $(CLI_SHARED) $(LIBSPATH)
 	ln -f -s $(LIBSPATH)/$(FASTDB_SHARED) $(LIBSPATH)/libfastdb$(SUFF).so
 	ln -f -s $(LIBSPATH)/$(CLI_SHARED) $(LIBSPATH)/libcli$(SUFF).so