summaryrefslogtreecommitdiff
path: root/guile/Makefile.am
blob: acbb594e2cf8d22e4e7f2a9d5d29dd5fe45bb99c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#  GnuTLS --- Guile bindings for GnuTLS.
#  Copyright (C) 2007-2012, 2016 Free Software Foundation, Inc.
#
#  GnuTLS is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2.1 of the License, or (at your option) any later version.
#
#  GnuTLS is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with GnuTLS; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

# 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:
	$(AM_V_GEN)$(MKDIR_P) "`dirname "$@"`" ; cat "$^" |		\
	  $(SED) -e's|[@]guileextensiondir[@]|$(guileextensiondir)|g'	\
	  > "$@.tmp"
	$(AM_V_at)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