- fix for ticker #4787
[oscam.git] / README.build
blob4d5483b863b595aeda8de572b1345eefa4a3f02b
1 ** This file is generated from 'make help' output, do not edit it. **
3 OSCam build system documentation
4 ================================
6  Build variables:
7    The build variables are set on the make command line and control the build
8    process. Setting the variables lets you enable additional features, request
9    extra libraries and more. Currently recognized build variables are:
11    CROSS=prefix   - Set tools prefix. This variable is used when OScam is being
12                     cross compiled. For example if you want to cross compile
13                     for SH4 architecture you can run: 'make CROSS=sh4-linux-'
14                     If you don't have the directory where cross compilers are
15                     in your PATH you can run:
16                     'make CROSS=/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-'
18    CROSS_DIR=dir  - Set tools directory. This variable is added in front of
19                     CROSS variable. CROSS_DIR is useful if you want to use
20                     predefined targets that are setting CROSS, but you don't have
21                     the cross compilers in your PATH. For example:
22                     'make sh4 CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/'
23                     'make dm500 CROSS_DIR=/opt/cross/dm500/cdk/bin/'
25    CONF_DIR=/dir  - Set OSCam config directory. For example to change config
26                     directory to /etc run: 'make CONF_DIR=/etc'
27                     The default config directory is: '/usr/local/etc'
29    CC_OPTS=text   - This variable holds compiler optimization parameters.
30                     Default CC_OPTS value is:
31                     '-O2 -ggdb -pipe -ffunction-sections -fdata-sections '
32                     To add text to this variable set EXTRA_CC_OPTS=text.
34    CC_WARN=text   - This variable holds compiler warning parameters.
35                     Default CC_WARN value is:
36                     '-W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition '
37                     To add text to this variable set EXTRA_CC_WARN=text.
39    V=1            - Request build process to print verbose messages. By
40                     default the only messages that are shown are simple info
41                     what is being compiled. To request verbose build run:
42                     'make V=1'
44  Extra build variables:
45    These variables add text to build variables. They are useful if you want
46    to add additional options to already set variables without overwriting them
47    Currently defined EXTRA_xxx variables are:
49    EXTRA_CC_OPTS  - Add text to CC_OPTS.
50                     Example: 'make EXTRA_CC_OPTS=-Os'
52    EXTRA_CC_WARN  - Add text to CC_WARN.
53                     Example: 'make EXTRA_CC_WARN=-Wshadow'
55    EXTRA_TARGET   - Add text to TARGET.
56                     Example: 'make EXTRA_TARGET=-private'
58    EXTRA_CFLAGS   - Add text to CFLAGS (affects compilation).
59                     Example: 'make EXTRA_CFLAGS="-DBLAH=1 -I/opt/local"'
61    EXTRA_LDFLAGS  - Add text to LDFLAGS (affects linking).
62                     Example: 'make EXTRA_LDFLAGS=-Llibdir'
64    EXTRA_FLAGS    - Add text to both EXTRA_CFLAGS and EXTRA_LDFLAGS.
65                     Example: 'make EXTRA_FLAGS=-DBLAH=1'
67    EXTRA_LIBS     - Add text to LIBS (affects linking).
68                     Example: 'make EXTRA_LIBS="-L./stapi -loscam_stapi"'
70  Use flags:
71    Use flags are used to request additional libraries or features to be used
72    by OSCam. Currently defined USE_xxx flags are:
74    USE_LIBUSB=1    - Request linking with libusb. The variables that control
75                      USE_LIBUSB=1 build are:
76                          LIBUSB_FLAGS='-DWITH_LIBUSB=1'
77                          LIBUSB_CFLAGS='-DWITH_LIBUSB=1'
78                          LIBUSB_LDFLAGS='-DWITH_LIBUSB=1'
79                          LIBUSB_LIB='-lusb-1.0 -lrt'
80                      Using USE_LIBUSB=1 adds to '-libusb' to PLUS_TARGET.
81                      To build with static libusb, set the variable LIBUSB_LIB
82                      to contain full path of libusb library. For example:
83                       make USE_LIBUSB=1 LIBUSB_LIB=/usr/lib/libusb-1.0.a
85    USE_PCSC=1      - Request linking with PCSC. The variables that control
86                      USE_PCSC=1 build are:
87                          PCSC_FLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
88                          PCSC_CFLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
89                          PCSC_LDFLAGS='-DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC'
90                          PCSC_LIB='-lpcsclite'
91                      Using USE_PCSC=1 adds to '-pcsc' to PLUS_TARGET.
92                      To build with static PCSC, set the variable PCSC_LIB
93                      to contain full path of PCSC library. For example:
94                       make USE_PCSC=1 PCSC_LIB=/usr/local/lib/libpcsclite.a
96    USE_STAPI=1    - Request linking with STAPI. The variables that control
97                      USE_STAPI=1 build are:
98                          STAPI_FLAGS='-DWITH_STAPI=1'
99                          STAPI_CFLAGS='-DWITH_STAPI=1'
100                          STAPI_LDFLAGS='-DWITH_STAPI=1'
101                          STAPI_LIB='-L./stapi -loscam_stapi'
102                      Using USE_STAPI=1 adds to '-stapi' to PLUS_TARGET.
103                      In order for USE_STAPI to work you have to create stapi
104                      directory and put liboscam_stapi.a file in it.
105                      
106    USE_STAPI5=1    - Request linking with STAPI5. The variables that control
107                      USE_STAPI5=1 build are:
108                          STAPI5_FLAGS='-DWITH_STAPI5=1'
109                          STAPI5_CFLAGS='-DWITH_STAPI5=1'
110                          STAPI5_LDFLAGS='-DWITH_STAPI5=1'
111                          STAPI5_LIB='-L./stapi -loscam_stapi5'
112                      Using USE_STAPI5=1 adds to '-stapi' to PLUS_TARGET.
113                      In order for USE_STAPI5 to work you have to create stapi
114                      directory and put liboscam_stapi5.a file in it.
116    USE_COOLAPI=1  - Request support for Coolstream API (libnxp) aka NeutrinoHD
117                     box. The variables that control the build are:
118                          COOLAPI_FLAGS='-DWITH_COOLAPI=1'
119                          COOLAPI_CFLAGS='-DWITH_COOLAPI=1'
120                          COOLAPI_LDFLAGS='-DWITH_COOLAPI=1'
121                          COOLAPI_LIB='-lnxp -lrt'
122                      Using USE_COOLAPI=1 adds to '-coolapi' to PLUS_TARGET.
123                      In order for USE_COOLAPI to work you have to have libnxp.so
124                      library in your cross compilation toolchain.
126    USE_SU980=1  - Request support for SU980 API (libentropic) aka Enimga2 arm
127                     box. The variables that control the build are:
128                          COOLAPI_FLAGS='-DWITH_SU980=1'
129                          COOLAPI_CFLAGS='-DWITH_SU980=1'
130                          COOLAPI_LDFLAGS='-DWITH_SU980=1'
131                          COOLAPI_LIB='-lentropic -lrt'
132                      Using USE_SU980=1 adds to '-su980' to PLUS_TARGET.
133                      In order for USE_SU980 to work you have to have libentropic.a
134                      library in your cross compilation toolchain.
136    USE_AZBOX=1    - Request support for AZBOX (openxcas)
137                     box. The variables that control the build are:
138                          AZBOX_FLAGS='-DWITH_AZBOX=1'
139                          AZBOX_CFLAGS='-DWITH_AZBOX=1'
140                          AZBOX_LDFLAGS='-DWITH_AZBOX=1'
141                          AZBOX_LIB='-Lextapi/openxcas -lOpenXCASAPI'
142                      Using USE_AZBOX=1 adds to '-azbox' to PLUS_TARGET.
143                      extapi/openxcas/libOpenXCASAPI.a library that is shipped
144                      with OSCam is compiled for MIPSEL.
146    USE_MCA=1      - Request support for Matrix Cam Air (MCA).
147                     The variables that control the build are:
148                          MCA_FLAGS='-DWITH_MCA=1'
149                          MCA_CFLAGS='-DWITH_MCA=1'
150                          MCA_LDFLAGS='-DWITH_MCA=1'
151                      Using USE_MCA=1 adds to '-mca' to PLUS_TARGET.
153    USE_LIBCRYPTO=1 - Request linking with libcrypto instead of using OSCam
154                      internal crypto functions. USE_LIBCRYPTO is automatically
155                      enabled if the build is configured with SSL support. The
156                      variables that control USE_LIBCRYPTO=1 build are:
157                          LIBCRYPTO_FLAGS='-DWITH_LIBCRYPTO=1'
158                          LIBCRYPTO_CFLAGS='-DWITH_LIBCRYPTO=1'
159                          LIBCRYPTO_LDFLAGS='-DWITH_LIBCRYPTO=1'
160                          LIBCRYPTO_LIB='-lcrypto'
162    USE_SSL=1       - Request linking with libssl. USE_SSL is automatically
163                      enabled if the build is configured with SSL support. The
164                      variables that control USE_SSL=1 build are:
165                          SSL_FLAGS='-DWITH_SSL=1'
166                          SSL_CFLAGS='-DWITH_SSL=1'
167                          SSL_LDFLAGS='-DWITH_SSL=1'
168                          SSL_LIB='-lssl'
169                      Using USE_SSL=1 adds to '-ssl' to PLUS_TARGET.
171  Automatically intialized variables:
173    TARGET=text     - This variable is auto detected by using the compiler's
174                     -dumpmachine output. To see the target on your machine run:
175                      'gcc -dumpmachine'
177    PLUS_TARGET     - This variable is added to TARGET and it is set depending
178                      on the chosen USE_xxx flags. To disable adding
179                      PLUS_TARGET to TARGET, set NO_PLUS_TARGET=1
181    BINDIR          - The directory where final oscam binary would be put. The
182                      default is: Distribution
184    OSCAM_BIN=text  - This variable controls how the oscam binary will be named.
185                      Default OSCAM_BIN value is:
186                       'BINDIR/oscam-VERSVN_REV-TARGET'
187                      Once the variables (BINDIR, VER, SVN_REV and TARGET) are
188                      replaced, the resulting filename can look like this:
189                       'Distribution/oscam-1.20-unstable_svn7404-i486-slackware-linux-static'
190                      For example you can run: 'make OSCAM_BIN=my-oscam'
192  Binaries compiled and run during the OSCam build:
194    OSCam builds webif/pages_gen binary that is run by the build system to
195    generate file that holds web pages. To build this binary two variables
196    are used:
198    HOSTCC=gcc     - The compiler used for building binaries that are run on
199                     the build machine (the host). Default: gcc
200                     To use clang for example run: make CC=clang HOSTCC=clang
202    HOSTCFLAGS=xxx - The CFLAGS passed to HOSTCC. See webif/Makefile for the
203                     default host cflags.
205  Config targets:
206    make config        - Start configuration utility.
207    make allyesconfig  - Enable all configuration options.
208    make allnoconfig   - Disable all configuration options.
209    make defconfig     - Restore default configuration options.
211  Cleaning targets:
212    make clean     - Remove 'build' directory which contains compiled
213                     object files.
214    make distclean - Executes clean target and also removes binary files
215                     located in 'Distribution' directory.
217  Build system files:
218    config.sh      - OSCam configuration. Run 'config.sh --help' to see
219                     available parameters or 'make config' to start GUI
220                     configuratior.
221    Makefile       - Main build system file.
222    Makefile.extra - Contains predefined targets. You can use this file
223                     as example on how to use the build system.
224    Makefile.local - This file is included in Makefile and allows creation
225                     of local build system targets. See Makefile.extra for
226                     examples.
228  Here are some of the interesting predefined targets in Makefile.extra.
229  To use them run 'make target ...' where ... can be any extra flag. For
230  example if you want to compile OSCam for Dreambox (DM500) but do not
231  have the compilers in the path, you can run:
232     make dm500 CROSS_DIR=/opt/cross/dm500/cdk/bin/
234  Predefined targets in Makefile.extra:
236     make libusb        - Builds OSCam with libusb support
237     make pcsc          - Builds OSCam with PCSC support
238     make pcsc-libusb   - Builds OSCam with PCSC and libusb support
239     make dm500         - Builds OSCam for Dreambox (DM500)
240     make sh4           - Builds OSCam for SH4 boxes
241     make azbox         - Builds OSCam for AZBox STBs
242     make mca           - Builds OSCam for Matrix Cam Air (MCA)
243     make coolstream    - Builds OSCam for Coolstream
244     make dockstar      - Builds OSCam for Dockstar
245     make qboxhd        - Builds OSCam for QBoxHD STBs
246     make opensolaris   - Builds OSCam for OpenSolaris
247     make uclinux       - Builds OSCam for m68k uClinux
249  Predefined targets for static builds:
250     make static        - Builds OSCam statically
251     make static-libusb - Builds OSCam with libusb linked statically
252     make static-libcrypto - Builds OSCam with libcrypto linked statically
253     make static-ssl    - Builds OSCam with SSL support linked statically
255  Developer targets:
256     make tests         - Builds 'tests.bin' binary
258  Examples:
259    Build OSCam for SH4 (the compilers are in the path):
260      make CROSS=sh4-linux-
262    Build OSCam for SH4 (the compilers are in not in the path):
263      make sh4 CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/
264      make CROSS_DIR=/opt/STM/STLinux-2.3/devkit/sh4/bin/ CROSS=sh4-linux-
265      make CROSS=/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-
267    Build OSCam for SH4 with STAPI:
268      make CROSS=sh4-linux- USE_STAPI=1
270    Build OSCam for SH4 with STAPI and changed configuration directory:
271      make CROSS=sh4-linux- USE_STAPI=1 CONF_DIR=/var/tuxbox/config
273    Build OSCam for ARM with COOLAPI (coolstream aka NeutrinoHD):
274      make CROSS=arm-cx2450x-linux-gnueabi- USE_COOLAPI=1
276    Build OSCam for MIPSEL with AZBOX support:
277      make CROSS=mipsel-linux-uclibc- USE_AZBOX=1
279    Build OSCam for ARM with MCA support:
280      make CROSS=arm-none-linux-gnueabi- USE_MCA=1
282    Build OSCam with libusb and PCSC:
283      make USE_LIBUSB=1 USE_PCSC=1
285    Build OSCam with static libusb:
286      make USE_LIBUSB=1 LIBUSB_LIB="/usr/lib/libusb-1.0.a"
288    Build OSCam with static libcrypto:
289      make USE_LIBCRYPTO=1 LIBCRYPTO_LIB="/usr/lib/libcrypto.a"
291    Build OSCam with static libssl and libcrypto:
292      make USE_SSL=1 SSL_LIB="/usr/lib/libssl.a" LIBCRYPTO_LIB="/usr/lib/libcrypto.a"
294    Build with verbose messages and size optimizations:
295      make V=1 CC_OPTS=-Os
297    Build and set oscam file name:
298      make OSCAM_BIN=oscam
300    Build and set oscam file name depending on revision:
301      make OSCAM_BIN=oscam-`./config.sh -r`