1 ## Process this file with Automake to create Makefile.in
3 ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 ## This file is part of GUILE.
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.
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.
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
22 include $(top_srcdir)/am/snarf
24 AUTOMAKE_OPTIONS = gnu
26 ## Prevent automake from adding extra -I options
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>.
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)
40 AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
42 ## The Gnulib Libtool archive.
43 gnulib_library = $(top_builddir)/lib/libgnu.la
45 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
46 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
48 lib_LTLIBRARIES = libguile-@GUILE_EFFECTIVE_VERSION@.la
51 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
53 gen_scmconfig_SOURCES = gen-scmconfig.c
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
59 if [ "$(cross_compiling)" = "yes" ]; then \
60 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
62 $(COMPILE) -c -o $@ $<; \
65 ## Override default rule; this should run on BUILD host.
66 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
68 rm -f gen-scmconfig$(EXEEXT); \
69 if [ "$(cross_compiling)" = "yes" ]; then \
70 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
72 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
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; \
81 mv scmconfig.h.tmp scmconfig.h)
84 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
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
90 if [ "$(cross_compiling)" = "yes" ]; then \
91 $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
93 $(COMPILE) -c -o $@ $<; \
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)
99 rm -f guile_filter_doc_snarfage$(EXEEXT); \
100 if [ "$(cross_compiling)" = "yes" ]; then \
101 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
103 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \
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)
112 libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
114 libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
147 generalized-arrays.c \
148 generalized-vectors.c \
247 generalized-arrays.x \
248 generalized-vectors.x \
310 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
312 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
346 generalized-arrays.doc \
347 generalized-vectors.doc \
408 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
410 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
413 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
415 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
417 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
419 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
420 memmove.c strerror.c \
421 dynl.c regex-posix.c \
422 filesys.c posix.c net_db.c socket.c \
423 debug-malloc.c mkstemp.c \
424 win32-uname.c win32-dirent.c win32-socket.c \
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
431 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
433 ## This is kind of nasty... there are ".c" files that we don't want to
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
437 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
441 win32-uname.h win32-dirent.h win32-socket.h \
442 private-gc.h private-options.h
445 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
447 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
448 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
449 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) \
450 $(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL)
451 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
452 @LTLIBINTL@ $(LIBFFI_LIBS) $(INET_NTOP_LIB) $(INET_PTON_LIB) \
453 $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(SERVENT_LIB) \
454 -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ \
455 -export-dynamic -no-undefined \
458 if HAVE_LD_VERSION_SCRIPT
460 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
462 endif HAVE_LD_VERSION_SCRIPT
465 # These are headers visible as <guile/mumble.h>
468 # These are headers visible as <libguile/mumble.h>.
469 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
470 modinclude_HEADERS = \
508 generalized-arrays.h \
509 generalized-vectors.h \
586 nodist_modinclude_HEADERS = version.h scmconfig.h
588 bin_SCRIPTS = guile-snarf
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.
592 noinst_SCRIPTS = guile-snarf-docs
594 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
595 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
596 guile-func-name-check \
597 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
599 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
600 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
601 # guile-procedures.txt guile.texi
603 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
604 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
606 @echo '/* generated by Makefile */' > libpath.tmp
607 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
608 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
609 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
610 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
611 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
612 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
613 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
614 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
615 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
616 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
617 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
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
628 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
629 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
630 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
631 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
632 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
633 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
634 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
636 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
637 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
638 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
640 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
641 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
642 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
643 @echo '}' >> libpath.tmp
644 $(AM_V_GEN)mv libpath.tmp libpath.h
647 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
651 AM_V_FILTER = $(AM_V_FILTER_$(V))
652 AM_V_FILTER_ = $(AM_V_FILTER_$(AM_DEFAULT_VERBOSITY))
653 AM_V_FILTER_0 = @echo " FILTER" $@;
656 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
658 -$(AM_V_FILTER)$(AWK) -f $(srcdir)/guile-func-name-check $< && (./guile-snarf-docs $(snarfcppopts) $< | ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
660 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
662 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
668 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
669 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi
670 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
672 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
673 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
675 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
676 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
680 guile-procedures.txt: guile-procedures.texi
682 makeinfo --force -o $@ guile-procedures.texi || test -f $@
686 guile-procedures.txt: guile-procedures.texi
687 cp guile-procedures.texi $@
691 c-tokenize.c: c-tokenize.lex
692 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
694 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
695 schemelib_DATA = guile-procedures.txt
697 ## Add -MG to make the .x magic work with auto-dep code.
698 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
701 # This page is for maintenance of the lists of CPP symbols that are eventually
702 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
703 # in the funcs scm_init_{error,posix}, respectively.
705 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
706 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
707 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
708 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
710 # To maintain the (source) lists of symbols, we use a GCC-specific feature
711 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
712 # the output for {E,SIG}*, massage the result into a usable form, and
713 # construct a union of the current and new symbols. This is written to
714 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
715 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
716 # an informative message is the job of targets chknew-{E,SIG}.
718 # For each line in foo.syms, transform:
722 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
724 # writing output to foo.c.
726 sed 's/.*/#ifdef &\nscm_c_define ("&", scm_from_int (&));\n#endif/' \
730 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
731 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
733 @bit=`echo $@ | sed s/^chknew-//` ; \
734 old="$(srcdir)/cpp-$$bit.syms" ; \
735 echo "#include <$${bit}.h>" \
736 | sed 's/E/errno/;s/SIG/signal/' \
737 | gcc -undef -dM -E - \
738 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
739 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
741 if [ -s TMP ] ; then new="$$old.NEW" ; \
742 cat $$old TMP | sort > $$new ; \
743 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
745 else echo "No new symbols found." ; \
751 scmconfig.h scmconfig.h.tmp
753 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
756 MAINTAINERCLEANFILES = c-tokenize.c