summaryrefslogtreecommitdiff
path: root/security/cryptopp
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-07-23 22:44:33 +0000
committerXin LI <delphij@FreeBSD.org>2012-07-23 22:44:33 +0000
commita6cc38da5032392be3bdceb02eb5da28ab1e7807 (patch)
tree22ddd84554915cc91971615f4392f4e71f3d1f94 /security/cryptopp
parent- remove old apache13 parts (diff)
Make it possible to build and install shared library of crypto++, and
convert to use OPTIONSng [1]. While I'm there, also add an option to build with GCC 4.6.x and newer binutils, which enables use of AES-NI. PR: ports/170045 Submitted by: Michael Gmelin <freebsd grem.de>
Notes
Notes: svn path=/head/; revision=301416
Diffstat (limited to 'security/cryptopp')
-rw-r--r--security/cryptopp/Makefile42
-rw-r--r--security/cryptopp/files/patch-GNUmakefile11
-rw-r--r--security/cryptopp/pkg-plist3
3 files changed, 51 insertions, 5 deletions
diff --git a/security/cryptopp/Makefile b/security/cryptopp/Makefile
index 11bfa9e73fff..4bb248f44870 100644
--- a/security/cryptopp/Makefile
+++ b/security/cryptopp/Makefile
@@ -7,7 +7,7 @@
PORTNAME= cryptopp
PORTVERSION= 5.6.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF \
http://www.cryptopp.com/
@@ -16,6 +16,13 @@ DISTNAME= cryptopp${PORTVERSION:S/.//g}
MAINTAINER= delphij@FreeBSD.org
COMMENT= A free C++ class library of Cryptographic Primitives
+OPTIONS_DEFINE= DEBUG DOCS GCC46 STATIC THREADS
+OPTIONS_DEFAULT= STATIC THREADS
+STATIC_DESC= Build static version only (no shared libs)
+GCC46_DESC= Build with GCC 4.6+
+
+.include <bsd.port.options.mk>
+
NO_WRKSUBDIR= yes
USE_ZIP= yes
EXTRACT_BEFORE_ARGS= -aq
@@ -23,8 +30,30 @@ USE_GMAKE= yes
MAKE_JOBS_SAFE= yes
MAKEFILE= GNUmakefile
-.if !defined(WITH_DEBUG)
-CXXFLAGS+= -DNDEBUG
+LIBVERSION= 0
+PLIST_SUB+= LIBVERSION=${LIBVERSION}
+PLIST_SUB+= PORTVERSION=${PORTVERSION}
+
+.if !${PORT_OPTIONS:MDEBUG}
+CXXFLAGS+= -DNDEBUG
+.endif
+
+.if ${PORT_OPTIONS:MGCC46}
+USE_GCC= 4.6+
+.endif
+
+.if ${PORT_OPTIONS:MSTATIC}
+PLIST_SUB+= DYNAMIC_ENABLED="@comment "
+.else
+PLIST_SUB+= DYNAMIC_ENABLED=""
+MAKE_ARGS= all libcryptopp.so
+CXXFLAGS+= -fPIC
+USE_LDCONFIG= yes
+.endif
+
+.if ${PORT_OPTIONS:MTHREADS}
+CXXFLAGS+= ${PTHREAD_CFLAGS}
+LDFLAGS+= ${PTHREAD_LIBS}
.endif
do-install:
@@ -36,7 +65,12 @@ do-install:
-and -not -name 'resource.h'`; do \
${INSTALL_DATA} $$i ${PREFIX}/include/cryptopp; \
done)
-.if !defined(NOPORTDOCS)
+.if !${PORT_OPTIONS:MSTATIC}
+ ${INSTALL_LIB} ${WRKSRC}/libcryptopp.so ${PREFIX}/lib/libcryptopp.so.${PORTVERSION}
+ ${LN} -fs libcryptopp.so.${PORTVERSION} ${PREFIX}/lib/libcryptopp.so.${LIBVERSION}
+ ${LN} -fs libcryptopp.so.${LIBVERSION} ${PREFIX}/lib/libcryptopp.so
+.endif
+.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${PREFIX}/share/doc/cryptopp
${CP} ${WRKSRC}/Readme.txt ${PREFIX}/share/doc/cryptopp/README
${CP} ${WRKSRC}/License.txt ${PREFIX}/share/doc/cryptopp/License
diff --git a/security/cryptopp/files/patch-GNUmakefile b/security/cryptopp/files/patch-GNUmakefile
index 43ca3c81f89f..61a065dc0425 100644
--- a/security/cryptopp/files/patch-GNUmakefile
+++ b/security/cryptopp/files/patch-GNUmakefile
@@ -1,5 +1,5 @@
--- ./GNUmakefile.orig 2010-08-09 14:22:42.000000000 -0700
-+++ ./GNUmakefile 2011-01-27 12:43:08.905856979 -0800
++++ ./GNUmakefile 2012-07-21 03:14:01.000000000 +0200
@@ -1,4 +1,4 @@
-CXXFLAGS = -DNDEBUG -g -O2
+#CXXFLAGS = -DNDEBUG -g -O2
@@ -19,3 +19,12 @@
ISMINGW = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "mingw")
ifneq ($(GCC42_OR_LATER),0)
+@@ -151,7 +151,7 @@
+ $(RANLIB) $@
+
+ libcryptopp.so: $(LIBOBJS)
+- $(CXX) -shared -o $@ $(LIBOBJS)
++ $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $(LIBOBJS)
+
+ cryptest.exe: libcryptopp.a $(TESTOBJS)
+ $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L. -lcryptopp $(LDFLAGS) $(LDLIBS)
diff --git a/security/cryptopp/pkg-plist b/security/cryptopp/pkg-plist
index b6c94029f542..09235ff8da32 100644
--- a/security/cryptopp/pkg-plist
+++ b/security/cryptopp/pkg-plist
@@ -132,6 +132,9 @@ include/cryptopp/zdeflate.h
include/cryptopp/zinflate.h
include/cryptopp/zlib.h
lib/libcryptopp.a
+%%DYNAMIC_ENABLED%%lib/libcryptopp.so
+%%DYNAMIC_ENABLED%%lib/libcryptopp.so.%%LIBVERSION%%
+%%DYNAMIC_ENABLED%%lib/libcryptopp.so.%%PORTVERSION%%
@dirrm include/cryptopp
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/License