summaryrefslogtreecommitdiff
path: root/guile/Makefile.am
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-11 23:04:35 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-02-15 10:06:09 +0100
commit3045a96d37f551f60482e9cc74513d60b0590600 (patch)
tree503784b454b0d59236295e53f431d4040c6e3442 /guile/Makefile.am
parent92d471b8c10d09795737b695533a43dd08a6b693 (diff)
downloadgnutls-3045a96d37f551f60482e9cc74513d60b0590600.tar.gz
guile: Build and install .go files on Guile 2.x.
* configure.ac: Check for 'guild' and substitute 'GUILD'. Define 'HAVE_GUILD'. Substitute 'guileobjectdir'. Don't output guile/modules/Makefile and guile/tests/Makefile. * guile/modules/Makefile.am, guile/tests/Makefile.am: Remove. Move contents to... * guile/Makefile.am: ... here. (SUBDIRS): Remove 'modules' and 'tests'.
Diffstat (limited to 'guile/Makefile.am')
-rw-r--r--guile/Makefile.am118
1 files changed, 117 insertions, 1 deletions
diff --git a/guile/Makefile.am b/guile/Makefile.am
index ed9b8ba1d7..98ac7a1d65 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -15,6 +15,122 @@
# License along with GnuTLS; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SUBDIRS = modules src tests
+# First of all, built the DSO. We cannot compile the Scheme code until this
+# is done.
+SUBDIRS = src
+
EXTRA_DIST = .dir-locals.el
+
+guilemoduledir = $(GUILE_SITE)
+guilemodulesubdir = $(GUILE_SITE)/gnutls
+
+nodist_guilemodule_DATA = modules/gnutls.scm
+dist_guilemodulesub_DATA = modules/gnutls/extra.scm
+
+documentation_modules = \
+ modules/system/documentation/README \
+ modules/system/documentation/c-snarf.scm \
+ modules/system/documentation/output.scm
+
+helper_modules = \
+ modules/gnutls/build/enums.scm \
+ modules/gnutls/build/smobs.scm \
+ modules/gnutls/build/utils.scm \
+ modules/gnutls/build/tests.scm
+
+EXTRA_DIST += modules/gnutls.in $(helper_modules) $(documentation_modules)
+
+CLEANFILES = modules/gnutls.scm
+
+.in.scm:
+ cat "$^" | $(SED) -e's|[@]guileextensiondir[@]|$(guileextensiondir)|g' \
+ > "$@.tmp"
+ mv "$@.tmp" "$@"
+
+
+#
+# Scheme code compilation.
+#
+
+if HAVE_GUILD
+
+guileobjectsubdir = $(guileobjectdir)/gnutls
+nodist_guileobject_DATA = modules/gnutls.go
+nodist_guileobjectsub_DATA = modules/gnutls/extra.go
+
+GOBJECTS = \
+ $(nodist_guileobject_DATA) \
+ $(nodist_guileobjectsub_DATA)
+
+CLEANFILES += $(GOBJECTS)
+
+AM_V_GUILEC = $(AM_V_GUILEC_$(V))
+AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
+AM_V_GUILEC_0 = @echo " GUILEC " $@;
+
+# Make sure 'gnutls.scm' is built first.
+# Unset 'GUILE_LOAD_COMPILED_PATH' so we can be sure that any .go file that we
+# load comes from the build directory.
+# XXX: Use the C locale for when Guile lacks
+# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
+%.go: %.scm modules/gnutls.scm
+ $(AM_V_GUILEC)$(MKDIR_P) "`dirname "$@"`" ; \
+ $(AM_V_P) && out=1 || out=- ; \
+ unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C \
+ GNUTLS_GUILE_EXTENSION_DIR="$(abs_top_builddir)/guile/src" \
+ $(GUILD) compile --target="$(host)" \
+ -L "$(top_builddir)/guile/modules" \
+ -L "$(top_srcdir)/guile/modules" \
+ -Wformat -Wunbound-variable -Warity-mismatch \
+ -o "$@" "$<" >&$$out
+
+SUFFIXES = .go
+
+endif HAVE_GUILD
+
+
+#
+# Tests.
+#
+
+TESTS = \
+ tests/anonymous-auth.scm \
+ tests/session-record-port.scm \
+ tests/pkcs-import-export.scm \
+ tests/errors.scm \
+ tests/x509-certificates.scm \
+ tests/x509-auth.scm \
+ tests/priorities.scm
+
+if ENABLE_OPENPGP
+TESTS += \
+ tests/openpgp-keys.scm \
+ tests/openpgp-keyring.scm \
+ tests/openpgp-auth.scm
+endif
+
+if ENABLE_SRP
+TESTS += \
+ tests/srp-base64.scm
+endif
+
+TESTS_ENVIRONMENT = \
+ GUILE_AUTO_COMPILE=0 \
+ GUILE_WARN_DEPRECATED=detailed
+
+LOG_COMPILER = $(top_builddir)/guile/pre-inst-guile -L $(srcdir)/tests
+
+
+EXTRA_DIST += \
+ $(TESTS) \
+ tests/openpgp-pub.asc \
+ tests/openpgp-sec.asc \
+ tests/openpgp-elg-pub.asc \
+ tests/openpgp-elg-sec.asc \
+ tests/openpgp-keyring.gpg \
+ tests/openpgp-keyring.asc \
+ tests/rsa-parameters.pem \
+ tests/dh-parameters.pem \
+ tests/x509-certificate.pem \
+ tests/x509-key.pem