-
Notifications
You must be signed in to change notification settings - Fork 67
/
README.build
302 lines (243 loc) · 14.5 KB
/
README.build
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
** This file is generated from 'make help' output, do not edit it. **
OSCam build system documentation
================================
Build variables:
The build variables are set on the make command line and control the build
process. Setting the variables lets you enable additional features, request
extra libraries and more. Currently recognized build variables are:
CROSS=prefix - Set tools prefix. This variable is used when OScam is being
cross compiled. For example if you want to cross compile
for SH4 architecture you can run: 'make CROSS=sh4-linux-'
If you don't have the directory where cross compilers are
in your PATH you can run:
'make CROSS=/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-'
CROSS_DIR=dir - Set tools directory. This variable is added in front of
CROSS variable. CROSS_DIR is useful if you want to use
predefined targets that are setting CROSS, but you don't have
the cross compilers in your PATH. For example:
'make sh4 CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/'
'make dm500 CROSS_DIR=/opt/cross/dm500/cdk/bin/'
CONF_DIR=/dir - Set OSCam config directory. For example to change config
directory to /etc run: 'make CONF_DIR=/etc'
The default config directory is: '/usr/local/etc'
CC_OPTS=text - This variable holds compiler optimization parameters.
Default CC_OPTS value is:
'-O2 -ggdb -pipe -ffunction-sections -fdata-sections '
To add text to this variable set EXTRA_CC_OPTS=text.
CC_WARN=text - This variable holds compiler warning parameters.
Default CC_WARN value is:
'-W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition '
To add text to this variable set EXTRA_CC_WARN=text.
V=1 - Request build process to print verbose messages. By
default the only messages that are shown are simple info
what is being compiled. To request verbose build run:
'make V=1'
Extra build variables:
These variables add text to build variables. They are useful if you want
to add additional options to already set variables without overwriting them
Currently defined EXTRA_xxx variables are:
EXTRA_CC_OPTS - Add text to CC_OPTS.
Example: 'make EXTRA_CC_OPTS=-Os'
EXTRA_CC_WARN - Add text to CC_WARN.
Example: 'make EXTRA_CC_WARN=-Wshadow'
EXTRA_TARGET - Add text to TARGET.
Example: 'make EXTRA_TARGET=-private'
EXTRA_CFLAGS - Add text to CFLAGS (affects compilation).
Example: 'make EXTRA_CFLAGS="-DBLAH=1 -I/opt/local"'
EXTRA_LDFLAGS - Add text to LDFLAGS (affects linking).
Example: 'make EXTRA_LDFLAGS=-Llibdir'
EXTRA_FLAGS - Add text to both EXTRA_CFLAGS and EXTRA_LDFLAGS.
Example: 'make EXTRA_FLAGS=-DBLAH=1'
EXTRA_LIBS - Add text to LIBS (affects linking).
Example: 'make EXTRA_LIBS="-L./stapi -loscam_stapi"'
Use flags:
Use flags are used to request additional libraries or features to be used
by OSCam. Currently defined USE_xxx flags are:
USE_LIBUSB=1 - Request linking with libusb. The variables that control
USE_LIBUSB=1 build are:
LIBUSB_FLAGS='-DWITH_LIBUSB=1'
LIBUSB_CFLAGS='-DWITH_LIBUSB=1'
LIBUSB_LDFLAGS='-DWITH_LIBUSB=1'
LIBUSB_LIB='-lusb-1.0 -lrt'
Using USE_LIBUSB=1 adds to '-libusb' to PLUS_TARGET.
To build with static libusb, set the variable LIBUSB_LIB
to contain full path of libusb library. For example:
make USE_LIBUSB=1 LIBUSB_LIB=/usr/lib/libusb-1.0.a
USE_PCSC=1 - Request linking with PCSC. The variables that control
USE_PCSC=1 build are:
PCSC_FLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
PCSC_CFLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
PCSC_LDFLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
PCSC_LIB='-lpcsclite'
Using USE_PCSC=1 adds to '-pcsc' to PLUS_TARGET.
To build with static PCSC, set the variable PCSC_LIB
to contain full path of PCSC library. For example:
make USE_PCSC=1 PCSC_LIB=/usr/local/lib/libpcsclite.a
USE_STAPI=1 - Request linking with STAPI. The variables that control
USE_STAPI=1 build are:
STAPI_FLAGS='-DWITH_STAPI=1'
STAPI_CFLAGS='-DWITH_STAPI=1'
STAPI_LDFLAGS='-DWITH_STAPI=1'
STAPI_LIB='-L./stapi -loscam_stapi'
Using USE_STAPI=1 adds to '-stapi' to PLUS_TARGET.
In order for USE_STAPI to work you have to create stapi
directory and put liboscam_stapi.a file in it.
USE_STAPI5=1 - Request linking with STAPI5. The variables that control
USE_STAPI5=1 build are:
STAPI5_FLAGS='-DWITH_STAPI5=1'
STAPI5_CFLAGS='-DWITH_STAPI5=1'
STAPI5_LDFLAGS='-DWITH_STAPI5=1'
STAPI5_LIB='-L./stapi -loscam_stapi5'
Using USE_STAPI5=1 adds to '-stapi' to PLUS_TARGET.
In order for USE_STAPI5 to work you have to create stapi
directory and put liboscam_stapi5.a file in it.
USE_COOLAPI=1 - Request support for Coolstream API (libnxp) aka NeutrinoHD
box. The variables that control the build are:
COOLAPI_FLAGS='-DWITH_COOLAPI=1'
COOLAPI_CFLAGS='-DWITH_COOLAPI=1'
COOLAPI_LDFLAGS='-DWITH_COOLAPI=1'
COOLAPI_LIB='-lnxp -lrt'
Using USE_COOLAPI=1 adds to '-coolapi' to PLUS_TARGET.
In order for USE_COOLAPI to work you have to have libnxp.so
library in your cross compilation toolchain.
USE_SU980=1 - Request support for SU980 API (libentropic) aka Enimga2 arm
box. The variables that control the build are:
COOLAPI_FLAGS='-DWITH_SU980=1'
COOLAPI_CFLAGS='-DWITH_SU980=1'
COOLAPI_LDFLAGS='-DWITH_SU980=1'
COOLAPI_LIB='-lentropic -lrt'
Using USE_SU980=1 adds to '-su980' to PLUS_TARGET.
In order for USE_SU980 to work you have to have libentropic.a
library in your cross compilation toolchain.
USE_AZBOX=1 - Request support for AZBOX (openxcas)
box. The variables that control the build are:
AZBOX_FLAGS='-DWITH_AZBOX=1'
AZBOX_CFLAGS='-DWITH_AZBOX=1'
AZBOX_LDFLAGS='-DWITH_AZBOX=1'
AZBOX_LIB='-Lextapi/openxcas -lOpenXCASAPI'
Using USE_AZBOX=1 adds to '-azbox' to PLUS_TARGET.
extapi/openxcas/libOpenXCASAPI.a library that is shipped
with OSCam is compiled for MIPSEL.
USE_MCA=1 - Request support for Matrix Cam Air (MCA).
The variables that control the build are:
MCA_FLAGS='-DWITH_MCA=1'
MCA_CFLAGS='-DWITH_MCA=1'
MCA_LDFLAGS='-DWITH_MCA=1'
Using USE_MCA=1 adds to '-mca' to PLUS_TARGET.
USE_LIBCRYPTO=1 - Request linking with libcrypto instead of using OSCam
internal crypto functions. USE_LIBCRYPTO is automatically
enabled if the build is configured with SSL support. The
variables that control USE_LIBCRYPTO=1 build are:
LIBCRYPTO_FLAGS='-DWITH_LIBCRYPTO=1'
LIBCRYPTO_CFLAGS='-DWITH_LIBCRYPTO=1'
LIBCRYPTO_LDFLAGS='-DWITH_LIBCRYPTO=1'
LIBCRYPTO_LIB='-lcrypto'
USE_SSL=1 - Request linking with libssl. USE_SSL is automatically
enabled if the build is configured with SSL support. The
variables that control USE_SSL=1 build are:
SSL_FLAGS='-DWITH_SSL=1'
SSL_CFLAGS='-DWITH_SSL=1'
SSL_LDFLAGS='-DWITH_SSL=1'
SSL_LIB='-lssl'
Using USE_SSL=1 adds to '-ssl' to PLUS_TARGET.
Automatically intialized variables:
TARGET=text - This variable is auto detected by using the compiler's
-dumpmachine output. To see the target on your machine run:
'gcc -dumpmachine'
PLUS_TARGET - This variable is added to TARGET and it is set depending
on the chosen USE_xxx flags. To disable adding
PLUS_TARGET to TARGET, set NO_PLUS_TARGET=1
BINDIR - The directory where final oscam binary would be put. The
default is: Distribution
OSCAM_BIN=text - This variable controls how the oscam binary will be named.
Default OSCAM_BIN value is:
'BINDIR/oscam-VERSVN_REV-TARGET'
Once the variables (BINDIR, VER, SVN_REV and TARGET) are
replaced, the resulting filename can look like this:
'Distribution/oscam-1.20-unstable_svn7404-i486-slackware-linux-static'
For example you can run: 'make OSCAM_BIN=my-oscam'
Binaries compiled and run during the OSCam build:
OSCam builds webif/pages_gen binary that is run by the build system to
generate file that holds web pages. To build this binary two variables
are used:
HOSTCC=gcc - The compiler used for building binaries that are run on
the build machine (the host). Default: gcc
To use clang for example run: make CC=clang HOSTCC=clang
HOSTCFLAGS=xxx - The CFLAGS passed to HOSTCC. See webif/Makefile for the
default host cflags.
Config targets:
make config - Start configuration utility.
make allyesconfig - Enable all configuration options.
make allnoconfig - Disable all configuration options.
make defconfig - Restore default configuration options.
Cleaning targets:
make clean - Remove 'build' directory which contains compiled
object files.
make distclean - Executes clean target and also removes binary files
located in 'Distribution' directory.
Build system files:
config.sh - OSCam configuration. Run 'config.sh --help' to see
available parameters or 'make config' to start GUI
configuratior.
Makefile - Main build system file.
Makefile.extra - Contains predefined targets. You can use this file
as example on how to use the build system.
Makefile.local - This file is included in Makefile and allows creation
of local build system targets. See Makefile.extra for
examples.
Here are some of the interesting predefined targets in Makefile.extra.
To use them run 'make target ...' where ... can be any extra flag. For
example if you want to compile OSCam for Dreambox (DM500) but do not
have the compilers in the path, you can run:
make dm500 CROSS_DIR=/opt/cross/dm500/cdk/bin/
Predefined targets in Makefile.extra:
make libusb - Builds OSCam with libusb support
make pcsc - Builds OSCam with PCSC support
make pcsc-libusb - Builds OSCam with PCSC and libusb support
make dm500 - Builds OSCam for Dreambox (DM500)
make sh4 - Builds OSCam for SH4 boxes
make azbox - Builds OSCam for AZBox STBs
make mca - Builds OSCam for Matrix Cam Air (MCA)
make coolstream - Builds OSCam for Coolstream
make dockstar - Builds OSCam for Dockstar
make qboxhd - Builds OSCam for QBoxHD STBs
make opensolaris - Builds OSCam for OpenSolaris
make uclinux - Builds OSCam for m68k uClinux
Predefined targets for static builds:
make static - Builds OSCam statically
make static-libusb - Builds OSCam with libusb linked statically
make static-libcrypto - Builds OSCam with libcrypto linked statically
make static-ssl - Builds OSCam with SSL support linked statically
Developer targets:
make tests - Builds 'tests.bin' binary
Examples:
Build OSCam for SH4 (the compilers are in the path):
make CROSS=sh4-linux-
Build OSCam for SH4 (the compilers are in not in the path):
make sh4 CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/
make CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/ CROSS=sh4-linux-
make CROSS=/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-
Build OSCam for SH4 with STAPI:
make CROSS=sh4-linux- USE_STAPI=1
Build OSCam for SH4 with STAPI and changed configuration directory:
make CROSS=sh4-linux- USE_STAPI=1 CONF_DIR=/var/tuxbox/config
Build OSCam for ARM with COOLAPI (coolstream aka NeutrinoHD):
make CROSS=arm-cx2450x-linux-gnueabi- USE_COOLAPI=1
Build OSCam for MIPSEL with AZBOX support:
make CROSS=mipsel-linux-uclibc- USE_AZBOX=1
Build OSCam for ARM with MCA support:
make CROSS=arm-none-linux-gnueabi- USE_MCA=1
Build OSCam with libusb and PCSC:
make USE_LIBUSB=1 USE_PCSC=1
Build OSCam with static libusb:
make USE_LIBUSB=1 LIBUSB_LIB="/usr/lib/libusb-1.0.a"
Build OSCam with static libcrypto:
make USE_LIBCRYPTO=1 LIBCRYPTO_LIB="/usr/lib/libcrypto.a"
Build OSCam with static libssl and libcrypto:
make USE_SSL=1 SSL_LIB="/usr/lib/libssl.a" LIBCRYPTO_LIB="/usr/lib/libcrypto.a"
Build with verbose messages and size optimizations:
make V=1 CC_OPTS=-Os
Build and set oscam file name:
make OSCAM_BIN=oscam
Build and set oscam file name depending on revision:
make OSCAM_BIN=oscam-`./config.sh -r`