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