summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-02-03 20:52:52 (GMT)
committerBruno Haible <bruno@clisp.org>2019-02-03 20:59:33 (GMT)
commit2809191828fb91fe7440814da363f6325c718234 (patch)
tree6453933bc408d3b57b013375a6e4fb00ac8e6a33
parent88da35931723a83a4eeb5e5781f57b6d1c7a3b85 (diff)
downloadlibunistring-2809191828fb91fe7440814da363f6325c718234.tar.gz
Move declared.sh to gnulib.
-rw-r--r--ChangeLog5
-rwxr-xr-xautogen.sh5
-rw-r--r--lib/.gitignore1
-rwxr-xr-xlib/declared.sh135
4 files changed, 9 insertions, 137 deletions
diff --git a/ChangeLog b/ChangeLog
index de891ae..2920a3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-03 Bruno Haible <bruno@clisp.org>
+
+ Move declared.sh to gnulib.
+ * autogen.sh: Copy lib/declared.sh from gnulib.
+
2019-01-28 Bruno Haible <bruno@clisp.org>
Accommodate a shell that is not in /bin/sh.
diff --git a/autogen.sh b/autogen.sh
index 7d284bc..f8b2fe3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -12,7 +12,7 @@
# It also requires
# - the gperf program.
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2019 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
@@ -442,7 +442,7 @@ if test $skip_gnulib = false; then
< lib/unistr.in.h \
> lib/unistr.in.h.tmp \
&& mv lib/unistr.in.h.tmp lib/unistr.in.h
- # Change lib/unictype.h and lib/uninorm.h for shared libraries on Woe32 systems.
+ # Change lib/unictype.h, lib/uninorm.h, lib/unicase.h for shared libraries on Woe32 systems.
sed -e 's/extern const uc_general_category_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_/' \
-e 's/extern const uc_property_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_/' \
< lib/unictype.in.h \
@@ -458,6 +458,7 @@ if test $skip_gnulib = false; then
&& mv lib/unicase.in.h.tmp lib/unicase.in.h
$GNULIB_TOOL --copy-file build-aux/config.guess; chmod a+x build-aux/config.guess
$GNULIB_TOOL --copy-file build-aux/config.sub; chmod a+x build-aux/config.sub
+ $GNULIB_TOOL --copy-file build-aux/declared.sh lib/declared.sh; chmod a+x lib/declared.sh
$GNULIB_TOOL --copy-file build-aux/test-driver.diff
# If we got no texinfo.tex so far, take the snapshot from gnulib.
if test ! -f build-aux/texinfo.tex; then
diff --git a/lib/.gitignore b/lib/.gitignore
index 8652f5f..d47952d 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -14,6 +14,7 @@
/c-strcaseeq.h
/c-strncasecmp.c
/config.charset
+/declared.sh
/errno.in.h
/flexmember.h
/float+.h
diff --git a/lib/declared.sh b/lib/declared.sh
deleted file mode 100755
index 293939f..0000000
--- a/lib/declared.sh
+++ /dev/null
@@ -1,135 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2006-2018 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/>.
-#
-
-# This script determines the declared global symbols in a C header file.
-# Assumptions:
-# - The header files are in C, with only C89 comments.
-# - No use of macros with parameters.
-# - All global declarations are marked with 'extern'.
-# - All declarations end in ';' on the same line.
-# - Not more than one symbol is declared in a declaration.
-
-# func_usage
-# outputs to stdout the --help usage message.
-func_usage ()
-{
- echo "\
-Usage: declared.sh [OPTION]... < SOURCE.h
-
-Extracts the declared global symbols of a C header file.
-
-Options:
- --help print this help and exit
- --version print version information and exit
-
-Report bugs to <bruno@clisp.org>."
-}
-
-# func_version
-# outputs to stdout the --version message.
-func_version ()
-{
- echo "declared.sh (GNU libunistring)"
- echo "Copyright (C) 2006-2018 Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law."
- echo "Written by" "Bruno Haible"
-}
-
-# func_fatal_error message
-# outputs to stderr a fatal error message, and terminates the program.
-func_fatal_error ()
-{
- echo "declared.sh: *** $1" 1>&2
- echo "declared.sh: *** Stop." 1>&2
- exit 1
-}
-
-# Command-line option processing.
-while test $# -gt 0; do
- case "$1" in
- --help | --hel | --he | --h )
- func_usage
- exit 0 ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v )
- func_version
- exit 0 ;;
- -- ) # Stop option prcessing
- shift; break ;;
- -* )
- func_fatal_error "unrecognized option: $option"
- ;;
- * )
- break ;;
- esac
-done
-
-if test $# -gt 0; then
- func_fatal_error "too many arguments"
-fi
-
-# A sed expression that removes ANSI C and ISO C99 comments.
-sed_remove_comments="
-/[/][/*]/{
- ta
- :a
- s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)//.*,\\1,
- te
- s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)/[*]\\([^*]\\|[*][^/*]\\)*[*][*]*/,\\1 ,
- ta
- /^\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*[/][*]/{
- s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)/[*].*,\\1 ,
- tu
- :u
- n
- s,^\\([^*]\\|[*][^/*]\\)*[*][*]*/,,
- tv
- s,^.*\$,,
- bu
- :v
- }
- :e
-}"
-
-# Check that 'sed' supports the kind of regular expressions used in
-# sed_remove_comments. The use of \| meaning alternation of basic regular
-# expressions is a GNU extension.
-sed_test='s,^\(\(a\|X\)*\)//.*,\1,'
-sed_result=`echo 'aaa//bcd' | sed -e "$sed_test"`
-test "$sed_result" = 'aaa' \
- || func_fatal_error "The 'sed' program is not GNU sed. Try installing GNU sed."
-
-# A sed expression that joins 'extern' declarations that are broken over
-# several lines.
-sed_join_multiline_externs='
-/^extern [^;]*$/{
- :a
- N
- s/\n/ /g
- /^extern [^;]*$/{
- ba
- }
-}'
-
-# A sed expression that extracts the identifier of each 'extern' declaration.
-sed_extract_extern_declared='s/^extern [^()]* \([A-Za-z_][A-Za-z0-9_]*\) *[;(].*$/\1/p'
-
-sed -e "$sed_remove_comments" \
- | sed -e "$sed_join_multiline_externs" \
- | sed -n -e "$sed_extract_extern_declared"