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, 2013 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) -I$(top_builddir) -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 \
257 generalized-arrays.x \
258 generalized-vectors.x \
321 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
323 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
358 generalized-arrays.doc \
359 generalized-vectors.doc \
421 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
423 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
426 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
428 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
430 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
432 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
433 memmove.c strerror.c \
434 dynl.c regex-posix.c \
435 posix.c net_db.c socket.c \
436 debug-malloc.c mkstemp.c \
440 ## delete guile-snarf.awk from the installation bindir, in case it's
441 ## lingering there due to an earlier guile version not having been
444 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
446 ## This is kind of nasty... there are ".c" files that we don't want to
447 ## compile, since they are #included. So instead we list them here.
448 ## Perhaps we can deal with them normally once the merge seems to be
450 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
454 private-gc.h private-options.h
457 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
459 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
461 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
462 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
464 # Libtool version info.
465 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
467 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
468 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
481 $(LIB_CLOCK_GETTIME) \
490 -version-info $(version_info) \
491 -export-dynamic -no-undefined \
494 if HAVE_LD_VERSION_SCRIPT
496 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
498 endif HAVE_LD_VERSION_SCRIPT
501 # These are headers visible as <guile/mumble.h>
504 # These are headers visible as <libguile/mumble.h>.
505 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
506 modinclude_HEADERS = \
545 generalized-arrays.h \
546 generalized-vectors.h \
625 nodist_modinclude_HEADERS = version.h scmconfig.h
627 bin_SCRIPTS = guile-snarf
629 # We can re-enable install for some of these if/when they are documented
630 # and people feel like maintaining them. For now, this is not the case.
631 noinst_SCRIPTS = guile-snarf-docs
633 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
634 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
635 guile-func-name-check \
636 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
638 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
639 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
640 # guile-procedures.txt guile.texi
642 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
643 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
645 @echo '/* generated by Makefile */' > libpath.tmp
646 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
647 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
648 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
649 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
650 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
651 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
652 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
653 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
654 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
655 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
656 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
657 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
658 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
659 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
660 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
661 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
662 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
663 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
664 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
665 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
666 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
667 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
668 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
669 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
670 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
671 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
672 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
673 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
674 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
676 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
677 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
678 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
680 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
681 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
682 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
683 @echo '}' >> libpath.tmp
684 $(AM_V_GEN)mv libpath.tmp libpath.h
687 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
692 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
694 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
696 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
698 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
705 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
706 snarf2checkedtexi = GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
707 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
708 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
710 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
711 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
713 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
714 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
716 c-tokenize.c: c-tokenize.lex
717 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
719 ## Add -MG to make the .x magic work with auto-dep code.
720 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
723 # This page is for maintenance of the lists of CPP symbols that are eventually
724 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
725 # in the funcs scm_init_{error,posix}, respectively.
727 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
728 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
729 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
730 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
732 # To maintain the (source) lists of symbols, we use a GCC-specific feature
733 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
734 # the output for {E,SIG}*, massage the result into a usable form, and
735 # construct a union of the current and new symbols. This is written to
736 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
737 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
738 # an informative message is the job of targets chknew-{E,SIG}.
740 # For each line in foo.syms, transform:
744 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
746 # writing output to foo.c. We use a while-read loop instead of a
747 # one-line sed script because some seds (e.g., FreeBSD) don't read
748 # '\n' as a newline (like GNU sed does). Sad, but true.
751 cat $< | while read sym ; do \
752 echo "#ifdef $$sym" ; \
753 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
758 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
759 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
760 chknew-E chknew-SIG: \
761 @bit=`echo $@ | sed s/^chknew-//` ; \
762 old="$(srcdir)/cpp-$$bit.syms" ; \
763 echo "#include <$${bit}.h>" \
764 | sed 's/E/errno/;s/SIG/signal/' \
766 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
767 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
769 if [ -s TMP ] ; then new="$$old.NEW" ; \
770 cat $$old TMP | sort > $$new ; \
771 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
773 else echo "No new symbols found." ; \
779 scmconfig.h scmconfig.h.tmp
781 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
784 MAINTAINERCLEANFILES = c-tokenize.c