1 ## Process this file with Automake to create Makefile.in
3 ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007,
4 ## 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
6 ## This file is part of GUILE.
8 ## GUILE is free software; you can redistribute it and/or modify it
9 ## under the terms of the GNU Lesser General Public License as
10 ## published by the Free Software Foundation; either version 3, or
11 ## (at your option) any later version.
13 ## GUILE is distributed in the hope that it will be useful, but
14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU Lesser General Public License for more details.
18 ## You should have received a copy of the GNU Lesser General Public
19 ## License along with GUILE; see the file COPYING.LESSER. If not,
20 ## write to the Free Software Foundation, Inc., 51 Franklin Street,
21 ## Fifth Floor, Boston, MA 02110-1301 USA
23 include $(top_srcdir)/am/snarf
25 AUTOMAKE_OPTIONS = gnu
27 ## Prevent automake from adding extra -I options
30 # Override Automake's `DEFAULT_INCLUDES'. By default, it contains
31 # "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
32 # is picked up by <stdlib.h> instead of the libc's <random.h>.
35 ## Check for headers in $(srcdir)/.., so that #include
36 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
37 ## building. Also look for Gnulib headers in `lib'.
38 AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
39 -I$(top_srcdir)/lib -I$(top_builddir)/lib $(LIBFFI_CFLAGS)
41 AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
43 ## The Gnulib Libtool archive.
44 gnulib_library = $(top_builddir)/lib/libgnu.la
46 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
47 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
49 lib_LTLIBRARIES = libguile-@GUILE_EFFECTIVE_VERSION@.la
52 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
54 gen_scmconfig_SOURCES = gen-scmconfig.c
56 ## Override default rule; this should be compiled for BUILD host. Note
57 ## that we don't add $(AM_CPPFLAGS) here, as we need to run this
58 ## program, but $(top_srcdir)/lib has a gnulib configured for the
59 ## target. Instead we manually add $(top_builddir), in order to pick up
60 ## the generated config.h and gen-scmconfig.h. Nothing else from Guile
61 ## is included by this code generator.
62 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
64 if [ "$(cross_compiling)" = "yes" ]; then \
65 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \
68 $(COMPILE) -c -o $@ $<; \
71 ## Override default rule; this should run on BUILD host.
72 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
74 rm -f gen-scmconfig$(EXEEXT); \
75 if [ "$(cross_compiling)" = "yes" ]; then \
76 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
78 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
81 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
82 $(AM_V_GEN)(rm -f scmconfig.h.tmp; \
83 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp; \
84 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp; \
85 chmod 444 scmconfig.h.tmp; \
87 mv scmconfig.h.tmp scmconfig.h)
90 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
92 ## Override default rule; this should be compiled for BUILD host.
93 ## For some reason, OBJEXT does not include the dot
94 c-tokenize.$(OBJEXT): c-tokenize.c
96 if [ "$(cross_compiling)" = "yes" ]; then \
97 $(CC_FOR_BUILD) -I$(top_builddir) -c -o $@ $<; \
99 $(COMPILE) -c -o $@ $<; \
102 ## Override default rule; this should run on BUILD host.
103 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
105 rm -f guile_filter_doc_snarfage$(EXEEXT); \
106 if [ "$(cross_compiling)" = "yes" ]; then \
107 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
109 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(gnulib_library) $(LIBS); \
113 guile_SOURCES = guile.c
114 guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
115 guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
116 guile_LDFLAGS = $(GUILE_CFLAGS)
118 libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
120 libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
155 generalized-arrays.c \
156 generalized-vectors.c \
261 generalized-arrays.x \
262 generalized-vectors.x \
330 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
365 generalized-arrays.doc \
366 generalized-vectors.doc \
430 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
432 vm-operations.h: vm-engine.c
433 @echo '/* This file was generated automatically from $<; do not' > $@
434 @echo ' edit. See the source file for copyright information. */' >> $@
436 @echo "#define FOR_EACH_VM_OPERATION(M) \\" >> $@
437 $(AM_V_GEN)$(GREP) '^ *VM_DEFINE_OP' $< \
438 | sed -e 's,VM_DEFINE_OP (\(.*\)).*, M (\1) \\,' >> $@
441 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
443 $(DOT_I_FILES) vm-operations.h $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
445 # Force the generation of `guile-procedures.texi' because the top-level
446 # Makefile expects it to be built.
447 all-local: guile-procedures.texi
449 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
450 memmove.c strerror.c \
451 dynl.c regex-posix.c \
452 posix.c net_db.c socket.c \
453 debug-malloc.c mkstemp.c \
457 ## delete guile-snarf.awk from the installation bindir, in case it's
458 ## lingering there due to an earlier guile version not having been
461 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
463 ## This is kind of nasty... there are ".c" files that we don't want to
464 ## compile, since they are #included. So instead we list them here.
465 ## Perhaps we can deal with them normally once the merge seems to be
467 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
472 private-options.h ports-internal.h
475 noinst_HEADERS += vm-engine.c
477 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
479 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
480 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
482 # Libtool version info.
483 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
485 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
486 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
499 $(LIB_CLOCK_GETTIME) \
508 -version-info $(version_info) \
509 -export-dynamic -no-undefined \
512 if HAVE_LD_VERSION_SCRIPT
514 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
516 endif HAVE_LD_VERSION_SCRIPT
519 # These are headers visible as <guile/mumble.h>
522 # These are headers visible as <libguile/mumble.h>.
523 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
524 modinclude_HEADERS = \
562 generalized-arrays.h \
563 generalized-vectors.h \
644 nodist_modinclude_HEADERS = version.h scmconfig.h
646 bin_SCRIPTS = guile-snarf
648 # We can re-enable install for some of these if/when they are documented
649 # and people feel like maintaining them. For now, this is not the case.
650 noinst_SCRIPTS = guile-snarf-docs
652 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
653 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
654 guile-func-name-check \
655 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
657 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
658 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
659 # guile-procedures.txt guile.texi
661 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
662 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
664 @echo '/* generated by Makefile */' > libpath.tmp
665 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
666 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
667 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
668 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
669 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
670 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
671 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
672 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
673 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
674 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
675 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
676 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
677 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
678 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
679 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
680 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
681 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
682 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
683 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
684 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
685 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
686 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
687 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
688 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
689 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
690 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
691 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
692 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
693 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
695 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
696 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
697 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
699 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
700 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
701 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
702 @echo '}' >> libpath.tmp
703 $(AM_V_GEN)mv libpath.tmp libpath.h
706 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
711 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
713 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
715 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
717 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
724 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
725 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
726 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
728 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
729 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
731 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
732 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
734 c-tokenize.c: c-tokenize.lex
735 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
737 ## Add -MG to make the .x magic work with auto-dep code.
738 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
741 # This page is for maintenance of the lists of CPP symbols that are eventually
742 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
743 # in the funcs scm_init_{error,posix}, respectively.
745 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
746 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
747 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
748 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
750 # To maintain the (source) lists of symbols, we use a GCC-specific feature
751 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
752 # the output for {E,SIG}*, massage the result into a usable form, and
753 # construct a union of the current and new symbols. This is written to
754 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
755 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
756 # an informative message is the job of targets chknew-{E,SIG}.
758 # For each line in foo.syms, transform:
762 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
764 # writing output to foo.c. We use a while-read loop instead of a
765 # one-line sed script because some seds (e.g., FreeBSD) don't read
766 # '\n' as a newline (like GNU sed does). Sad, but true.
769 cat $< | while read sym ; do \
770 echo "#ifdef $$sym" ; \
771 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
776 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
777 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
778 chknew-E chknew-SIG: \
779 @bit=`echo $@ | sed s/^chknew-//` ; \
780 old="$(srcdir)/cpp-$$bit.syms" ; \
781 echo "#include <$${bit}.h>" \
782 | sed 's/E/errno/;s/SIG/signal/' \
784 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
785 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
787 if [ -s TMP ] ; then new="$$old.NEW" ; \
788 cat $$old TMP | sort > $$new ; \
789 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
791 else echo "No new symbols found." ; \
797 scmconfig.h scmconfig.h.tmp
799 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
801 MAINTAINERCLEANFILES = c-tokenize.c