--- uClinux-dist.orig/config/Configure.help	2006-11-15 03:03:58.000000000 +0100
+++ uClinux-dist/config/Configure.help	2007-06-04 14:46:48.000000000 +0200
@@ -762,6 +762,24 @@
   set up by init during system boot.  This means that changes to the
   time zone take effect immediately instead of requiring a reboot.
 
+CONFIG_LIB_LIBGPGERROR_FORCE
+  The libgpg-error library, error handling for the GnuPG components.
+  Needed by GnuTLS.
+
+CONFIG_LIB_LIBGCRYPT_FORCE
+  Low-level cryptographic library.  This library requires (and
+  enables) libgpg-error.  Needed by GnuTLS and GNU SASL.
+
+CONFIG_LIB_GNUTLS_FORCE
+  Library for the Transport Layer Security (TLS) network security
+  protocol.  This library requires (and enables) libgpg-error and
+  libgcrypt.
+
+CONFIG_LIB_GSASL_FORCE
+  Library for the Simple Authentication and Security Layer (SASL)
+  network security protocol.  This library requires (and enables)
+  libgpg-error and libgcrypt.
+
 CONFIG_USER_BOA_EMERG
   If enabled, boa will syslog all messages at the emergency level
 
--- uClinux-dist.orig/config/config.in	2007-01-30 03:10:39.000000000 +0100
+++ uClinux-dist/config/config.in	2007-06-04 14:47:35.000000000 +0200
@@ -135,6 +135,21 @@
 	define_bool CONFIG_LIB_LIBSSL y
 fi
 bool 'Build libcrypt_old'	CONFIG_LIB_LIBCRYPT_OLD_FORCE
+bool 'Build libgpg-error'	CONFIG_LIB_LIBGPGERROR_FORCE
+bool 'Build libgcrypt'		CONFIG_LIB_LIBGCRYPT_FORCE
+if [ "$CONFIG_LIB_LIBGCRYPT_FORCE" = "y" ]; then
+	define_bool CONFIG_LIB_LIBGPGERROR y
+fi
+bool 'Build gnutls'		CONFIG_LIB_GNUTLS_FORCE
+if [ "$CONFIG_LIB_GNUTLS_FORCE" = "y" ]; then
+	define_bool CONFIG_LIB_LIBGPGERROR y
+	define_bool CONFIG_LIB_LIBGCRYPT y
+fi
+bool 'Build gsasl'		CONFIG_LIB_GSASL_FORCE
+if [ "$CONFIG_LIB_GSASL_FORCE" = "y" ]; then
+	define_bool CONFIG_LIB_LIBGPGERROR y
+	define_bool CONFIG_LIB_LIBGCRYPT y
+fi
 
 comment 'Library Configuration'
 bool 'Support time zones'	CONFIG_LIB_UC_LIBC_TIMEZONE
--- uClinux-dist.orig/lib/Makefile	2006-10-31 06:21:43.000000000 +0100
+++ uClinux-dist/lib/Makefile	2007-06-04 15:04:08.000000000 +0200
@@ -100,12 +100,20 @@
 dir_4_$(CONFIG_LIB_NETFILTER_CONNTRACK) += libnetfilter_conntrack
 dir_4_$(CONFIG_LIB_LIBPNG)       += libpng
 dir_4_$(CONFIG_LIB_LIBPNG_FORCE) += libpng
+dir_3_$(CONFIG_LIB_LIBGPGERROR) += libgpg-error
+dir_3_$(CONFIG_LIB_LIBGPGERROR_FORCE) += libgpg-error
+dir_4_$(CONFIG_LIB_LIBGCRYPT)    += libgcrypt
+dir_4_$(CONFIG_LIB_LIBGCRYPT_FORCE) += libgcrypt
+dir_5_$(CONFIG_LIB_GNUTLS)       += gnutls
+dir_5_$(CONFIG_LIB_GNUTLS_FORCE) += gnutls
+dir_6_$(CONFIG_LIB_GSASL)        += gsasl
+dir_6_$(CONFIG_LIB_GSASL_FORCE)  += gsasl
 
 # And build libraries in the prop directory last
-dir_5_y = $(ROOTDIR)/prop
+dir_7_y = $(ROOTDIR)/prop
 
-DIRS_y   = $(foreach n,1 2 3 4 5,$(sort $(dir_$(n)_y)))
-DIRS_all = $(foreach n,1 2 3 4 5,$(sort $(dir_$(n)_y) $(dir_$(n)_n) $(dir_$(n)_)))
+DIRS_y   = $(foreach n,1 2 3 4 5 6 7,$(sort $(dir_$(n)_y)))
+DIRS_all = $(foreach n,1 2 3 4 5 6 7,$(sort $(dir_$(n)_y) $(dir_$(n)_n) $(dir_$(n)_)))
 
 ##############################################################################
 
@@ -131,6 +139,14 @@
 		$(MAKE) -j$(HOST_NCPU) $(sort $(dir_5_y)) || exit $$?
 	$(MAKE) -j1 -C ../include
 	$(MAKE) make_links                        || exit $$?
+	[ -z "$(dir_6_y)" ] ||\
+		$(MAKE) -j$(HOST_NCPU) $(sort $(dir_6_y)) || exit $$?
+	$(MAKE) -j1 -C ../include
+	$(MAKE) make_links                        || exit $$?
+	[ -z "$(dir_7_y)" ] ||\
+		$(MAKE) -j$(HOST_NCPU) $(sort $(dir_7_y)) || exit $$?
+	$(MAKE) -j1 -C ../include
+	$(MAKE) make_links                        || exit $$?
 
 # the actual dir target
 .PHONY: $(DIRS_y)
