build: Use pipe symbol instead of comma for substitutions.
[bpt/guile.git] / meta / Makefile.am
CommitLineData
2764bd99
JB
1## Process this file with Automake to create Makefile.in
2## Jim Blandy <jimb@red-bean.com> --- September 1997
3##
9331f40a
MW
4## Copyright (C) 1998, 1999, 2001, 2006-2009, 2011-2015
5## Free Software Foundation, Inc.
2764bd99
JB
6##
7## This file is part of GUILE.
8##
53befeb7
NJ
9## GUILE is free software; you can redistribute it and/or modify it
10## under the terms of the GNU Lesser General Public License as
11## published by the Free Software Foundation; either version 3, or
2764bd99
JB
12## (at your option) any later version.
13##
14## GUILE is distributed in the hope that it will be useful, but
15## WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53befeb7 17## GNU Lesser General Public License for more details.
2764bd99 18##
53befeb7
NJ
19## You should have received a copy of the GNU Lesser General Public
20## License along with GUILE; see the file COPYING.LESSER. If not,
21## write to the Free Software Foundation, Inc., 51 Franklin Street,
22## Fifth Floor, Boston, MA 02110-1301 USA
9a56cb24 23
b8b06598 24bin_SCRIPTS = guile-config guild
12dfe656
AW
25EXTRA_DIST= \
26 guile.m4 ChangeLog-2008 \
27 guile-$(GUILE_EFFECTIVE_VERSION).pc.in \
28 guile-$(GUILE_EFFECTIVE_VERSION)-uninstalled.pc.in \
b8b06598
AW
29 guild.in guile-config.in
30
31# What we now call `guild' used to be known as `guile-tools'.
068adc19 32install-exec-hook:
3742d778 33 guild="`echo $(ECHO_N) guild \
dac5e649 34 | $(SED) -e '$(program_transform_name)'`" ; \
3742d778 35 guile_tools="`echo $(ECHO_N) guile-tools \
dac5e649 36 | $(SED) -e '$(program_transform_name)'`" ; \
3742d778
LC
37 cd $(DESTDIR)$(bindir) && rm -f "$$guile_tools" && \
38 $(LN_S) "$$guild" "$$guile_tools"
0b6d8fdc
AW
39
40pkgconfigdir = $(libdir)/pkgconfig
12dfe656 41pkgconfig_DATA = guile-$(GUILE_EFFECTIVE_VERSION).pc
9a56cb24 42
2b9fe19f
JB
43## FIXME: in the future there will be direct automake support for
44## doing this. When that happens, switch over.
45aclocaldir = $(datadir)/aclocal
46aclocal_DATA = guile.m4
297273e4 47
5fac1a7a
LC
48# Script to instantiate substitution variables found on the standard
49# input. We do this from the Makefile because we need things like
50# $(program_transform_name), which are not usable from 'configure.ac'.
9331f40a
MW
51#
52# Some of these may include things like "-Wl,-rpath", which is why we do
53# not use a comma to separate the 's' arguments.
7c433cbb
LC
54substitute = \
55 guile="`echo guile | $(SED) -e '$(program_transform_name)'`" ; \
56 guild="`echo guild | $(SED) -e '$(program_transform_name)'`" ; \
57 installed_guile="@bindir@/$$guile" ; \
9331f40a
MW
58 $(SED) -e "s|[@]PACKAGE_NAME[@]|$(PACKAGE_NAME)|g" \
59 -e "s|[@]PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g" \
60 -e "s|[@]GUILE_EFFECTIVE_VERSION[@]|$(GUILE_EFFECTIVE_VERSION)|g" \
61 -e "s|[@]GUILE_VERSION[@]|$(GUILE_VERSION)|g" \
62 -e "s|[@]GUILE_CFLAGS[@]|$(GUILE_CFLAGS)|g" \
63 -e "s|[@]GUILE_LIBS[@]|$(GUILE_LIBS)|g" \
64 -e "s|[@]LIBGUILE_INTERFACE[@]|$(LIBGUILE_INTERFACE)|g" \
7c433cbb 65 $(dependency_substitutions) \
9331f40a
MW
66 -e "s|[@]PKG_CONFIG[@]|$(PKG_CONFIG)|g" \
67 -e "s|[@]pkgconfigdir[@]|$(pkgconfigdir)|g" \
68 -e "s|[@]prefix[@]|$(prefix)|g" \
69 -e "s|[@]exec_prefix[@]|$(exec_prefix)|g" \
70 -e "s|[@]bindir[@]|$(bindir)|g" \
71 -e "s|[@]libdir[@]|$(libdir)|g" \
72 -e "s|[@]includedir[@]|$(includedir)|g" \
73 -e "s|[@]datarootdir[@]|$(datarootdir)|g" \
74 -e "s|[@]datadir[@]|$(datadir)|g" \
75 -e "s|[@]sitedir[@]|$(sitedir)|g" \
76 -e "s|[@]guile[@]|$$guile|g" \
77 -e "s|[@]guild[@]|$$guild|g" \
78 -e "s|[@]installed_guile[@]|$$installed_guile|g"
5fac1a7a 79
7c433cbb
LC
80# Substitutions for dependencies that appear in 'guile-2.0.pc'.
81dependency_substitutions = \
47ca15c7
LC
82 -e "s|[@]BDW_GC_CFLAGS[@]|$(BDW_GC_CFLAGS)|g" \
83 -e "s|[@]BDW_GC_LIBS[@]|$(BDW_GC_LIBS)|g" \
84 -e "s|[@]LIB_CLOCK_GETTIME[@]|$(LIB_CLOCK_GETTIME)|g" \
85 -e "s|[@]LIBGMP[@]|$(LIBGMP)|g" \
86 -e "s|[@]LIBLTDL[@]|$(LIBLTDL)|g" \
87 -e "s|[@]LIBFFI_LIBS[@]|$(LIBFFI_LIBS)|g" \
88 -e "s|[@]LIBUNISTRING[@]|$(LIBUNISTRING)|g" \
89 -e "s|[@]LIBICONV[@]|$(LIBICONV)|g" \
90 -e "s|[@]LIBINTL[@]|$(LIBINTL)|g" \
91 -e "s|[@]LIBSOCKET[@]|$(LIBSOCKET)|g" \
92 -e "s|[@]SERVENT_LIB[@]|$(SERVENT_LIB)|g" \
93 -e "s|[@]HOSTENT_LIB[@]|$(HOSTENT_LIB)|g" \
94 -e "s|[@]GETADDRINFO_LIB[@]|$(GETADDRINFO_LIB)|g" \
95 -e "s|[@]INET_NTOP_LIB[@]|$(INET_NTOP_LIB)|g" \
96 -e "s|[@]INET_PTON_LIB[@]|$(INET_PTON_LIB)|g"
7c433cbb 97
12dfe656 98guile-$(GUILE_EFFECTIVE_VERSION).pc: guile-$(GUILE_EFFECTIVE_VERSION).pc.in
5fac1a7a
LC
99 $(substitute) < "$<" > "$@.out"
100 mv "$@.out" "$@"
101
12dfe656 102guile-$(GUILE_EFFECTIVE_VERSION)-uninstalled.pc: guile-$(GUILE_EFFECTIVE_VERSION)-uninstalled.pc.in
5fac1a7a
LC
103 $(substitute) < "$<" > "$@.out"
104 mv "$@.out" "$@"
105
31c94422 106guile-config: $(srcdir)/guile-config.in $(top_builddir)/config.status
5fac1a7a 107 $(substitute) < "$<" > "$@.out"
7a85f2b6
LC
108 chmod +x "$@.out"
109 mv "$@.out" "$@"
a16eda7a 110
d80b6acf 111guild: $(srcdir)/guild.in $(top_builddir)/config.status
5fac1a7a 112 $(substitute) < "$<" > "$@.out"
d80b6acf
LC
113 chmod +x "$@.out"
114 mv "$@.out" "$@"
115
5fac1a7a
LC
116CLEANFILES = \
117 guile-config guild \
12dfe656 118 guile-$(GUILE_EFFECTIVE_VERSION).pc guile-$(GUILE_EFFECTIVE_VERSION)-uninstalled.pc