1 | : README.build -- notes on the build process |
---|
2 | |
---|
3 | The "Makefile" in this directory uses BSD make(1) syntax. If you are |
---|
4 | trying to build this library on a platform that does not have a |
---|
5 | pre-built BSD compatible make(1), then you could try porting NetBSD's |
---|
6 | make(1). NetBSD's make(1) is available at: |
---|
7 | |
---|
8 | http://www.crufty.net/help/sjg/bmake.html |
---|
9 | |
---|
10 | |
---|
11 | : Supporting cross builds |
---|
12 | |
---|
13 | In the general case, libelf may be built for a target operating system |
---|
14 | and machine architecture that is different from the host operating |
---|
15 | system and machine architecture that the compilation is happening on. |
---|
16 | For example, compilation could be running on a Linux/i386 host, with |
---|
17 | target binaries being created for a NetBSD/sparc64 system. |
---|
18 | |
---|
19 | To support cross building: |
---|
20 | - The top-level "Makefile" pulls in the appropriate make rules for the |
---|
21 | target system. |
---|
22 | |
---|
23 | Inside of makefiles, we determine the target OS by looking at the |
---|
24 | contents of the ${unix} make variable. The top-level makefile then |
---|
25 | includes any target specific makefiles if they exist. |
---|
26 | |
---|
27 | - Operating systems differ in the names and locations of the headers |
---|
28 | where their ELF types are defined. They also differ in the set of |
---|
29 | ELF types supported. |
---|
30 | |
---|
31 | Instead of relying on the host operating system to provide ELF related |
---|
32 | types and symbols, we define these in header <common/elfdefinitions.h>. |
---|
33 | |
---|
34 | - The file "_libelf_config.h" defines the 'native' architecture, byte order |
---|
35 | and word size for libelf. |
---|
36 | |
---|
37 | : OS Specific Configuration : |
---|
38 | |
---|
39 | :: Debian :: |
---|
40 | |
---|
41 | The following packages are needed for the build: |
---|
42 | - `build-essential' |
---|
43 | - `m4' |
---|
44 | - `freebsd-buildutils' or `freebsd5-buildutils' |
---|
45 | |
---|
46 | You would need to use `freebsd-make' instead of GNU make to build |
---|
47 | the tools. You would also need to place /usr/lib/freebsd in the |
---|
48 | shell's `PATH', preferably at the beginning. |
---|
49 | |
---|
50 | :: FreeBSD :: |
---|
51 | |
---|
52 | libelf should build out of the box on FreeBSD versions later than 6.0. |
---|
53 | |
---|
54 | :: NetBSD :: |
---|
55 | |
---|
56 | libelf should build out of the box on NetBSD versions later than 4.0. |
---|
57 | |
---|
58 | :: Ubuntu :: |
---|
59 | |
---|
60 | See the section on 'Debian' above. |
---|
61 | |
---|
62 | |
---|
63 | : Porting resources on the 'net |
---|
64 | |
---|
65 | The 'predef' project [http://predef.sourceforge.net/] has a |
---|
66 | comprehensive list of CPP macros predefined by various OSes. |
---|