--- uClinux-dist.orig/lib/libgpg-error/makefile	1970-01-01 01:00:00.000000000 +0100
+++ uClinux-dist/lib/libgpg-error/makefile	2007-06-07 14:14:34.000000000 +0200
@@ -0,0 +1,28 @@
+# Copyright (C) 2005, 2007 Simon Josefson
+#
+# This file is free software; the author gives unlimited permission to
+# copy and/or distribute it, with or without modifications, as long as
+# this notice is preserved.
+#
+# This work was sponsored by a company using GNU SASL and GNU TLS on
+# a uClinux platform.  If you need commercial help with Libgpg-error,
+# Libgcrypt, GNU SASL or GNU TLS, please contact Simon Josefsson
+# <simon@josefsson.org>.
+
+CONFOPTS := --prefix=$(ROOTDIR)/lib/libgpg-error/inst \
+	--disable-shared
+
+all: build/build
+	$(MAKE) -C build install
+
+build/build: makefile
+	chmod u+x configure
+	rm -rf build
+	mkdir build
+	cd build && ../configure $(CONFIGURE_OPTS) $(CONFOPTS)
+	touch build/build
+
+clean:
+	rm -rf build
+
+romfs:
--- uClinux-dist.orig/lib/libgcrypt/makefile	1970-01-01 01:00:00.000000000 +0100
+++ uClinux-dist/lib/libgcrypt/makefile	2007-06-07 14:14:30.000000000 +0200
@@ -0,0 +1,30 @@
+# Copyright (C) 2005, 2007 Simon Josefson
+#
+# This file is free software; the author gives unlimited permission to
+# copy and/or distribute it, with or without modifications, as long as
+# this notice is preserved.
+#
+# This work was sponsored by a company using GNU SASL and GNU TLS on
+# a uClinux platform.  If you need commercial help with Libgpg-error,
+# Libgcrypt, GNU SASL or GNU TLS, please contact Simon Josefsson
+# <simon@josefsson.org>.
+
+CONFOPTS := --prefix=$(ROOTDIR)/lib/libgcrypt/inst \
+	--disable-shared \
+	--with-gpg-error-prefix=$(ROOTDIR)/lib/libgpg-error/inst \
+	--disable-asm
+
+all: build/build
+	$(MAKE) -C build install
+
+build/build: makefile
+	chmod u+x configure
+	rm -rf build
+	mkdir build
+	cd build && ../configure $(CONFIGURE_OPTS) $(CONFOPTS)
+	touch build/build
+
+clean:
+	rm -rf build
+
+romfs:
--- uClinux-dist.orig/lib/gnutls/makefile	1970-01-01 01:00:00.000000000 +0100
+++ uClinux-dist/lib/gnutls/makefile	2007-06-07 14:14:17.000000000 +0200
@@ -0,0 +1,32 @@
+# Copyright (C) 2005, 2007 Simon Josefson
+#
+# This file is free software; the author gives unlimited permission to
+# copy and/or distribute it, with or without modifications, as long as
+# this notice is preserved.
+#
+# This work was sponsored by a company using GNU SASL and GNU TLS on
+# a uClinux platform.  If you need commercial help with Libgpg-error,
+# Libgcrypt, GNU SASL or GNU TLS, please contact Simon Josefsson
+# <simon@josefsson.org>.
+
+CONFOPTS := --prefix=$(ROOTDIR)/lib/gnutls/inst \
+	--disable-shared \
+	--with-libgcrypt-prefix=$(ROOTDIR)/lib/libgcrypt/inst \
+	--with-included-opencdk \
+	--with-included-libtasn1 \
+	--disable-cxx
+
+all: build/build
+	$(MAKE) -C build install
+
+build/build: makefile
+	chmod u+x configure
+	rm -rf build
+	mkdir build
+	cd build && ../configure $(CONFIGURE_OPTS) $(CONFOPTS)
+	touch build/build
+
+clean:
+	rm -rf build
+
+romfs:
--- uClinux-dist.orig/lib/gsasl/makefile	1970-01-01 01:00:00.000000000 +0100
+++ uClinux-dist/lib/gsasl/makefile	2007-06-07 14:30:11.000000000 +0200
@@ -0,0 +1,32 @@
+# Copyright (C) 2005, 2007 Simon Josefson
+#
+# This file is free software; the author gives unlimited permission to
+# copy and/or distribute it, with or without modifications, as long as
+# this notice is preserved.
+#
+# This work was sponsored by a company using GNU SASL and GNU TLS on
+# a uClinux platform.  If you need commercial help with Libgpg-error,
+# Libgcrypt, GNU SASL or GNU TLS, please contact Simon Josefsson
+# <simon@josefsson.org>.
+
+CONFOPTS := --prefix=$(ROOTDIR)/lib/gsasl/inst \
+	--disable-shared \
+	--with-libgcrypt \
+	--with-libgcrypt-prefix=$(ROOTDIR)/lib/libgcrypt/inst \
+	--disable-gssapi \
+	--disable-obsolete
+
+all: build/build
+	$(MAKE) -C build install
+
+build/build: makefile
+	chmod u+x configure
+	rm -rf build
+	mkdir build
+	cd build && ../configure $(CONFIGURE_OPTS) $(CONFOPTS)
+	touch build/build
+
+clean:
+	rm -rf build
+
+romfs:
