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