67 lines
2.1 KiB
Text
67 lines
2.1 KiB
Text
|
: 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.
|