Blame README

Packit cdaae3
Packit cdaae3
A build can be done via cmake, which is
Packit cdaae3
new as of November 2016.
Packit cdaae3
  mkdir /tmp/builddir
Packit cdaae3
  cd /tmp/builddir
Packit cdaae3
  # Assuming the source tree in /a/b/code
Packit cdaae3
  cmake /a/b/code
Packit cdaae3
  make
Packit cdaae3
Packit cdaae3
Standard builds are done by configure/make as
Packit cdaae3
described below.
Packit cdaae3
Packit cdaae3
BUILDING IN SOURCE TREE
Packit cdaae3
To just build libdwarf and dwarfdump
Packit cdaae3
if the source tree is in /a/b/libdwarf-1 
Packit cdaae3
one might do:
Packit cdaae3
    cd /a/b/libdwarf-1
Packit cdaae3
    ./configure
Packit cdaae3
    make dd
Packit cdaae3
    #You may need to be root to do the following copy commands
Packit cdaae3
    cp dwarfdump/dwarfdump      /usr/local/bin
Packit cdaae3
    cp dwarfdump/dwarfdump.conf /usr/local/lib
Packit cdaae3
    #The following is optional, not needed to run dwarfdump
Packit cdaae3
    #when doing the default build.
Packit cdaae3
    cp libdwarf/libdwarf.a      /usr/local/lib
Packit cdaae3
Packit cdaae3
BUILDING OUT OF SOURCE TREE
Packit cdaae3
Or one could  create a new directory, for example,
Packit cdaae3
    mkdir /var/tmp/dwarfex
Packit cdaae3
    cd /var/tmp/dwarfex
Packit cdaae3
    /a/b/libdwarf-1/configure
Packit cdaae3
    make dd
Packit cdaae3
In this case the source directory is not touched and
Packit cdaae3
all objects and files created are under /var/tmp/dwarfex
Packit cdaae3
Packit cdaae3
NOTE: When building out of source tree the source tree
Packit cdaae3
must be cleaned of any files created by a build
Packit cdaae3
in the source tree. This is due to the way GNU Make
Packit cdaae3
VPATH works.
Packit cdaae3
Packit cdaae3
For a simple build of libdwarf, and dwarfdump
Packit cdaae3
and the other tools:
Packit cdaae3
    ./configure
Packit cdaae3
    make
Packit cdaae3
    #Optionally: cp libdwarf/libdwarf.a <somewhere>
Packit cdaae3
Packit cdaae3
To build all the tools (including dwarfgen and 
Packit cdaae3
dwarfexample) use 'make all'. There are known 
Packit cdaae3
small compile-time issues with building dwarfgen on 
Packit cdaae3
MaxOSX and most don't need to build dwarfgen.
Packit cdaae3
    ./configure
Packit cdaae3
    make all
Packit cdaae3
Packit cdaae3
By default configure compiles and uses libdwarf.a.
Packit cdaae3
Packit cdaae3
With 
Packit cdaae3
    ./configure --enabled-shared
Packit cdaae3
both libdwarf.a and libdwarf.so
Packit cdaae3
are built. The runtimes built will reference libdwarf.so.
Packit cdaae3
Packit cdaae3
With 
Packit cdaae3
    ./configure --enabled-shared --disable-nonshared
Packit cdaae3
libdwarf.so is built and used; libdwarf.a is not built.
Packit cdaae3
Packit cdaae3
When ready to create a new source distribution do
Packit cdaae3
    ./CPTOPUBLIC
Packit cdaae3
    ./BLDLIBDWARF yyyymmdd
Packit cdaae3
where that could be
Packit cdaae3
    ./BLDLIBDWARF 20140131
Packit cdaae3
as an example.
Packit cdaae3
Packit cdaae3
Sanity checking:
Packit cdaae3
Recent gcc has some checks that can be done at runtime.
Packit cdaae3
  -fsanitize=address
Packit cdaae3
  -fsanitize=leak
Packit cdaae3
  -fsanitize=undefined
Packit cdaae3
which are turned on here by --enable-sanitize at build time.
Packit cdaae3
Packit cdaae3
David Anderson.  Updated November 30, 2016