[96252] trunk/dports/devel
raimue at macports.org
raimue at macports.org
Mon Aug 6 07:56:04 PDT 2012
Revision: 96252
https://trac.macports.org/changeset/96252
Author: raimue at macports.org
Date: 2012-08-06 07:56:00 -0700 (Mon, 06 Aug 2012)
Log Message:
-----------
devel/elftoolchain:
New port, a BSD-licensed toolchain for the ELF binary format.
Added Paths:
-----------
trunk/dports/devel/elftoolchain/
trunk/dports/devel/elftoolchain/Portfile
trunk/dports/devel/elftoolchain/files/
trunk/dports/devel/elftoolchain/files/patch-byteorder-macros.diff
trunk/dports/devel/elftoolchain/files/patch-common-elftc.diff
trunk/dports/devel/elftoolchain/files/patch-disable-tests.diff
trunk/dports/devel/elftoolchain/files/patch-libelf-config.diff
trunk/dports/devel/elftoolchain/files/patch-mk.diff
Added: trunk/dports/devel/elftoolchain/Portfile
===================================================================
--- trunk/dports/devel/elftoolchain/Portfile (rev 0)
+++ trunk/dports/devel/elftoolchain/Portfile 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,95 @@
+# $Id$
+
+PortSystem 1.0
+
+name elftoolchain
+version 0.5.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 4be0adf8349c764474810e23cfb022c655002d77 \
+ sha256 b34351b26503ce7f106426d926a87e6c6adef81e324ec7052f3e09108ae7ab81
+
+depends_build port:bsdmake \
+ port:bison \
+ port:flex
+
+depends_lib port:libarchive
+
+patchfiles patch-mk.diff \
+ patch-disable-tests.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 ${destroot}${prefix}/bin/*] {
+ set nf [file dirname $f]/elftc-[file tail $f]
+ move $f $nf
+ ln -s $nf ${destroot}${prefix}/libexec/${name}/[file tail $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+)+)
Property changes on: trunk/dports/devel/elftoolchain/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/devel/elftoolchain/files/patch-byteorder-macros.diff
===================================================================
--- trunk/dports/devel/elftoolchain/files/patch-byteorder-macros.diff (rev 0)
+++ trunk/dports/devel/elftoolchain/files/patch-byteorder-macros.diff 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,28 @@
+--- ar/write.c 2012-02-25 00:59:04.000000000 +0100
++++ ar/write.c 2012-02-25 00:59:16.000000000 +0100
+@@ -42,6 +42,11 @@
+
+ ELFTC_VCSID("$Id: write.c 2130 2011-11-10 06:56:46Z jkoshy $");
+
++#ifdef __APPLE__
++#include <libkern/OSByteOrder.h>
++#define htobe32(x) OSSwapHostToBigInt32(x)
++#endif
++
+ #define _ARMAG_LEN 8 /* length of ar magic string */
+ #define _ARHDR_LEN 60 /* length of ar header */
+ #define _INIT_AS_CAP 128 /* initial archive string table size */
+--- elfcopy/archive.c 2012-02-25 01:00:13.000000000 +0100
++++ elfcopy/archive.c 2012-02-25 01:00:27.000000000 +0100
+@@ -43,6 +43,11 @@
+
+ ELFTC_VCSID("$Id: archive.c 2126 2011-11-10 05:07:18Z jkoshy $");
+
++#ifdef __APPLE__
++#include <libkern/OSByteOrder.h>
++#define htobe32(x) OSSwapHostToBigInt32(x)
++#endif
++
+ #define _ARMAG_LEN 8 /* length of ar magic string */
+ #define _ARHDR_LEN 60 /* length of ar header */
+ #define _INIT_AS_CAP 128 /* initial archive string table size */
Added: trunk/dports/devel/elftoolchain/files/patch-common-elftc.diff
===================================================================
--- trunk/dports/devel/elftoolchain/files/patch-common-elftc.diff (rev 0)
+++ trunk/dports/devel/elftoolchain/files/patch-common-elftc.diff 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,43 @@
+--- common/_elftc.h 2012-02-25 00:00:07.000000000 +0100
++++ common/_elftc.h 2012-02-25 00:11:26.000000000 +0100
+@@ -89,6 +89,10 @@
+ #define ELFTC_VCSID(ID) __RCSID(ID)
+ #endif
+
++#if defined(__APPLE__)
++#define ELFTC_VCSID(ID) /**/
++#endif
++
+ #endif /* ELFTC_VCSID */
+
+ /*
+@@ -97,7 +101,7 @@
+
+ #ifndef ELFTC_GETPROGNAME
+
+-#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+
+ #include <stdlib.h>
+
+@@ -173,4 +177,20 @@
+ #define ELFTC_BROKEN_YY_NO_INPUT 1
+ #endif /* __NetBSD __ */
+
++
++#if defined(__APPLE__)
++
++#include <machine/endian.h>
++
++#define ELFTC_BYTE_ORDER __DARWIN_BYTE_ORDER
++#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
++#define ELFTC_BYTE_ORDER_BIG_ENDIAN __DARWIN_BIG_ENDIAN
++
++#define ELFTC_HAVE_STRMODE 1
++#define ELFTC_NEED_BYTEORDER_EXTENSIONS 1
++
++#define roundup2 roundup
++
++#endif /* __APPLE__ */
++
+ #endif /* _ELFTC_H */
Added: trunk/dports/devel/elftoolchain/files/patch-disable-tests.diff
===================================================================
--- trunk/dports/devel/elftoolchain/files/patch-disable-tests.diff (rev 0)
+++ trunk/dports/devel/elftoolchain/files/patch-disable-tests.diff 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,14 @@
+--- Makefile 2012-02-25 01:59:07.000000000 +0100
++++ Makefile 2012-02-25 01:59:29.000000000 +0100
+@@ -25,11 +25,6 @@
+ SUBDIR += size
+ SUBDIR += strings
+
+-# Build the test suites.
+-.if exists(${.CURDIR}/test)
+-SUBDIR += test
+-.endif
+-
+ # Build documentation at the end.
+ .if exists(${.CURDIR}/documentation)
+ SUBDIR += documentation
Added: trunk/dports/devel/elftoolchain/files/patch-libelf-config.diff
===================================================================
--- trunk/dports/devel/elftoolchain/files/patch-libelf-config.diff (rev 0)
+++ trunk/dports/devel/elftoolchain/files/patch-libelf-config.diff 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,29 @@
+--- libelf/_libelf_config.h 2011-10-23 11:07:00.000000000 +0200
++++ libelf/_libelf_config.h 2012-02-24 23:54:10.000000000 +0100
+@@ -149,3 +149,26 @@
+ #define roundup2 roundup
+
+ #endif /* defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) */
++
++
++#ifdef __APPLE__
++
++#define LIBELF_VCSID(ID)
++
++#if defined(__i386__)
++
++#define LIBELF_ARCH EM_386
++#define LIBELF_BYTEORDER ELFDATA2LSB
++#define LIBELF_CLASS ELFCLASS32
++
++#elif defined(__x86_64__)
++
++#define LIBELF_ARCH EM_X86_64
++#define LIBELF_BYTEORDER ELFDATA2LSB
++#define LIBELF_CLASS ELFCLASS64
++
++#else
++#error Unknown Mac OS X architecture.
++#endif
++
++#endif /* __APPLE__ */
Added: trunk/dports/devel/elftoolchain/files/patch-mk.diff
===================================================================
--- trunk/dports/devel/elftoolchain/files/patch-mk.diff (rev 0)
+++ trunk/dports/devel/elftoolchain/files/patch-mk.diff 2012-08-06 14:56:00 UTC (rev 96252)
@@ -0,0 +1,63 @@
+--- mk/elftoolchain.inc.mk 2012-02-24 23:30:51.000000000 +0100
++++ mk/elftoolchain.inc.mk 2012-02-24 23:32:03.000000000 +0100
+@@ -11,7 +11,7 @@
+
+ .include <bsd.own.mk>
+
+-.if ${OS_HOST} == "FreeBSD"
++.if ${OS_HOST} == Darwin || ${OS_HOST} == FreeBSD
+ # Simulate <bsd.inc.mk>.
+ .PHONY: incinstall
+ includes: ${INCS} incinstall
+--- mk/elftoolchain.subdir.mk 2012-02-25 01:46:53.000000000 +0100
++++ mk/elftoolchain.subdir.mk 2012-02-25 01:47:40.000000000 +0100
+@@ -6,7 +6,7 @@
+
+ .include "$(TOP)/mk/elftoolchain.os.mk"
+
+-.if ${OS_HOST} == FreeBSD
++.if ${OS_HOST} == Darwin || ${OS_HOST} == FreeBSD
+ SUBDIR_TARGETS+= clobber test
+ .else
+ TARGETS+= clobber test
+--- common/Makefile 2012-02-25 02:09:41.000000000 +0100
++++ common/Makefile 2012-02-25 02:09:58.000000000 +0100
+@@ -5,9 +5,9 @@
+ INCS= elfdefinitions.h
+ INCSDIR?= /usr/include
+
+-.PHONY: all clean clobber depend obj
++.PHONY: all clean install clobber depend obj
+
+-all depend obj:
++all install depend obj:
+
+ clean clobber:
+ rm -f ${CLEANFILES}
+--- mk/elftoolchain.prog.mk 2012-03-10 13:03:40.000000000 +0100
++++ mk/elftoolchain.prog.mk 2012-03-10 13:04:46.000000000 +0100
+@@ -36,6 +36,11 @@
+ .endif
+ .endif
+
++.if ${OS_HOST} == "Darwin"
++CFLAGS+= -I at PREFIX@/include
++LDFLAGS+= -L at PREFIX@/lib
++.endif
++
+ #
+ # Handle lex(1) and yacc(1) in a portable fashion.
+ #
+--- mk/elftoolchain.lib.mk 2012-03-10 13:26:28.000000000 +0100
++++ mk/elftoolchain.lib.mk 2012-03-10 13:29:02.000000000 +0100
+@@ -8,6 +8,10 @@
+
+ .include "${TOP}/mk/elftoolchain.os.mk"
+
++.if ${OS_HOST} == "Darwin" && !defined(SONAME)
++SONAME= ${SHLIBDIR}/${SHLIB_NAME}
++.endif
++
+ .include <bsd.lib.mk>
+
+ # Support a 'clobber' target.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120806/a4dc1874/attachment.html>
More information about the macports-changes
mailing list