[dev-libs/libtom{crypt,math}] convert to autotools-multilib, static-libs support is incomplete (i. e. not working)
This commit is contained in:
@@ -1,37 +1,81 @@
|
||||
--- a/makefile.shared 2009-03-16 11:07:19.000000000 +0100
|
||||
+++ b/makefile.shared 2009-03-16 11:30:25.000000000 +0100
|
||||
@@ -9,7 +9,7 @@
|
||||
--- makefile.shared.old 2013-11-11 19:07:58.870000000 +0100
|
||||
+++ makefile.shared 2013-11-11 19:09:02.790000000 +0100
|
||||
@@ -9,7 +9,8 @@
|
||||
VERSION=0:117
|
||||
|
||||
# Compiler and Linker Names
|
||||
-CC=libtool --mode=compile --tag=CC gcc
|
||||
+CC=libtool --mode=compile --tag CC gcc
|
||||
+LT ?= libtool
|
||||
+LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
||||
|
||||
# ranlib tools
|
||||
ifndef RANLIB
|
||||
@@ -244,7 +244,7 @@
|
||||
@@ -229,9 +230,12 @@
|
||||
#The default rule for make builds the libtomcrypt library.
|
||||
default:library
|
||||
|
||||
+%.lo: %.c
|
||||
+ $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||
+
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
-src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
- $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
+src/ciphers/aes/aes_enc.lo: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
+ $(LTCOMPILE) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
@@ -244,38 +248,38 @@
|
||||
library: $(LIBNAME)
|
||||
|
||||
testprof/$(LIBTEST):
|
||||
- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared
|
||||
+ cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) $(MAKE) -f makefile.shared
|
||||
+ cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared
|
||||
|
||||
objs: $(OBJECTS)
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
-$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST)
|
||||
- libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
|
||||
+$(LIBNAME): $(OBJECTS:.o=.lo) testprof/$(LIBTEST:.o=.lo)
|
||||
+ libtool --silent --mode=link --tag CC $(CC) $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
|
||||
|
||||
install: $(LIBNAME)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
|
||||
+ cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) $(MAKE) -f makefile.shared install
|
||||
libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
--- a/testprof/makefile.shared 2009-03-16 11:26:19.000000000 +0100
|
||||
+++ b/testprof/makefile.shared 2009-03-16 11:26:47.000000000 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-CC=libtool --mode=compile gcc
|
||||
+CC=libtool --mode=compile --tag CC gcc
|
||||
- libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
|
||||
- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
+ install -d $(DESTDIR)$(LIBPATH)
|
||||
+ cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
|
||||
+ $(LT) --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
|
||||
+ install -d $(DESTDIR)$(INCPATH)
|
||||
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
|
||||
CFLAGS += -I../src/headers -I./ -Wall -W
|
||||
#This rule makes the hash program included with libtomcrypt
|
||||
hashsum: library
|
||||
- gcc $(CFLAGS) demos/hashsum.c -o hashsum.o
|
||||
- gcc -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS)
|
||||
+ $(CC) $(CFLAGS) demos/hashsum.c -o hashsum.o
|
||||
+ $(CC) -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
#makes the crypt program
|
||||
crypt: library
|
||||
- gcc $(CFLAGS) demos/encrypt.c -o encrypt.o
|
||||
- gcc -o crypt encrypt.o -ltomcrypt $(EXTRALIBS)
|
||||
+ $(CC) $(CFLAGS) demos/encrypt.c -o encrypt.o
|
||||
+ $(CC) -o crypt encrypt.o -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
tv_gen: library $(TVS)
|
||||
- gcc -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS)
|
||||
+ $(CC) -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
test: library testprof/$(LIBTEST) $(TESTS)
|
||||
- gcc -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
+ $(CC) -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
timing: library testprof/$(LIBTEST) $(TIMINGS)
|
||||
- gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
+ $(CC) -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
# $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $
|
||||
# $Revision: 1.80 $
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libtomcrypt/libtomcrypt-1.17-r6.ebuild,v 1.2 2012/02/25 15:22:17 jer Exp $
|
||||
# $Header: $Id$
|
||||
|
||||
EAPI="2"
|
||||
EAPI="5"
|
||||
|
||||
inherit flag-o-matic multilib toolchain-funcs
|
||||
inherit autotools-multilib eutils flag-o-matic multilib toolchain-funcs
|
||||
|
||||
DESCRIPTION="modular and portable cryptographic toolkit"
|
||||
HOMEPAGE="http://libtom.org/?page=features&whatfile=crypt"
|
||||
@@ -13,9 +13,9 @@ SRC_URI="http://libtom.org/files/crypt-${PV}.tar.bz2"
|
||||
LICENSE="WTFPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
IUSE="doc"
|
||||
IUSE="doc static-libs"
|
||||
|
||||
RDEPEND="dev-libs/libtommath"
|
||||
RDEPEND="dev-libs/libtommath[static-libs?,${MULTILIB_USEDEP}]"
|
||||
DEPEND="${RDEPEND}
|
||||
doc? ( virtual/latex-base app-text/ghostscript-gpl )"
|
||||
|
||||
@@ -28,16 +28,34 @@ src_prepare() {
|
||||
-e "s:src/pk/rsa/rsa_verify_hash.o :src/pk/rsa/rsa_verify_hash.o src/pk/rsa/rsa_verify_simple.o :g" \
|
||||
{,testprof/}makefile.shared || die
|
||||
cp "${FILESDIR}/rsa_verify_simple.c" "${S}/src/pk/rsa"
|
||||
|
||||
# need libtool for cross compilation. Bug #376643
|
||||
cat <<-EOF > configure.ac
|
||||
AC_INIT(libtomcrypt, 0)
|
||||
AM_INIT_AUTOMAKE
|
||||
LT_INIT
|
||||
AC_CONFIG_FILES(Makefile)
|
||||
AC_OUTPUT
|
||||
EOF
|
||||
touch NEWS README AUTHORS ChangeLog Makefile.am
|
||||
eautoreconf
|
||||
# export LT="${S}"/libtool
|
||||
multilib_copy_sources
|
||||
}
|
||||
|
||||
_emake() {
|
||||
cd ${BUILD_DIR}
|
||||
emake CC="$(tc-getCC)" -f makefile.shared \
|
||||
EXTRALIBS="-ltommath" \
|
||||
IGNORE_SPEED=1 \
|
||||
LIBPATH="${EPREFIX}/usr/$(get_libdir)" \
|
||||
INCPATH="${EPREFIX}/usr/include" \
|
||||
"$@"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
append-flags -DLTM_DESC
|
||||
export LIBPATH="/usr/$(get_libdir)"
|
||||
EXTRALIBS="-ltommath" \
|
||||
CC=$(tc-getCC) \
|
||||
IGNORE_SPEED=1 \
|
||||
emake -f makefile.shared \
|
||||
|| die "emake failed"
|
||||
append-cflags -DLTM_DESC
|
||||
multilib_foreach_abi _emake
|
||||
}
|
||||
|
||||
src_test() {
|
||||
@@ -46,12 +64,11 @@ src_test() {
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake -f makefile.shared DESTDIR="${D}" install ||\
|
||||
die "emake install failed"
|
||||
dodoc TODO changes || die "dodoc failed"
|
||||
multilib_foreach_abi _emake DESTDIR="${ED}" install
|
||||
dodoc TODO changes
|
||||
if use doc ; then
|
||||
dodoc doc/* || die "dodoc failed"
|
||||
docinto notes ; dodoc notes/* || die "dodoc failed"
|
||||
docinto demos ; dodoc demos/* || die "dodoc failed"
|
||||
dodoc doc/*
|
||||
docinto notes ; dodoc notes/*
|
||||
docinto demos ; dodoc demos/*
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user