* srfi-13.c, srfi-13.h, srfi-14.c, srfi-14.h: New files.
[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 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., 59 Temple Place, Suite
20 ## 330, Boston, MA 02111-1307 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) -I$(top_srcdir)/libguile-ltdl
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) $(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_LDADD = libguile.la
90 guile_LDFLAGS = @DLPREOPEN@
91
92 libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
93 chars.c continuations.c convert.c debug.c deprecation.c deprecated.c \
94 discouraged.c dynwind.c environments.c eq.c error.c eval.c \
95 evalext.c extensions.c \
96 feature.c fluids.c fports.c futures.c \
97 gc.c gc-mark.c gc-segment.c gc-malloc.c gc-card.c gc-freelist.c \
98 gc_os_dep.c gdbint.c gh_data.c gh_eval.c gh_funcs.c gh_init.c \
99 gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c guardians.c hash.c \
100 hashtab.c hooks.c init.c inline.c ioext.c keywords.c \
101 lang.c list.c \
102 load.c macros.c mallocs.c modules.c numbers.c objects.c objprop.c \
103 options.c pairs.c ports.c print.c procprop.c procs.c properties.c \
104 random.c rdelim.c read.c root.c rw.c scmsigs.c script.c simpos.c smob.c \
105 sort.c srcprop.c stackchk.c stacks.c stime.c strings.c srfi-13.c srfi-14.c \
106 strorder.c strports.c struct.c symbols.c threads.c throw.c values.c \
107 variable.c vectors.c version.c vports.c weaks.c
108
109 DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \
110 continuations.x debug.x deprecation.x deprecated.x discouraged.x \
111 dynl.x dynwind.x \
112 environments.x eq.x \
113 error.x eval.x evalext.x extensions.x feature.x fluids.x fports.x \
114 futures.x \
115 gc.x gc-mark.x gc-segment.x gc-malloc.x gc-card.x goops.x \
116 gsubr.x guardians.x hash.x hashtab.x hooks.x init.x ioext.x \
117 keywords.x lang.x list.x load.x macros.x mallocs.x modules.x \
118 numbers.x objects.x objprop.x options.x pairs.x ports.x print.x \
119 procprop.x procs.x properties.x random.x rdelim.x read.x root.x rw.x \
120 scmsigs.x script.x simpos.x smob.x sort.x srcprop.x \
121 stackchk.x stacks.x stime.x strings.x srfi-13.x srfi-14.x strorder.x strports.x \
122 struct.x symbols.x threads.x throw.x values.x variable.x vectors.x \
123 version.x vports.x weaks.x
124
125 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
126
127 DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \
128 boolean.doc chars.doc continuations.doc debug.doc deprecation.doc \
129 deprecated.doc discouraged.doc dynl.doc dynwind.doc \
130 environments.doc eq.doc \
131 error.doc eval.doc evalext.doc \
132 extensions.doc feature.doc fluids.doc fports.doc futures.doc \
133 gc.doc goops.doc \
134 gsubr.doc gc-mark.doc gc-segment.doc gc-malloc.doc gc-card.doc \
135 guardians.doc hash.doc hashtab.doc hooks.doc init.doc ioext.doc \
136 keywords.doc lang.doc list.doc load.doc macros.doc \
137 mallocs.doc modules.doc numbers.doc objects.doc objprop.doc \
138 options.doc pairs.doc ports.doc print.doc procprop.doc \
139 procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc \
140 scmsigs.doc script.doc simpos.doc smob.doc sort.doc \
141 srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc srfi-13.doc srfi-14.doc \
142 strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc \
143 values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc
144
145 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
146
147 BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
148 version.h scmconfig.h \
149 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) guile.texi
150
151 EXTRA_libguile_la_SOURCES = _scm.h \
152 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
153 dynl.c regex-posix.c \
154 filesys.c posix.c net_db.c socket.c \
155 ramap.c unif.c debug-malloc.c mkstemp.c \
156 win32-uname.c win32-dirent.c win32-socket.c
157
158 ## delete guile-snarf.awk from the installation bindir, in case it's
159 ## lingering there due to an earlier guile version not having been
160 ## wiped out.
161 install-exec-hook:
162 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
163
164 ## This is kind of nasty... there are ".c" files that we don't want to
165 ## compile, since they are #included. So instead we list them here.
166 ## Perhaps we can deal with them normally once the merge seems to be
167 ## working.
168 noinst_HEADERS = convert.i.c \
169 conv-integer.i.c conv-uinteger.i.c \
170 win32-uname.h win32-dirent.h win32-socket.h \
171 private-gc.h
172
173 libguile_la_DEPENDENCIES = @LIBLOBJS@
174 libguile_la_LIBADD = @LIBLOBJS@ ../libguile-ltdl/libguile-ltdl.la $(THREAD_LIBS_LOCAL)
175 libguile_la_LDFLAGS = -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined
176
177 # These are headers visible as <guile/mumble.h>
178 pkginclude_HEADERS = gh.h
179
180 # These are headers visible as <libguile/mumble.h>.
181 modincludedir = $(includedir)/libguile
182 modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h boolean.h \
183 chars.h continuations.h convert.h debug.h \
184 debug-malloc.h threads-plugin.h null-threads.h pthread-threads.h \
185 deprecation.h deprecated.h discouraged.h dynl.h dynwind.h \
186 environments.h eq.h \
187 error.h eval.h \
188 evalext.h extensions.h feature.h filesys.h fluids.h fports.h futures.h \
189 gc.h gdb_interface.h gdbint.h \
190 goops.h gsubr.h guardians.h hash.h hashtab.h hooks.h init.h \
191 inline.h ioext.h \
192 iselect.h keywords.h lang.h list.h load.h macros.h mallocs.h modules.h \
193 net_db.h numbers.h objects.h objprop.h options.h pairs.h ports.h posix.h \
194 regex-posix.h print.h procprop.h procs.h properties.h random.h ramap.h \
195 rdelim.h read.h root.h rw.h scmsigs.h validate.h script.h simpos.h smob.h \
196 snarf.h socket.h sort.h srcprop.h stackchk.h stacks.h stime.h strings.h \
197 srfi-13.h srfi-14.h strorder.h strports.h struct.h symbols.h tags.h threads.h \
198 throw.h unif.h values.h variable.h vectors.h vports.h weaks.h
199
200 nodist_modinclude_HEADERS = version.h scmconfig.h
201
202 bin_SCRIPTS = guile-snarf
203
204 # We can re-enable install for some of these if/when they are documented
205 # and people feel like maintaining them. For now, this is not the case.
206 noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
207
208 EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads \
209 ChangeLog-1996-1999 ChangeLog-2000 cpp_signal.c \
210 cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
211 cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
212 c-tokenize.lex threads-plugin.c version.h.in pthread-threads.c \
213 scmconfig.h.top
214 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
215 # guile-procedures.txt guile.texi
216
217 ## We use @-...-@ as the substitution brackets here, instead of the
218 ## usual @...@, so autoconf doesn't go and substitute the values
219 ## directly into the left-hand sides of the sed substitutions. *sigh*
220 version.h: version.h.in
221 sed < $< > $@.tmp \
222 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
223 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
224 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}:
225 mv $@.tmp $@
226
227 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
228 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
229 @echo "Generating libpath.h..."
230 @rm -f libpath.tmp
231 @echo '/* generated by Makefile */' > libpath.tmp
232 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
233 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
234 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
235 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
236 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
237 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
238 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
239 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
240 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
241 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
242 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
243 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
244 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
245 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
246 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
247 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
248 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
249 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
250 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
251 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
252 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
253 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
254 >> libpath.tmp
255 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
256 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
257 >> libpath.tmp
258 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
259 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
260 @echo '}' >> libpath.tmp
261 @mv libpath.tmp libpath.h
262
263
264 snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
265
266 SUFFIXES = .x .doc
267 .c.x:
268 ./guile-snarf -o $@ $< $(snarfcppopts)
269 .c.doc:
270 -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<)
271 (./guile-snarf-docs $(snarfcppopts) $< | \
272 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
273
274 $(DOT_X_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf.in
275
276 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
277
278 error.x: cpp_err_symbols.c
279 posix.x: cpp_sig_symbols.c
280 load.x: libpath.h
281
282 include $(top_srcdir)/am/pre-inst-guile
283
284 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
285 snarf2checkedtexi = GUILE="$(GUILE_FOR_BUILD)" $(top_srcdir)/scripts/snarf-check-and-output-texi
286 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
287
288 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
289 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
290
291 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
292 $(dotdoc2texi) > $@ || { rm $@; false; }
293
294 if HAVE_MAKEINFO
295
296 guile-procedures.txt: guile-procedures.texi
297 rm -f $@
298 makeinfo --force -o $@ guile-procedures.texi || test -f $@
299
300 else
301
302 guile-procedures.txt: guile-procedures.texi
303 cp guile-procedures.texi $@
304
305 endif
306
307 c-tokenize.c: c-tokenize.lex
308 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
309
310 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
311 schemelib_DATA = guile-procedures.txt
312
313 ## Add -MG to make the .x magic work with auto-dep code.
314 MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
315
316 cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
317 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
318 cpp_err_symbols.tmp
319 mv cpp_err_symbols.tmp cpp_err_symbols.c
320
321 cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
322 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
323 cpp_sig_symbols.tmp
324 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
325
326 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
327 ## macros defined on this platform.
328 check_signals:
329 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
330 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
331 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
332 | egrep '^\+S' \
333 | cut -c2- > cpp_sig_symbols_diff
334 if test -s cpp_sig_symbols_diff ; then \
335 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
336 | sort > cpp_sig_symbols_new ;\
337 echo "cpp_sig_symbols_new has the following additions:" ;\
338 cat cpp_sig_symbols_diff ;\
339 else echo "No new symbols found."; \
340 fi
341
342 ## Likewise for cpp_err_symbols.in.
343 check_errnos:
344 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
345 | cut -f2 -d' ' | sort > cpp_err_symbols_here
346 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
347 | egrep '^\+E' \
348 | cut -c2- > cpp_err_symbols_diff
349 if test -s cpp_err_symbols_diff ; then \
350 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
351 | sort > cpp_err_symbols_new ;\
352 echo "cpp_err_symbols_new has the following additions:" ;\
353 cat cpp_err_symbols_diff ;\
354 else echo "No new symbols found."; \
355 fi
356
357 MOSTLYCLEANFILES = \
358 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
359 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new \
360 version.h version.h.tmp \
361 scmconfig.h scmconfig.h.tmp
362
363 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
364
365 MAINTAINERCLEANFILES = c-tokenize.c