Try to detect when people are using one version of libguile and a
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9
TT
1## Process this file with Automake to create Makefile.in
2
3AUTOMAKE_OPTIONS = foreign
4
5## Check for headers in $(srcdir)/.., so that #include
6## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
7## building.
8INCLUDES = -I.. -I$(srcdir)/..
9
fef07353
JB
10ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(PROC\|PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/'
11
e13d8dc0 12lib_LTLIBRARIES = libguile.la
549436de
JB
13bin_PROGRAMS = guile
14
15guile_SOURCES = guile.c
16guile_LDADD = libguile.la ${THREAD_LIBS}
ee2a8b9b
JB
17
18libguile_la_SOURCES = \
19 alist.c append.c appinit.c arbiters.c async.c boolean.c chars.c \
20 continuations.c dynl.c dynwind.c eq.c error.c eval.c extchrs.c \
21 feature.c filesys.c fports.c gc.c gdbint.c genio.c gh_data.c gh_eval.c \
22 gh_funcs.c gh_init.c gh_io.c gh_list.c gh_predicates.c gsubr.c hash.c \
23 hashtab.c init.c ioext.c kw.c list.c load.c mallocs.c markers.c \
24 mbstrings.c net_db.c numbers.c objprop.c options.c pairs.c ports.c \
25 posix.c print.c procprop.c procs.c ramap.c read.c root.c scmsigs.c \
549436de
JB
26 script.c sequences.c simpos.c smob.c socket.c stackchk.c stime.c \
27 strings.c strop.c strorder.c strports.c struct.c symbols.c tag.c \
28 throw.c unif.c variable.c vectors.c version.c vports.c weaks.c
29
ee2a8b9b
JB
30EXTRA_libguile_la_SOURCES = _scm.h \
31 backtrace.c stacks.c debug.c srcprop.c \
7bfd3b9e 32 strerror.c inet_aton.c putenv.c \
f255378e
JB
33 threads.c alloca.c \
34 regex-posix.c
7bfd3b9e
JB
35
36## This is kind of nasty... there are ".c" files that we don't want to
37## compile, since they are #included in threads.c. So instead we list
38## them here. Perhaps we can deal with them normally once the merge
39## seems to be working.
40noinst_HEADERS = coop-threads.c coop-threads.h coop.c
41
78bda5f3 42libguile_la_DEPENDENCIES = @LIBLOBJS@
e13d8dc0 43libguile_la_LIBADD = @LIBLOBJS@
fef07353 44libguile_la_LDFLAGS = -version-info 1:2 -rpath $(libdir)
733943b9
TT
45
46include_HEADERS = libguile.h
47
ee2a8b9b
JB
48# These are headers visible as <guile/mumble.h>
49pkginclude_HEADERS = gh.h
50
733943b9 51# These are headers visible as <libguile/mumble.h>.
5380de6b 52modincludedir = $(includedir)/libguile
733943b9 53modinclude_HEADERS = __scm.h alist.h append.h arbiters.h async.h \
e13d8dc0
JB
54 backtrace.h boolean.h chars.h continuations.h debug.h dynl.h dynwind.h \
55 eq.h error.h eval.h extchrs.h feature.h filesys.h fports.h gc.h \
56 gdb_interface.h gdbint.h genio.h gsubr.h hash.h hashtab.h init.h \
57 ioext.h kw.h list.h load.h mallocs.h markers.h mbstrings.h net_db.h \
f255378e 58 numbers.h objprop.h options.h pairs.h ports.h posix.h regex-posix.h print.h \
549436de 59 procprop.h procs.h ramap.h read.h root.h scmhob.h scmsigs.h script.h \
e13d8dc0
JB
60 sequences.h simpos.h smob.h socket.h srcprop.h stackchk.h stacks.h \
61 stime.h strings.h strop.h strorder.h strports.h struct.h symbols.h \
62 tag.h tags.h throw.h unif.h variable.h vectors.h version.h vports.h \
7bfd3b9e 63 weaks.h snarf.h threads.h coop-defs.h
733943b9 64
adb75a41
TT
65## This file is generated at configure time. That is why it is DATA
66## and not a header -- headers are included in the distribution.
733943b9
TT
67modinclude_DATA = scmconfig.h
68
adb75a41
TT
69bin_SCRIPTS = guile-snarf
70
ee2a8b9b
JB
71THREAD_LIBS = @THREAD_LIBS@
72check_ldadd = libguile.la ${THREAD_LIBS}
73check_PROGRAMS = gh_test_c gh_test_repl
74gh_test_c_SOURCES = gh_test_c.c
75gh_test_c_LDADD = ${check_ldadd}
76gh_test_repl_SOURCES = gh_test_repl.c
77gh_test_repl_LDADD = ${check_ldadd}
78
52f980e4
JB
79check-local:
80 echo '(+ 1 2 3)' | ./gh_test_c; echo
81 echo '(+ 1 2 3)' | ./gh_test_repl; echo
82
1773993b
JB
83EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads dynl-dl.c \
84 dynl-dld.c dynl-shl.c dynl-vms.c DYNAMIC-LINKING cpp_signal.c cpp_errno.c \
85 cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk coop-threads.h.cygnus \
86 coop-threads.c.cygnus mit-pthreads.h mit-pthreads.c fsu-pthreads.h
733943b9 87
fef07353 88## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
733943b9 89libpath.h: Makefile
593d151f
JB
90 rm -f libpath.tmp
91 echo '/* generated by Makefile */' > libpath.tmp
92 echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
93 echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"' >>libpath.tmp
94 echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
95 mv libpath.tmp libpath.h
733943b9 96
fef07353
JB
97## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
98versiondat.h: Makefile
99 rm -f versiondat.tmp
100 echo '/* generated by Makefile */' > versiondat.tmp
101 echo '#define GUILE_VERSION "$(GUILE_VERSION)"' >> versiondat.tmp
102 echo '#define GUILE_MAJOR_VERSION "$(GUILE_MAJOR_VERSION)"' \
103 >> versiondat.tmp
104 echo '#define GUILE_MINOR_VERSION "$(GUILE_MINOR_VERSION)"' \
105 >> versiondat.tmp
106 echo '#define GUILE_STAMP "$(GUILE_STAMP)"' >> versiondat.tmp
107 mv versiondat.tmp versiondat.h
108
733943b9
TT
109SUFFIXES = .x
110.c.x:
adb75a41 111 ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
733943b9
TT
112
113## Add -MG to make the .x magic work with auto-dep code.
114MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 115
a0e90145
JB
116cpp_err_symbols.c: cpp_err_symbols.in
117 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
593d151f
JB
118 cpp_err_symbols.tmp
119 mv cpp_err_symbols.tmp cpp_err_symbols.c
ee78fbb0 120
a0e90145
JB
121cpp_sig_symbols.c: cpp_sig_symbols.in
122 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
593d151f
JB
123 cpp_sig_symbols.tmp
124 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
67ec3667 125
a0e90145 126## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
67ec3667
GH
127## macros defined on this platform.
128check_signals:
129 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
130 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
a0e90145
JB
131 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
132 | egrep '^\+S' \
67ec3667
GH
133 | cut -c2- > cpp_sig_symbols_diff
134 if test -s cpp_sig_symbols_diff ; then \
a0e90145 135 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
67ec3667
GH
136 | sort > cpp_sig_symbols_new ;\
137 echo "cpp_sig_symbols_new has the following additions:" ;\
138 cat cpp_sig_symbols_diff ;\
139 else echo "No new symbols found."; \
140 fi
141
a0e90145 142## Likewise for cpp_err_symbols.in.
67ec3667
GH
143check_errnos:
144 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
145 | cut -f2 -d' ' | sort > cpp_err_symbols_here
a0e90145
JB
146 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
147 | egrep '^\+E' \
67ec3667
GH
148 | cut -c2- > cpp_err_symbols_diff
149 if test -s cpp_err_symbols_diff ; then \
a0e90145 150 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
67ec3667
GH
151 | sort > cpp_err_symbols_new ;\
152 echo "cpp_err_symbols_new has the following additions:" ;\
153 cat cpp_err_symbols_diff ;\
154 else echo "No new symbols found."; \
155 fi
156
157CLEANFILES=cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
158 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new