patch: build libcryptopp.so

390 views
Skip to first unread message

Zooko Wilcox-O'Hearn

unread,
May 23, 2009, 8:40:56 PM5/23/09
to Crypto++ Users
Folks:

Here is a patch to build a shared lib on Linux.

Regards,

Zooko

Fri May 22 20:59:12 MDT 2009 zo...@zooko.com
* add shared-library target "libcryptopp.so" for linux, add "*.so"
to install target
diff -rN -u old-release-5.6.0-plus-zookopatches/c5/GNUmakefile new-
release-5.6.0-plus-zookopatches/c5/GNUmakefile
--- old-release-5.6.0-plus-zookopatches/c5/GNUmakefile 2009-05-23
18:39:57.000000000 -0600
+++ new-release-5.6.0-plus-zookopatches/c5/GNUmakefile 2009-05-23
18:39:58.000000000 -0600
@@ -120,13 +120,17 @@
install:
$(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
$(CP) *.h $(PREFIX)/include/cryptopp
- $(CP) *.a $(PREFIX)/lib
+ -$(CP) *.a $(PREFIX)/lib
+ $(CP) *.so $(PREFIX)/lib
$(CP) *.exe $(PREFIX)/bin

libcryptopp.a: $(LIBOBJS)
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@

+libcryptopp.so: $(LIBOBJS)
+ $(CXX) -shared -o $@ $(LIBOBJS)
+
cryptest.exe: libcryptopp.a $(TESTOBJS)
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L. -lcryptopp $(LDFLAGS) $
(LDLIBS)

p1.txt

zooko

unread,
Jun 4, 2009, 4:43:24 PM6/4/09
to Crypto++ Users, j...@debian.org, aure...@bompard.org
[adding Cc: Jens Peter Secher, the Debian maintainer for Crypto++, and
Aurélien Bompard, the Fedora maintainer for Crypto++]

Dear Wei Dai and members of cryptopp-users mailing list:

Per the discussion on the Python cplusplus-sig [1, 2], I no longer
think this patch to build a shared lib for Crypto++ is a good idea and
have eliminated it from my copy of Crypto++ which is bundled inside
pycryptopp.

I know that Debian and Fedora have both developed their own build
systems for Crypto++ which do produce shared libs. It would seem
useful for Crypto++ mainline and Debian and Fedora to share these
build scripts with each other, and for either the former to persuade
the latter to use the upstream (static lib) approach or for the latter
to persuade the former to support the distribution (shared lib)
approach, or at least for the build scripts to be added into the
upstream repository along with some note saying "The following is what
Debian/Fedora does to build shared libs, but this is not supported by
Crypto++ upstream.".

Adding the scripts into the repository and updating the readme or the
GNUmakefile like this would be a form of inter-project communication,
helping both sides to be aware of what the other side is doing and
also helping third parties (like me) to recognize what the situation
is.

Thank you for your attention.

Regards,

Zooko

[1] http://mail.python.org/pipermail/cplusplus-sig/2009-May/014531.html
[2] http://mail.python.org/pipermail/cplusplus-sig/2009-May/014536.html
Reply all
Reply to author
Forward
0 new messages