aboutsummaryrefslogtreecommitdiff
path: root/devel/distorm
diff options
context:
space:
mode:
authorBrendan Fabeny <bf@FreeBSD.org>2011-05-08 04:46:41 +0000
committerBrendan Fabeny <bf@FreeBSD.org>2011-05-08 04:46:41 +0000
commit0a80d4502d28a255b99fd229cb24de8ca0718e4f (patch)
tree5d5a8f8d83e92f8167537bb609d0e7e31733046f /devel/distorm
parent80405781b73394bb89ffef55a62d0fc8fe03db0c (diff)
downloadports-0a80d4502d28a255b99fd229cb24de8ca0718e4f.tar.gz
ports-0a80d4502d28a255b99fd229cb24de8ca0718e4f.zip
Notes
Diffstat (limited to 'devel/distorm')
-rw-r--r--devel/distorm/Makefile35
-rw-r--r--devel/distorm/distinfo4
-rw-r--r--devel/distorm/files/patch-examples__linux__main.c11
-rw-r--r--devel/distorm/files/patch-make__linux__Makefile28
4 files changed, 44 insertions, 34 deletions
diff --git a/devel/distorm/Makefile b/devel/distorm/Makefile
index 7d7f8a6c87b4..b44b88955a8d 100644
--- a/devel/distorm/Makefile
+++ b/devel/distorm/Makefile
@@ -7,7 +7,7 @@
PORTNAME= distorm
PORTVERSION= 3.0.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} \
LOCAL/bf
@@ -23,15 +23,30 @@ USE_ZIP= yes
USE_LDCONFIG= yes
BUILD_WRKSRC= ${WRKSRC}/make/linux
-ALL_TARGET= clib
-PLIST_FILES= bin/disasm lib/libdistorm3.a lib/libdistorm3.so
-
-post-build:
- ${CC} ${CFLAGS} -o ${BUILD_WRKSRC}/disasm ${WRKSRC}/examples/linux/main.c \
- ${BUILD_WRKSRC}/libdistorm3.a
+PLIST_FILES= bin/disasm lib/libdistorm3.a lib/libdistorm3.so lib/libdistorm3.so.0
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "sparc64"
+PICFLAG?= -fPIC
+.else
+PICFLAG?= -fpic
+.endif
+
+do-build:
+ @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
+ EXTRAFLAGS="${PICFLAG} -DDISTORM_DYNAMIC" ${MAKE} ${_MAKE_JOBS} \
+ ${MAKE_ARGS} clib clean)
+ @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
+ EXTRAFLAGS="-DDISTORM_STATIC" ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} staticlib)
+ ${CC} ${CFLAGS} ${LDFLAGS} -DSUPPORT_64BIT_OFFSET \
+ -o ${BUILD_WRKSRC}/disasm ${WRKSRC}/examples/linux/main.c \
+ ${BUILD_WRKSRC}/libdistorm3.a
do-install:
- ( cd ${BUILD_WRKSRC} && ${INSTALL_DATA} libdistorm3.a libdistorm3.so ${PREFIX}/lib \
- && ${INSTALL_PROGRAM} disasm ${PREFIX}/bin )
+ (cd ${BUILD_WRKSRC}; ${INSTALL_LIB} libdistorm3.a ${PREFIX}/lib; \
+ ${INSTALL_LIB} libdistorm3.so ${PREFIX}/lib/libdistorm3.so.0; \
+ ${LN} -sf ${PREFIX}/lib/libdistorm3.so.0 ${PREFIX}/lib/libdistorm3.so; \
+ ${INSTALL_PROGRAM} disasm ${PREFIX}/bin)
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/devel/distorm/distinfo b/devel/distorm/distinfo
index 6edbaf8947e4..1d47763510e3 100644
--- a/devel/distorm/distinfo
+++ b/devel/distorm/distinfo
@@ -1,2 +1,2 @@
-SHA256 (distorm3.zip) = 13f9b3f536e2325b2f91cb5fb467607b82fd2eb741f2aa622d5af9dd6675dccc
-SIZE (distorm3.zip) = 193204
+SHA256 (distorm3.zip) = 4fba8606caab377d10646953a205507a1faa184047f869cc13e62b1ebf4a1b0e
+SIZE (distorm3.zip) = 205761
diff --git a/devel/distorm/files/patch-examples__linux__main.c b/devel/distorm/files/patch-examples__linux__main.c
deleted file mode 100644
index 84dc34f9e682..000000000000
--- a/devel/distorm/files/patch-examples__linux__main.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- examples/linux/main.c.orig 2011-01-21 01:44:22.000000000 -0500
-+++ examples/linux/main.c 2011-01-21 01:44:53.000000000 -0500
-@@ -29,7 +29,7 @@
- #define EX_NOPERM 77
- #define EX_CONFIG 78
-
--#include "../include/distorm.h"
-+#include "../../include/distorm.h"
-
- // The number of the array of instructions the decoder function will use to return the disassembled instructions.
- // Play with this value for performance...
diff --git a/devel/distorm/files/patch-make__linux__Makefile b/devel/distorm/files/patch-make__linux__Makefile
index 20267d2bf817..6310cb7845fd 100644
--- a/devel/distorm/files/patch-make__linux__Makefile
+++ b/devel/distorm/files/patch-make__linux__Makefile
@@ -1,26 +1,32 @@
---- make/linux/Makefile.orig 2011-01-21 01:11:45.000000000 -0500
-+++ make/linux/Makefile 2011-01-21 01:18:16.000000000 -0500
-@@ -3,18 +3,17 @@
- #
+--- make/linux/Makefile.orig 2011-05-03 09:49:41.000000000 -0400
++++ make/linux/Makefile 2011-05-03 09:50:17.000000000 -0400
+@@ -4,22 +4,23 @@
TARGET = libdistorm3.so
--COBJS = ../../mnemonics.o ../../src/wstring.o ../../src/textdefs.o ../../src/x86defs.o ../../src/prefix.o ../../src/operands.o ../../src/insts.o ../../src/instructions.o ../../src/distorm.o ../../src/decoder.o
+ COBJS = ../../src/mnemonics.o ../../src/wstring.o ../../src/textdefs.o ../../src/x86defs.o ../../src/prefix.o ../../src/operands.o ../../src/insts.o ../../src/instructions.o ../../src/distorm.o ../../src/decoder.o
-CC = gcc
--CFLAGS = -fPIC -O2 -Wall -DSUPPORT_64BIT_OFFSET -DLIBDISTORM
-+COBJS = ../../include/mnemonics.o ../../src/wstring.o ../../src/textdefs.o ../../src/x86defs.o ../../src/prefix.o ../../src/operands.o ../../src/insts.o ../../src/instructions.o ../../src/distorm.o ../../src/decoder.o
-+CFLAGS += -fPIC -DSUPPORT_64BIT_OFFSET -DLIBDISTORM
+-CFLAGS = -fPIC -O2 -Wall -DSUPPORT_64BIT_OFFSET -DDISTORM_STATIC
++CFLAGS += -DSUPPORT_64BIT_OFFSET
all: clib
clean:
-- /bin/rm -rf ../../src/*.o ${TARGET} ../../distorm3.a ../../mnemonics.o ../../*.o
-+ /bin/rm -rf ../../src/*.o ${TARGET} libdistorm3.a ../../include/mnemonics.o
+- /bin/rm -rf ../../src/*.o ${TARGET} ../../distorm3.a ./../*.o
++ /bin/rm -rf ../../src/*.o ../../distorm3.a ./../*.o
clib: ${COBJS}
- ${CC} ${CFLAGS} ${VERSION} ${COBJS} -shared -o ${TARGET}
- ar rs ../../distorm3.a ${COBJS}
-+ ${CC} ${CFLAGS} ${LDFLAGS} ${COBJS} -shared -o ${TARGET}
++ ${CC} ${CFLAGS} ${LDFLAGS} ${EXTRAFLAGS} ${VERSION} ${COBJS} -shared -o ${TARGET}
++
++staticlib: ${COBJS}
+ ${AR} rs libdistorm3.a ${COBJS}
install: libdistorm3.so
install -s ${TARGET} /usr/local/lib
+ @echo "... running ldconfig might be smart ..."
+
+ .c.o:
+- ${CC} ${CFLAGS} ${VERSION} -c $< -o $@
++ ${CC} ${CFLAGS} ${EXTRAFLAGS} ${VERSION} -c $< -o $@
+