* configure.in: check for hstrerror.
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
553bb641 3## Copyright (C) 1998, 1999 Free Software Foundation, Inc.
2764bd99
JB
4##
5## This file is part of GUILE.
6##
7## GUILE is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as
9## published by the Free Software Foundation; either version 2, or
10## (at your option) any later version.
11##
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 General Public License for more details.
16##
17## You should have received a copy of the GNU General Public
18## License along with GUILE; see the file COPYING. If not, write
19## to the Free Software Foundation, Inc., 59 Temple Place, Suite
20## 330, Boston, MA 02111-1307 USA
733943b9
TT
21
22AUTOMAKE_OPTIONS = foreign
23
24## Check for headers in $(srcdir)/.., so that #include
25## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
26## building.
a0e6f509 27INCLUDES = -I.. -I$(srcdir)/.. ${THREAD_CPPFLAGS}
733943b9 28
27ab23a4 29ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/'
fef07353 30
e13d8dc0 31lib_LTLIBRARIES = libguile.la
549436de
JB
32bin_PROGRAMS = guile
33
34guile_SOURCES = guile.c
a0e6f509 35guile_LDADD = libguile.la ${THREAD_LIBS_LOCAL}
ee2a8b9b
JB
36
37libguile_la_SOURCES = \
f6e164d4
JB
38 alist.c arbiters.c async.c backtrace.c boolean.c chars.c \
39 continuations.c debug.c dynl.c dynwind.c eq.c error.c eval.c \
52cfc69b 40 evalext.c feature.c fluids.c fports.c gc.c gdbint.c \
f15913d0 41 gh_data.c gh_eval.c gh_funcs.c gh_init.c gh_io.c gh_list.c \
f6e164d4 42 gh_predicates.c gsubr.c guardians.c hash.c hashtab.c init.c \
4725c298 43 ioext.c keywords.c lang.c list.c load.c macros.c mallocs.c \
52cfc69b
GH
44 modules.c numbers.c objects.c objprop.c options.c pairs.c \
45 ports.c print.c procprop.c procs.c ramap.c random.c read.c \
46 root.c scmsigs.c script.c simpos.c smob.c sort.c \
f6e164d4
JB
47 srcprop.c stackchk.c stacks.c stime.c strings.c strop.c strorder.c \
48 strports.c struct.c symbols.c tag.c throw.c unif.c variable.c \
49 vectors.c version.c vports.c weaks.c
549436de 50
a3365d47 51BUILT_SOURCES = \
f6e164d4
JB
52 cpp_err_symbols.c cpp_sig_symbols.c libpath.h alist.x arbiters.x \
53 async.x backtrace.x boolean.x chars.x continuations.x debug.x \
54 dynl.x dynwind.x eq.x error.x eval.x evalext.x feature.x filesys.x \
5d175eaf 55 fluids.x fports.x gc.x gsubr.x \
f6e164d4 56 guardians.x hash.x hashtab.x init.x ioext.x iselect.x keywords.x \
094ce856 57 lang.x list.x load.x macros.x mallocs.x modules.x net_db.x \
f6e164d4
JB
58 numbers.x objects.x objprop.x options.x pairs.x ports.x posix.x \
59 print.x procprop.x procs.x random.x ramap.x read.x regex-posix.x \
60 root.x scmsigs.x script.x simpos.x smob.x socket.x sort.x \
61 srcprop.x stackchk.x stacks.x stime.x strings.x strop.x strorder.x \
62 strports.x struct.x symbols.x tag.x threads.x throw.x unif.x \
63 variable.x vectors.x version.x vports.x weaks.x
a3365d47 64
60a059e6
JB
65EXTRA_libguile_la_SOURCES = _scm.h \
66 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
52cfc69b 67 threads.c regex-posix.c iselect.c \
3b307d43 68 filesys.c posix.c net_db.c socket.c
7bfd3b9e
JB
69
70## This is kind of nasty... there are ".c" files that we don't want to
71## compile, since they are #included in threads.c. So instead we list
72## them here. Perhaps we can deal with them normally once the merge
73## seems to be working.
74noinst_HEADERS = coop-threads.c coop-threads.h coop.c
75
78bda5f3 76libguile_la_DEPENDENCIES = @LIBLOBJS@
4a5fa91c 77libguile_la_LIBADD = @LIBLOBJS@
b3ad3103 78libguile_la_LDFLAGS = -version-info 7:0 -export-dynamic
733943b9
TT
79
80include_HEADERS = libguile.h
81
ee2a8b9b
JB
82# These are headers visible as <guile/mumble.h>
83pkginclude_HEADERS = gh.h
84
733943b9 85# These are headers visible as <libguile/mumble.h>.
5380de6b 86modincludedir = $(includedir)/libguile
99dc0f92 87modinclude_HEADERS = \
f6e164d4
JB
88 __scm.h alist.h arbiters.h async.h backtrace.h boolean.h chars.h \
89 continuations.h debug.h dynl.h dynwind.h eq.h error.h eval.h \
90 evalext.h feature.h filesys.h fports.h gc.h gdb_interface.h \
91 gdbint.h genio.h gsubr.h guardians.h hash.h hashtab.h init.h \
094ce856 92 ioext.h keywords.h kw.h lang.h list.h load.h macros.h mallocs.h \
f6e164d4
JB
93 modules.h net_db.h numbers.h objects.h objprop.h options.h pairs.h \
94 ports.h posix.h regex-posix.h print.h procprop.h procs.h random.h \
95 ramap.h read.h root.h scmsigs.h script.h simpos.h smob.h socket.h \
96 sort.h srcprop.h stackchk.h stacks.h stime.h strings.h strop.h \
97 strorder.h strports.h struct.h symbols.h tag.h tags.h throw.h \
98 unif.h variable.h vectors.h version.h vports.h weaks.h snarf.h \
99 threads.h coop-defs.h fluids.h iselect.h
4725c298 100
adb75a41
TT
101## This file is generated at configure time. That is why it is DATA
102## and not a header -- headers are included in the distribution.
733943b9
TT
103modinclude_DATA = scmconfig.h
104
adb75a41
TT
105bin_SCRIPTS = guile-snarf
106
a0e6f509 107check_ldadd = libguile.la ${THREAD_LIBS_LOCAL}
ee2a8b9b
JB
108check_PROGRAMS = gh_test_c gh_test_repl
109gh_test_c_SOURCES = gh_test_c.c
110gh_test_c_LDADD = ${check_ldadd}
111gh_test_repl_SOURCES = gh_test_repl.c
112gh_test_repl_LDADD = ${check_ldadd}
113
52f980e4 114check-local:
429ae864
JB
115 echo '(+ 1 2 3)' | GUILE_LOAD_PATH=${top_srcdir}:.. ./gh_test_c; echo
116 echo '(+ 1 2 3)' | GUILE_LOAD_PATH=${top_srcdir}:.. ./gh_test_repl; echo
52f980e4 117
1773993b
JB
118EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads dynl-dl.c \
119 dynl-dld.c dynl-shl.c dynl-vms.c DYNAMIC-LINKING cpp_signal.c cpp_errno.c \
120 cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk coop-threads.h.cygnus \
121 coop-threads.c.cygnus mit-pthreads.h mit-pthreads.c fsu-pthreads.h
733943b9 122
fef07353 123## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 124libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
e151bee6
JB
125 @echo "Generating libpath.h..."
126 @rm -f libpath.tmp
127 @echo '/* generated by Makefile */' > libpath.tmp
128 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
129 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
130 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
131 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
132 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
133 @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
134 >> libpath.tmp
135 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
136 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
137 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
138 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
139 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
140 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
141 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
142 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
143 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
144 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
145 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
146 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
147 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
148 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
149 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
150 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
151 >> libpath.tmp
90ff3ec5 152 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
e151bee6
JB
153 @echo '}' >> libpath.tmp
154 @mv libpath.tmp libpath.h
733943b9
TT
155
156SUFFIXES = .x
157.c.x:
7677589a 158 ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
95042d95 159 || { rm $@; false; }
733943b9
TT
160
161## Add -MG to make the .x magic work with auto-dep code.
162MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 163
a0e90145
JB
164cpp_err_symbols.c: cpp_err_symbols.in
165 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
593d151f
JB
166 cpp_err_symbols.tmp
167 mv cpp_err_symbols.tmp cpp_err_symbols.c
ee78fbb0 168
a0e90145
JB
169cpp_sig_symbols.c: cpp_sig_symbols.in
170 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
593d151f
JB
171 cpp_sig_symbols.tmp
172 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
67ec3667 173
a0e90145 174## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
67ec3667
GH
175## macros defined on this platform.
176check_signals:
177 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
178 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
a0e90145
JB
179 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
180 | egrep '^\+S' \
67ec3667
GH
181 | cut -c2- > cpp_sig_symbols_diff
182 if test -s cpp_sig_symbols_diff ; then \
a0e90145 183 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
67ec3667
GH
184 | sort > cpp_sig_symbols_new ;\
185 echo "cpp_sig_symbols_new has the following additions:" ;\
186 cat cpp_sig_symbols_diff ;\
187 else echo "No new symbols found."; \
188 fi
189
a0e90145 190## Likewise for cpp_err_symbols.in.
67ec3667
GH
191check_errnos:
192 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
193 | cut -f2 -d' ' | sort > cpp_err_symbols_here
a0e90145
JB
194 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
195 | egrep '^\+E' \
67ec3667
GH
196 | cut -c2- > cpp_err_symbols_diff
197 if test -s cpp_err_symbols_diff ; then \
a0e90145 198 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
67ec3667
GH
199 | sort > cpp_err_symbols_new ;\
200 echo "cpp_err_symbols_new has the following additions:" ;\
201 cat cpp_err_symbols_diff ;\
202 else echo "No new symbols found."; \
203 fi
204
ad6b30a0
TP
205MOSTLYCLEANFILES = \
206 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
67ec3667 207 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
ad6b30a0 208
553bb641 209CLEANFILES = libpath.h
ad6b30a0
TP
210
211DISTCLEANFILES = *.x
212