CLEANFILES += libtool libtoolize libtoolize.tmp \
$(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
-edit = sed \
- -e 's,@EGREP\@,$(EGREP),g' \
- -e 's,@FGREP\@,$(FGREP),g' \
- -e 's,@GREP\@,$(GREP),g' \
- -e 's,@LN_S\@,$(LN_S),g' \
- -e 's,@MACRO_VERSION\@,$(VERSION),g' \
- -e 's,@PACKAGE\@,$(PACKAGE),g' \
- -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
- -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
- -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
- -e 's,@PACKAGE_STRING\@,$(PACKAGE_NAME) $(VERSION),g' \
- -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
- -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
- -e 's,@SED\@,$(SED),g' \
- -e 's,@VERSION\@,$(VERSION),g' \
- -e 's,@aclocaldir\@,$(aclocaldir),g' \
- -e 's,@datadir\@,$(datadir),g' \
- -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
- -e 's,@host_triplet\@,$(host_triplet),g' \
- -e 's,@prefix\@,$(prefix),g'
+## These are the replacements that need to be made at bootstrap time,
+## because they must be static in distributed files, and not accidentally
+## changed by configure running on the build machine.
+bootstrap_edit = sed \
+ -e 's,@MACRO_VERSION\@,$(VERSION),g' \
+ -e "s,@MACRO_REVISION\@,$$correctver,g" \
+ -e "s,@MACRO_SERIAL\@,$$serial,g" \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
+ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
+ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
+ -e "s,@package_revision\@,$$correctver,g" \
+ -e 's,@PACKAGE_STRING\@,$(PACKAGE_NAME) $(VERSION),g' \
+ -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
+ -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
+ -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
+ -e 's,@VERSION\@,$(VERSION),g'
## We build ltversion.m4 here, instead of from config.status,
## because config.status is rerun each time one of configure's
cd $(srcdir); \
rm -f $(m4dir)/ltversion.tmp; \
serial=`echo "$$correctver" | sed 's,^1[.],,g'`; \
- echo $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
- -e "s,@MACRO_SERIAL\@,$$serial,g" \
+ echo $(bootstrap_edit) \
$(srcdir)/$(m4dir)/ltversion.in \> $(srcdir)/$(m4dir)/ltversion.m4; \
- $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
- -e "s,@MACRO_SERIAL\@,$$serial,g" \
+ $(bootstrap_edit) \
$(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \
chmod a-w $(m4dir)/ltversion.tmp; \
mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4; \
\> $(auxdir)/ltmain.in; \
$(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
> $(auxdir)/ltmain.in; \
- echo $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
- -e "s,@package_revision\@,$$correctver," \
+ echo $(bootstrap_edit) \
$(srcdir)/$(auxdir)/ltmain.in "> $$target"; \
- $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
- -e "s,@package_revision\@,$$1,g" \
+ $(bootstrap_edit) \
$(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \
rm -f $(auxdir)/ltmain.in; \
chmod a-w $(auxdir)/ltmain.tmp; \
EXTRA_DIST += libtoolize.m4sh
$(srcdir)/libtoolize.in: $(sh_files) libtoolize.m4sh Makefile.am
cd $(srcdir); \
- rm -f libtoolize.in; \
- $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in
+ rm -f libtoolize.in libtoolize.tmp; \
+ $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.tmp; \
+ $(bootstrap_edit) libtoolize.tmp > libtoolize.in; \
+ rm -f libtoolize.tmp
$(srcdir)/libltdl/Makefile.am: $(srcdir)/libltdl/Makefile.inc
cd $(srcdir); \
## Libtool scripts. ##
## ---------------- ##
+configure_edit = sed \
+ -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \
+ -e 's,@aclocaldir\@,$(aclocaldir),g' \
+ -e 's,@datadir\@,$(datadir),g' \
+ -e 's,@EGREP\@,$(EGREP),g' \
+ -e 's,@FGREP\@,$(FGREP),g' \
+ -e 's,@GREP\@,$(GREP),g' \
+ -e 's,@host_triplet\@,$(host_triplet),g' \
+ -e 's,@LN_S\@,$(LN_S),g' \
+ -e "s,@pkgconfig_files\@,$(auxfiles),g" \
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
+ -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@SED\@,$(SED),g'
+
# The libtool distributor and the standalone libtool script.
bin_SCRIPTS = libtoolize libtool
libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
rm -f libtoolize.tmp libtoolize
- $(timestamp); \
- $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
- -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \
- -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \
- -e "s,@pkgconfig_files\@,$(auxfiles),g" \
+ $(configure_edit) \
$(srcdir)/libtoolize.in > libtoolize.tmp
chmod a+x libtoolize.tmp
chmod a-w libtoolize.tmp
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
echo 'm4_define([AT_PACKAGE_URL], [@PACKAGE_URL@])'; \
- } | $(edit) > $(srcdir)/tests/package.m4
+ } | $(bootstrap_edit) > $(srcdir)/tests/package.m4
tests/atconfig: $(top_builddir)/config.status
$(SHELL) ./config.status tests/atconfig
check-recursive: tests/defs
tests/defs: $(srcdir)/tests/defs.in
rm -f tests/defs.tmp tests/defs; \
- $(edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
+ $(configure_edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
mv -f tests/defs.tmp tests/defs
# Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is