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