add xyssl
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8534 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
e12cdb0b84
commit
ff50ed55c1
82
libs/xyssl/Makefile
Normal file
82
libs/xyssl/Makefile
Normal file
@ -0,0 +1,82 @@
|
||||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xyssl
|
||||
PKG_VERSION:=0.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
|
||||
PKG_SOURCE_URL:=http://xyssl.org/code/download/
|
||||
PKG_MD5SUM:=f6422c393a4ca72577331f373c6c4248
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/xyssl/Default
|
||||
TITLE:=Embedded SSL
|
||||
URL:=http://xyssl.org/
|
||||
endef
|
||||
|
||||
define Package/libxyssl/Default/description
|
||||
The aim of the XySSL project is to provide a quality, open-source
|
||||
cryptographic library written in C and targeted at embedded systems.
|
||||
endef
|
||||
|
||||
define Package/libxyssl
|
||||
$(call Package/xyssl/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE+= (library)
|
||||
endef
|
||||
|
||||
define Package/xyssl-progs
|
||||
$(call Package/xyssl/Default)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libxyssl
|
||||
TITLE+= (programs)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
OFLAGS="$(TARGET_CFLAGS)" \
|
||||
all
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)/usr" \
|
||||
install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p $(STAGING_DIR)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/xyssl $(STAGING_DIR)/usr/include/
|
||||
mkdir -p $(STAGING_DIR)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxyssl.{a,so} $(STAGING_DIR)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/UninstallDev
|
||||
rm -rf $(STAGING_DIR)/usr/include/xyssl \
|
||||
$(STAGING_DIR)/usr/lib/libxyssl.{a,so}
|
||||
endef
|
||||
|
||||
define Package/libxyssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libxyssl.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/xyssl-progs/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xyssl_* $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libxyssl))
|
||||
$(eval $(call BuildPackage,xyssl-progs))
|
147
libs/xyssl/patches/001-cross_compile.patch
Normal file
147
libs/xyssl/patches/001-cross_compile.patch
Normal file
@ -0,0 +1,147 @@
|
||||
diff -ruN xyssl-0.7-old/library/Makefile xyssl-0.7-new/library/Makefile
|
||||
--- xyssl-0.7-old/library/Makefile 2007-07-07 07:07:00.000000000 +0200
|
||||
+++ xyssl-0.7-new/library/Makefile 2007-08-29 12:20:53.000000000 +0200
|
||||
@@ -9,10 +9,13 @@
|
||||
# _BSD_EXTENSION when compiling on Plan9
|
||||
|
||||
DEFINES = -DSELF_TEST -DHAVE_RDTSC
|
||||
-CFLAGS = $(DEFINES) -I../include -O
|
||||
+CFLAGS = $(DEFINES) -I../include
|
||||
+OFLAGS = -O
|
||||
+
|
||||
+AR ?= ar
|
||||
|
||||
# To compile as a shared library:
|
||||
-# CFLAGS += -fPIC
|
||||
+CFLAGS += -fPIC
|
||||
|
||||
# MicroBlaze specific options:
|
||||
# CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift
|
||||
@@ -25,21 +28,21 @@
|
||||
|
||||
.SILENT:
|
||||
|
||||
-all: libxyssl.a
|
||||
+all: libxyssl.a libxyssl.so
|
||||
|
||||
libxyssl.a: $(OBJS)
|
||||
echo " AR $@"
|
||||
- ar r $@ $(OBJS)
|
||||
+ $(AR) r $@ $(OBJS)
|
||||
|
||||
shared: libxyssl.so
|
||||
|
||||
libxyssl.so: libxyssl.a
|
||||
echo " LD $@"
|
||||
- gcc -shared -Wl,-soname,$@ -o $@ $(OBJS)
|
||||
+ $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS)
|
||||
|
||||
.c.o:
|
||||
echo " CC $<"
|
||||
- $(CC) $(CFLAGS) -c $<
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) -c $<
|
||||
|
||||
clean:
|
||||
rm -f *.o libxyssl.*
|
||||
diff -ruN xyssl-0.7-old/programs/Makefile xyssl-0.7-new/programs/Makefile
|
||||
--- xyssl-0.7-old/programs/Makefile 2007-07-07 07:07:00.000000000 +0200
|
||||
+++ xyssl-0.7-new/programs/Makefile 2007-08-29 12:19:25.000000000 +0200
|
||||
@@ -2,7 +2,8 @@
|
||||
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
|
||||
# To compile on MinGW: add "-lws2_32" to LDFLAGS
|
||||
|
||||
-CFLAGS = -I../include -O
|
||||
+CFLAGS = -I../include
|
||||
+OFLAGS = -O
|
||||
LDFLAGS = -L../library -lxyssl
|
||||
|
||||
APPS = aes/aescrypt2 hash/hello \
|
||||
@@ -21,71 +22,71 @@
|
||||
|
||||
aes/aescrypt2: aes/aescrypt2.c ../library/libxyssl.a
|
||||
echo " CC aes/aescrypt2.c"
|
||||
- $(CC) $(CFLAGS) aes/aescrypt2.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) aes/aescrypt2.c $(LDFLAGS) -o $@
|
||||
|
||||
hash/hello: hash/hello.c ../library/libxyssl.a
|
||||
echo " CC hash/hello.c"
|
||||
- $(CC) $(CFLAGS) hash/hello.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) hash/hello.c $(LDFLAGS) -o $@
|
||||
|
||||
hash/md5sum: hash/md5sum.c ../library/libxyssl.a
|
||||
echo " CC hash/md5sum.c"
|
||||
- $(CC) $(CFLAGS) hash/md5sum.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) hash/md5sum.c $(LDFLAGS) -o $@
|
||||
|
||||
hash/sha1sum: hash/sha1sum.c ../library/libxyssl.a
|
||||
echo " CC hash/sha1sum.c"
|
||||
- $(CC) $(CFLAGS) hash/sha1sum.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) hash/sha1sum.c $(LDFLAGS) -o $@
|
||||
|
||||
hash/sha2sum: hash/sha2sum.c ../library/libxyssl.a
|
||||
echo " CC hash/sha2sum.c"
|
||||
- $(CC) $(CFLAGS) hash/sha2sum.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) hash/sha2sum.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/dh_client: pkey/dh_client.c ../library/libxyssl.a
|
||||
echo " CC pkey/dh_client.c"
|
||||
- $(CC) $(CFLAGS) pkey/dh_client.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/dh_client.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/dh_genprime: pkey/dh_genprime.c ../library/libxyssl.a
|
||||
echo " CC pkey/dh_genprime.c"
|
||||
- $(CC) $(CFLAGS) pkey/dh_genprime.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/dh_genprime.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/dh_server: pkey/dh_server.c ../library/libxyssl.a
|
||||
echo " CC pkey/dh_server.c"
|
||||
- $(CC) $(CFLAGS) pkey/dh_server.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/dh_server.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/mpi_demo: pkey/mpi_demo.c ../library/libxyssl.a
|
||||
echo " CC pkey/mpi_demo.c"
|
||||
- $(CC) $(CFLAGS) pkey/mpi_demo.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/mpi_demo.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/rsa_genkey: pkey/rsa_genkey.c ../library/libxyssl.a
|
||||
echo " CC pkey/rsa_genkey.c"
|
||||
- $(CC) $(CFLAGS) pkey/rsa_genkey.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_genkey.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/rsa_sign: pkey/rsa_sign.c ../library/libxyssl.a
|
||||
echo " CC pkey/rsa_sign.c"
|
||||
- $(CC) $(CFLAGS) pkey/rsa_sign.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_sign.c $(LDFLAGS) -o $@
|
||||
|
||||
pkey/rsa_verify: pkey/rsa_verify.c ../library/libxyssl.a
|
||||
echo " CC pkey/rsa_verify.c"
|
||||
- $(CC) $(CFLAGS) pkey/rsa_verify.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_verify.c $(LDFLAGS) -o $@
|
||||
|
||||
ssl/ssl_client1: ssl/ssl_client1.c ../library/libxyssl.a
|
||||
echo " CC ssl/ssl_client1.c"
|
||||
- $(CC) $(CFLAGS) ssl/ssl_client1.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client1.c $(LDFLAGS) -o $@
|
||||
|
||||
ssl/ssl_client2: ssl/ssl_client2.c ../library/libxyssl.a
|
||||
echo " CC ssl/ssl_client2.c"
|
||||
- $(CC) $(CFLAGS) ssl/ssl_client2.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client2.c $(LDFLAGS) -o $@
|
||||
|
||||
ssl/ssl_server: ssl/ssl_server.c ../library/libxyssl.a
|
||||
echo " CC ssl/ssl_server.c"
|
||||
- $(CC) $(CFLAGS) ssl/ssl_server.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_server.c $(LDFLAGS) -o $@
|
||||
|
||||
test/benchmark: test/benchmark.c ../library/libxyssl.a
|
||||
echo " CC test/benchmark.c"
|
||||
- $(CC) $(CFLAGS) test/benchmark.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) test/benchmark.c $(LDFLAGS) -o $@
|
||||
|
||||
test/selftest: test/selftest.c ../library/libxyssl.a
|
||||
echo " CC test/selftest.c"
|
||||
- $(CC) $(CFLAGS) test/selftest.c $(LDFLAGS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(OFLAGS) test/selftest.c $(LDFLAGS) -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(APPS)
|
15
libs/xyssl/patches/002-install.patch
Normal file
15
libs/xyssl/patches/002-install.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- xyssl-0.7-old/Makefile 2007-07-07 07:07:00.000000000 +0200
|
||||
+++ xyssl-0.7-new/Makefile 2007-08-29 12:26:01.000000000 +0200
|
||||
@@ -8,9 +8,10 @@
|
||||
cd programs && make all && cd ..
|
||||
|
||||
install:
|
||||
- mkdir -p $(DESTDIR)/{include/xyssl,lib}
|
||||
+ mkdir -p $(DESTDIR)/include/xyssl
|
||||
cp -v -r include $(DESTDIR)/include
|
||||
- cp -v library/libxyssl.a $(DESTDIR)/lib
|
||||
+ mkdir -p $(DESTDIR)/lib
|
||||
+ cp -v library/libxyssl.* $(DESTDIR)/lib
|
||||
|
||||
mkdir -p $(DESTDIR)/bin
|
||||
for p in programs/*/* ; do \
|
Loading…
x
Reference in New Issue
Block a user