print: Fix printing of weak vectors.
[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, 2007,
4 ## 2008, 2009, 2010, 2011, 2012, 2013, 2014 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 AUTOMAKE_OPTIONS = gnu
26
27 ## Prevent automake from adding extra -I options
28 DEFS = @DEFS@
29
30 # Override Automake's `DEFAULT_INCLUDES'. By default, it contains
31 # "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
32 # is picked up by <stdlib.h> instead of the libc's <random.h>.
33 DEFAULT_INCLUDES =
34
35 ## Check for headers in $(srcdir)/.., so that #include
36 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
37 ## building. Also look for Gnulib headers in `lib'.
38 AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
39 -I$(top_srcdir)/lib -I$(top_builddir)/lib $(LIBFFI_CFLAGS)
40
41 AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
42
43 ## The Gnulib Libtool archive.
44 gnulib_library = $(top_builddir)/lib/libgnu.la
45
46 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
47 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
48
49 lib_LTLIBRARIES = libguile-@GUILE_EFFECTIVE_VERSION@.la
50 bin_PROGRAMS = guile
51
52 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
53
54 gen_scmconfig_SOURCES = gen-scmconfig.c
55
56 ## Override default rule; this should be compiled for BUILD host. Note
57 ## that we don't add $(AM_CPPFLAGS) here, as we need to run this
58 ## program, but $(top_srcdir)/lib has a gnulib configured for the
59 ## target. Instead we manually add $(top_builddir), in order to pick up
60 ## the generated config.h and gen-scmconfig.h. Nothing else from Guile
61 ## is included by this code generator.
62 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
63 $(AM_V_GEN) \
64 if [ "$(cross_compiling)" = "yes" ]; then \
65 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \
66 -c -o $@ $<; \
67 else \
68 $(COMPILE) -c -o $@ $<; \
69 fi
70
71 ## Override default rule; this should run on BUILD host.
72 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
73 $(AM_V_GEN) \
74 rm -f gen-scmconfig$(EXEEXT); \
75 if [ "$(cross_compiling)" = "yes" ]; then \
76 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
77 else \
78 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
79 fi
80
81 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
82 $(AM_V_GEN)(rm -f scmconfig.h.tmp; \
83 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp; \
84 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp; \
85 chmod 444 scmconfig.h.tmp; \
86 rm -f scmconfig.h; \
87 mv scmconfig.h.tmp scmconfig.h)
88
89
90 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
91
92 ## Override default rule; this should be compiled for BUILD host.
93 ## For some reason, OBJEXT does not include the dot
94 c-tokenize.$(OBJEXT): c-tokenize.c
95 $(AM_V_GEN) \
96 if [ "$(cross_compiling)" = "yes" ]; then \
97 $(CC_FOR_BUILD) -I$(top_builddir) -c -o $@ $<; \
98 else \
99 $(COMPILE) -c -o $@ $<; \
100 fi
101
102 ## Override default rule; this should run on BUILD host.
103 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
104 $(AM_V_GEN) \
105 rm -f guile_filter_doc_snarfage$(EXEEXT); \
106 if [ "$(cross_compiling)" = "yes" ]; then \
107 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
108 else \
109 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(gnulib_library) $(LIBS); \
110 fi
111
112
113 guile_SOURCES = guile.c
114 guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
115 guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
116 guile_LDFLAGS = $(GUILE_CFLAGS)
117
118 libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
119
120 libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
121 alist.c \
122 arbiters.c \
123 array-handle.c \
124 array-map.c \
125 arrays.c \
126 async.c \
127 backtrace.c \
128 boolean.c \
129 bitvectors.c \
130 bytevectors.c \
131 chars.c \
132 control.c \
133 continuations.c \
134 debug.c \
135 deprecated.c \
136 deprecation.c \
137 dynstack.c \
138 dynwind.c \
139 eq.c \
140 error.c \
141 eval.c \
142 evalext.c \
143 expand.c \
144 extensions.c \
145 feature.c \
146 filesys.c \
147 finalizers.c \
148 fluids.c \
149 foreign.c \
150 fports.c \
151 frames.c \
152 gc-malloc.c \
153 gc.c \
154 gettext.c \
155 generalized-arrays.c \
156 generalized-vectors.c \
157 goops.c \
158 gsubr.c \
159 guardians.c \
160 hash.c \
161 hashtab.c \
162 hooks.c \
163 i18n.c \
164 init.c \
165 inline.c \
166 instructions.c \
167 ioext.c \
168 keywords.c \
169 list.c \
170 load.c \
171 loader.c \
172 macros.c \
173 mallocs.c \
174 memoize.c \
175 modules.c \
176 null-threads.c \
177 numbers.c \
178 objprop.c \
179 options.c \
180 pairs.c \
181 poll.c \
182 ports.c \
183 print.c \
184 procprop.c \
185 procs.c \
186 programs.c \
187 promises.c \
188 r6rs-ports.c \
189 random.c \
190 rdelim.c \
191 read.c \
192 root.c \
193 rw.c \
194 scmsigs.c \
195 script.c \
196 simpos.c \
197 smob.c \
198 sort.c \
199 srcprop.c \
200 srfi-1.c \
201 srfi-4.c \
202 srfi-13.c \
203 srfi-14.c \
204 srfi-60.c \
205 stackchk.c \
206 stacks.c \
207 stime.c \
208 strings.c \
209 strorder.c \
210 strports.c \
211 struct.c \
212 symbols.c \
213 threads.c \
214 throw.c \
215 trees.c \
216 uniform.c \
217 values.c \
218 variable.c \
219 vectors.c \
220 version.c \
221 vm.c \
222 vports.c \
223 weak-set.c \
224 weak-table.c \
225 weak-vector.c
226
227 DOT_X_FILES = \
228 alist.x \
229 arbiters.x \
230 array-handle.x \
231 array-map.x \
232 arrays.x \
233 async.x \
234 backtrace.x \
235 boolean.x \
236 bitvectors.x \
237 bytevectors.x \
238 chars.x \
239 control.x \
240 continuations.x \
241 debug.x \
242 deprecated.x \
243 deprecation.x \
244 dynl.x \
245 dynwind.x \
246 eq.x \
247 error.x \
248 eval.x \
249 evalext.x \
250 expand.x \
251 extensions.x \
252 feature.x \
253 filesys.x \
254 fluids.x \
255 foreign.x \
256 fports.x \
257 frames.x \
258 gc-malloc.x \
259 gc.x \
260 gettext.x \
261 generalized-arrays.x \
262 generalized-vectors.x \
263 goops.x \
264 gsubr.x \
265 guardians.x \
266 hash.x \
267 hashtab.x \
268 hooks.x \
269 i18n.x \
270 init.x \
271 instructions.x \
272 ioext.x \
273 keywords.x \
274 list.x \
275 load.x \
276 loader.x \
277 macros.x \
278 mallocs.x \
279 memoize.x \
280 modules.x \
281 numbers.x \
282 objprop.x \
283 options.x \
284 pairs.x \
285 ports.x \
286 print.x \
287 procprop.x \
288 procs.x \
289 programs.x \
290 promises.x \
291 r6rs-ports.x \
292 random.x \
293 rdelim.x \
294 read.x \
295 root.x \
296 rw.x \
297 scmsigs.x \
298 script.x \
299 simpos.x \
300 smob.x \
301 sort.x \
302 srcprop.x \
303 srfi-1.x \
304 srfi-4.x \
305 srfi-13.x \
306 srfi-14.x \
307 srfi-60.x \
308 stackchk.x \
309 stacks.x \
310 stime.x \
311 strings.x \
312 strorder.x \
313 strports.x \
314 struct.x \
315 symbols.x \
316 threads.x \
317 throw.x \
318 trees.x \
319 uniform.x \
320 values.x \
321 variable.x \
322 vectors.x \
323 version.x \
324 vm.x \
325 vports.x \
326 weak-set.x \
327 weak-table.x \
328 weak-vector.x
329
330 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
331
332 DOT_DOC_FILES = \
333 alist.doc \
334 arbiters.doc \
335 array-handle.doc \
336 array-map.doc \
337 arrays.doc \
338 async.doc \
339 backtrace.doc \
340 boolean.doc \
341 bitvectors.doc \
342 bytevectors.doc \
343 chars.doc \
344 control.doc \
345 continuations.doc \
346 debug.doc \
347 deprecated.doc \
348 deprecation.doc \
349 dynl.doc \
350 dynwind.doc \
351 eq.doc \
352 error.doc \
353 eval.doc \
354 evalext.doc \
355 expand.doc \
356 extensions.doc \
357 feature.doc \
358 filesys.doc \
359 fluids.doc \
360 foreign.doc \
361 fports.doc \
362 gc-malloc.doc \
363 gc.doc \
364 gettext.doc \
365 generalized-arrays.doc \
366 generalized-vectors.doc \
367 goops.doc \
368 gsubr.doc \
369 guardians.doc \
370 hash.doc \
371 hashtab.doc \
372 hooks.doc \
373 i18n.doc \
374 init.doc \
375 ioext.doc \
376 keywords.doc \
377 list.doc \
378 load.doc \
379 macros.doc \
380 mallocs.doc \
381 memoize.doc \
382 modules.doc \
383 numbers.doc \
384 objprop.doc \
385 options.doc \
386 pairs.doc \
387 ports.doc \
388 print.doc \
389 procprop.doc \
390 procs.doc \
391 promises.doc \
392 r6rs-ports.doc \
393 random.doc \
394 rdelim.doc \
395 read.doc \
396 root.doc \
397 rw.doc \
398 scmsigs.doc \
399 script.doc \
400 simpos.doc \
401 smob.doc \
402 sort.doc \
403 srcprop.doc \
404 srfi-1.doc \
405 srfi-4.doc \
406 srfi-13.doc \
407 srfi-14.doc \
408 srfi-60.doc \
409 stackchk.doc \
410 stacks.doc \
411 stime.doc \
412 strings.doc \
413 strorder.doc \
414 strports.doc \
415 struct.doc \
416 symbols.doc \
417 threads.doc \
418 throw.doc \
419 trees.doc \
420 uniform.doc \
421 values.doc \
422 variable.doc \
423 vectors.doc \
424 version.doc \
425 vports.doc \
426 weak-set.doc \
427 weak-table.doc \
428 weak-vector.doc
429
430 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
431
432 vm-operations.h: vm-engine.c
433 @echo '/* This file was generated automatically from $<; do not' > $@
434 @echo ' edit. See the source file for copyright information. */' >> $@
435 @echo '' >> $@
436 @echo "#define FOR_EACH_VM_OPERATION(M) \\" >> $@
437 $(AM_V_GEN)$(GREP) '^ *VM_DEFINE_OP' $< \
438 | sed -e 's,VM_DEFINE_OP (\(.*\)).*, M (\1) \\,' >> $@
439 @echo '' >> $@
440
441 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
442 scmconfig.h \
443 $(DOT_I_FILES) vm-operations.h $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
444
445 # Force the generation of `guile-procedures.texi' because the top-level
446 # Makefile expects it to be built.
447 all-local: guile-procedures.texi
448
449 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
450 memmove.c strerror.c \
451 dynl.c regex-posix.c \
452 posix.c net_db.c socket.c \
453 debug-malloc.c mkstemp.c \
454 win32-uname.c \
455 locale-categories.h
456
457 ## delete guile-snarf.awk from the installation bindir, in case it's
458 ## lingering there due to an earlier guile version not having been
459 ## wiped out.
460 install-exec-hook:
461 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
462
463 ## This is kind of nasty... there are ".c" files that we don't want to
464 ## compile, since they are #included. So instead we list them here.
465 ## Perhaps we can deal with them normally once the merge seems to be
466 ## working.
467 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
468 elf.h \
469 srfi-14.i.c \
470 quicksort.i.c \
471 win32-uname.h \
472 private-options.h ports-internal.h
473
474 # vm instructions
475 noinst_HEADERS += vm-engine.c
476
477 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
478
479 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
480 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
481
482 # Libtool version info.
483 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
484
485 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
486 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
487 $(CEIL_LIBM) \
488 $(FLOOR_LIBM) \
489 $(FREXP_LIBM) \
490 $(GETADDRINFO_LIB) \
491 $(HOSTENT_LIB) \
492 $(INET_NTOP_LIB) \
493 $(INET_PTON_LIB) \
494 $(ISNAND_LIBM) \
495 $(ISNANF_LIBM) \
496 $(ISNANL_LIBM) \
497 $(LDEXP_LIBM) \
498 $(LIBSOCKET) \
499 $(LIB_CLOCK_GETTIME) \
500 $(LOG1P_LIBM) \
501 $(LOG_LIBM) \
502 $(LTLIBICONV) \
503 $(LTLIBINTL) \
504 $(LTLIBUNISTRING) \
505 $(ROUND_LIBM) \
506 $(SERVENT_LIB) \
507 $(TRUNC_LIBM) \
508 -version-info $(version_info) \
509 -export-dynamic -no-undefined \
510 $(GNU_LD_FLAGS)
511
512 if HAVE_LD_VERSION_SCRIPT
513
514 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
515
516 endif HAVE_LD_VERSION_SCRIPT
517
518
519 # These are headers visible as <guile/mumble.h>
520 pkginclude_HEADERS =
521
522 # These are headers visible as <libguile/mumble.h>.
523 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
524 modinclude_HEADERS = \
525 __scm.h \
526 alist.h \
527 arbiters.h \
528 array-handle.h \
529 array-map.h \
530 arrays.h \
531 async.h \
532 backtrace.h \
533 bdw-gc.h \
534 boolean.h \
535 bitvectors.h \
536 bytevectors.h \
537 chars.h \
538 control.h \
539 continuations.h \
540 debug-malloc.h \
541 debug.h \
542 deprecated.h \
543 deprecation.h \
544 dynl.h \
545 dynstack.h \
546 dynwind.h \
547 eq.h \
548 error.h \
549 eval.h \
550 evalext.h \
551 expand.h \
552 extensions.h \
553 feature.h \
554 finalizers.h \
555 filesys.h \
556 fluids.h \
557 foreign.h \
558 fports.h \
559 frames.h \
560 gc.h \
561 gc-inline.h \
562 gettext.h \
563 generalized-arrays.h \
564 generalized-vectors.h \
565 goops.h \
566 gsubr.h \
567 guardians.h \
568 hash.h \
569 hashtab.h \
570 hooks.h \
571 i18n.h \
572 init.h \
573 inline.h \
574 instructions.h \
575 ioext.h \
576 iselect.h \
577 keywords.h \
578 list.h \
579 load.h \
580 loader.h \
581 macros.h \
582 mallocs.h \
583 memoize.h \
584 modules.h \
585 net_db.h \
586 null-threads.h \
587 numbers.h \
588 objprop.h \
589 options.h \
590 pairs.h \
591 poll.h \
592 ports.h \
593 posix.h \
594 print.h \
595 procprop.h \
596 procs.h \
597 programs.h \
598 promises.h \
599 pthread-threads.h \
600 r6rs-ports.h \
601 random.h \
602 rdelim.h \
603 read.h \
604 regex-posix.h \
605 root.h \
606 rw.h \
607 scmsigs.h \
608 script.h \
609 simpos.h \
610 smob.h \
611 snarf.h \
612 socket.h \
613 sort.h \
614 srcprop.h \
615 srfi-1.h \
616 srfi-4.h \
617 srfi-13.h \
618 srfi-14.h \
619 srfi-60.h \
620 stackchk.h \
621 stacks.h \
622 stime.h \
623 strings.h \
624 strorder.h \
625 strports.h \
626 struct.h \
627 symbols.h \
628 tags.h \
629 threads.h \
630 throw.h \
631 trees.h \
632 validate.h \
633 uniform.h \
634 values.h \
635 variable.h \
636 vectors.h \
637 vm-builtins.h \
638 vm-expand.h \
639 vm.h \
640 vports.h \
641 weak-set.h \
642 weak-table.h \
643 weak-vector.h
644
645 nodist_modinclude_HEADERS = version.h scmconfig.h
646
647 bin_SCRIPTS = guile-snarf
648
649 # We can re-enable install for some of these if/when they are documented
650 # and people feel like maintaining them. For now, this is not the case.
651 noinst_SCRIPTS = guile-snarf-docs
652
653 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
654 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
655 guile-func-name-check \
656 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
657 c-tokenize.lex \
658 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
659 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
660 # guile-procedures.txt guile.texi
661
662 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
663 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
664 @rm -f libpath.tmp
665 @echo '/* generated by Makefile */' > libpath.tmp
666 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
667 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
668 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
669 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
670 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
671 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
672 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
673 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
674 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
675 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
676 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
677 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
678 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
679 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
680 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
681 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
682 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
683 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
684 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
685 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
686 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
687 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
688 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
689 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
690 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
691 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
692 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
693 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
694 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
695 >> libpath.tmp
696 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
697 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
698 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
699 >> libpath.tmp
700 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
701 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
702 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
703 @echo '}' >> libpath.tmp
704 $(AM_V_GEN)mv libpath.tmp libpath.h
705
706
707 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
708
709 SUFFIXES = .x .doc
710
711 .c.x:
712 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
713 .c.doc:
714 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
715
716 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
717
718 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
719
720 error.x: cpp-E.c
721 posix.x: cpp-SIG.c
722 load.x: libpath.h
723 dynl.x: libpath.h
724
725 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
726 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
727 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
728
729 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
730 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
731
732 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
733 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
734
735 c-tokenize.c: c-tokenize.lex
736 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
737
738 ## Add -MG to make the .x magic work with auto-dep code.
739 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
740
741 \f
742 # This page is for maintenance of the lists of CPP symbols that are eventually
743 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
744 # in the funcs scm_init_{error,posix}, respectively.
745 #
746 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
747 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
748 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
749 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
750 #
751 # To maintain the (source) lists of symbols, we use a GCC-specific feature
752 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
753 # the output for {E,SIG}*, massage the result into a usable form, and
754 # construct a union of the current and new symbols. This is written to
755 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
756 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
757 # an informative message is the job of targets chknew-{E,SIG}.
758
759 # For each line in foo.syms, transform:
760 # SYMBOL
761 # to:
762 # #ifdef SYMBOL
763 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
764 # #endif
765 # writing output to foo.c. We use a while-read loop instead of a
766 # one-line sed script because some seds (e.g., FreeBSD) don't read
767 # '\n' as a newline (like GNU sed does). Sad, but true.
768 .syms.c:
769 $(AM_V_GEN) \
770 cat $< | while read sym ; do \
771 echo "#ifdef $$sym" ; \
772 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
773 echo "#endif" ; \
774 done > $@T
775 @mv $@T $@
776
777 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
778 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
779 chknew-E chknew-SIG: \
780 @bit=`echo $@ | sed s/^chknew-//` ; \
781 old="$(srcdir)/cpp-$$bit.syms" ; \
782 echo "#include <$${bit}.h>" \
783 | sed 's/E/errno/;s/SIG/signal/' \
784 | gcc -dM -E - \
785 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
786 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
787 > TMP ; \
788 if [ -s TMP ] ; then new="$$old.NEW" ; \
789 cat $$old TMP | sort > $$new ; \
790 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
791 sed 's/^/ /' TMP ; \
792 else echo "No new symbols found." ; \
793 fi ; rm TMP
794
795 \f
796
797 MOSTLYCLEANFILES = \
798 scmconfig.h scmconfig.h.tmp
799
800 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
801
802 MAINTAINERCLEANFILES = c-tokenize.c