1 ## Process this file with Automake to create Makefile.in
3 ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 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 AUTOMAKE_OPTIONS = gnu
24 ## Prevent automake from adding extra -I options
27 # Override Automake's `DEFAULT_INCLUDES'. By default, it contains
28 # "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
29 # is picked up by <stdlib.h> instead of the libc's <random.h>.
32 ## Check for headers in $(srcdir)/.., so that #include
33 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
34 ## building. Also look for Gnulib headers in `lib'.
35 AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
36 -I$(top_srcdir)/lib -I$(top_builddir)/lib
38 AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
40 ## The Gnulib Libtool archive.
41 gnulib_library = $(top_builddir)/lib/libgnu.la
43 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
44 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
46 lib_LTLIBRARIES = libguile.la
49 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
51 gen_scmconfig_SOURCES = gen-scmconfig.c
53 ## Override default rule; this should be compiled for BUILD host.
54 ## For some reason, OBJEXT does not include the dot
55 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
56 if [ "$(cross_compiling)" = "yes" ]; then \
57 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
59 $(COMPILE) -c -o $@ $<; \
62 ## Override default rule; this should run on BUILD host.
63 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
64 @rm -f gen-scmconfig$(EXEEXT)
65 if [ "$(cross_compiling)" = "yes" ]; then \
66 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
68 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
71 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
73 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp
74 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp
75 chmod 444 scmconfig.h.tmp
77 mv scmconfig.h.tmp scmconfig.h
79 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
81 ## Override default rule; this should be compiled for BUILD host.
82 ## For some reason, OBJEXT does not include the dot
83 c-tokenize.$(OBJEXT): c-tokenize.c
84 if [ "$(cross_compiling)" = "yes" ]; then \
85 $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
87 $(filter-out -Werror,$(COMPILE)) -c -o $@ $<; \
90 ## Override default rule; this should run on BUILD host.
91 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
92 @rm -f guile_filter_doc_snarfage$(EXEEXT)
93 if [ "$(cross_compiling)" = "yes" ]; then \
94 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
96 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \
100 guile_SOURCES = guile.c
101 guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
102 guile_LDADD = libguile.la
103 guile_LDFLAGS = $(GUILE_CFLAGS)
105 libguile_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
107 libguile_la_SOURCES = \
138 generalized-arrays.c \
139 generalized-vectors.c \
235 generalized-arrays.x \
236 generalized-vectors.x \
297 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
299 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
331 generalized-arrays.doc \
332 generalized-vectors.doc \
392 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
394 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
397 grep '^VM_DEFINE' $< > $@
399 BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
400 version.h scmconfig.h \
401 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
403 EXTRA_libguile_la_SOURCES = _scm.h \
404 memmove.c strerror.c \
405 dynl.c regex-posix.c \
406 filesys.c posix.c net_db.c socket.c \
407 debug-malloc.c mkstemp.c \
408 win32-uname.c win32-dirent.c win32-socket.c \
411 ## delete guile-snarf.awk from the installation bindir, in case it's
412 ## lingering there due to an earlier guile version not having been
415 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
417 ## This is kind of nasty... there are ".c" files that we don't want to
418 ## compile, since they are #included. So instead we list them here.
419 ## Perhaps we can deal with them normally once the merge seems to be
421 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
426 win32-uname.h win32-dirent.h win32-socket.h \
427 private-gc.h private-options.h
430 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
432 libguile_la_DEPENDENCIES = @LIBLOBJS@
433 libguile_la_LIBADD = \
434 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) \
435 $(LTLIBUNISTRING) $(LTLIBICONV)
436 libguile_la_LDFLAGS = \
437 @LTLIBINTL@ $(INET_NTOP_LIB) $(INET_PTON_LIB) \
438 -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ \
439 -export-dynamic -no-undefined \
442 if HAVE_LD_VERSION_SCRIPT
444 libguile_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
446 endif HAVE_LD_VERSION_SCRIPT
449 # These are headers visible as <guile/mumble.h>
452 # These are headers visible as <libguile/mumble.h>.
453 modincludedir = $(includedir)/libguile
454 modinclude_HEADERS = \
490 generalized-arrays.h \
491 generalized-vectors.h \
568 nodist_modinclude_HEADERS = version.h scmconfig.h
570 bin_SCRIPTS = guile-snarf
572 # We can re-enable install for some of these if/when they are documented
573 # and people feel like maintaining them. For now, this is not the case.
574 noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
576 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
577 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 cpp_signal.c \
578 cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
579 cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
580 c-tokenize.lex version.h.in \
581 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
582 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
583 # guile-procedures.txt guile.texi
585 ## We use @-...-@ as the substitution brackets here, instead of the
586 ## usual @...@, so autoconf doesn't go and substitute the values
587 ## directly into the left-hand sides of the sed substitutions. *sigh*
588 version.h: version.h.in
589 sed < $(srcdir)/version.h.in > $@.tmp \
590 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
591 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
592 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}:
595 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
596 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
597 @echo "Generating libpath.h..."
599 @echo '/* generated by Makefile */' > libpath.tmp
600 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
601 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
602 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
603 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
604 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
605 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
606 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
607 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
608 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
609 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
610 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
611 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
612 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
613 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
614 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
615 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
616 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
617 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
618 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
619 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
620 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
621 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
622 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
623 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
624 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
625 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
626 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
628 @echo ' { "extensionsdir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
629 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
630 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
632 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
633 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
634 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
635 @echo '}' >> libpath.tmp
636 @mv libpath.tmp libpath.h
639 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
643 ./guile-snarf -o $@ $< $(snarfcppopts)
645 -$(AWK) -f ./guile-func-name-check $<
646 (./guile-snarf-docs $(snarfcppopts) $< | \
647 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
649 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in
651 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
653 error.x: cpp_err_symbols.c
654 posix.x: cpp_sig_symbols.c
657 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
658 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi
659 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
661 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
662 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
664 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
665 $(dotdoc2texi) > $@ || { rm $@; false; }
669 guile-procedures.txt: guile-procedures.texi
671 makeinfo --force -o $@ guile-procedures.texi || test -f $@
675 guile-procedures.txt: guile-procedures.texi
676 cp guile-procedures.texi $@
680 c-tokenize.c: c-tokenize.lex
681 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
683 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
684 schemelib_DATA = guile-procedures.txt
686 ## Add -MG to make the .x magic work with auto-dep code.
687 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
689 cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
690 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
692 mv cpp_err_symbols.tmp cpp_err_symbols.c
694 cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
695 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
697 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
699 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
700 ## macros defined on this platform.
702 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
703 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
704 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
706 | cut -c2- > cpp_sig_symbols_diff
707 if test -s cpp_sig_symbols_diff ; then \
708 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
709 | sort > cpp_sig_symbols_new ;\
710 echo "cpp_sig_symbols_new has the following additions:" ;\
711 cat cpp_sig_symbols_diff ;\
712 else echo "No new symbols found."; \
715 ## Likewise for cpp_err_symbols.in.
717 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
718 | cut -f2 -d' ' | sort > cpp_err_symbols_here
719 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
721 | cut -c2- > cpp_err_symbols_diff
722 if test -s cpp_err_symbols_diff ; then \
723 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
724 | sort > cpp_err_symbols_new ;\
725 echo "cpp_err_symbols_new has the following additions:" ;\
726 cat cpp_err_symbols_diff ;\
727 else echo "No new symbols found."; \
731 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
732 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new \
733 version.h version.h.tmp \
734 scmconfig.h scmconfig.h.tmp
736 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
739 MAINTAINERCLEANFILES = c-tokenize.c