fix define-module ordering
[bpt/guile.git] / test-suite / standalone / Makefile.am
1 ## Process this file with automake to produce Makefile.in.
2 ##
3 ## Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 ## 2011 Free Software Foundation, Inc.
5 ##
6 ## This file is part of GUILE.
7 ##
8 ## GUILE is free software; you can redistribute it and/or modify it
9 ## under the terms of the GNU Lesser General Public License as
10 ## published by the Free Software Foundation; either version 3, or
11 ## (at your option) any later version.
12 ##
13 ## GUILE is distributed in the hope that it will be useful, but
14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU Lesser General Public License for more details.
17 ##
18 ## You should have received a copy of the GNU Lesser General Public
19 ## License along with GUILE; see the file COPYING.LESSER. If not,
20 ## write to the Free Software Foundation, Inc., 51 Franklin Street,
21 ## Fifth Floor, Boston, MA 02110-1301 USA
22
23 include $(top_srcdir)/am/snarf
24
25 # initializations so we can use += below.
26 TESTS =
27 noinst_LTLIBRARIES =
28 check_PROGRAMS =
29 check_SCRIPTS =
30 BUILT_SOURCES =
31 EXTRA_DIST =
32
33 TESTS_ENVIRONMENT = \
34 builddir="$(builddir)" \
35 GUILE_AUTO_COMPILE=0 "${top_builddir}/meta/uninstalled-env"
36
37 ## Check for headers in $(srcdir) and bulid dir before $(CPPFLAGS), which
38 ## may point us to an old, installed version of guile.
39 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \
40 -I$(top_srcdir)/lib -I$(top_builddir)/lib
41
42 test_cflags = \
43 -I$(top_srcdir)/test-suite/standalone -I. \
44 $(EXTRA_DEFS) $(GUILE_CFLAGS) $(GCC_CFLAGS)
45
46 AM_LDFLAGS = $(GUILE_CFLAGS)
47
48 # How to link with libguile (same as `Libs' in `guile-2.0.pc'.)
49 LIBGUILE_LDADD = \
50 ${top_builddir}/libguile/libguile-@GUILE_EFFECTIVE_VERSION@.la \
51 $(BDW_GC_LIBS)
52
53
54 snarfcppopts = \
55 -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib -I$(top_builddir) \
56 -I. $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(CFLAGS)
57
58 SUFFIXES = .x
59 .c.x:
60 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
61
62 CLEANFILES = *.x
63
64 .DELETE_ON_ERROR:
65
66 check_SCRIPTS += test-system-cmds
67 TESTS += test-system-cmds
68
69 check_SCRIPTS += test-bad-identifiers
70 TESTS += test-bad-identifiers
71
72 check_SCRIPTS += test-require-extension
73 TESTS += test-require-extension
74
75 check_SCRIPTS += test-guile-snarf
76 TESTS += test-guile-snarf
77
78 check_SCRIPTS += test-import-order
79 TESTS += test-import-order
80 EXTRA_DIST += test-import-order-a.scm test-import-order-b.scm \
81 test-import-order-c.scm test-import-order-d.scm
82
83 # test-num2integral
84 test_num2integral_SOURCES = test-num2integral.c
85 test_num2integral_CFLAGS = ${test_cflags}
86 test_num2integral_LDADD = $(LIBGUILE_LDADD)
87 check_PROGRAMS += test-num2integral
88 TESTS += test-num2integral
89
90 # test-round
91 test_round_CFLAGS = ${test_cflags}
92 test_round_LDADD = $(LIBGUILE_LDADD)
93 check_PROGRAMS += test-round
94 TESTS += test-round
95
96 if HAVE_SHARED_LIBRARIES
97
98 # test-asmobs
99 noinst_LTLIBRARIES += libtest-asmobs.la
100 libtest_asmobs_la_SOURCES = test-asmobs-lib.c
101 libtest_asmobs_la_CFLAGS = ${test_cflags}
102 libtest_asmobs_la_LDFLAGS = -module -no-undefined -rpath `pwd` # so libtool will really build an .so
103 libtest_asmobs_la_LIBADD = $(LIBGUILE_LDADD)
104 BUILT_SOURCES += test-asmobs-lib.x
105 check_SCRIPTS += test-asmobs
106 TESTS += test-asmobs
107
108 # test-ffi
109 noinst_LTLIBRARIES += libtest-ffi.la
110 libtest_ffi_la_SOURCES = test-ffi-lib.c
111 libtest_ffi_la_CFLAGS = ${test_cflags}
112 libtest_ffi_la_LDFLAGS = -module -no-undefined -rpath `pwd` # so libtool will really build an .so
113 libtest_ffi_la_LIBADD = $(LIBGUILE_LDADD)
114 check_SCRIPTS += test-ffi
115 TESTS += test-ffi
116
117 endif HAVE_SHARED_LIBRARIES
118
119 # test-list
120 test_list_SOURCES = test-list.c
121 test_list_CFLAGS = ${test_cflags}
122 test_list_LDADD = $(LIBGUILE_LDADD)
123 check_PROGRAMS += test-list
124 TESTS += test-list
125
126 # test-unwind
127 test_unwind_SOURCES = test-unwind.c
128 test_unwind_CFLAGS = ${test_cflags}
129 test_unwind_LDADD = $(LIBGUILE_LDADD)
130 check_PROGRAMS += test-unwind
131 TESTS += test-unwind
132
133 # test-conversion
134 test_conversion_SOURCES = test-conversion.c
135 test_conversion_CFLAGS = ${test_cflags}
136 test_conversion_LDADD = $(LIBGUILE_LDADD)
137 check_PROGRAMS += test-conversion
138 TESTS += test-conversion
139
140 # test-loose-ends
141 test_loose_ends_SOURCES = test-loose-ends.c
142 test_loose_ends_CFLAGS = ${test_cflags}
143 test_loose_ends_LDADD = $(LIBGUILE_LDADD)
144 check_PROGRAMS += test-loose-ends
145 TESTS += test-loose-ends
146
147 # test-fast-slot-ref
148 check_SCRIPTS += test-fast-slot-ref
149 TESTS += test-fast-slot-ref
150
151 # test-mb-regexp
152 check_SCRIPTS += test-mb-regexp
153 TESTS += test-mb-regexp
154
155 # test-use-srfi
156 check_SCRIPTS += test-use-srfi
157 TESTS += test-use-srfi
158
159 # test-scm-c-read
160 test_scm_c_read_SOURCES = test-scm-c-read.c
161 test_scm_c_read_CFLAGS = ${test_cflags}
162 test_scm_c_read_LDADD = $(LIBGUILE_LDADD)
163 check_PROGRAMS += test-scm-c-read
164 TESTS += test-scm-c-read
165
166 # test-scm-take-locale-symbol
167 test_scm_take_locale_symbol_SOURCES = test-scm-take-locale-symbol.c
168 test_scm_take_locale_symbol_CFLAGS = ${test_cflags}
169 test_scm_take_locale_symbol_LDADD = $(LIBGUILE_LDADD)
170 check_PROGRAMS += test-scm-take-locale-symbol
171 TESTS += test-scm-take-locale-symbol
172
173 # test-scm-take-u8vector
174 test_scm_take_u8vector_SOURCES = test-scm-take-u8vector.c
175 test_scm_take_u8vector_CFLAGS = ${test_cflags}
176 test_scm_take_u8vector_LDADD = $(LIBGUILE_LDADD)
177 check_PROGRAMS += test-scm-take-u8vector
178 TESTS += test-scm-take-u8vector
179
180 if HAVE_SHARED_LIBRARIES
181
182 # test-extensions
183 noinst_LTLIBRARIES += libtest-extensions.la
184 libtest_extensions_la_SOURCES = test-extensions-lib.c
185 libtest_extensions_la_CFLAGS = ${test_cflags}
186 libtest_extensions_la_LDFLAGS = -module -no-undefined -rpath `pwd` # so libtool will really build an .so
187 libtest_extensions_la_LIBADD = $(LIBGUILE_LDADD)
188 check_SCRIPTS += test-extensions
189 TESTS += test-extensions
190
191 endif HAVE_SHARED_LIBRARIES
192
193 if BUILD_PTHREAD_SUPPORT
194
195 # test-with-guile-module
196 test_with_guile_module_CFLAGS = ${test_cflags}
197 test_with_guile_module_LDADD = $(LIBGUILE_LDADD)
198 check_PROGRAMS += test-with-guile-module
199 TESTS += test-with-guile-module
200
201 test_scm_with_guile_CFLAGS = ${test_cflags}
202 test_scm_with_guile_LDADD = $(LIBGUILE_LDADD)
203 check_PROGRAMS += test-scm-with-guile
204 TESTS += test-scm-with-guile
205
206 test_scm_spawn_thread_CFLAGS = ${test_cflags}
207 test_scm_spawn_thread_LDADD = $(LIBGUILE_LDADD)
208 check_PROGRAMS += test-scm-spawn-thread
209 TESTS += test-scm-spawn-thread
210
211 test_pthread_create_CFLAGS = ${test_cflags}
212 test_pthread_create_LDADD = $(LIBGUILE_LDADD)
213 check_PROGRAMS += test-pthread-create
214 TESTS += test-pthread-create
215
216 test_pthread_create_secondary_CFLAGS = ${test_cflags} $(BDW_GC_CFLAGS)
217 test_pthread_create_secondary_LDADD = $(LIBGUILE_LDADD)
218 check_PROGRAMS += test-pthread-create-secondary
219 TESTS += test-pthread-create-secondary
220
221 else
222
223 EXTRA_DIST += test-with-guile-module.c test-scm-with-guile.c
224
225 endif
226
227 EXTRA_DIST += ${check_SCRIPTS}