blob: d6ce60e9c16c523f1845e2411cde310cdf51fb19 [file] [log] [blame]
Neels Hofmeyr697a6172018-08-22 17:32:21 +02001=== WHAT IS THIS?
2
3* quickly build the entire Osmocom core network stack from source, with a
4 generated top-level makefile (see the rest of this README file below).
5
6* quickly configure, launch and tear down an entire Osmocom core network on
7 your box (see net/README).
8
9
Neels Hofmeyr569f8ff2018-01-06 21:20:28 +010010=== Quick Start
11
12sudo apt install \
13 build-essential gcc g++ make automake autoconf libtool pkg-config \
14 libtalloc-dev libpcsclite-dev libortp-dev libsctp-dev libssl-dev libdbi-dev \
15 libdbd-sqlite3 libsqlite3-dev libpcap-dev libc-ares-dev libgnutls28-dev \
16 libsctp-dev sqlite3
17
18./gen_makefile.py 3G+2G.deps default.opts iu.opts -I -m make
19
20cd make
21make
22
23- 'make' will ask for sudo password to run 'make install' and 'ldconfig'.
24 To run non-interactively:
25
26 - 'make install':
27 chown $USER: /usr/local
28 Then call gen_makefile.py once without the -I option
29
30 - 'ldconfig':
31 echo "$USER ALL= NOPASSWD: /sbin/ldconfig" > /etc/sudoers.d/ldconfig
32
33
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +020034=== gen_makefile.py
35
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020036This provides a set of top-level makefiles to build variants of the Osmocom
37source trees. It is inteded for the core network components and related
38projects, but works generically.
39
40The idea is to have all your Osmocom git clones in ./src, while keeping one or
41more separate build trees in ./make-*.
42
43Run ./gen_makefile.py with a choice of projects (2G only or also 3G?)
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020044and a choice of configure options.
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020045
Neels Hofmeyr00e6a572017-09-20 19:41:09 +020046
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020047Examples:
48
49Full 2G and 3G support:
50
Neels Hofmeyr015f3012017-12-10 13:39:08 +010051 ./gen_makefile.py 3G+2G.deps default.opts iu.opts -m make
52 cd make
53 make
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020054
Neels Hofmeyr015f3012017-12-10 13:39:08 +0100552G only, and a custom dir name of 'make-2G':
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020056
Neels Hofmeyr95ea8ec2017-09-06 18:54:58 +020057 ./gen_makefile.py 2G.deps default.opts -m make-2G
Neels Hofmeyr015f3012017-12-10 13:39:08 +010058 cd make-2G
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020059 make
60
61If you make modifications in one of the source trees, this Makefile will pick
62it up, rebuild the project and also rebuild all dependencies (according to the
63*.deps file the Makefile was generated from).
64
65If you modify the *.deps or *.opts file, you can easily run 'make regen' in a
66make-* subdir to regenerate the Makefile from the same files.
67
68In your make-* subdir there are empty status files that are touched for every
69completed make target. From these, 'make' can detect what needs to be rebuilt.
70You can manually remove them to force a rebuild of a specific target.
71
72For example, if you 'rm .make.libosmocore.autoconf', libosmocore and all
73projects depending on libosmocore will be rebuilt from scratch.
74
75For more details on the *.opts and *.deps syntax, read the docs at the top of
76./gen_makefile.py.
77
78It is also easily possible to keep sources and build trees in various
79configurations, see the command line options of ./gen_makefile.py.
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +020080
81
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020082=== Build Environment
83
Neels Hofmeyr015f3012017-12-10 13:39:08 +010084For dependencies, see the "External dependencies" on:
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020085
86 https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source
87
Neels Hofmeyr015f3012017-12-10 13:39:08 +010088If /usr/local/ is not writable by your user, pass the --sudo-make-install
89option to gen_makefile.py above (a custom --prefix is not yet supported).
90
91If your system doesn't have this by default, you will need:
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020092
93 export LD_LIBRARY_PATH="/usr/local/lib"
94
95and
96
97 export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
98
99to your environment. To use the installed binaries after installation, also
100
101 export PATH="$PATH:/usr/local/bin"
102
103
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +0200104=== osmo-uninstall.sh
105
106Remove osmocom built binaries and headers from given prefix,
107default is /usr/local.
Neels Hofmeyrf6402d82017-09-04 04:32:21 +0200108
109
110=== src/*
111
112Find other useful scripts in src/, see src/README.