summaryrefslogtreecommitdiffstats
path: root/rtemstoolkit/elftoolchain/libelf/README.build
blob: 7975182e821b28277f460ee1cacb26516d98815f (plain) (blame)
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
: README.build -- notes on the build process

The "Makefile" in this directory uses BSD make(1) syntax.  If you are
trying to build this library on a platform that does not have a
pre-built BSD compatible make(1), then you could try porting NetBSD's
make(1).  NetBSD's make(1) is available at:

    http://www.crufty.net/help/sjg/bmake.html


: Supporting cross builds

In the general case, libelf may be built for a target operating system
and machine architecture that is different from the host operating
system and machine architecture that the compilation is happening on.
For example, compilation could be running on a Linux/i386 host, with
target binaries being created for a NetBSD/sparc64 system.

To support cross building:
- The top-level "Makefile" pulls in the appropriate make rules for the
  target system.

  Inside of makefiles, we determine the target OS by looking at the
  contents of the ${unix} make variable.  The top-level makefile then
  includes any target specific makefiles if they exist.

- Operating systems differ in the names and locations of the headers
  where their ELF types are defined.  They also differ in the set of
  ELF types supported.

  Instead of relying on the host operating system to provide ELF related
  types and symbols, we define these in header <common/elfdefinitions.h>.

- The file "_libelf_config.h" defines the 'native' architecture, byte order
  and word size for libelf.

: OS Specific Configuration :

:: Debian ::

The following packages are needed for the build:
- `build-essential'
- `m4'
- `freebsd-buildutils' or `freebsd5-buildutils'

You would need to use `freebsd-make' instead of GNU make to build
the tools.  You would also need to place /usr/lib/freebsd in the
shell's `PATH', preferably at the beginning.

:: FreeBSD ::

libelf should build out of the box on FreeBSD versions later than 6.0.

:: NetBSD ::

libelf should build out of the box on NetBSD versions later than 4.0.

:: Ubuntu ::

See the section on 'Debian' above.


: Porting resources on the 'net

The 'predef' project [http://predef.sourceforge.net/] has a
comprehensive list of CPP macros predefined by various OSes.