blob: be8fa65f60420ed651c18b58a90587502e55588d (
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
#
# Jamrules -- build configurations
#
# The default build is for debugging. To compile a release
# build, add -sBUILD=release to the jam command line. To provide
# a custom build you can use any name you want instead of release
# or debug.
#
# JBIG2 and JPEG2000 support is optional. To compile with this,
# add the following to the jam command line:
#
# -sHAVE_JBIG2DEC=true
#
# -sHAVE_JASPER=true
# -- or --
# -sHAVE_OPENJPEG=true
#
# Windows builds assume that third party headers and
# libraries are in c:/local/include and c:/local/lib.
#
# MacOS X builds assume that you have third party libraries installed
# in /usr/local or some other system known location.
#
# Linux builds assume that you have freetype-config to find the paths
# to the freetype library.
#
# To override these defaults, please supply the paths on the jam
# command line with -sTHIRDPARTINC and -sTHIRDPARTYLIB.
#
# -sTHIRDPARTYINC="-Ic:/wherever/include"
# -sTHIRDPARTYLIB="-Lc:/wherever/lib"
#
# To compile without builtin CJK CMap and font support, and save a few
# megabytes of executable space:
#
# -sDEFINES=NOCJK
#
# Workaround for different OS/OSPLAT settings on FTJam and plain jam
if $(JAM_TOOLSET) = MINGW { OS = MINGW ; }
if $(JAM_TOOLSET) = VISUALC { OS = NT ; }
BUILD ?= debug ;
# Place all build products here:
ALL_LOCATE_TARGET ?= [ FDirName $(TOP) build $(OS:L)-$(OSPLAT:L)-$(BUILD:L) ] ;
# Add compile time defines for JBIG2 and JPEG2000 support.
if $(HAVE_JBIG2DEC) { DEFINES += HAVE_JBIG2DEC ; }
if $(HAVE_JASPER) { DEFINES += HAVE_JASPER ; }
if $(HAVE_OPENJPEG) { DEFINES += HAVE_OPENJPEG ; }
# NEED_STRLCPY = true ;
# NEED_STRSEP = true ;
# NEED_GETOPT = true ;
if $(OS) = LINUX
{
Echo Building for LINUX ;
THIRDPARTYINC ?= "`freetype-config --cflags`" ;
THIRDPARTYLIB ?= "`freetype-config --libs`" -L/usr/X11R6/lib ;
NEED_STRLCPY = true ;
NEED_STRSEP = true ;
NEED_GETOPT = true ;
BUILD_X11APP = true ;
CCFLAGS = -Wall -std=c99 $(THIRDPARTYINC) ;
LINKFLAGS = $(THIRDPARTYLIB) ;
LINKLIBS = -lfreetype -ljpeg -lz -lm ;
APPLINKLIBS = -lX11 -lXext ;
if $(BUILD) = debug { OPTIM = -g -O0 -fno-inline ; }
if $(BUILD) = release { OPTIM = -O3 ; }
if $(HAVE_JBIG2DEC) { LINKLIBS += -ljbig2dec ; }
if $(HAVE_JASPER) { LINKLIBS += -ljasper ; }
if $(HAVE_OPENJPEG) { LINKLIBS += -lopenjpeg ; }
}
if $(OS) = MACOSX
{
Echo Building for MACOSX ;
BUILD_X11APP = true ;
THIRDPARTYINC ?= -I/usr/X11R6/include ;
THIRDPARTYLIB ?= -L/usr/X11R6/lib ;
CCFLAGS = -Wall -std=c99 $(THIRDPARTYINC) ;
LINKFLAGS = $(THIRDPARTYLIB) ;
LINKLIBS = -lfreetype -ljpeg -lz -lm ;
APPLINKLIBS = -lX11 -lXext ;
if $(BUILD) = debug { OPTIM = -g -O0 -fno-inline ; }
if $(BUILD) = release { OPTIM = -O3 ; }
if $(HAVE_JBIG2DEC) { LINKLIBS += -ljbig2dec ; }
if $(HAVE_JASPER) { LINKLIBS += -ljasper ; }
if $(HAVE_OPENJPEG) { LINKLIBS += -lopenjpeg ; }
}
if $(OS) = MINGW
{
Echo Building for MINGW ;
NOARSCAN = true ;
BUILD_WINAPP = true ;
BUILD_PLUGIN = true ;
THIRDPARTYINC ?= -Ic:/local/include ;
THIRDPARTYLIB ?= -Lc:/local/lib ;
NEED_STRLCPY = true ;
NEED_STRSEP = true ;
NEED_GETOPT = true ;
CCFLAGS = -Wall -std=c99 $(THIRDPARTYINC) ;
LINKFLAGS = $(THIRDPARTYLIB) ;
LINKLIBS = -lfreetype -ljpeg -lz ;
APPLINKLIBS = -lgdi32 -lcomdlg32 -luser32 -ladvapi32 -lshell32 -mwindows ;
if $(BUILD) = debug { OPTIM = -g -O0 -fno-inline ; }
if $(BUILD) = release { OPTIM = -O3 ; }
if $(HAVE_JBIG2DEC) { LINKLIBS += -ljbig2dec ; }
if $(HAVE_JASPER) { LINKLIBS += -ljasper ; }
if $(HAVE_OPENJPEG) { LINKLIBS += -lopenjpeg ; }
actions WindRes { windres -i $(>) -o $(<) --include-dir=$(>:D) }
}
if $(OS) = NT
{
Echo Building for MSVC ;
DEFINES += MSVC ;
BUILD_WINAPP = true ;
THIRDPARTYINC ?= /Ic:/local/include ;
THIRDPARTYLIB ?= /LIBPATH:c:/local/lib ;
NEED_STRLCPY = true ;
NEED_STRSEP = true ;
NEED_GETOPT = true ;
CCFLAGS = $(THIRDPARTYINC) ;
LINKFLAGS = $(THIRDPARTYLIB) ;
LINKLIBS = freetype.lib jpeg.lib z.lib ;
APPLINKLIBS = gdi32.lib comdlg32.lib user32.lib advapi32.lib shell32.lib ;
if $(BUILD) = debug { }
if $(BUILD) = release { }
if $(HAVE_JBIG2DEC) { LINKLIBS += jbig2dec.lib ; }
if $(HAVE_JASPER) { LINKLIBS += jasper.lib ; }
actions WindRes { rc /fo $(<) $(>) }
}
# Set some DEFINES based on missing platform features
if $(NEED_STRLCPY) { DEFINES += NEED_STRLCPY ; }
if $(NEED_STRSEP) { DEFINES += NEED_STRSEP ; }
if $(NEED_GETOPT) { DEFINES += NEED_GETOPT ; }
# WindRes rule for compiling the windows viewer and plugin
rule UserObject
{
switch $(>)
{
case *.rc : WindRes $(<) : $(>) ;
case * : Echo "unknown suffix on" $(>) ;
}
}
rule WindRes
{
Depends $(<) : $(>) ;
Clean clean : $(<) ;
}
|