diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/Makefile.am | 26 |
2 files changed, 24 insertions, 9 deletions
@@ -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 |