aboutsummaryrefslogtreecommitdiff
path: root/devel/distorm/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'devel/distorm/Makefile')
-rw-r--r--devel/distorm/Makefile35
1 files changed, 25 insertions, 10 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>