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