summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-22 20:12:52 (GMT)
committerBruno Haible <bruno@clisp.org>2019-12-22 20:12:52 (GMT)
commitfacdea659083095a6ec8bcc7aa322f683898739b (patch)
treec964ba71f13835cbac3b19cea1001d0f1072a230
parente741a0f18c571a20c0bc86c5bbfd6bb565ac44f7 (diff)
downloadlibunistring-facdea659083095a6ec8bcc7aa322f683898739b.tar.gz
build: Don't erase the .sym file if 'sed' is not GNU sed.
* lib/Makefile.am (libunistring.sym): Test the exit status of the declared.sh command. Preserve the existing libunistring.sym if it failed.
-rw-r--r--ChangeLog7
-rw-r--r--lib/Makefile.am26
2 files changed, 24 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c52f289..ca1ca30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-12-22 Bruno Haible <bruno@clisp.org>
+ build: Don't erase the .sym file if 'sed' is not GNU sed.
+ * lib/Makefile.am (libunistring.sym): Test the exit status of the
+ declared.sh command. Preserve the existing libunistring.sym if it
+ failed.
+
+2019-12-22 Bruno Haible <bruno@clisp.org>
+
build: Update after gnulib changed.
* lib/Makefile.am (libunistring.sym): Don't rename the
gl_get_setlocale_null_lock function.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index aa32f57..3798a0a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -242,16 +242,24 @@ HEADERS_WITH_EXTERNS = \
# '-export-symbols', but we don't use this option, because it would prevent us
# from building some of the gnulib unit tests.
$(srcdir)/libunistring.sym : $(HEADERS_WITH_EXTERNS)
- for f in $(HEADERS_WITH_EXTERNS); do \
- if test -f $$f; then \
- cat $$f; \
+ if \
+ for f in $(HEADERS_WITH_EXTERNS); do \
+ if test -f $$f; then \
+ cat $$f; \
+ else \
+ cat $(srcdir)/$$f; \
+ fi; \
+ done \
+ | $(srcdir)/declared.sh > $@-t1; \
+ then \
+ LC_ALL=C sort < $@-t1 | LC_ALL=C uniq > $@-t2 && mv $@-t2 $@; \
+ else \
+ if test -f $@; then \
+ echo "Continuing with existing libunistring.sym."; \
else \
- cat $(srcdir)/$$f; \
+ exit 1; \
fi; \
- done \
- | $(srcdir)/declared.sh | LC_ALL=C sort | LC_ALL=C uniq \
- > $@-t
- mv $@-t $@
+ fi
# We distribute it because declared.sh relies on GNU sed.
# The GNU Coding Standards say in
# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
@@ -261,7 +269,7 @@ $(srcdir)/libunistring.sym : $(HEADERS_WITH_EXTERNS)
# So Makefile rules to update them should put the updated files in the
# source directory."
# Therefore we put this file in the source directory, not the build directory.
-MOSTLYCLEANFILES += libunistring.sym-t
+MOSTLYCLEANFILES += libunistring.sym-t1 libunistring.sym-t2
MAINTAINERCLEANFILES += libunistring.sym
EXTRA_DIST += libunistring.sym declared.sh