Gentoo Archives: gentoo-commits

From: "Tim Harder (radhermit)" <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/crypto++/files: crypto++-5.6.2-make.patch
Date: Sat, 02 Mar 2013 08:27:21
Message-Id: 20130302082716.A97122171E@flycatcher.gentoo.org
1 radhermit 13/03/02 08:27:16
2
3 Added: crypto++-5.6.2-make.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
8
9 Revision Changes Path
10 1.1 dev-libs/crypto++/files/crypto++-5.6.2-make.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/crypto++/files/crypto++-5.6.2-make.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/crypto++/files/crypto++-5.6.2-make.patch?rev=1.1&content-type=text/plain
14
15 Index: crypto++-5.6.2-make.patch
16 ===================================================================
17 --- cryptopp562/GNUmakefile
18 +++ cryptopp562/GNUmakefile
19 @@ -1,3 +1,5 @@
20 +LIBTOOL = libtool
21 +LIBDIR = lib
22 CXXFLAGS = -DNDEBUG -g -O2
23 # -O3 fails to link on Cygwin GCC version 4.5.3
24 # -fPIC is supported. Please report any breakage of -fPIC as a bug.
25 @@ -7,8 +9,9 @@
26 # LDFLAGS += -Wl,--gc-sections
27 ARFLAGS = -cr # ar needs the dash on OpenBSD
28 RANLIB = ranlib
29 -CP = cp
30 +LN_S = ln -s
31 MKDIR = mkdir
32 +INSTALL = install
33 EGREP = egrep
34 UNAME = $(shell uname)
35 ISX86 = $(shell uname -m | $(EGREP) -c "i.86|x86|i86|amd64")
36 @@ -79,8 +82,11 @@
37 LDLIBS += -lws2_32
38 endif
39
40 +THREAD_LIBS =
41 +
42 ifeq ($(IS_LINUX),1)
43 LDFLAGS += -pthread
44 +THREAD_LIBS += -lpthread
45 ifneq ($(shell uname -i | $(EGREP) -c "(_64|d64)"),0)
46 M32OR64 = -m64
47 endif
48 @@ -126,54 +132,52 @@
49 SRCS = $(shell echo *.cpp)
50 endif
51
52 -OBJS = $(SRCS:.cpp=.o)
53 -# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
54 -TESTOBJS = bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
55 +OBJS = $(SRCS:.cpp=.lo)
56 +# test.lo needs to be after bench.lo for cygwin 1.1.4 (possible ld bug?)
57 +TESTOBJS = bench.lo bench2.lo test.lo validat1.lo validat2.lo validat3.lo adhoc.lo datatest.lo regtest.lo fipsalgt.lo dlltest.lo
58 LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
59
60 DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
61 -DLLOBJS = $(DLLSRCS:.cpp=.export.o)
62 -LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
63 -TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
64 -DLLTESTOBJS = dlltest.dllonly.o
65 -
66 -all: cryptest.exe
67 -static: libcryptopp.a
68 -dynamic: libcryptopp.so
69 +DLLOBJS = $(DLLSRCS:.cpp=.export.lo)
70 +LIBIMPORTOBJS = $(LIBOBJS:.lo=.import.lo)
71 +TESTIMPORTOBJS = $(TESTOBJS:.lo=.import.lo)
72 +DLLTESTOBJS = dlltest.dllonly.lo
73 +
74 +all: libcrypto++.la
75
76 -test: cryptest.exe
77 - ./cryptest.exe v
78 +test: cryptest
79 + ./cryptest v
80
81 clean:
82 - -$(RM) cryptest.exe libcryptopp.a libcryptopp.so $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTI MPORTOBJS) $(DLLTESTOBJS)
83 + $(RM) -f .libs cryptest libcrypto++.* libcryptopp.* $(LIBOBJS) $(TESTOBJS) cryptopp.dll cryptest.import dlltest $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
84 +
85
86 install:
87 - $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
88 - -$(CP) *.h $(PREFIX)/include/cryptopp
89 - -$(CP) *.a $(PREFIX)/lib
90 - -$(CP) *.so $(PREFIX)/lib
91 - -$(CP) *.exe $(PREFIX)/bin
92 + $(MKDIR) -p $(DESTDIR)$(PREFIX)/include/crypto++ $(DESTDIR)$(PREFIX)/$(LIBDIR)
93 + $(INSTALL) -m 644 *.h $(DESTDIR)$(PREFIX)/include/crypto++
94 + $(LN_S) crypto++ $(DESTDIR)$(PREFIX)/include/cryptopp
95 + $(LIBTOOL) --mode=install $(INSTALL) libcrypto++.la $(DESTDIR)$(PREFIX)/$(LIBDIR)
96 + $(LN_S) libcrypto++.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.a
97 + $(LN_S) libcrypto++.so.0.0.0 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.so
98 + $(LN_S) libcrypto++.so.0.0.0 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.so.0
99 + $(LN_S) libcrypto++.so.0.0.0 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.so.0.0.0
100
101 remove:
102 - -$(RM) -rf $(PREFIX)/include/cryptopp
103 - -$(RM) $(PREFIX)/lib/libcryptopp.a
104 - -$(RM) $(PREFIX)/lib/libcryptopp.so
105 - -$(RM) $(PREFIX)/bin/cryptest.exe
106 -
107 -libcryptopp.a: $(LIBOBJS)
108 - $(AR) $(ARFLAGS) $@ $(LIBOBJS)
109 - $(RANLIB) $@
110 + $(RM) -rf $(DESTDIR)$(PREFIX)/include/crypto++
111 + $(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.a
112 + $(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/libcryptopp.so*
113 + $(RM) $(DESTDIR)$(PREFIX)/bin/cryptest
114
115 -libcryptopp.so: $(LIBOBJS)
116 - $(CXX) -shared -o $@ $(LIBOBJS)
117 +libcrypto++.la: $(LIBOBJS)
118 + $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(LDFLAGS) -rpath $(PREFIX)/$(LIBDIR) -o $@ $(LIBOBJS) $(THREAD_LIBS)
119
120 -cryptest.exe: libcryptopp.a $(TESTOBJS)
121 - $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
122 +cryptest: libcrypto++.la $(TESTOBJS)
123 + $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(LDFLAGS) -o $@ $(TESTOBJS) -L. -lcrypto++ $(LDLIBS) $(THREAD_LIBS)
124
125 nolib: $(OBJS) # makes it faster to test changes
126 - $(CXX) -o ct $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS)
127 + $(LIBTOOL) --tag=CXX --mode=link $(CXX) -o ct $(LDFLAGS) $(OBJS) $(LDLIBS) $(THREAD_LIBS)
128
129 -dll: cryptest.import.exe dlltest.exe
130 +dll: cryptest.import dlltest
131
132 cryptopp.dll: $(DLLOBJS)
133 $(CXX) -shared -o $@ $(CXXFLAGS) $(DLLOBJS) $(LDFLAGS) $(LDLIBS) -Wl,--out-implib=libcryptopp.dll.a
134 @@ -182,10 +186,10 @@
135 $(AR) $(ARFLAGS) $@ $(LIBIMPORTOBJS)
136 $(RANLIB) $@
137
138 -cryptest.import.exe: cryptopp.dll libcryptopp.import.a $(TESTIMPORTOBJS)
139 +cryptest.import: cryptopp.dll libcryptopp.import.a $(TESTIMPORTOBJS)
140 $(CXX) -o $@ $(CXXFLAGS) $(TESTIMPORTOBJS) -L. -lcryptopp.dll -lcryptopp.import $(LDFLAGS) $(LDLIBS)
141
142 -dlltest.exe: cryptopp.dll $(DLLTESTOBJS)
143 +dlltest: cryptopp.dll $(DLLTESTOBJS)
144 $(CXX) -o $@ $(CXXFLAGS) $(DLLTESTOBJS) -L. -lcryptopp.dll $(LDFLAGS) $(LDLIBS)
145
146 adhoc.cpp: adhoc.cpp.proto
147 @@ -195,14 +199,14 @@
148 touch adhoc.cpp
149 endif
150
151 -%.dllonly.o : %.cpp
152 +%.dllonly.lo : %.cpp
153 $(CXX) $(CXXFLAGS) -DCRYPTOPP_DLL_ONLY -c $< -o $@
154
155 -%.import.o : %.cpp
156 +%.import.lo : %.cpp
157 $(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@
158
159 -%.export.o : %.cpp
160 +%.export.lo : %.cpp
161 $(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@
162
163 -%.o : %.cpp
164 - $(CXX) $(CXXFLAGS) -c $<
165 +%.lo : %.cpp
166 + $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(CXXFLAGS) -c $<