# $Id: Portfile 107252 2013-06-24 10:44:30Z mfeiri@macports.org $ PortSystem 1.0 name elftoolchain version 0.6.1 revision 1 categories devel platforms darwin license BSD maintainers raimue description Compilation tools and libraries for ELF long_description \ BSD-licensed compilation tools and libaries for handling the ELF file \ format. This includes implementations of libelf and libdwarf along with \ the tools nm, ar, as, elfdump and more. homepage http://elftoolchain.sourceforge.net/ master_sites sourceforge use_bzip2 yes checksums rmd160 4268371905cb6e1741371cfb957bf8a7cb04ce18 \ sha256 a3e0c11ed9b0fe2f40b687b11849e7d52cb6675ebc60745c85d37a3ae4272cab depends_build port:bsdmake \ port:bison \ port:flex depends_lib port:libarchive patchfiles patch-mk.diff \ patch-libelf-config.diff \ patch-common-elftc.diff \ patch-byteorder-macros.diff post-patch { reinplace "s:@PREFIX@:${prefix}:g" ${worksrcpath}/mk/elftoolchain.prog.mk } use_configure no build.type bsd build.cmd ${prefix}/bin/bsdmake build.args CC=${configure.cc} \ CWARNFLAGS= \ prefix=${prefix} \ BINDIR=${prefix}/bin \ LIBDIR=${prefix}/lib/elftoolchain \ SHLIBDIR=${prefix}/lib/elftoolchain \ INCSDIR=${prefix}/include/elftoolchain # Exclude docs to avoid pulling in a full TeX distribution build.args-append MKTEX=no destroot.target install destroot.args prefix=${prefix} \ BINDIR=${prefix}/bin \ LIBDIR=${prefix}/lib/elftoolchain \ SHLIBDIR=${prefix}/lib/elftoolchain \ INCSDIR=${prefix}/include/elftoolchain # Do not strip binaries as that leads to errors destroot.args-append STRIP= pre-destroot { file mkdir ${destroot}${prefix}/lib/elftoolchain file mkdir ${destroot}${prefix}/include/elftoolchain file mkdir ${destroot}${prefix}/libexec/elftoolchain } # Add elftc- prefix to all binaries to avoid conflicts post-destroot { foreach f [glob -tails -directory ${destroot}${prefix}/bin *] { set nf elftc-$f move ${destroot}${prefix}/bin/$f ${destroot}${prefix}/bin/$nf ln -s ${prefix}/bin/$nf ${destroot}${prefix}/libexec/${name}/$f } foreach f [glob ${destroot}${prefix}/share/man/man{1,5}/*] { move $f [file dirname $f]/elftc-[file tail $f] } } notes " The tools provided by elftoolchain are prefixed with the string 'elftc-' by\ default to distinguish them from the commands provided by your default\ toolchain. For example, nm becomes elftc-nm and size becomes elftc-size. If you want to use the tools provided by elftoolchain by default, add this\ directory to the front of your PATH environment variable: ${prefix}/libexec/elftoolchain " livecheck.type regex livecheck.url http://sourceforge.net/projects/elftoolchain/files/Sources/ livecheck.regex ${name}-(\\d+(\\.\\d+)+)