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