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, 2011, 2012 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. Note
56 ## that we don't add $(AM_CPPFLAGS) here, as we need to run this
57 ## program, but $(top_srcdir)/lib has a gnulib configured for the
58 ## target. Instead we manually add $(top_builddir), in order to pick up
59 ## the generated config.h and gen-scmconfig.h. Nothing else from Guile
60 ## is included by this code generator.
61 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
63 if [ "$(cross_compiling)" = "yes" ]; then \
64 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \
67 $(COMPILE) -c -o $@ $<; \
70 ## Override default rule; this should run on BUILD host.
71 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
73 rm -f gen-scmconfig$(EXEEXT); \
74 if [ "$(cross_compiling)" = "yes" ]; then \
75 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
77 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
80 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
81 $(AM_V_GEN)(rm -f scmconfig.h.tmp; \
82 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp; \
83 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp; \
84 chmod 444 scmconfig.h.tmp; \
86 mv scmconfig.h.tmp scmconfig.h)
89 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
91 ## Override default rule; this should be compiled for BUILD host.
92 ## For some reason, OBJEXT does not include the dot
93 c-tokenize.$(OBJEXT): c-tokenize.c
95 if [ "$(cross_compiling)" = "yes" ]; then \
96 $(CC_FOR_BUILD) -c -o $@ $<; \
98 $(COMPILE) -c -o $@ $<; \
101 ## Override default rule; this should run on BUILD host.
102 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
104 rm -f guile_filter_doc_snarfage$(EXEEXT); \
105 if [ "$(cross_compiling)" = "yes" ]; then \
106 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
108 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(gnulib_library) $(LIBS); \
112 guile_SOURCES = guile.c
113 guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
114 guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
115 guile_LDFLAGS = $(GUILE_CFLAGS)
117 libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
119 libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
154 generalized-arrays.c \
155 generalized-vectors.c \
259 generalized-arrays.x \
260 generalized-vectors.x \
325 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
327 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
362 generalized-arrays.doc \
363 generalized-vectors.doc \
427 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
429 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
432 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
434 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
436 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
438 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
439 memmove.c strerror.c \
440 dynl.c regex-posix.c \
441 posix.c net_db.c socket.c \
442 debug-malloc.c mkstemp.c \
443 win32-uname.c win32-socket.c \
446 ## delete guile-snarf.awk from the installation bindir, in case it's
447 ## lingering there due to an earlier guile version not having been
450 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
452 ## This is kind of nasty... there are ".c" files that we don't want to
453 ## compile, since they are #included. So instead we list them here.
454 ## Perhaps we can deal with them normally once the merge seems to be
456 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
460 win32-uname.h win32-socket.h \
461 private-gc.h private-options.h
464 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
466 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
468 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
469 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
471 # Libtool version info.
472 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
474 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
475 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
487 $(LIB_CLOCK_GETTIME) \
495 -version-info $(version_info) \
496 -export-dynamic -no-undefined \
499 if HAVE_LD_VERSION_SCRIPT
501 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
503 endif HAVE_LD_VERSION_SCRIPT
506 # These are headers visible as <guile/mumble.h>
509 # These are headers visible as <libguile/mumble.h>.
510 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
511 modinclude_HEADERS = \
550 generalized-arrays.h \
551 generalized-vectors.h \
632 nodist_modinclude_HEADERS = version.h scmconfig.h
634 bin_SCRIPTS = guile-snarf
636 # We can re-enable install for some of these if/when they are documented
637 # and people feel like maintaining them. For now, this is not the case.
638 noinst_SCRIPTS = guile-snarf-docs
640 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
641 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
642 guile-func-name-check \
643 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
645 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
646 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
647 # guile-procedures.txt guile.texi
649 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
650 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
652 @echo '/* generated by Makefile */' > libpath.tmp
653 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
654 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
655 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
656 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
657 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
658 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
659 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
660 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
661 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
662 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
663 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
664 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
665 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
666 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
667 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
668 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
669 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
670 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
671 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
672 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
673 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
674 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
675 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
676 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
677 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
678 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
679 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
680 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
681 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
683 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
684 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
685 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
687 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
688 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
689 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
690 @echo '}' >> libpath.tmp
691 $(AM_V_GEN)mv libpath.tmp libpath.h
694 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
699 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
701 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
703 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
705 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
711 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
712 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
713 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
715 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
716 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
718 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
719 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
723 guile-procedures.txt: guile-procedures.texi
725 makeinfo --force -o $@ guile-procedures.texi || test -f $@
729 guile-procedures.txt: guile-procedures.texi
730 cp guile-procedures.texi $@
734 c-tokenize.c: c-tokenize.lex
735 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
737 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
738 schemelib_DATA = guile-procedures.txt
740 ## Add -MG to make the .x magic work with auto-dep code.
741 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
744 # This page is for maintenance of the lists of CPP symbols that are eventually
745 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
746 # in the funcs scm_init_{error,posix}, respectively.
748 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
749 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
750 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
751 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
753 # To maintain the (source) lists of symbols, we use a GCC-specific feature
754 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
755 # the output for {E,SIG}*, massage the result into a usable form, and
756 # construct a union of the current and new symbols. This is written to
757 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
758 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
759 # an informative message is the job of targets chknew-{E,SIG}.
761 # For each line in foo.syms, transform:
765 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
767 # writing output to foo.c. We use a while-read loop instead of a
768 # one-line sed script because some seds (e.g., FreeBSD) don't read
769 # '\n' as a newline (like GNU sed does). Sad, but true.
772 cat $< | while read sym ; do \
773 echo "#ifdef $$sym" ; \
774 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
779 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
780 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
781 chknew-E chknew-SIG: \
782 @bit=`echo $@ | sed s/^chknew-//` ; \
783 old="$(srcdir)/cpp-$$bit.syms" ; \
784 echo "#include <$${bit}.h>" \
785 | sed 's/E/errno/;s/SIG/signal/' \
787 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
788 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
790 if [ -s TMP ] ; then new="$$old.NEW" ; \
791 cat $$old TMP | sort > $$new ; \
792 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
794 else echo "No new symbols found." ; \
800 scmconfig.h scmconfig.h.tmp
802 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
805 MAINTAINERCLEANFILES = c-tokenize.c