summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-04-06 23:47:27 +0200
committerBruno Haible <bruno@clisp.org>2021-04-07 01:32:16 +0200
commitca45f9feb81f5c3eb8aeecb4902e3a828c216767 (patch)
tree32ddb540852967edbb79ec767b2b749f9ca60b1c
parentd508c957535ea48bf1dcd29c9ddbae4c35e2f235 (diff)
downloadlibunistring-ca45f9feb81f5c3eb8aeecb4902e3a828c216767.tar.gz
build: Fix the set of exported symbols on Alpine Linux.
* build-aux/join-v-1: New file. * Makefile.am (EXTRA_DIST): Add it. * lib/Makefile.am (config.h): Use it instead of 'join -v 1'.
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.am4
-rwxr-xr-xbuild-aux/join-v-143
-rw-r--r--lib/Makefile.am4
4 files changed, 54 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e94815e..c807132 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-04-06 Bruno Haible <bruno@clisp.org>
+
+ build: Fix the set of exported symbols on Alpine Linux.
+ * build-aux/join-v-1: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+ * lib/Makefile.am (config.h): Use it instead of 'join -v 1'.
+
2021-02-28 Bruno Haible <bruno@clisp.org>
Update DEPENDENCIES.
diff --git a/Makefile.am b/Makefile.am
index fdc3e68..2fdb9c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
## Makefile for the toplevel directory of GNU libunistring.
-## Copyright (C) 2009, 2016, 2018 Free Software Foundation, Inc.
+## Copyright (C) 2009, 2016, 2018, 2021 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ SUBDIRS = doc gnulib-local lib tests
EXTRA_DIST = \
version.sh BUGS DEPENDENCIES HACKING autogen.sh \
- build-aux/texi2html build-aux/run-test
+ build-aux/join-v-1 build-aux/texi2html build-aux/run-test
# Allow users to use "gnulib-tool --update".
diff --git a/build-aux/join-v-1 b/build-aux/join-v-1
new file mode 100755
index 0000000..d1948ac
--- /dev/null
+++ b/build-aux/join-v-1
@@ -0,0 +1,43 @@
+#!/bin/sh
+# join-v-1 - Filter out a set of items from another set of items.
+
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# Usage: join-v-1 FILE1 FILE2
+# Produces on stdout a list of items that are contained in FILE1 but not
+# contained in FILE2. The items are strings without whitespace.
+# FILE1 and FILE2 contain such items, one per line, sorted according to
+# the current locale.
+# FILE1 or FILE2 can be specified as '-', which denotes standard input.
+
+# The 'join' program does not exist on all platforms. Where it exists,
+# we can use it.
+if (type join) >/dev/null 2>&1; then
+ join -v 1 "$1" "$2"
+else
+ # Two solutions based on awk, by Bernhard Voelker <mail@bernhard-voelker.de>.
+ if true; then
+ awk -v keyfile="$2" '
+ BEGIN { while ((getline < keyfile) > 0) k[$1]=1 }
+ !k[$1]
+ ' "$1"
+ else
+ awk '
+ keys { k[$1]=1; next }
+ !k[$1]
+ ' keys=1 "$2" keys=0 "$1"
+ fi
+fi
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6136ced..3ed6230 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,5 @@
## Makefile for the lib subdirectory of GNU libunistring.
-## Copyright (C) 2009-2019 Free Software Foundation, Inc.
+## Copyright (C) 2009-2021 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -303,7 +303,7 @@ config.h: $(BUILT_SOURCES) $(srcdir)/libunistring.sym
done; \
} 5>&1 1>&2 \
| sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \
- | LC_ALL=C join -v 1 - $(srcdir)/libunistring.sym \
+ | LC_ALL=C $(top_srcdir)/build-aux/join-v-1 - $(srcdir)/libunistring.sym \
| grep -v '^libintl_locale' \
| grep -v 'gl_get_setlocale_null_lock' \
| sed -e 's,^\(.*\)$$,#define \1 libunistring_\1,' > config.h-t; \