Use thread-local allocation (significant perf. improvement!); added the `boehm-gc...
[bpt/guile.git] / libguile / Makefile.am
1 ## Process this file with Automake to create Makefile.in
2 ##
3 ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 ##
5 ## This file is part of GUILE.
6 ##
7 ## GUILE is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as
9 ## published by the Free Software Foundation; either version 2, or
10 ## (at your option) any later version.
11 ##
12 ## GUILE is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public
18 ## License along with GUILE; see the file COPYING. If not, write
19 ## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
20 ## Floor, Boston, MA 02110-1301 USA
21
22 AUTOMAKE_OPTIONS = gnu
23
24 ## Prevent automake from adding extra -I options
25 DEFS = @DEFS@
26 ## Check for headers in $(srcdir)/.., so that #include
27 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
28 ## building.
29 INCLUDES = -I.. -I$(top_srcdir)
30
31 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
32 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
33
34 lib_LTLIBRARIES = libguile.la
35 bin_PROGRAMS = guile
36
37 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
38
39 gen_scmconfig_SOURCES = gen-scmconfig.c
40
41 ## Override default rule; this should be compiled for BUILD host.
42 ## For some reason, OBJEXT does not include the dot
43 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
44 if [ "$(cross_compiling)" = "yes" ]; then \
45 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ $<; \
46 else \
47 $(COMPILE) -c -o $@ $<; \
48 fi
49
50 ## Override default rule; this should run on BUILD host.
51 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
52 @rm -f gen-scmconfig$(EXEEXT)
53 if [ "$(cross_compiling)" = "yes" ]; then \
54 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
55 else \
56 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
57 fi
58
59 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
60 rm -f scmconfig.h.tmp
61 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp
62 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp
63 chmod 444 scmconfig.h.tmp
64 rm -f scmconfig.h
65 mv scmconfig.h.tmp scmconfig.h
66
67 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
68
69 ## Override default rule; this should be compiled for BUILD host.
70 ## For some reason, OBJEXT does not include the dot
71 c-tokenize.$(OBJEXT): c-tokenize.c
72 if [ "$(cross_compiling)" = "yes" ]; then \
73 $(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<; \
74 else \
75 $(COMPILE) -c -o $@ $<; \
76 fi
77
78 ## Override default rule; this should run on BUILD host.
79 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
80 @rm -f guile_filter_doc_snarfage$(EXEEXT)
81 if [ "$(cross_compiling)" = "yes" ]; then \
82 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
83 else \
84 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \
85 fi
86
87
88 guile_SOURCES = guile.c
89 guile_CFLAGS = $(GUILE_CFLAGS)
90 guile_LDADD = libguile.la
91 guile_LDFLAGS = @DLPREOPEN@ $(GUILE_CFLAGS)
92
93 libguile_la_CFLAGS = $(GUILE_CFLAGS)
94
95 libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
96 chars.c continuations.c convert.c debug.c deprecation.c \
97 deprecated.c discouraged.c dynwind.c environments.c eq.c error.c \
98 eval.c evalext.c extensions.c feature.c fluids.c fports.c \
99 futures.c gc.c gc-malloc.c \
100 gdbint.c gh_data.c gh_eval.c gh_funcs.c \
101 gh_init.c gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c \
102 guardians.c hash.c hashtab.c hooks.c i18n.c init.c inline.c \
103 ioext.c keywords.c lang.c list.c load.c macros.c mallocs.c \
104 modules.c numbers.c objects.c objprop.c options.c pairs.c ports.c \
105 print.c procprop.c procs.c properties.c random.c rdelim.c read.c \
106 root.c rw.c scmsigs.c script.c simpos.c smob.c sort.c srcprop.c \
107 stackchk.c stacks.c stime.c strings.c srfi-4.c srfi-13.c srfi-14.c \
108 strorder.c strports.c struct.c symbols.c threads.c null-threads.c \
109 throw.c values.c variable.c vectors.c version.c vports.c weaks.c \
110 ramap.c unif.c
111
112 DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \
113 continuations.x debug.x deprecation.x deprecated.x discouraged.x \
114 dynl.x dynwind.x environments.x eq.x error.x eval.x evalext.x \
115 extensions.x feature.x fluids.x fports.x futures.x gc.x \
116 goops.x gsubr.x guardians.x \
117 hash.x hashtab.x hooks.x i18n.x init.x ioext.x keywords.x lang.x \
118 list.x load.x macros.x mallocs.x modules.x numbers.x objects.x \
119 objprop.x options.x pairs.x ports.x print.x procprop.x procs.x \
120 properties.x random.x rdelim.x read.x root.x rw.x scmsigs.x \
121 script.x simpos.x smob.x sort.x srcprop.x stackchk.x stacks.x \
122 stime.x strings.x srfi-4.x srfi-13.x srfi-14.x strorder.x \
123 strports.x struct.x symbols.x threads.x throw.x values.x \
124 variable.x vectors.x version.x vports.x weaks.x ramap.x unif.x
125
126 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
127
128 DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \
129 boolean.doc chars.doc continuations.doc debug.doc deprecation.doc \
130 deprecated.doc discouraged.doc dynl.doc dynwind.doc \
131 environments.doc eq.doc error.doc eval.doc evalext.doc \
132 extensions.doc feature.doc fluids.doc fports.doc futures.doc \
133 gc.doc goops.doc gsubr.doc \
134 gc-malloc.doc guardians.doc hash.doc hashtab.doc \
135 hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc \
136 list.doc load.doc macros.doc mallocs.doc modules.doc numbers.doc \
137 objects.doc objprop.doc options.doc pairs.doc ports.doc print.doc \
138 procprop.doc procs.doc properties.doc random.doc rdelim.doc \
139 read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc \
140 smob.doc sort.doc srcprop.doc stackchk.doc stacks.doc stime.doc \
141 strings.doc srfi-4.doc srfi-13.doc srfi-14.doc strorder.doc \
142 strports.doc struct.doc symbols.doc threads.doc throw.doc \
143 values.doc variable.doc vectors.doc version.doc vports.doc \
144 weaks.doc ramap.doc unif.doc
145
146 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
147
148 BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
149 version.h scmconfig.h \
150 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
151
152 EXTRA_libguile_la_SOURCES = _scm.h \
153 inet_aton.c memmove.c putenv.c strerror.c \
154 dynl.c regex-posix.c \
155 filesys.c posix.c net_db.c socket.c \
156 debug-malloc.c mkstemp.c \
157 win32-uname.c win32-dirent.c win32-socket.c
158
159 ## delete guile-snarf.awk from the installation bindir, in case it's
160 ## lingering there due to an earlier guile version not having been
161 ## wiped out.
162 install-exec-hook:
163 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
164
165 ## This is kind of nasty... there are ".c" files that we don't want to
166 ## compile, since they are #included. So instead we list them here.
167 ## Perhaps we can deal with them normally once the merge seems to be
168 ## working.
169 noinst_HEADERS = convert.i.c \
170 conv-integer.i.c conv-uinteger.i.c \
171 srfi-4.i.c \
172 quicksort.i.c \
173 win32-uname.h win32-dirent.h win32-socket.h \
174 private-gc.h
175
176 libguile_la_DEPENDENCIES = @LIBLOBJS@
177 libguile_la_LIBADD = @LIBLOBJS@
178 libguile_la_LDFLAGS = @LTLIBINTL@ -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined
179
180 # These are headers visible as <guile/mumble.h>
181 pkginclude_HEADERS = gh.h
182
183 # These are headers visible as <libguile/mumble.h>.
184 modincludedir = $(includedir)/libguile
185 modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h \
186 boehm-gc.h \
187 boolean.h chars.h continuations.h convert.h debug.h debug-malloc.h \
188 deprecation.h deprecated.h discouraged.h dynl.h dynwind.h \
189 environments.h eq.h error.h eval.h evalext.h extensions.h \
190 feature.h filesys.h fluids.h fports.h futures.h gc.h \
191 gdb_interface.h gdbint.h goops.h gsubr.h guardians.h hash.h \
192 hashtab.h hooks.h i18n.h init.h inline.h ioext.h iselect.h \
193 keywords.h lang.h list.h load.h macros.h mallocs.h modules.h \
194 net_db.h numbers.h objects.h objprop.h options.h pairs.h ports.h \
195 posix.h regex-posix.h print.h procprop.h procs.h properties.h \
196 random.h ramap.h rdelim.h read.h root.h rw.h scmsigs.h validate.h \
197 script.h simpos.h smob.h snarf.h socket.h sort.h srcprop.h \
198 stackchk.h stacks.h stime.h strings.h srfi-4.h srfi-13.h srfi-14.h \
199 strorder.h strports.h struct.h symbols.h tags.h threads.h \
200 pthread-threads.h null-threads.h throw.h unif.h values.h \
201 variable.h vectors.h vports.h weaks.h
202
203 nodist_modinclude_HEADERS = version.h scmconfig.h
204
205 bin_SCRIPTS = guile-snarf
206
207 # We can re-enable install for some of these if/when they are documented
208 # and people feel like maintaining them. For now, this is not the case.
209 noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
210
211 EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads \
212 ChangeLog-1996-1999 ChangeLog-2000 cpp_signal.c \
213 cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
214 cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
215 c-tokenize.lex version.h.in \
216 scmconfig.h.top gettext.h
217 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
218 # guile-procedures.txt guile.texi
219
220 ## We use @-...-@ as the substitution brackets here, instead of the
221 ## usual @...@, so autoconf doesn't go and substitute the values
222 ## directly into the left-hand sides of the sed substitutions. *sigh*
223 version.h: version.h.in
224 sed < $< > $@.tmp \
225 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
226 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
227 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}:
228 mv $@.tmp $@
229
230 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
231 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
232 @echo "Generating libpath.h..."
233 @rm -f libpath.tmp
234 @echo '/* generated by Makefile */' > libpath.tmp
235 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
236 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
237 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
238 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
239 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
240 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
241 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
242 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
243 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
244 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
245 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
246 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
247 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
248 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
249 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
250 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
251 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
252 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
253 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
254 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
255 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
256 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
257 >> libpath.tmp
258 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
259 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
260 >> libpath.tmp
261 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
262 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
263 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
264 @echo '}' >> libpath.tmp
265 @mv libpath.tmp libpath.h
266
267
268 snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
269
270 SUFFIXES = .x .doc
271 .c.x:
272 ./guile-snarf -o $@ $< $(snarfcppopts)
273 .c.doc:
274 -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<)
275 (./guile-snarf-docs $(snarfcppopts) $< | \
276 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
277
278 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in
279
280 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
281
282 error.x: cpp_err_symbols.c
283 posix.x: cpp_sig_symbols.c
284 load.x: libpath.h
285
286 include $(top_srcdir)/am/pre-inst-guile
287
288 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
289 snarf2checkedtexi = GUILE="$(GUILE_FOR_BUILD)" $(top_srcdir)/scripts/snarf-check-and-output-texi
290 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
291
292 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
293 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
294
295 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
296 $(dotdoc2texi) > $@ || { rm $@; false; }
297
298 if HAVE_MAKEINFO
299
300 guile-procedures.txt: guile-procedures.texi
301 rm -f $@
302 makeinfo --force -o $@ guile-procedures.texi || test -f $@
303
304 else
305
306 guile-procedures.txt: guile-procedures.texi
307 cp guile-procedures.texi $@
308
309 endif
310
311 c-tokenize.c: c-tokenize.lex
312 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
313
314 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
315 schemelib_DATA = guile-procedures.txt
316
317 ## Add -MG to make the .x magic work with auto-dep code.
318 MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
319
320 cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
321 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
322 cpp_err_symbols.tmp
323 mv cpp_err_symbols.tmp cpp_err_symbols.c
324
325 cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
326 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
327 cpp_sig_symbols.tmp
328 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
329
330 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
331 ## macros defined on this platform.
332 check_signals:
333 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
334 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
335 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
336 | egrep '^\+S' \
337 | cut -c2- > cpp_sig_symbols_diff
338 if test -s cpp_sig_symbols_diff ; then \
339 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
340 | sort > cpp_sig_symbols_new ;\
341 echo "cpp_sig_symbols_new has the following additions:" ;\
342 cat cpp_sig_symbols_diff ;\
343 else echo "No new symbols found."; \
344 fi
345
346 ## Likewise for cpp_err_symbols.in.
347 check_errnos:
348 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
349 | cut -f2 -d' ' | sort > cpp_err_symbols_here
350 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
351 | egrep '^\+E' \
352 | cut -c2- > cpp_err_symbols_diff
353 if test -s cpp_err_symbols_diff ; then \
354 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
355 | sort > cpp_err_symbols_new ;\
356 echo "cpp_err_symbols_new has the following additions:" ;\
357 cat cpp_err_symbols_diff ;\
358 else echo "No new symbols found."; \
359 fi
360
361 MOSTLYCLEANFILES = \
362 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
363 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new \
364 version.h version.h.tmp \
365 scmconfig.h scmconfig.h.tmp
366
367 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
368
369 MAINTAINERCLEANFILES = c-tokenize.c