blob: 0a87bb70d00483ecae135c61837496bc24a68189 (
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#
# NetBSD specific Makefile setup
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You find a copy of this
# license in the file COPYRIGHT in the root directory of this release.
#
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
# BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# Description:
#
# NetBSD specific Makefile to reduce changes to the original Makefile.
# base on the the FreeBSD version from Simon Barner
# Author: Mario Kemper
#
# X11BASE, LOCALBASE and PREFIX are variables used by the ports collection
# Users of the ports collection may override these values => ifndef foo
# Paths
X11BASE ?= /usr/X11R6
LOCALBASE ?= /usr/local
PREFIX ?= $(X11BASE)
prefix = $(PREFIX)
TK_LIBRARY_BASE = $(LOCALBASE)/lib
SYS_DBDIR = /tmp/nxtvdb
# uncomment to force system wide db dir
WANT_USER_DBDIR = 1
# other settings
# On FreeBSD there is only a modified tclsh with a message to launch
# tclsh8.3 or tclsh8.4 , so this is hardcoded here
TCL_VER = 8.3
LDLIBS = -L$(LOCALBASE)/lib\
-L$(X11BASE)/lib\
-ltk83 -ltcl83 -lX11 -lXmu -lm
INCS += -I$(LOCALBASE)/include/tcl$(TCL_VER)\
-I$(LOCALBASE)/include/tk$(TCL_VER)
WANT_THREADS = 1 # uncomment to force process based implementation
PTHREAD = -pthread
### Common part for all UN*X variants ###
# Tools
PERL ?= /usr/bin/perl
CC ?= gcc
ECHO ?= @echo
# Paths
ROOT =
exec_prefix = ${prefix}
bindir = $(ROOT)${exec_prefix}/bin
mandir = $(ROOT)${prefix}/man/man1
resdir = $(LOCALBASE)/lib/X11
# other settings
OPTFLAGS = -O6 -pipe
# use static libraries for debugging only
#LDLIBS += -Ldbglib -static
INCS += -I. -I$(X11BASE)/include
# path to Tcl/Tk headers, if not properly installed
#INCS += -I/usr/local/tcl/tcl8.0/generic -I/usr/local/tcl/tk8.0/generic
# path to Tcl/Tk script library (Tk is usually in X11/lib/tk#.#)
DEFS += -DTK_LIBRARY_PATH=\"$(TK_LIBRARY_BASE)/tk$(TCL_VER)\"
DEFS += -DTCL_LIBRARY_PATH=\"$(TK_LIBRARY_BASE)/tcl$(TCL_VER)\"
# enable use of multi-threading
ifdef WANT_THREADS
DEFS += -DUSE_THREADS
LDLIBS += $(PTHREAD)
endif
# enable use of daemon and client/server connection
DEFS += -DUSE_DAEMON
# The database directory can be either in the user's $HOME (or relative to any
# other env variable) or at a global place like /var/spool (world-writable)
# -> set WANT_USER_DBDIR in OS specific part
ifdef WANT_USER_DBDIR
USER_DBDIR = .nxtvdb
DEFS += -DEPG_DB_ENV=\"HOME\" -DEPG_DB_DIR=\"$(USER_DBDIR)\"
endif
ifndef USER_DBDIR
DEFS += -DEPG_DB_DIR=\"$(SYS_DBDIR)\"
INST_DB_DIR = $(ROOT)$(SYS_DBDIR)
INST_DB_PERM = 0777
endif
WARN = -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
#WARN += -Wpointer-arith -Werror
# the following flags can be overridden by an environment variable with the same name
CFLAGS ?= $(OPTFLAGS)
CFLAGS += $(WARN) $(INCS) $(DEFS) -g
#LDLIBS += -pg
X11_APP_DEFAULTS=$(LOCALBASE)/lib/X11/app_defaults
DEFS += -DX11_APP_DEFAULTS=\"$(X11_APP_DEFAULTS)\"
all :: printconfig
# this will print some information on the current configuration
.PHONY: printconfig
printconfig ::
$(ECHO)
$(ECHO) Building on $(OS)...
$(ECHO)
$(ECHO) " prefix: $(prefix)"
$(ECHO) " tcl version: $(TCL_VER)"
ifdef USER_DBDIR
$(ECHO) " db in home: yes"
else
$(ECHO) " db in home: no"
$(ECHO) " system db dir: $(SYS_DBDIR)"
endif
ifdef WANT_THREADS
$(ECHO) " Concurrency implementation based on: threads"
else
$(ECHO) " Concurrency implementation based on: processes"
endif
$(ECHO) " C compiler: $(CC)"
$(ECHO)
# end of NetBSD specific makefile
# here the main Makefile continues
|