summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in15
-rw-r--r--aclocal.m472
-rwxr-xr-xbuild-aux/ar-lib23
-rwxr-xr-xbuild-aux/compile35
-rwxr-xr-xbuild-aux/config.guess11
-rwxr-xr-xbuild-aux/config.sub729
-rwxr-xr-xbuild-aux/depcomp8
-rwxr-xr-xbuild-aux/install-sh6
-rwxr-xr-xbuild-aux/ltmain.sh736
-rwxr-xr-xbuild-aux/missing8
-rwxr-xr-xbuild-aux/test-driver37
-rwxr-xr-xconfigure1963
-rw-r--r--configure.ac7
-rw-r--r--doc/api.rst43
-rw-r--r--doc/changelog.rst58
-rw-r--r--doc/inline_clist.rst2
-rw-r--r--doc/inline_list.rst2
-rw-r--r--doc/misc_functions.rst2
-rw-r--r--doc/option_parsing.rst326
-rw-r--r--doc/string_ops.rst74
-rw-r--r--include/Makefile.in5
-rw-r--r--include/libHX/defs.h4
-rw-r--r--include/libHX/deque.h38
-rw-r--r--include/libHX/io.h2
-rw-r--r--include/libHX/list.h8
-rw-r--r--include/libHX/map.h4
-rw-r--r--include/libHX/misc.h12
-rw-r--r--include/libHX/option.h90
-rw-r--r--include/libHX/string.h22
-rw-r--r--m4/gcc4_visibility.m421
-rw-r--r--m4/libtool.m4461
-rw-r--r--m4/ltoptions.m4106
-rw-r--r--m4/ltsugar.m42
-rw-r--r--m4/ltversion.m412
-rw-r--r--m4/lt~obsolete.m42
-rw-r--r--src/Makefile.am8
-rw-r--r--src/Makefile.in56
-rw-r--r--src/deque.c52
-rw-r--r--src/format.c38
-rw-r--r--src/internal.h2
-rw-r--r--src/io.c34
-rw-r--r--src/libHX.map58
-rw-r--r--src/map_int.h3
-rw-r--r--src/misc.c14
-rw-r--r--src/opt.c299
-rw-r--r--src/string.c370
-rw-r--r--src/tc-list.c2
-rw-r--r--src/tc-map.c22
-rw-r--r--src/tc-option.c207
-rw-r--r--src/tc-realpath.c52
-rw-r--r--src/tc-string.c68
-rw-r--r--src/tc-strquote.c5
-rw-r--r--src/tc-switchuser.c19
-rw-r--r--src/tc-time.c1
-rw-r--r--src/tx-option.cpp21
55 files changed, 4222 insertions, 2055 deletions
diff --git a/Makefile.in b/Makefile.in
index 0d47770..1e77c09 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.17 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2024 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -575,6 +575,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -650,6 +651,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
+dist-bzip3: distdir
+ tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3
+ $(am__post_remove_distdir)
+
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
@@ -694,6 +699,8 @@ distcheck: dist
eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.bz3*) \
+ bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
@@ -885,8 +892,8 @@ uninstall-am: uninstall-pkgconfigDATA
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
- dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
- dist-xz dist-zip dist-zstd distcheck distclean \
+ dist-all dist-bzip2 dist-bzip3 dist-gzip dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
diff --git a/aclocal.m4 b/aclocal.m4
index 10af86b..63f7b9d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.17 -*- Autoconf -*-
+# generated automatically by aclocal 1.18.1 -*- Autoconf -*-
-# Copyright (C) 1996-2024 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2024 Free Software Foundation, Inc.
+# Copyright (C) 2002-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.17'
+[am__api_version='1.18'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.17], [],
+m4_if([$1], [1.18.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.17])dnl
+[AM_AUTOMAKE_VERSION([1.18.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-# Copyright (C) 2011-2024 Free Software Foundation, Inc.
+# Copyright (C) 2011-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -120,7 +120,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -172,7 +172,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2024 Free Software Foundation, Inc.
+# Copyright (C) 1997-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -203,7 +203,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2024 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -394,7 +394,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2024 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -462,7 +462,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2024 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -562,8 +562,9 @@ AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])],
+ [_AM_PROG_TAR([ustar])])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
@@ -597,6 +598,7 @@ fi
AC_SUBST([CSCOPE])
AC_REQUIRE([_AM_SILENT_RULES])dnl
+AM_SILENT_RULES([yes])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
@@ -607,7 +609,6 @@ AC_CONFIG_COMMANDS_PRE(dnl
AC_REQUIRE([_AM_PROG_RM_F])
AC_REQUIRE([_AM_PROG_XARGS_N])
-AM_SILENT_RULES([yes])
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
@@ -640,7 +641,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -661,7 +662,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2024 Free Software Foundation, Inc.
+# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -682,7 +683,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -725,7 +726,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2024 Free Software Foundation, Inc.
+# Copyright (C) 1997-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -759,7 +760,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -788,7 +789,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2024 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -820,7 +821,10 @@ AC_CACHE_CHECK(
break
fi
done
- rm -f core conftest*
+ # aligned with autoconf, so not including core; see bug#72225.
+ rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \
+ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \
+ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
@@ -835,7 +839,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+# Copyright (C) 2022-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -851,7 +855,7 @@ AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
AC_SUBST(am__rm_f_notfound)
])
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -870,7 +874,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2024 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1039,10 +1043,12 @@ am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
@@ -1095,7 +1101,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2024 Free Software Foundation, Inc.
+# Copyright (C) 2009-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1164,9 +1170,13 @@ fi
# empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_REQUIRE([_AM_SILENT_RULES])
-AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
+AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline
+dnl We intentionally force a newline after the assignment, since a) nothing
+dnl good can come of more text following, and b) that was the behavior
+dnl before 1.17. See https://bugs.gnu.org/72267.
+])
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1194,7 +1204,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2024 Free Software Foundation, Inc.
+# Copyright (C) 2006-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1213,7 +1223,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2024 Free Software Foundation, Inc.
+# Copyright (C) 2004-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1348,7 +1358,7 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+# Copyright (C) 2022-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/build-aux/ar-lib b/build-aux/ar-lib
index 1521987..d0a7b5c 100755
--- a/build-aux/ar-lib
+++ b/build-aux/ar-lib
@@ -2,9 +2,9 @@
# Wrapper for Microsoft lib.exe
me=ar-lib
-scriptversion=2024-06-19.01; # UTC
+scriptversion=2025-02-03.05; # UTC
-# Copyright (C) 2010-2024 Free Software Foundation, Inc.
+# Copyright (C) 2010-2025 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
@@ -51,9 +51,20 @@ func_file_conv ()
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
- file_conv=mingw
+ if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
+ # MSYS2 environment.
+ file_conv=cygwin
+ else
+ # Original MinGW environment.
+ file_conv=mingw
+ fi
;;
- CYGWIN* | MSYS*)
+ MSYS*)
+ # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
+ file_conv=cygwin
+ ;;
+ CYGWIN*)
+ # Cygwin environment.
file_conv=cygwin
;;
*)
@@ -65,8 +76,8 @@ func_file_conv ()
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin | msys)
- file=`cygpath -m "$file" || echo "$file"`
+ cygwin)
+ file=`cygpath -w "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
diff --git a/build-aux/compile b/build-aux/compile
index 49b3d05..02ff093 100755
--- a/build-aux/compile
+++ b/build-aux/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2024-06-19.01; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 1999-2024 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -37,11 +37,11 @@ IFS=" "" $nl"
file_conv=
-# func_file_conv build_file lazy
+# func_file_conv build_file unneeded_conversions
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
+# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
+# conversion will take place.
func_file_conv ()
{
file=$1
@@ -51,9 +51,20 @@ func_file_conv ()
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
- file_conv=mingw
+ if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
+ # MSYS2 environment.
+ file_conv=cygwin
+ else
+ # Original MinGW environment.
+ file_conv=mingw
+ fi
;;
- CYGWIN* | MSYS*)
+ MSYS*)
+ # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
+ file_conv=cygwin
+ ;;
+ CYGWIN*)
+ # Cygwin environment.
file_conv=cygwin
;;
*)
@@ -63,12 +74,14 @@ func_file_conv ()
fi
case $file_conv/,$2, in
*,$file_conv,*)
+ # This is the optimization mentioned above:
+ # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/* | msys/*)
- file=`cygpath -m "$file" || echo "$file"`
+ cygwin/*)
+ file=`cygpath -w "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
@@ -343,9 +356,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 67f9aa0..6116f18 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -4,7 +4,7 @@
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2024-01-01'
+timestamp='2024-07-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -123,7 +123,7 @@ set_cc_for_build() {
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
- for driver in cc gcc c89 c99 ; do
+ for driver in cc gcc c17 c99 c89 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
@@ -645,7 +645,8 @@ EOF
sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
- main()
+ int
+ main ()
{
if (!__power_pc())
exit(1);
@@ -729,7 +730,8 @@ EOF
#include <stdlib.h>
#include <unistd.h>
- int main ()
+ int
+ main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
@@ -1632,6 +1634,7 @@ cat > "$dummy.c" <<EOF
#endif
#endif
#endif
+int
main ()
{
#if defined (sony)
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 2c6a07a..4aaae46 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,9 +2,9 @@
# Configuration validation subroutine script.
# Copyright 1992-2024 Free Software Foundation, Inc.
-# shellcheck disable=SC2006,SC2268 # see below for rationale
+# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale
-timestamp='2024-01-01'
+timestamp='2024-05-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -120,7 +120,6 @@ case $# in
esac
# Split fields of configuration type
-# shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF
$1
@@ -142,10 +141,20 @@ case $1 in
# parts
maybe_os=$field2-$field3
case $maybe_os in
- nto-qnx* | linux-* | uclinux-uclibc* \
- | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
- | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
- | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
+ cloudabi*-eabi* \
+ | kfreebsd*-gnu* \
+ | knetbsd*-gnu* \
+ | kopensolaris*-gnu* \
+ | linux-* \
+ | managarm-* \
+ | netbsd*-eabi* \
+ | netbsd*-gnu* \
+ | nto-qnx* \
+ | os2-emx* \
+ | rtmk-nova* \
+ | storm-chaos* \
+ | uclinux-gnu* \
+ | uclinux-uclibc* \
| windows-* )
basic_machine=$field1
basic_os=$maybe_os
@@ -161,8 +170,12 @@ case $1 in
esac
;;
*-*)
- # A lone config we happen to match not fitting any pattern
case $field1-$field2 in
+ # Shorthands that happen to contain a single dash
+ convex-c[12] | convex-c3[248])
+ basic_machine=$field2-convex
+ basic_os=
+ ;;
decstation-3100)
basic_machine=mips-dec
basic_os=
@@ -170,28 +183,88 @@ case $1 in
*-*)
# Second component is usually, but not always the OS
case $field2 in
- # Prevent following clause from handling this valid os
+ # Do not treat sunos as a manufacturer
sun*os*)
basic_machine=$field1
basic_os=$field2
;;
- zephyr*)
- basic_machine=$field1-unknown
- basic_os=$field2
- ;;
# Manufacturers
- dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
- | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
- | unicom* | ibm* | next | hp | isi* | apollo | altos* \
- | convergent* | ncr* | news | 32* | 3600* | 3100* \
- | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
- | ultra | tti* | harris | dolphin | highlevel | gould \
- | cbm | ns | masscomp | apple | axis | knuth | cray \
- | microblaze* | sim | cisco \
- | oki | wec | wrs | winbond)
+ 3100* \
+ | 32* \
+ | 3300* \
+ | 3600* \
+ | 7300* \
+ | acorn \
+ | altos* \
+ | apollo \
+ | apple \
+ | atari \
+ | att* \
+ | axis \
+ | be \
+ | bull \
+ | cbm \
+ | ccur \
+ | cisco \
+ | commodore \
+ | convergent* \
+ | convex* \
+ | cray \
+ | crds \
+ | dec* \
+ | delta* \
+ | dg \
+ | digital \
+ | dolphin \
+ | encore* \
+ | gould \
+ | harris \
+ | highlevel \
+ | hitachi* \
+ | hp \
+ | ibm* \
+ | intergraph \
+ | isi* \
+ | knuth \
+ | masscomp \
+ | microblaze* \
+ | mips* \
+ | motorola* \
+ | ncr* \
+ | news \
+ | next \
+ | ns \
+ | oki \
+ | omron* \
+ | pc533* \
+ | rebel \
+ | rom68k \
+ | rombug \
+ | semi \
+ | sequent* \
+ | siemens \
+ | sgi* \
+ | siemens \
+ | sim \
+ | sni \
+ | sony* \
+ | stratus \
+ | sun \
+ | sun[234]* \
+ | tektronix \
+ | tti* \
+ | ultra \
+ | unicom* \
+ | wec \
+ | winbond \
+ | wrs)
basic_machine=$field1-$field2
basic_os=
;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
*)
basic_machine=$field1
basic_os=$field2
@@ -272,26 +345,6 @@ case $1 in
basic_machine=arm-unknown
basic_os=cegcc
;;
- convex-c1)
- basic_machine=c1-convex
- basic_os=bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- basic_os=bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- basic_os=bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- basic_os=bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- basic_os=bsd
- ;;
cray)
basic_machine=j90-cray
basic_os=unicos
@@ -714,15 +767,26 @@ case $basic_machine in
vendor=dec
basic_os=tops20
;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
+ delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300)
cpu=m68k
vendor=motorola
;;
- dpx2*)
+ # This used to be dpx2*, but that gets the RS6000-based
+ # DPX/20 and the x86-based DPX/2-100 wrong. See
+ # https://oldskool.silicium.org/stations/bull_dpx20.htm
+ # https://www.feb-patrimoine.com/english/bull_dpx2.htm
+ # https://www.feb-patrimoine.com/english/unix_and_bull.htm
+ dpx2 | dpx2[23]00 | dpx2[23]xx)
cpu=m68k
vendor=bull
- basic_os=sysv3
+ ;;
+ dpx2100 | dpx21xx)
+ cpu=i386
+ vendor=bull
+ ;;
+ dpx20)
+ cpu=rs6000
+ vendor=bull
;;
encore | umax | mmax)
cpu=ns32k
@@ -837,18 +901,6 @@ case $basic_machine in
next | m*-next)
cpu=m68k
vendor=next
- case $basic_os in
- openstep*)
- ;;
- nextstep*)
- ;;
- ns2*)
- basic_os=nextstep2
- ;;
- *)
- basic_os=nextstep3
- ;;
- esac
;;
np1)
cpu=np1
@@ -937,7 +989,6 @@ case $basic_machine in
;;
*-*)
- # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read cpu vendor <<EOF
$basic_machine
@@ -972,15 +1023,19 @@ unset -v basic_machine
# Decode basic machines in the full and proper CPU-Company form.
case $cpu-$vendor in
- # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
- # some cases the only manufacturer, in others, it is the most popular.
+ # Here we handle the default manufacturer of certain CPU types in canonical form.
+ # It is in some cases the only manufacturer, in others, it is the most popular.
+ c[12]-convex | c[12]-unknown | c3[248]-convex | c3[248]-unknown)
+ vendor=convex
+ basic_os=${basic_os:-bsd}
+ ;;
craynv-unknown)
vendor=cray
basic_os=${basic_os:-unicosmp}
;;
c90-unknown | c90-cray)
vendor=cray
- basic_os=${Basic_os:-unicos}
+ basic_os=${basic_os:-unicos}
;;
fx80-unknown)
vendor=alliant
@@ -1026,11 +1081,29 @@ case $cpu-$vendor in
vendor=alt
basic_os=${basic_os:-linux-gnueabihf}
;;
- dpx20-unknown | dpx20-bull)
- cpu=rs6000
- vendor=bull
+
+ # Normalized CPU+vendor pairs that imply an OS, if not otherwise specified
+ m68k-isi)
+ basic_os=${basic_os:-sysv}
+ ;;
+ m68k-sony)
+ basic_os=${basic_os:-newsos}
+ ;;
+ m68k-tektronix)
+ basic_os=${basic_os:-bsd}
+ ;;
+ m88k-harris)
+ basic_os=${basic_os:-sysv3}
+ ;;
+ i386-bull | m68k-bull)
+ basic_os=${basic_os:-sysv3}
+ ;;
+ rs6000-bull)
basic_os=${basic_os:-bosx}
;;
+ mips-sni)
+ basic_os=${basic_os:-sysv4}
+ ;;
# Here we normalize CPU types irrespective of the vendor
amd64-*)
@@ -1038,7 +1111,7 @@ case $cpu-$vendor in
;;
blackfin-*)
cpu=bfin
- basic_os=linux
+ basic_os=${basic_os:-linux}
;;
c54x-*)
cpu=tic54x
@@ -1061,7 +1134,7 @@ case $cpu-$vendor in
;;
m68knommu-*)
cpu=m68k
- basic_os=linux
+ basic_os=${basic_os:-linux}
;;
m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
cpu=s12z
@@ -1071,7 +1144,7 @@ case $cpu-$vendor in
;;
parisc-*)
cpu=hppa
- basic_os=linux
+ basic_os=${basic_os:-linux}
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
cpu=i586
@@ -1085,9 +1158,6 @@ case $cpu-$vendor in
pentium4-*)
cpu=i786
;;
- pc98-*)
- cpu=i386
- ;;
ppc-* | ppcbe-*)
cpu=powerpc
;;
@@ -1121,9 +1191,6 @@ case $cpu-$vendor in
tx39el-*)
cpu=mipstx39el
;;
- x64-*)
- cpu=x86_64
- ;;
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
@@ -1179,90 +1246,227 @@ case $cpu-$vendor in
# Recognize the canonical CPU types that are allowed with any
# company name.
case $cpu in
- 1750a | 580 \
+ 1750a \
+ | 580 \
+ | [cjt]90 \
| a29k \
- | aarch64 | aarch64_be | aarch64c | arm64ec \
+ | aarch64 \
+ | aarch64_be \
+ | aarch64c \
| abacus \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
- | alphapca5[67] | alpha64pca5[67] \
+ | alpha \
+ | alpha64 \
+ | alpha64ev56 \
+ | alpha64ev6[78] \
+ | alpha64ev[4-8] \
+ | alpha64pca5[67] \
+ | alphaev56 \
+ | alphaev6[78] \
+ | alphaev[4-8] \
+ | alphapca5[67] \
| am33_2.0 \
| amdgcn \
- | arc | arceb | arc32 | arc64 \
- | arm | arm[lb]e | arme[lb] | armv* \
- | avr | avr32 \
+ | arc \
+ | arc32 \
+ | arc64 \
+ | arceb \
+ | arm \
+ | arm64e \
+ | arm64ec \
+ | arm[lb]e \
+ | arme[lb] \
+ | armv* \
| asmjs \
+ | avr \
+ | avr32 \
| ba \
- | be32 | be64 \
- | bfin | bpf | bs2000 \
- | c[123]* | c30 | [cjt]90 | c4x \
- | c8051 | clipper | craynv | csky | cydra \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | elxsi | epiphany \
- | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
- | javascript \
- | h8300 | h8500 \
- | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | be32 \
+ | be64 \
+ | bfin \
+ | bpf \
+ | bs2000 \
+ | c30 \
+ | c4x \
+ | c8051 \
+ | c[123]* \
+ | clipper \
+ | craynv \
+ | csky \
+ | cydra \
+ | d10v \
+ | d30v \
+ | dlx \
+ | dsp16xx \
+ | e2k \
+ | elxsi \
+ | epiphany \
+ | f30[01] \
+ | f700 \
+ | fido \
+ | fr30 \
+ | frv \
+ | ft32 \
+ | fx80 \
+ | h8300 \
+ | h8500 \
| hexagon \
- | i370 | i*86 | i860 | i960 | ia16 | ia64 \
- | ip2k | iq2000 \
+ | hppa \
+ | hppa1.[01] \
+ | hppa2.0 \
+ | hppa2.0[nw] \
+ | hppa64 \
+ | i*86 \
+ | i370 \
+ | i860 \
+ | i960 \
+ | ia16 \
+ | ia64 \
+ | ip2k \
+ | iq2000 \
+ | javascript \
| k1om \
| kvx \
- | le32 | le64 \
+ | le32 \
+ | le64 \
| lm32 \
- | loongarch32 | loongarch64 \
- | m32c | m32r | m32rle \
- | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
- | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
- | m88110 | m88k | maxq | mb | mcore | mep | metag \
- | microblaze | microblazeel \
+ | loongarch32 \
+ | loongarch64 \
+ | m32c \
+ | m32r \
+ | m32rle \
+ | m5200 \
+ | m68000 \
+ | m680[012346]0 \
+ | m6811 \
+ | m6812 \
+ | m68360 \
+ | m683?2 \
+ | m68hc11 \
+ | m68hc12 \
+ | m68hcs12x \
+ | m68k \
+ | m88110 \
+ | m88k \
+ | maxq \
+ | mb \
+ | mcore \
+ | mep \
+ | metag \
+ | microblaze \
+ | microblazeel \
| mips* \
| mmix \
- | mn10200 | mn10300 \
+ | mn10200 \
+ | mn10300 \
| moxie \
- | mt \
| msp430 \
+ | mt \
| nanomips* \
- | nds32 | nds32le | nds32be \
+ | nds32 \
+ | nds32be \
+ | nds32le \
| nfp \
- | nios | nios2 | nios2eb | nios2el \
- | none | np1 | ns16k | ns32k | nvptx \
+ | nios \
+ | nios2 \
+ | nios2eb \
+ | nios2el \
+ | none \
+ | np1 \
+ | ns16k \
+ | ns32k \
+ | nvptx \
| open8 \
| or1k* \
| or32 \
| orion \
+ | pdp10 \
+ | pdp11 \
| picochip \
- | pdp10 | pdp11 | pj | pjl | pn | power \
- | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pj \
+ | pjl \
+ | pn \
+ | power \
+ | powerpc \
+ | powerpc64 \
+ | powerpc64le \
+ | powerpcle \
+ | powerpcspe \
| pru \
| pyramid \
- | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
- | rl78 | romp | rs6000 | rx \
- | s390 | s390x \
+ | riscv \
+ | riscv32 \
+ | riscv32be \
+ | riscv64 \
+ | riscv64be \
+ | rl78 \
+ | romp \
+ | rs6000 \
+ | rx \
+ | s390 \
+ | s390x \
| score \
- | sh | shl \
- | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
- | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sh \
+ | sh64 \
+ | sh64le \
+ | sh[12345][lb]e \
+ | sh[1234] \
+ | sh[1234]e[lb] \
+ | sh[23]e \
+ | sh[23]ele \
+ | sh[24]a \
+ | sh[24]ae[lb] \
+ | sh[lb]e \
+ | she[lb] \
+ | shl \
+ | sparc \
+ | sparc64 \
+ | sparc64b \
+ | sparc64v \
+ | sparc86x \
+ | sparclet \
| sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | sparcv8 \
+ | sparcv9 \
+ | sparcv9b \
+ | sparcv9v \
| spu \
+ | sv1 \
+ | sx* \
| tahoe \
| thumbv7* \
- | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tic30 \
+ | tic4x \
+ | tic54x \
+ | tic55x \
+ | tic6x \
+ | tic80 \
| tron \
| ubicom32 \
- | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | v70 \
+ | v810 \
+ | v850 \
+ | v850e \
+ | v850e1 \
+ | v850e2 \
+ | v850e2v3 \
+ | v850es \
| vax \
| vc4 \
| visium \
| w65 \
- | wasm32 | wasm64 \
+ | wasm32 \
+ | wasm64 \
| we32k \
- | x86 | x86_64 | xc16x | xgate | xps100 \
- | xstormy16 | xtensa* \
+ | x86 \
+ | x86_64 \
+ | xc16x \
+ | xgate \
+ | xps100 \
+ | xstormy16 \
+ | xtensa* \
| ymp \
- | z8k | z80)
+ | z80 \
+ | z8k)
;;
*)
@@ -1307,7 +1511,6 @@ case $basic_os in
os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
;;
*-*)
- # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read kernel os <<EOF
$basic_os
@@ -1354,6 +1557,23 @@ case $os in
unixware*)
os=sysv4.2uw
;;
+ # The marketing names for NeXT's operating systems were
+ # NeXTSTEP, NeXTSTEP 2, OpenSTEP 3, OpenSTEP 4. 'openstep' is
+ # mapped to 'openstep3', but 'openstep1' and 'openstep2' are
+ # mapped to 'nextstep' and 'nextstep2', consistent with the
+ # treatment of SunOS/Solaris.
+ ns | ns1 | nextstep | nextstep1 | openstep1)
+ os=nextstep
+ ;;
+ ns2 | nextstep2 | openstep2)
+ os=nextstep2
+ ;;
+ ns3 | nextstep3 | openstep | openstep3)
+ os=openstep3
+ ;;
+ ns4 | nextstep4 | openstep4)
+ os=openstep4
+ ;;
# es1800 is here to avoid being matched by es* (a different OS)
es1800*)
os=ose
@@ -1424,6 +1644,7 @@ case $os in
;;
utek*)
os=bsd
+ vendor=`echo "$vendor" | sed -e 's|^unknown$|tektronix|'`
;;
dynix*)
os=bsd
@@ -1440,21 +1661,25 @@ case $os in
386bsd)
os=bsd
;;
- ctix* | uts*)
+ ctix*)
os=sysv
+ vendor=`echo "$vendor" | sed -e 's|^unknown$|convergent|'`
;;
- nova*)
- os=rtmk-nova
+ uts*)
+ os=sysv
;;
- ns2)
- os=nextstep2
+ nova*)
+ kernel=rtmk
+ os=nova
;;
# Preserve the version number of sinix5.
sinix5.*)
os=`echo "$os" | sed -e 's|sinix|sysv|'`
+ vendor=`echo "$vendor" | sed -e 's|^unknown$|sni|'`
;;
sinix*)
os=sysv4
+ vendor=`echo "$vendor" | sed -e 's|^unknown$|sni|'`
;;
tpf*)
os=tpf
@@ -1595,6 +1820,14 @@ case $cpu-$vendor in
os=
obj=elf
;;
+ # The -sgi and -siemens entries must be before the mips- entry
+ # or we get the wrong os.
+ *-sgi)
+ os=irix
+ ;;
+ *-siemens)
+ os=sysv4
+ ;;
mips*-cisco)
os=
obj=elf
@@ -1607,7 +1840,8 @@ case $cpu-$vendor in
os=
obj=coff
;;
- *-tti) # must be before sparc entry or we get the wrong os.
+ # This must be before the sparc-* entry or we get the wrong os.
+ *-tti)
os=sysv3
;;
sparc-* | *-sun)
@@ -1639,7 +1873,7 @@ case $cpu-$vendor in
os=hpux
;;
*-hitachi)
- os=hiux
+ os=hiuxwe2
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=sysv
@@ -1683,12 +1917,6 @@ case $cpu-$vendor in
*-encore)
os=bsd
;;
- *-sgi)
- os=irix
- ;;
- *-siemens)
- os=sysv4
- ;;
*-masscomp)
os=rtu
;;
@@ -1735,40 +1963,193 @@ case $os in
ghcjs)
;;
# Now accept the basic system types.
- # The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
- gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
- | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
- | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
- | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
- | hiux* | abug | nacl* | netware* | windows* \
- | os9* | macos* | osx* | ios* | tvos* | watchos* \
- | mpw* | magic* | mmixware* | mon960* | lnews* \
- | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
- | aos* | aros* | cloudabi* | sortix* | twizzler* \
- | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
- | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
- | mirbsd* | netbsd* | dicos* | openedition* | ose* \
- | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
- | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
- | bosx* | nextstep* | cxux* | oabi* \
- | ptx* | ecoff* | winnt* | domain* | vsta* \
- | udi* | lites* | ieee* | go32* | aux* | hcos* \
- | chorusrdb* | cegcc* | glidix* | serenity* \
- | cygwin* | msys* | moss* | proelf* | rtems* \
- | midipix* | mingw32* | mingw64* | mint* \
- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
- | interix* | uwin* | mks* | rhapsody* | darwin* \
- | openstep* | oskit* | conix* | pw32* | nonstopux* \
- | storm-chaos* | tops10* | tenex* | tops20* | its* \
- | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
- | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
- | skyos* | haiku* | rdos* | toppers* | drops* | es* \
- | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
- | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
- | fiwix* | mlibc* | cos* | mbr* | ironclad* )
+ abug \
+ | aix* \
+ | amdhsa* \
+ | amigados* \
+ | amigaos* \
+ | android* \
+ | aof* \
+ | aos* \
+ | aros* \
+ | atheos* \
+ | auroraux* \
+ | aux* \
+ | beos* \
+ | bitrig* \
+ | bme* \
+ | bosx* \
+ | bsd* \
+ | cegcc* \
+ | chorusos* \
+ | chorusrdb* \
+ | clix* \
+ | cloudabi* \
+ | cnk* \
+ | conix* \
+ | cos* \
+ | cxux* \
+ | cygwin* \
+ | darwin* \
+ | dgux* \
+ | dicos* \
+ | dnix* \
+ | domain* \
+ | dragonfly* \
+ | drops* \
+ | ebmon* \
+ | ecoff* \
+ | ekkobsd* \
+ | emscripten* \
+ | emx* \
+ | es* \
+ | fiwix* \
+ | freebsd* \
+ | fuchsia* \
+ | genix* \
+ | genode* \
+ | glidix* \
+ | gnu* \
+ | go32* \
+ | haiku* \
+ | hcos* \
+ | hiux* \
+ | hms* \
+ | hpux* \
+ | ieee* \
+ | interix* \
+ | ios* \
+ | iris* \
+ | irix* \
+ | ironclad* \
+ | isc* \
+ | its* \
+ | l4re* \
+ | libertybsd* \
+ | lites* \
+ | lnews* \
+ | luna* \
+ | lynxos* \
+ | mach* \
+ | macos* \
+ | magic* \
+ | mbr* \
+ | midipix* \
+ | midnightbsd* \
+ | mingw32* \
+ | mingw64* \
+ | minix* \
+ | mint* \
+ | mirbsd* \
+ | mks* \
+ | mlibc* \
+ | mmixware* \
+ | mon960* \
+ | morphos* \
+ | moss* \
+ | moxiebox* \
+ | mpeix* \
+ | mpw* \
+ | msdos* \
+ | msys* \
+ | mvs* \
+ | nacl* \
+ | netbsd* \
+ | netware* \
+ | newsos* \
+ | nextstep* \
+ | nindy* \
+ | nonstopux* \
+ | nova* \
+ | nsk* \
+ | nucleus* \
+ | nx6 \
+ | nx7 \
+ | oabi* \
+ | ohos* \
+ | onefs* \
+ | openbsd* \
+ | openedition* \
+ | openstep* \
+ | os108* \
+ | os2* \
+ | os400* \
+ | os68k* \
+ | os9* \
+ | ose* \
+ | osf* \
+ | oskit* \
+ | osx* \
+ | palmos* \
+ | phoenix* \
+ | plan9* \
+ | powermax* \
+ | powerunix* \
+ | proelf* \
+ | psos* \
+ | psp* \
+ | ptx* \
+ | pw32* \
+ | qnx* \
+ | rdos* \
+ | redox* \
+ | rhapsody* \
+ | riscix* \
+ | riscos* \
+ | rtems* \
+ | rtmk* \
+ | rtu* \
+ | scout* \
+ | secbsd* \
+ | sei* \
+ | serenity* \
+ | sim* \
+ | skyos* \
+ | solaris* \
+ | solidbsd* \
+ | sortix* \
+ | storm-chaos* \
+ | sunos \
+ | sunos[34]* \
+ | superux* \
+ | syllable* \
+ | sym* \
+ | sysv* \
+ | tenex* \
+ | tirtos* \
+ | toppers* \
+ | tops10* \
+ | tops20* \
+ | tpf* \
+ | tvos* \
+ | twizzler* \
+ | uclinux* \
+ | udi* \
+ | udk* \
+ | ultrix* \
+ | unicos* \
+ | uniplus* \
+ | unleashed* \
+ | unos* \
+ | uwin* \
+ | uxpv* \
+ | v88r* \
+ |*vms* \
+ | vos* \
+ | vsta* \
+ | vxsim* \
+ | vxworks* \
+ | wasi* \
+ | watchos* \
+ | wince* \
+ | windiss* \
+ | windows* \
+ | winnt* \
+ | xenix* \
+ | xray* \
+ | zephyr* \
+ | zvmoe* )
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1829,9 +2210,9 @@ esac
case $kernel-$os-$obj in
linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
| linux-mlibc*- | linux-musl*- | linux-newlib*- \
- | linux-relibc*- | linux-uclibc*- )
+ | linux-relibc*- | linux-uclibc*- | linux-ohos*- )
;;
- uclinux-uclibc*- )
+ uclinux-uclibc*- | uclinux-gnu*- )
;;
managarm-mlibc*- | managarm-kernel*- )
;;
@@ -1856,7 +2237,7 @@ case $kernel-$os-$obj in
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
exit 1
;;
- kfreebsd*-gnu*- | kopensolaris*-gnu*-)
+ kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-)
;;
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
;;
@@ -1864,6 +2245,8 @@ case $kernel-$os-$obj in
;;
os2-emx-)
;;
+ rtmk-nova-)
+ ;;
*-eabi*- | *-gnueabi*-)
;;
none--*)
@@ -1890,7 +2273,7 @@ case $vendor in
*-riscix*)
vendor=acorn
;;
- *-sunos*)
+ *-sunos* | *-solaris*)
vendor=sun
;;
*-cnk* | *-aix*)
diff --git a/build-aux/depcomp b/build-aux/depcomp
index 1f0aa97..9f6725b 100755
--- a/build-aux/depcomp
+++ b/build-aux/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2024-06-19.01; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 1999-2024 Free Software Foundation, Inc.
+# Copyright (C) 1999-2025 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
@@ -784,9 +784,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/build-aux/install-sh b/build-aux/install-sh
index b1d7a6f..1d8d966 100755
--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2024-06-19.01; # UTC
+scriptversion=2025-06-18.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -533,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index 2a50d7f..3e6a3db 100755
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -2,11 +2,11 @@
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2019-02-19.15
-# libtool (GNU libtool) 2.4.7
+# libtool (GNU libtool) 2.5.4
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
+# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.7
-package_revision=2.4.7
+VERSION=2.5.4
+package_revision=2.5.4
## ------ ##
@@ -72,11 +72,11 @@ scriptversion=2019-02-19.15; # UTC
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Copyright (C) 2004-2019, 2021 Bootstrap Authors
+# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
-# <https://opensource.org/license/MIT>, and GPL version 2 or later
-# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
+# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
# these licenses when using or redistributing this software or any of
# the files within it. See the URLs above, or the file `LICENSE`
# included in the Bootstrap distribution for the full license texts.
@@ -143,7 +143,7 @@ nl='
'
IFS="$sp $nl"
-# There are apparently some retarded systems that use ';' as a PATH separator!
+# There are apparently some systems that use ';' as a PATH separator!
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
@@ -589,7 +589,7 @@ func_require_term_colors ()
# _G_HAVE_PLUSEQ_OP
# Can be empty, in which case the shell is probed, "yes" if += is
- # useable or anything else if it does not work.
+ # usable or anything else if it does not work.
test -z "$_G_HAVE_PLUSEQ_OP" \
&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
&& _G_HAVE_PLUSEQ_OP=yes
@@ -739,7 +739,7 @@ eval 'func_dirname ()
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
+# value returned in "$func_basename_result"
# For efficiency, we do not delegate to the functions above but instead
# duplicate the functionality here.
eval 'func_dirname_and_basename ()
@@ -897,7 +897,7 @@ func_mkdir_p ()
# While some portion of DIR does not yet exist...
while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
+ # list in case some portion of path contains whitespace.
_G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
@@ -1536,11 +1536,11 @@ func_lt_ver ()
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Copyright (C) 2010-2019, 2021 Bootstrap Authors
+# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
-# <https://opensource.org/license/MIT>, and GPL version 2 or later
-# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
+# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
# these licenses when using or redistributing this software or any of
# the files within it. See the URLs above, or the file `LICENSE`
# included in the Bootstrap distribution for the full license texts.
@@ -2215,7 +2215,30 @@ func_version ()
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.7'
+scriptversion='(GNU libtool) 2.5.4'
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ year=`date +%Y`
+
+ cat <<EOF
+$progname $scriptversion
+Copyright (C) $year Free Software Foundation, Inc.
+License GPLv2+: GNU GPL version 2 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.
+
+Originally written by Gordon Matzigkeit, 1996
+(See AUTHORS for complete contributor listing)
+EOF
+
+ exit $?
+}
# func_echo ARG...
@@ -2238,18 +2261,6 @@ func_echo ()
}
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
- $debug_cmd
-
- $warning_func ${1+"$@"}
-}
-
-
## ---------------- ##
## Options parsing. ##
## ---------------- ##
@@ -2261,19 +2272,23 @@ usage='$progpath [OPTION]... [MODE-ARG]...'
# Short help message in response to '-h'.
usage_message="Options:
- --config show all configuration variables
- --debug enable verbose shell tracing
- -n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --mode=MODE use operation mode MODE
- --no-warnings equivalent to '-Wnone'
- --preserve-dup-deps don't remove duplicate dependency libraries
- --quiet, --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- -v, --verbose print more informational messages than default
- --version print version information
- -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
- -h, --help, --help-all print short, long, or detailed help message
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+ -n, --dry-run display commands without modifying any files
+ --features display basic configuration information
+ --finish use operation '--mode=finish'
+ --mode=MODE use operation mode MODE
+ --no-finish don't update shared library cache
+ --no-quiet, --no-silent print default informational messages
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --reorder-cache=DIRS reorder shared library cache for preferred DIRS
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
"
# Additional text appended to 'usage_message' in response to '--help'.
@@ -2306,13 +2321,13 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.7
+ version: $progname $scriptversion
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
+GNU libtool home page: <https://www.gnu.org/software/libtool/>.
+General help using GNU software: <https://www.gnu.org/gethelp/>."
exit 0
}
@@ -2502,8 +2517,11 @@ libtool_options_prep ()
opt_dry_run=false
opt_help=false
opt_mode=
+ opt_reorder_cache=false
opt_preserve_dup_deps=false
opt_quiet=false
+ opt_finishing=true
+ opt_warning=
nonopt=
preserve_args=
@@ -2593,14 +2611,18 @@ libtool_parse_options ()
clean|compile|execute|finish|install|link|relink|uninstall) ;;
# Catch anything else as an error
- *) func_error "invalid argument for $_G_opt"
+ *) func_error "invalid argument '$1' for $_G_opt"
exit_cmd=exit
- break
;;
esac
shift
;;
+ --no-finish)
+ opt_finishing=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
--no-silent|--no-quiet)
opt_quiet=false
func_append preserve_args " $_G_opt"
@@ -2616,6 +2638,24 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
+ --reorder-cache)
+ opt_reorder_cache=true
+ shared_lib_dirs=$1
+ if test -n "$shared_lib_dirs"; then
+ case $1 in
+ # Must begin with /:
+ /*) ;;
+
+ # Catch anything else as an error (relative paths)
+ *) func_error "invalid argument '$1' for $_G_opt"
+ func_error "absolute paths are required for $_G_opt"
+ exit_cmd=exit
+ ;;
+ esac
+ fi
+ shift
+ ;;
+
--silent|--quiet)
opt_quiet=:
opt_verbose=false
@@ -2652,6 +2692,18 @@ libtool_parse_options ()
func_add_hook func_parse_options libtool_parse_options
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ if $opt_warning; then
+ $debug_cmd
+ $warning_func ${1+"$@"}
+ fi
+}
+
# libtool_validate_options [ARG]...
# ---------------------------------
@@ -2668,10 +2720,10 @@ libtool_validate_options ()
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
- case $host in
+ case $host_os in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+ cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
@@ -3003,7 +3055,7 @@ EOF
# func_convert_core_file_wine_to_w32 ARG
# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
# correctly configured wine environment available, with the winepath program
# in $build's $PATH.
#
@@ -3035,9 +3087,10 @@ func_convert_core_file_wine_to_w32 ()
# func_convert_core_path_wine_to_w32 ARG
# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
+# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH. Assumes ARG has no leading or trailing path separator
+# characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
@@ -3180,6 +3233,15 @@ func_convert_path_front_back_pathsep ()
# end func_convert_path_front_back_pathsep
+# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER
+# Replaces a delimiter for a given path.
+func_convert_delimited_path ()
+{
+ converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"`
+}
+# end func_convert_delimited_path
+
+
##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
@@ -3514,6 +3576,65 @@ func_dll_def_p ()
}
+# func_reorder_shared_lib_cache DIRS
+# Reorder the shared library cache by unconfiguring previous shared library cache
+# and configuring preferred search directories before previous search directories.
+# Previous shared library cache: /usr/lib /usr/local/lib
+# Preferred search directories: /tmp/testing
+# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib
+func_reorder_shared_lib_cache ()
+{
+ $debug_cmd
+
+ case $host_os in
+ openbsd*)
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ save_search_directories=$converted_path
+ func_convert_delimited_path "$1" ':' '\ '
+
+ # Ensure directories exist
+ for dir in $converted_path; do
+ # Ensure each directory is an absolute path
+ case $dir in
+ /*) ;;
+ *) func_error "Directory '$dir' is not an absolute path"
+ exit $EXIT_FAILURE ;;
+ esac
+ # Ensure no trailing slashes
+ func_stripname '' '/' "$dir"
+ dir=$func_stripname_result
+ if test -d "$dir"; then
+ if test -n "$preferred_search_directories"; then
+ preferred_search_directories="$preferred_search_directories $dir"
+ else
+ preferred_search_directories=$dir
+ fi
+ else
+ func_error "Directory '$dir' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ done
+
+ PATH="$PATH:/sbin" ldconfig -U $save_search_directories
+ PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ reordered_search_directories=$converted_path
+
+ $ECHO "Original: $save_search_directories"
+ $ECHO "Reordered: $reordered_search_directories"
+ exit $EXIT_SUCCESS
+ ;;
+ *)
+ func_error "--reorder-cache is not supported for host_os=$host_os."
+ exit $EXIT_FAILURE
+ ;;
+ esac
+}
+# end func_reorder_shared_lib_cache
+
+
# func_mode_compile arg...
func_mode_compile ()
{
@@ -3692,7 +3813,7 @@ func_mode_compile ()
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | os2* | cegcc*)
pic_mode=default
;;
esac
@@ -4086,6 +4207,12 @@ if $opt_help; then
fi
+# If option '--reorder-cache', reorder the shared library cache and exit.
+if $opt_reorder_cache; then
+ func_reorder_shared_lib_cache $shared_lib_dirs
+fi
+
+
# func_mode_execute arg...
func_mode_execute ()
{
@@ -4270,7 +4397,7 @@ func_mode_finish ()
fi
fi
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
@@ -4295,6 +4422,12 @@ func_mode_finish ()
for libdir in $libdirs; do
$ECHO " $libdir"
done
+ if test "false" = "$opt_finishing"; then
+ echo
+ echo "NOTE: finish_cmds were not executed during testing, so you must"
+ echo "manually run ldconfig to add a given test directory, LIBDIR, to"
+ echo "the search path for generated executables."
+ fi
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
@@ -4531,8 +4664,15 @@ func_mode_install ()
func_append dir "$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -4569,7 +4709,7 @@ func_mode_install ()
'exit $?'
tstripme=$stripme
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $realname in
*.dll.a)
tstripme=
@@ -4682,7 +4822,7 @@ func_mode_install ()
# Do a test to see if this is really a libtool program.
case $host in
- *cygwin* | *mingw*)
+ *cygwin* | *mingw* | *windows*)
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
wrapper=$func_ltwrapper_scriptname_result
@@ -4910,7 +5050,7 @@ extern \"C\" {
$RM $export_symbols
eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
@@ -4922,7 +5062,7 @@ extern \"C\" {
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
@@ -4936,7 +5076,7 @@ extern \"C\" {
func_basename "$dlprefile"
name=$func_basename_result
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# if an import library, we need to obtain dlname
if func_win32_import_lib_p "$dlprefile"; then
func_tr_sh "$dlprefile"
@@ -4962,8 +5102,16 @@ extern \"C\" {
eval '$ECHO ": $name " >> "$nlist"'
fi
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ case $host in
+ i[3456]86-*-mingw32*)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ ;;
+ *)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'"
+ ;;
+ esac
}
else # not an import lib
$opt_dry_run || {
@@ -5111,7 +5259,7 @@ static const void *lt_preloaded_setup() {
# Transform the symbol file into the correct name.
symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
@@ -5187,7 +5335,7 @@ func_win32_libid ()
*ar\ archive*) # could be an import, or static
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then
case $nm_interface in
"MS dumpbin")
if func_cygming_ms_implib_p "$1" ||
@@ -5454,7 +5602,7 @@ func_extract_archives ()
#
# Emit a libtool wrapper script on stdout.
# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
+# incorporate the script contents within a cygwin/mingw/windows
# wrapper executable. Must ONLY be called from within
# func_mode_link because it depends on a number of variables
# set therein.
@@ -5462,7 +5610,7 @@ func_extract_archives ()
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
# will assume that the directory where it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
+# the $objdir directory. This is a cygwin/mingw/windows-specific
# behavior.
func_emit_wrapper ()
{
@@ -5587,7 +5735,7 @@ func_exec_program_core ()
"
case $host in
# Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
+ *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
@@ -5655,7 +5803,7 @@ func_exec_program ()
file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
done
- # Usually 'no', except on cygwin/mingw when embedded into
+ # Usually 'no', except on cygwin/mingw/windows when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
@@ -5787,7 +5935,7 @@ EOF
#endif
#include <stdio.h>
#include <stdlib.h>
-#ifdef _MSC_VER
+#if defined _WIN32 && !defined __GNUC__
# include <direct.h>
# include <process.h>
# include <io.h>
@@ -5812,7 +5960,7 @@ EOF
/* declarations of non-ANSI functions */
#if defined __MINGW32__
# ifdef __STRICT_ANSI__
-int _putenv (const char *);
+_CRTIMP int __cdecl _putenv (const char *);
# endif
#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
@@ -6010,7 +6158,7 @@ main (int argc, char *argv[])
{
EOF
case $host in
- *mingw* | *cygwin* )
+ *mingw* | *windows* | *cygwin* )
# make stdout use "unix" line endings
echo " setmode(1,_O_BINARY);"
;;
@@ -6029,7 +6177,7 @@ EOF
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
+ have already dealt with, above (including dump-script), then
report an error. Otherwise, targets might begin to believe
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
namespace. The first time any user complains about this, we'll
@@ -6113,7 +6261,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
{
char* p;
@@ -6155,7 +6303,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
newargz = prepare_spawn (newargz);
@@ -6574,7 +6722,7 @@ lt_update_lib_path (const char *name, const char *value)
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* Prepares an argument vector before calling spawn().
@@ -6749,7 +6897,7 @@ func_mode_link ()
$debug_cmd
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# what system we are compiling for in order to pass an extra
@@ -6773,6 +6921,7 @@ func_mode_link ()
finalize_command=$nonopt
compile_rpath=
+ compile_rpath_tail=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
@@ -6813,10 +6962,12 @@ func_mode_link ()
xrpath=
perm_rpath=
temp_rpath=
+ temp_rpath_tail=
thread_safe=no
vinfo=
vinfo_number=no
weak_libs=
+ rpath_arg=
single_module=$wl-single_module
func_infer_tag $base_compile
@@ -7079,7 +7230,7 @@ func_mode_link ()
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument to -rpath is not absolute: $arg"
;;
esac
if test rpath = "$prev"; then
@@ -7255,7 +7406,7 @@ func_mode_link ()
;;
esac
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
@@ -7275,7 +7426,7 @@ func_mode_link ()
-l*)
if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
continue
;;
@@ -7283,7 +7434,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -7303,7 +7454,7 @@ func_mode_link ()
esac
elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -7326,7 +7477,8 @@ func_mode_link ()
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
+ # -q <option> for IBM XL C/C++ compiler.
+ -model|-arch|-isysroot|--sysroot|-q)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -7347,7 +7499,7 @@ func_mode_link ()
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -7370,7 +7522,7 @@ func_mode_link ()
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "'-no-install' is ignored for $host"
@@ -7430,7 +7582,7 @@ func_mode_link ()
dir=$lt_sysroot$func_stripname_result
;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir"
;;
esac
case "$xrpath " in
@@ -7555,13 +7707,29 @@ func_mode_link ()
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fdiagnostics-color* simply affects output
+ # -frecord-gcc-switches used to verify flags were respected
# -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fno-sanitize* Clang/GCC memory and address sanitizer
+ # -shared-libsan Link with shared sanitizer runtimes (Clang)
+ # -static-libsan Link with static sanitizer runtimes (Clang)
+ # -no-canonical-prefixes Do not expand any symbolic links
# -fuse-ld=* Linker select flags for GCC
+ # -static-* direct GCC to link specific libraries statically
+ # -fcilkplus Cilk Plus language extension features for C/C++
+ # -rtlib=* select c runtime lib with clang
+ # --unwindlib=* select unwinder library with clang
+ # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
# -Wa,* Pass flags directly to the assembler
+ # -Werror, -Werror=* Report (specified) warnings as errors
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
+ -stdlib=*|-rtlib=*|--unwindlib=*| \
+ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
+ -fdiagnostics-color*|-frecord-gcc-switches| \
+ -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_append compile_command " $arg"
@@ -7719,8 +7887,20 @@ func_mode_link ()
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ if test -n "$rpath_arg"; then
+ func_append finalize_rpath " ${arg##*,}"
+ unset rpath_arg
+ else
+ case $arg in
+ -Wl,-rpath,*)
+ func_append finalize_rpath " ${arg##*,}";;
+ -Wl,-rpath)
+ rpath_arg=1;;
+ *)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ esac
+ fi
fi
done # argument parsing loop
@@ -7891,7 +8071,7 @@ func_mode_link ()
found=false
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -8068,18 +8248,15 @@ func_mode_link ()
;;
esac
if $valid_a_lib; then
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
+ func_warning "Linking the shared library $output against the static library $deplib is not portable!"
deplibs="$deplib $deplibs"
else
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
+ func_warning "Trying to link with static lib archive $deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because the file extensions .$libext of this argument makes me believe"
+ func_warning "that it is just a static archive that I should not use here."
fi
;;
esac
@@ -8274,7 +8451,7 @@ func_mode_link ()
fi
case $host in
# special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# Linker will automatically link against shared library if both
# static and shared are present. Therefore, ensure we extract
# symbols from the import library if a shared library is present
@@ -8374,7 +8551,10 @@ func_mode_link ()
# Make sure the rpath contains only unique directories.
case $temp_rpath: in
*"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append temp_rpath "$absdir:" ;;
+ *) func_append temp_rpath_tail "$absdir:" ;;
+ esac
esac
fi
@@ -8384,9 +8564,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8417,8 +8600,8 @@ func_mode_link ()
fi
if test -n "$library_names" &&
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
@@ -8444,11 +8627,11 @@ func_mode_link ()
if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
if test prog = "$linkmode"; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ func_warning "Linking the executable $output against the loadable module"
else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ func_warning "Linking the shared library $output against the loadable module"
fi
- $ECHO "*** $linklib is not portable!"
+ func_warning "$linklib is not portable!"
fi
if test lib = "$linkmode" &&
test yes = "$hardcode_into_libs"; then
@@ -8458,9 +8641,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8487,8 +8673,8 @@ func_mode_link ()
soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
@@ -8535,6 +8721,7 @@ func_mode_link ()
case $host in
*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
*-*-sysv4*uw2*) add_dir=-L$dir ;;
+ *-*-emscripten*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
@@ -8543,11 +8730,10 @@ func_mode_link ()
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ func_warning "lib $linklib is a module, not a shared library"
if test -z "$old_library"; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
+ func_warning "And there doesn't seem to be a static archive available"
+ func_warning "The link will probably fail, sorry"
else
add=$dir/$old_library
fi
@@ -8630,7 +8816,7 @@ func_mode_link ()
test no = "$hardcode_direct_absolute"; then
add=$libdir/$linklib
elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
@@ -8647,7 +8833,7 @@ func_mode_link ()
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -8687,21 +8873,19 @@ func_mode_link ()
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system cannot link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ func_warning "This system cannot link to static lib archive $lib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have."
if test yes = "$module"; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ func_warning "But as you try to build a module library, libtool will still create "
+ func_warning "a static module, that should work as long as the dlopening application"
+ func_warning "is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ func_warning "However, this would only work if libtool was able to extract symbol"
+ func_warning "lists from a program, using 'nm' or equivalent, but libtool could"
+ func_warning "not find such a program. So, this module is probably useless."
+ func_warning "'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
build_libtool_libs=module
@@ -8824,6 +9008,10 @@ func_mode_link ()
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
+
+ func_append temp_rpath "$temp_rpath_tail"
+ func_append compile_rpath "$compile_rpath_tail"
+
if test link = "$pass"; then
if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
@@ -8861,42 +9049,46 @@ func_mode_link ()
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken: new_libs="$deplib $new_libs"
for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ if $opt_preserve_dup_deps; then
+ new_libs="$deplib $new_libs"
+ else
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal. And if not possible for portability
+ # reasons, then --preserve-dup-deps should be used.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
esac
- ;;
- esac
+ fi
done
tmp_libs=
for deplib in $new_libs; do
@@ -9028,9 +9220,7 @@ func_mode_link ()
if test pass_all != "$deplibs_check_method"; then
func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
+ func_warning "Linking the shared library $output against the non-libtool objects $objs is not portable!"
func_append libobjs " $objs"
fi
fi
@@ -9091,13 +9281,13 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
+ darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_revision
;;
- freebsd-aout|qnx|sunos)
+ freebsd-aout|sco|sunos)
current=$number_major
revision=$number_minor
age=0
@@ -9109,6 +9299,9 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type '$version_type'"
+ ;;
esac
;;
no)
@@ -9244,8 +9437,9 @@ func_mode_link ()
;;
qnx)
- major=.$current
- versuffix=.$current
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
;;
sco)
@@ -9398,7 +9592,7 @@ func_mode_link ()
if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
@@ -9449,108 +9643,6 @@ func_mode_link ()
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- fi
- ;;
file_magic*)
set dummy $deplibs_check_method; shift
file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
@@ -9614,17 +9706,16 @@ EOF
fi
if test -n "$a_deplib"; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ func_warning "Linker path does not have real file for library $a_deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ func_warning "with $libname but no candidates were found. (...for file magic test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
+ func_warning "with $libname and none of the candidates passed a file format test"
+ func_warning "using a file magic. Last file checked: $potlib"
fi
fi
;;
@@ -9668,17 +9759,16 @@ EOF
fi
if test -n "$a_deplib"; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ func_warning "Linker path does not have real file for library $a_deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ func_warning "with $libname but no candidates were found. (...for regex pattern test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ func_warning "with $libname and none of the candidates passed a file format test"
+ func_warning "using a regex pattern. Last file checked: $potlib"
fi
fi
;;
@@ -9702,11 +9792,11 @@ EOF
*[!\ \ ]*)
echo
if test none = "$deplibs_check_method"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
+ func_warning "Inter-library dependencies are not supported in this platform."
else
- echo "*** Warning: inter-library dependencies are not known to be supported."
+ func_warning "Inter-library dependencies are not known to be supported."
fi
- echo "*** All declared inter-library dependencies are being dropped."
+ func_warning "All declared inter-library dependencies are being dropped."
droppeddeps=yes
;;
esac
@@ -9727,17 +9817,15 @@ EOF
if test yes = "$droppeddeps"; then
if test yes = "$module"; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
+ func_warning "libtool could not satisfy all declared inter-library"
+ func_warning "dependencies of module $libname. Therefore, libtool will create"
+ func_warning "a static module, that should work as long as the dlopening"
+ func_warning "application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ func_warning "However, this would only work if libtool was able to extract symbol"
+ func_warning "lists from a program, using 'nm' or equivalent, but libtool could"
+ func_warning "not find such a program. So, this module is probably useless."
+ func_warning "'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
oldlibs=$output_objdir/$libname.$libext
@@ -9912,7 +10000,7 @@ EOF
orig_export_symbols=
case $host_os in
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
func_dll_def_p "$export_symbols" || {
@@ -10110,20 +10198,7 @@ EOF
last_robj=
k=1
- if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
- output=$output_objdir/$output_la.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
@@ -10142,6 +10217,19 @@ EOF
func_append delfiles " $output"
func_to_tool_file "$output"
output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
@@ -10582,7 +10670,7 @@ EOF
esac
fi
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
@@ -10660,7 +10748,7 @@ EOF
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
wrappers_required=false
;;
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | *windows* )
test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
@@ -10814,7 +10902,7 @@ EOF
*) exeext= ;;
esac
case $host in
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | windows* )
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
@@ -11148,7 +11236,7 @@ EOF
# tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *windows*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
diff --git a/build-aux/missing b/build-aux/missing
index 7e7d78e..5e450ba 100755
--- a/build-aux/missing
+++ b/build-aux/missing
@@ -1,11 +1,11 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU and other programs.
-scriptversion=2024-06-07.14; # UTC
+scriptversion=2025-06-18.21; # UTC
# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
-# Copyright (C) 1996-2024 Free Software Foundation, Inc.
+# Copyright (C) 1996-2025 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -228,9 +228,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/build-aux/test-driver b/build-aux/test-driver
index 2c2a38b..d81fba7 100755
--- a/build-aux/test-driver
+++ b/build-aux/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2024-06-19.01; # UTC
+scriptversion=2025-06-18.21; # UTC
-# Copyright (C) 2011-2024 Free Software Foundation, Inc.
+# Copyright (C) 2011-2025 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
@@ -64,27 +64,22 @@ expect_failure=no
color_tests=no
collect_skipped_logs=yes
enable_hard_errors=yes
-while test $# -gt 1; do
- arg=${1%=*}
- val=${1#*=}
- if [ $arg = $val ]; then
- val=$2
- shift
- fi
- case $arg in
+while test $# -gt 0; do
+ case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;;
- --test-name) test_name=$val;;
- --log-file) log_file=$val;;
- --trs-file) trs_file=$val;;
- --color-tests) color_tests=$val;;
- --collect-skipped-logs) collect_skipped_logs=$val;;
- --expect-failure) expect_failure=$val;;
- --enable-hard-errors) enable_hard_errors=$val;;
- --) break;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --collect-skipped-logs) collect_skipped_logs=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
-*) usage_error "invalid option: '$1'";;
+ *) break;;
esac
- [ $arg != $val ] && shift
+ shift
done
missing_opts=
@@ -157,9 +152,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/configure b/configure
index d1e34b1..e73e86f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for libHX 4.27.
+# Generated by GNU Autoconf 2.72 for libHX 5.2.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libHX'
PACKAGE_TARNAME='libhx'
-PACKAGE_VERSION='4.27'
-PACKAGE_STRING='libHX 4.27'
+PACKAGE_VERSION='5.2'
+PACKAGE_STRING='libHX 5.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -663,8 +663,8 @@ HAVE_DLFCN_H_FALSE
HAVE_DLFCN_H_TRUE
WITH_SUN_LD_FALSE
WITH_SUN_LD_TRUE
-WITH_GNU_LD_FALSE
-WITH_GNU_LD_TRUE
+WITH_LDSYM_FALSE
+WITH_LDSYM_TRUE
pkgconfigdir
MINGW32_FALSE
MINGW32_TRUE
@@ -803,8 +803,10 @@ enable_silent_rules
enable_dependency_tracking
enable_static
enable_shared
+enable_pic
with_pic
enable_fast_install
+enable_aix_soname
with_aix_soname
with_gnu_ld
with_sysroot
@@ -1372,7 +1374,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures libHX 4.27 to adapt to many kinds of systems.
+'configure' configures libHX 5.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1443,7 +1445,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libHX 4.27:";;
+ short | recursive ) echo "Configuration of libHX 5.2:";;
esac
cat <<\_ACEOF
@@ -1459,18 +1461,18 @@ Optional Features:
speeds up one-time build
--enable-static[=PKGS] build static libraries [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
+ --enable-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
--disable-libtool-lock avoid locking (might break parallel builds)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-aix-soname=aix|svr4|both
- shared library versioning (aka "SONAME") variant to
- provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
@@ -1558,7 +1560,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libHX configure 4.27
+libHX configure 5.2
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2211,7 +2213,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libHX $as_me 4.27, which was
+It was created by libHX $as_me 5.2, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3305,7 +3307,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-am__api_version='1.17'
+am__api_version='1.18'
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5
printf %s "checking whether sleep supports fractional seconds... " >&6; }
@@ -3474,10 +3476,14 @@ am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
@@ -3904,7 +3910,7 @@ fi
# Define the identity of the package.
PACKAGE='libhx'
- VERSION='4.27'
+ VERSION='5.2'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -4052,11 +4058,12 @@ fi
+AM_DEFAULT_VERBOSITY=0
+
-AM_DEFAULT_VERBOSITY=0
@@ -5124,7 +5131,10 @@ _ACEOF
break
fi
done
- rm -f core conftest*
+ # aligned with autoconf, so not including core; see bug#72225.
+ rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \
+ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \
+ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM
unset am_i ;;
esac
fi
@@ -5862,6 +5872,8 @@ fi
AM_DEFAULT_VERBOSITY=0
+
+
if test -n "$ac_tool_prefix"; then
for ac_prog in ar lib "link -lib"
do
@@ -6057,8 +6069,8 @@ esac
-macro_version='2.4.7'
-macro_revision='2.4.7'
+macro_version='2.5.4'
+macro_revision='2.5.4'
@@ -6569,7 +6581,7 @@ if test yes = "$GCC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
printf %s "checking for ld used by $CC... " >&6; }
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -6698,7 +6710,7 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
@@ -6924,14 +6936,14 @@ else case e in #(
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -6953,7 +6965,7 @@ else case e in #(
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -7096,7 +7108,7 @@ else case e in #(
e) case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -7109,7 +7121,7 @@ else case e in #(
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -7145,9 +7157,9 @@ else case e in #(
e) #assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
@@ -7183,7 +7195,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -7205,9 +7217,8 @@ esac
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args.
-set dummy ${ac_tool_prefix}file; ac_word=$2
+# Extract the first word of "file", so it can be a program name with args.
+set dummy file; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_FILECMD+y}
@@ -7228,7 +7239,7 @@ do
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_FILECMD="${ac_tool_prefix}file"
+ ac_cv_prog_FILECMD="file"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -7236,6 +7247,7 @@ done
done
IFS=$as_save_IFS
+ test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":"
fi ;;
esac
fi
@@ -7249,66 +7261,6 @@ printf "%s\n" "no" >&6; }
fi
-fi
-if test -z "$ac_cv_prog_FILECMD"; then
- ac_ct_FILECMD=$FILECMD
- # Extract the first word of "file", so it can be a program name with args.
-set dummy file; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_FILECMD+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_FILECMD"; then
- ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_FILECMD="file"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD
-if test -n "$ac_ct_FILECMD"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5
-printf "%s\n" "$ac_ct_FILECMD" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
- if test "x$ac_ct_FILECMD" = x; then
- FILECMD=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- FILECMD=$ac_ct_FILECMD
- fi
-else
- FILECMD="$ac_cv_prog_FILECMD"
-fi
-
@@ -7443,7 +7395,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -7470,7 +7421,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -7479,7 +7430,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -7552,7 +7503,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -7570,7 +7525,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
@@ -7586,6 +7541,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -7638,7 +7597,7 @@ file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -7797,7 +7756,7 @@ else case e in #(
e) lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -7829,6 +7788,110 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
for ac_prog in ar
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
@@ -7949,7 +8012,7 @@ fi
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
-# higher priority because thats what people were doing historically (setting
+# higher priority because that's what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
@@ -8141,109 +8204,6 @@ test -z "$STRIP" && STRIP=:
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-printf "%s\n" "$RANLIB" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-printf "%s\n" "$ac_ct_RANLIB" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
test -z "$RANLIB" && RANLIB=:
@@ -8258,15 +8218,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -8346,7 +8299,7 @@ case $host_os in
aix*)
symcode='[BCDT]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
@@ -8361,7 +8314,7 @@ osf*)
symcode='[BCDEGQRST]'
;;
solaris*)
- symcode='[BDRT]'
+ symcode='[BCDRT]'
;;
sco3.2v5*)
symcode='[DT]'
@@ -8425,7 +8378,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -8476,7 +8429,7 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -8486,11 +8439,8 @@ _LT_EOF
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -8661,7 +8611,9 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
@@ -8878,7 +8830,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -8897,7 +8849,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
@@ -8926,7 +8878,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
@@ -9147,23 +9099,23 @@ fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if test ${lt_cv_path_mainfest_tool+y}
+if test ${lt_cv_path_manifest_tool+y}
then :
printf %s "(cached) " >&6
else case e in #(
- e) lt_cv_path_mainfest_tool=no
+ e) lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&5
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
rm -f conftest* ;;
esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5
+printf "%s\n" "$lt_cv_path_manifest_tool" >&6; }
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
@@ -9758,6 +9710,45 @@ fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
+printf %s "checking for -no_fixup_chains linker flag... " >&6; }
+if test ${lt_cv_support_no_fixup_chains+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ lt_cv_support_no_fixup_chains=yes
+else case e in #(
+ e) lt_cv_support_no_fixup_chains=no
+ ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
+printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
if test ${lt_cv_ld_exported_symbols_list+y}
@@ -9812,7 +9803,7 @@ _LT_EOF
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -9841,13 +9832,32 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; }
10.[012],*|,*powerpc*-darwin[5-8]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains'
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -10023,31 +10033,54 @@ fi
-
-# Check whether --with-pic was given.
+ # Check whether --enable-pic was given.
+if test ${enable_pic+y}
+then :
+ enableval=$enable_pic; lt_p=${PACKAGE-default}
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else case e in #(
+ e) # Check whether --with-pic was given.
if test ${with_pic+y}
then :
withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
else case e in #(
e) pic_mode=default ;;
esac
fi
+ ;;
+esac
+fi
+
@@ -10092,18 +10125,29 @@ case $host,$enable_shared in
power*-*-aix[5-9]*,yes)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
printf %s "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
+ # Check whether --enable-aix-soname was given.
+if test ${enable_aix_soname+y}
+then :
+ enableval=$enable_aix_soname; case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname
+else case e in #(
+ e) # Check whether --with-aix-soname was given.
if test ${with_aix_soname+y}
then :
withval=$with_aix_soname; case $withval in
- aix|svr4|both)
- ;;
- *)
- as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
else case e in #(
e) if test ${lt_cv_with_aix_soname+y}
then :
@@ -10112,11 +10156,15 @@ else case e in #(
e) lt_cv_with_aix_soname=aix ;;
esac
fi
+ ;;
+esac
+fi
- with_aix_soname=$lt_cv_with_aix_soname ;;
+ enable_aix_soname=$lt_cv_with_aix_soname ;;
esac
fi
+ with_aix_soname=$enable_aix_soname
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
printf "%s\n" "$with_aix_soname" >&6; }
if test aix != "$with_aix_soname"; then
@@ -10432,7 +10480,7 @@ objext=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
@@ -10574,7 +10622,7 @@ lt_prog_compiler_static=
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -10677,7 +10725,7 @@ lt_prog_compiler_static=
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -10718,6 +10766,12 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -10800,6 +10854,12 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -10816,6 +10876,9 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -11189,7 +11252,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
@@ -11201,9 +11264,6 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
ld_shlibs=yes
@@ -11304,7 +11364,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -11314,6 +11374,7 @@ _LT_EOF
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ file_list_spec='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -11333,7 +11394,7 @@ _LT_EOF
haiku*)
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs=yes
+ link_all_deplibs=no
;;
os2*)
@@ -11360,7 +11421,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
@@ -11439,6 +11500,7 @@ _LT_EOF
case $cc_basename in
tcc*)
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
export_dynamic_flag_spec='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -11459,7 +11521,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -11851,7 +11918,7 @@ fi
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -11868,14 +11935,14 @@ fi
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
@@ -12158,11 +12225,15 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
# Fabrice Bellard et al's Tiny C Compiler
ld_shlibs=yes
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -12184,7 +12255,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -12227,7 +12298,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
@@ -12263,6 +12334,9 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
hardcode_libdir_separator=:
;;
+ serenity*)
+ ;;
+
solaris*)
no_undefined_flag=' -z defs'
if test yes = "$GCC"; then
@@ -12669,7 +12743,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -12727,7 +12801,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([A-Za-z]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -12801,7 +12875,7 @@ aix[4-9]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -12895,7 +12969,7 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -12906,15 +12980,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -12927,7 +13015,7 @@ cygwin* | mingw* | pw32* | cegcc*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
@@ -12946,7 +13034,7 @@ cygwin* | mingw* | pw32* | cegcc*)
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -13053,7 +13141,28 @@ freebsd* | dragonfly* | midnightbsd*)
need_version=yes
;;
esac
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int test_pointer_size[sizeof (void *) - 5];
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
shlibpath_var=LD_LIBRARY_PATH
+else case e in #(
+ e) shlibpath_var=LD_32_LIBRARY_PATH ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -13083,8 +13192,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -13194,7 +13304,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -13206,8 +13316,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -13264,7 +13375,7 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -13284,6 +13395,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -13302,6 +13425,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -13321,7 +13456,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -13381,6 +13516,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -13478,6 +13624,496 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ serenity*)
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+='-fPIC'
+ archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ archive_cmds_need_lc=no
+ no_undefined_flag=
+ ;;
+
*)
dynamic_linker=no
;;
@@ -13662,7 +14298,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -14035,11 +14671,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -14143,11 +14779,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -14608,7 +15244,7 @@ if test yes = "$GCC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
printf %s "checking for ld used by $CC... " >&6; }
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -14723,8 +15359,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
whole_archive_flag_spec_CXX=
@@ -14744,7 +15379,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
GXX=no
@@ -15044,7 +15679,7 @@ fi
esac
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
@@ -15097,6 +15732,7 @@ fi
allow_undefined_flag_CXX=unsupported
always_export_symbols_CXX=no
enable_shared_with_static_runtimes_CXX=yes
+ file_list_spec_CXX='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -15140,7 +15776,7 @@ fi
module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
- if test yes != "$lt_cv_apple_cc_single_mod"; then
+ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
@@ -15175,7 +15811,7 @@ fi
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes_CXX=yes
file_list_spec_CXX='@'
;;
@@ -15216,7 +15852,7 @@ fi
haiku*)
archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs_CXX=yes
+ link_all_deplibs_CXX=no
;;
hpux9*)
@@ -15243,7 +15879,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -15308,7 +15944,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -15540,6 +16176,10 @@ fi
esac
;;
+ *-mlibc)
+ ld_shlibs_CXX=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
@@ -15556,7 +16196,7 @@ fi
ld_shlibs_CXX=yes
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct_CXX=yes
hardcode_shlibpath_var_CXX=no
@@ -15647,7 +16287,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
# FIXME: insert proper C++ library support
@@ -15662,6 +16302,9 @@ fi
ld_shlibs_CXX=no
;;
+ serenity*)
+ ;;
+
sunos4*)
case $cc_basename in
CC*)
@@ -15731,7 +16374,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -15742,7 +16385,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
fi
hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
@@ -15885,10 +16528,11 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
case $prev$p in
-L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
+ # Some compilers place space between "-{L,R,l}" and the path.
# Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
+ if test x-L = x"$p" ||
+ test x-R = x"$p" ||
+ test x-l = x"$p"; then
prev=$p
continue
fi
@@ -16055,7 +16699,7 @@ lt_prog_compiler_static_CXX=
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -16130,7 +16774,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
@@ -16255,7 +16899,9 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -16285,6 +16931,8 @@ lt_prog_compiler_static_CXX=
;;
psos*)
;;
+ serenity*)
+ ;;
solaris*)
case $cc_basename in
CC* | sunCC*)
@@ -16629,7 +17277,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
pw32*)
export_symbols_cmds_CXX=$ltdll_cmds
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
case $cc_basename in
cl* | icl*)
exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
@@ -16858,7 +17506,7 @@ aix[4-9]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -16952,7 +17600,7 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -16963,15 +17611,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -16983,7 +17645,7 @@ cygwin* | mingw* | pw32* | cegcc*)
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
@@ -17002,7 +17664,7 @@ cygwin* | mingw* | pw32* | cegcc*)
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -17108,7 +17770,28 @@ freebsd* | dragonfly* | midnightbsd*)
need_version=yes
;;
esac
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int test_pointer_size[sizeof (void *) - 5];
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
shlibpath_var=LD_LIBRARY_PATH
+else case e in #(
+ e) shlibpath_var=LD_32_LIBRARY_PATH ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -17138,8 +17821,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -17249,7 +17933,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -17261,8 +17945,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -17319,7 +18004,7 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -17339,6 +18024,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17357,6 +18054,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -17376,7 +18085,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -17436,6 +18145,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -17533,6 +18253,479 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static_CXX='$wl-static'
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly* | midnightbsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ serenity*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+='-fPIC'
+ archive_cmds_CXX='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ archive_cmds_need_lc_CXX=no
+ no_undefined_flag_CXX=
+ ;;
+
*)
dynamic_linker=no
;;
@@ -17881,22 +19074,43 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test "$with_gnu_ld" = yes; then
- WITH_GNU_LD_TRUE=
- WITH_GNU_LD_FALSE='#'
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking linker support for symbol maps" >&5
+printf %s "checking linker support for symbol maps... " >&6; }
+ echo '{global:*;};' >conftest.map
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ int main() { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ with_ldsym=yes
+else case e in #(
+ e) with_ldsym=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$saved_LDFLAGS"
+ rm conftest.map
+ if test "$with_ldsym" = yes; then
+ WITH_LDSYM_TRUE=
+ WITH_LDSYM_FALSE='#'
else
- WITH_GNU_LD_TRUE='#'
- WITH_GNU_LD_FALSE=
+ WITH_LDSYM_TRUE='#'
+ WITH_LDSYM_FALSE=
fi
-if test -n "$LD" && $LD -z help >/dev/null 2>/dev/null
+ if test -n "$LD" && $LD -z help >/dev/null 2>/dev/null
then :
with_sun_ld=yes
else case e in #(
e) with_sun_ld=no ;;
esac
fi
- if test "$with_sun_ld" = yes; then
+ if test "$with_sun_ld" = yes; then
WITH_SUN_LD_TRUE=
WITH_SUN_LD_FALSE='#'
else
@@ -17904,6 +19118,25 @@ else
WITH_SUN_LD_FALSE=
fi
+ if test "$with_ldsym" = yes
+then :
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -Wl,--version-script" >&5
+printf "%s\n" "-Wl,--version-script" >&6; }
+
+elif test "$with_sun_ld" = yes
+then :
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -M" >&5
+printf "%s\n" "-M" >&6; }
+
+else case e in #(
+ e)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ ;;
+esac
+fi
LIBS_system="$LIBS"
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
@@ -18755,8 +19988,8 @@ if test -z "${MINGW32_TRUE}" && test -z "${MINGW32_FALSE}"; then
as_fn_error $? "conditional \"MINGW32\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${WITH_GNU_LD_TRUE}" && test -z "${WITH_GNU_LD_FALSE}"; then
- as_fn_error $? "conditional \"WITH_GNU_LD\" was never defined.
+if test -z "${WITH_LDSYM_TRUE}" && test -z "${WITH_LDSYM_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_LDSYM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${WITH_SUN_LD_TRUE}" && test -z "${WITH_SUN_LD_FALSE}"; then
@@ -19160,7 +20393,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libHX $as_me 4.27, which was
+This file was extended by libHX $as_me 5.2, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19228,7 +20461,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-libHX config.status 4.27
+libHX config.status 5.2
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
@@ -20458,13 +21691,13 @@ See 'config.log' for more details" "$LINENO" 5; }
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit, 1996
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool 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 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -20845,7 +22078,7 @@ hardcode_direct=$hardcode_direct
# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e. impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
@@ -21088,7 +22321,7 @@ hardcode_direct=$hardcode_direct_CXX
# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e. impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute_CXX
diff --git a/configure.ac b/configure.ac
index 1ae500c..8cbc9c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([libHX], [4.27])
+AC_INIT([libHX], [5.2])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
@@ -60,10 +60,7 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
AC_SUBST([pkgconfigdir])
CHECK_GCC_FVISIBILITY
-AM_CONDITIONAL([WITH_GNU_LD], [test "$with_gnu_ld" = yes])
-AS_IF([test -n "$LD" && $LD -z help >/dev/null 2>/dev/null], [with_sun_ld=yes], [with_sun_ld=no])
-AM_CONDITIONAL([WITH_SUN_LD], [test "$with_sun_ld" = yes])
-
+CHECK_LD_SYMVERS
LIBS_system="$LIBS"
AC_CHECK_HEADERS([dlfcn.h sys/resource.h sys/un.h])
AM_CONDITIONAL([HAVE_DLFCN_H], [test "$ac_cv_header_dlfcn_h" = "yes"])
diff --git a/doc/api.rst b/doc/api.rst
index 2579486..332fca9 100644
--- a/doc/api.rst
+++ b/doc/api.rst
@@ -4,11 +4,20 @@ Function reference
* R column: Recommend version number to use in ``PKG_CONFIG_CHECK`` in
projects using libHX. Includes important bugfixes.
* M column: Lowest possible version with the same ABI (minus cv qualification).
-* F column: First version that the function name was in use.
+* F column: First version that the symbol name was in use.
====== ====== ====== ========================================
RMV MinVer FirstA Name
====== ====== ====== ========================================
+5.0 5.0 4.28 HXdeque_to_vecx
+5.2 4.28 4.28 HX_getopt6
+4.28 4.28 4.28 HX_getopt6_clean
+4.28 inline 4.28 HXOPT_CONST_INPUT
+4.28 inline 4.28 HXOPT_ITER_OPTS
+4.28 inline 4.28 HXOPT_ITER_ARGS
+4.28 inline 4.28 HXOPT_ITER_OA
+4.28 inline 4.28 HXOPT_DUP_ARGS
+4.28 4.28 4.28 HX_strtoull8601p_sec
4.27 inline 4.27 float_cpu_to_{le,be}{32,64}p
4.27 inline 4.27 float_{le,be}{32,64}p_to_cpu
4.25 inline 4.25 HX_isascii
@@ -17,7 +26,6 @@ RMV MinVer FirstA Name
4.25 inline 4.25 le{16,32,64}p_to_cpu be{16,32,64}p_to_cpu
4.25 4.25 4.25 HXSIZEOF_UNITSEC64
4.24 4.24 4.24 HX_getcwd
-4.19 4.18 4.18 HX_getopt5
4.16 4.16 4.16 HX_strtoull_nsec
4.15 4.15 4.15 HX_flpr
4.15 4.15 4.15 HX_flprf
@@ -35,7 +43,6 @@ RMV MinVer FirstA Name
4.2 4.2 4.2 HX_unit_size_cu
4.2 4.2 4.2 HX_strtod_unit
4.2 4.2 4.2 HX_strtoull_unit
-3.27 3.27 3.27 HXOPT_KEEP_ARGV
3.27 3.27 3.27 HXproc_top_fd
3.27 3.27 3.27 HXproc_switch_user
3.27 3.27 3.27 HXPROC_SU_SUCCESS
@@ -49,10 +56,7 @@ RMV MinVer FirstA Name
3.27 3.27 3.27 HX_slurp_file
3.25 3.25 3.25 HX_split_fixed
3.25 3.25 3.25 HX_split_inplace
-3.22 3.22 3.22 HXQUOTE_SQLBQUOTE
3.21 3.21 3.21 xml_getnsprop
-3.19 3.19 3.19 HXQUOTE_SQLSQUOTE
-3.18 3.18 3.18 HX_stpltrim
3.17 3.17 3.17 HX_LONGLONG_FMT
3.17 3.17 3.17 HX_SIZET_FMT
3.16 3.16 3.16 container_of
@@ -75,7 +79,6 @@ RMV MinVer FirstA Name
3.13 3.13 3.13 HX_timeval_sub
3.12 3.12 1.10.0 HX_mkdir
3.12 3.12 3.12 HX_strndup
-3.12 3.12 3.12 HX_strnlen
3.12 3.0 3.0 HXMAP_CDATA
3.12 3.0 3.0 HXMAP_CKEY
3.12 3.0 3.0 HXMAP_SCDATA
@@ -87,9 +90,9 @@ RMV MinVer FirstA Name
3.12 3.12 3.12 HXOPT_ERR_SYS
3.12 3.12 3.12 HXOPTCB_BY_LONG
3.12 3.12 3.12 HXOPTCB_BY_SHORT
-3.12 3.0 1.10.0 HXformat_aprintf
-3.12 3.0 1.10.0 HXformat_fprintf
-3.12 3.0 1.10.0 HXformat_sprintf
+3.12 4.9 1.10.0 HXformat_aprintf / HXformat3_aprintf
+3.12 4.9 1.10.0 HXformat_fprintf / HXformat3_fprintf
+3.12 4.9 1.10.0 HXformat_sprintf / HXformat3_sprintf
3.11 3.11 3.11 HXQUOTE_BASE64
3.10 3.10 3.10 BUILD_BUG_ON_EXPR
3.10 3.10 3.10 HX_readlink
@@ -216,7 +219,7 @@ RMV MinVer FirstA Name
1.28 1.28 1.28 HXTYPE_UINT32
1.28 1.28 1.28 HXTYPE_UINT64
1.28 1.28 1.28 HXTYPE_UINT8
-1.26 1.26 1.26 HX_hexdump
+1.26 5.0 1.26 HX_hexdump
1.26 1.26 1.26 HX_time_compare
1.25 1.25 1.25 HX_getl
1.25 1.25 1.25 HXmc_free
@@ -266,7 +269,6 @@ RMV MinVer FirstA Name
1.10.0 1.10.0 1.10.0 HXOPT_AND
1.10.0 1.10.0 1.10.0 HXOPT_AUTOHELP
1.10.0 1.10.0 1.10.0 HXOPT_DEC
-1.10.0 1.10.0 1.10.0 HXOPT_DESTROY_OLD
1.10.0 1.10.0 1.10.0 HXOPT_ERR_MIS
1.10.0 1.10.0 1.10.0 HXOPT_ERR_UNKN
1.10.0 1.10.0 1.10.0 HXOPT_ERR_VOID
@@ -275,7 +277,6 @@ RMV MinVer FirstA Name
1.10.0 1.10.0 1.10.0 HXOPT_NOT
1.10.0 1.10.0 1.10.0 HXOPT_OPTIONAL
1.10.0 1.10.0 1.10.0 HXOPT_OR
-1.10.0 1.10.0 1.10.0 HXOPT_PTHRU
1.10.0 1.10.0 1.10.0 HXOPT_QUIET
1.10.0 1.10.0 1.10.0 HXOPT_TABLEEND
1.10.0 1.10.0 1.10.0 HXOPT_USAGEONERR
@@ -307,13 +308,10 @@ RMV MinVer FirstA Name
1.10.0 1.10.0 1.10.0 HX_dlerror
1.10.0 1.10.0 1.10.0 HX_dlopen
1.10.0 1.10.0 1.10.0 HX_dlsym
-1.10.0 1.10.0 1.10.0 HX_dlsym<>
-1.10.0 1.10.0 1.10.0 HX_getopt
1.10.0 1.10.0 1.10.0 HX_getopt_help
1.10.0 1.10.0 1.10.0 HX_getopt_usage
1.10.0 1.10.0 1.10.0 HX_irand
1.10.0 1.10.0 1.10.0 HX_memdup
-1.10.0 1.10.0 1.10.0 HX_memdup<>
1.10.0 1.10.0 1.10.0 HX_rand
1.10.0 1.10.0 1.10.0 HX_rrmdir
1.10.0 1.10.0 1.10.0 HX_shconfig_free
@@ -329,7 +327,6 @@ RMV MinVer FirstA Name
1.10.0 1.10.0 1.10.0 HX_strrcspn
1.10.0 1.10.0 1.10.0 HX_strrev
1.10.0 1.10.0 1.10.0 HX_strrtrim
-1.10.0 1.10.0 1.10.0 HX_strsep
1.10.0 1.10.0 1.10.0 HX_strsep2
1.10.0 1.10.0 1.10.0 HX_strupper
1.10.0 1.10.0 1.10.0 HX_zvecfree
@@ -342,8 +339,7 @@ RMV MinVer FirstA Name
1.10.0 1.10.0 1.10.0 HXdeque_pop
1.10.0 1.10.0 1.10.0 HXdeque_push
1.10.0 1.10.0 1.10.0 HXdeque_shift
-1.10.0 1.10.0 1.10.0 HXdeque_to_vec
-1.10.0 1.10.0 1.10.0 HXdeque_to_vec<>
+5.0 5.0 1.10.0 HXdeque_to_vec
1.10.0 1.10.0 1.10.0 HXdeque_unshift
1.10.0 1.10.0 1.10.0 SHCONF_ONE
====== ====== ====== ========================================
@@ -355,6 +351,7 @@ Struct reference
====== ====== ================================================
MinVer FirstA
====== ====== ================================================
+4.28 4.28 struct HXopt6_result
2.0 2.0 struct HXdeque_node.sptr
1.10.0 1.10.0 struct HXdeque_node
1.10.0 1.10.0 struct HXdeque
@@ -376,6 +373,12 @@ Header reference
====== ===================================
MinVer Name
====== ===================================
+4.27 endian_float.h
+4.25 endian.h
+4.25 scope.hpp
+4.18 cast.h
+4.0 socket.h
+3.25 intdiff.hpp
3.9 libHX/io.h
3.4 libHX/init.h
3.0 libHX/map.h
@@ -384,7 +387,7 @@ MinVer Name
2.0 libHX/ctype_helper.h
1.23 libHX/misc.h
1.23 libHX/defs.h
-1.22 libHX/xml_helper.h
+1.22 libHX/libxml_helper.h
1.15 libHX/string.h
1.15 libHX/option.h
1.15 libHX/list.h
diff --git a/doc/changelog.rst b/doc/changelog.rst
index 94708fb..6d399ae 100644
--- a/doc/changelog.rst
+++ b/doc/changelog.rst
@@ -1,3 +1,61 @@
+v5.2 (2025-10-19)
+=================
+
+Fixes:
+
+* Cure buffer overflows in HXdir_read, HX_getopt6 and a use-after-free
+ in conjunction with HX_getopt6's result struct.
+
+
+v5.1 (2025-10-11)
+=================
+
+Enhancements:
+
+* getopt6: ``HXTYPE_STRP`` can now be used for HXoption::type. This will
+ perform assignment without strdup.
+* io: handle undocumented return code from FreeBSD/OpenBSD mkdir("/")
+
+Fixes:
+
+* map: resolve corruption of HXmap::items field
+
+
+v5.0 (2025-10-01)
+=================
+
+Enhancements:
+
+* getopt6: new function set ``HX_getopt6`` which allows for parsing options
+ with an iterative style.
+* getopt6: the result set no longer forces strdup-ed results on the user.
+
+Changes:
+
+* Deleted functions ``HX_getopt``, ``HX_getopt5`` (use ``HX_getopt6`` instead),
+ ``HX_strnlen`` (use ``strnlen`` instead), ``HX_strsep`` (use ``strtok_r``
+ instead), ``HX_stpltrim`` (no replacement).
+* The struct members ``HXclist::items``, ``HXdeque::items``, ``HXmap::items``
+ have changed from ``unsigned int`` to ``size_t``. The function
+ ``HXdeque_to_vec`` has accordingly changed the result parameter type.
+
+
+v4.28 (2025-09-10)
+==================
+
+Enhancements:
+
+* string: make HX_strtoull_sec support some ISO 8601 periods
+* string: add function HX_strtoull8601p_sec
+* opt: new getopt API that facilitates iterating over options and non-options
+ and doing away with unnecessary memory allocations
+
+Changes:
+
+* opt: the implementation for the HXOPT_PTHRU flag was deleted (its use will
+ now be rejected by the parser)
+
+
v4.27 (2025-03-17)
==================
diff --git a/doc/inline_clist.rst b/doc/inline_clist.rst
index f7bf138..f0b7821 100644
--- a/doc/inline_clist.rst
+++ b/doc/inline_clist.rst
@@ -53,7 +53,7 @@ Synopsis
Removes the first node in the list and returns it.
``HXclist_del``
- Deletes the node from the list.
+ Unlinks the node from the list.
The list count in the clist head is updated whenever a modification is done on
the clist through these functions.
diff --git a/doc/inline_list.rst b/doc/inline_list.rst
index 3e4cb7c..a9dca65 100644
--- a/doc/inline_list.rst
+++ b/doc/inline_list.rst
@@ -80,7 +80,7 @@ Synopsis
Adds ``elem`` to the end of the list.
``HXlist_del``
- Deletes the given element from the list.
+ Unlinks the given element from the list.
``HXlist_empty``
Tests whether the list is empty. (Note: For clists, you could also use
diff --git a/doc/misc_functions.rst b/doc/misc_functions.rst
index c988f37..0d9e11e 100644
--- a/doc/misc_functions.rst
+++ b/doc/misc_functions.rst
@@ -36,7 +36,7 @@ Miscellaneous functions
.. code-block:: c
#include <libHX/io.h>
- void HX_hexdump(FILE *fp, const void *ptr, unsigned int len);
+ void HX_hexdump(FILE *fp, const void *ptr, size_t len);
``HX_hexdump``
Outputs a nice pretty-printed hex and ASCII dump to the filedescriptor
diff --git a/doc/option_parsing.rst b/doc/option_parsing.rst
index fa928e0..a824559 100644
--- a/doc/option_parsing.rst
+++ b/doc/option_parsing.rst
@@ -12,13 +12,11 @@ Characteristics:
* recognition of the double dash as option list terminator
* offers POSIX strictness where the option list terminates at the first
non-option argument
-* option passthrough (conceptuall only works for options taking no argument,
- or when the argument is joined to a long option with a '=')
-* the parse function is one-shot; there is no context object (like popt),
- no global state (like getopt) and no ``while`` loop (either of the two others)
-* exclusively uses an option table
-* value storing is performed through pointers in the option table
-* or user-provided callbacks can be invoked per option
+* the parse function is one-shot; there is no state, just a result set
+* value storing is possible in different ways
+ * using pointers with type declarators in the option table
+ * with user-provided callbacks invoked per option
+ * by specifying the ITER_OPTS flag and iterating after HX_getopt6
Synopsis
@@ -38,7 +36,7 @@ Synopsis
const char *help, *htyp;
};
- int HX_getopt5(const struct HXoption *options_table, char **argv, int *new_argc, char ***new_argv, unsigned int flags);
+ int HX_getopt6(const struct HXoption *options_table, int argc, char **argv, struct HXopt6_result *result, unsigned int flags);
The various fields of ``struct HXoption`` are:
@@ -117,6 +115,29 @@ Type map
allocation so that subsequently modifying the original argument string
in any way will not falsely propagate.
+ HXTYPE_STRING is deprecated: When a user passes e.g. ``-S foo -S bar``
+ to HX_getopt, ptr would be assigned twice before control returns back
+ to the HX_getopt caller, thus leaking the memory for "foo" leaks. We
+ cannot retroactively make the assign routine call free(ptr) inbetween,
+ as some code might have assigned ptr a static buffer before the call to
+ HX_getopt, e.g.:
+
+ .. code-block:: c
+
+ char *p = "foo"; // default to foo
+ options_table[] = {
+ {0,'S',HXTYPE_STRING,&p,...},
+ };
+ HX_getopt(...);
+ // p is always valid, but may point to either static or allocated
+ // storage. [Also assumes a program that never frees these
+ // strings for brevity.]
+
+``HXTYPE_STRP``
+ The argument string pointer is stored in ``*(char **)ptr``.
+ No allocation occurs, but you are responsible for ensuring lifetime
+ adherence.
+
``HXTYPE_STRDQ``
The argument string is duplicated to a new memory region and the
resulting pointer is added to the given HXdeque. Note that you often
@@ -268,23 +289,23 @@ Invoking the parser
.. code-block:: c
- int HX_getopt5(const struct HXoption *options_table, char **argv, int *new_argc, char **new_argv, unsigned int flags);
- int HX_getopt(const struct HXoption *options_table, int *argc, char ***argv, unsigned int flags);
+ struct HXopt6_result {
+ int nargs;
+ const char **uarg;
+ char **dup_argv;
+ };
-``HX_getopt5`` is the central parsing function. ``options_table`` specifies
-the options that the parser will recognize. ``argv`` must be a NULL-terminated
-array of C strings.
+ int HX_getopt6(const struct HXoption *options_table, int argc, char **argv, struct HXopt6_result *result, unsigned int flags);
+ void HX_getopt6_clean(struct HXopt6_result *);
-If ``new_argv`` is non-NULL, the leftover arguments will be output as a new
-string vector on success. (That array can be freed with ``HX_zvecfree``). If
-``new_argc`` is non-NULL, the argument count for new_argv will be output too.
+``HX_getopt6`` is the central parsing function. ``options_table`` specifies the
+options that the parser will recognize. ``argv`` must be a vector of C strings,
+and ``argc`` be the count of strings that should be processed at most. ``argc``
+may be -1, in which case argc is auto-computed from ``argv``, and in this case,
+argv must be NULL-terminated.
The ``flags`` argument control the general behavior of ``HX_getopt``:
-``HXOPT_PTHRU``
- “Passthrough mode”. Any unknown options are passed through into
- ``new_argv``.
-
``HXOPT_QUIET``
Do not print any diagnostics when encountering errors in the user's
input.
@@ -299,12 +320,42 @@ The ``flags`` argument control the general behavior of ``HX_getopt``:
``HXOPT_RQ_ORDER``
Specifying this option terminates option processing when the first
non-option argument in argv is encountered. This behavior is also
- implicit when the environment variable ``POSIXLY_CORRECT`` is set.
-
-``HXOPT_KEEP_ARGV``
- Do not set ``*new_argc`` and ``*new_argv`` at all.
-
-The return value can be one of the following:
+ implicit when the environment variable ``POSIXLY_CORRECT`` is set
+ (and ``HXOPT_ANY_ORDER`` is not used).
+
+``HXOPT_ANY_ORDER``
+ Specifying this option allows mixing of options and non-options,
+ basically the opposite of the strict POSIX order.
+
+``HXOPT_CONST_INPUT``
+ Declaration by the user that elements in input argv must *not* be
+ reordered by the parser.
+
+``HXOPT_ITER_OPTS``
+ ``result->desc`` will be filled with pointers to the definitions of the
+ parsed options. ``result->oarg`` will be filled with pointers to the
+ option argument strings (potentially %nullptr if the option did not
+ take anything). ``result->nopts`` will be filled with the option count.
+
+``HXOPT_ITER_ARGS``
+ ``result->uarg`` will be filled with pointers to leftover arguments
+ (pointing into the memory regions of the original argv), and
+ ``result->nargs`` will contain the string count. uarg does *not*
+ contain NULL sentinel, so you cannot iterate with something like ``for
+ (const char **p = result.uarg; p != nullptr && *p != nullptr; ++p)``
+ but must use ``for (int uidx = 0; uidx < result.nargs; ++uidx)``.
+
+``HXOPT_ITER_OA``
+ Shortcut for ``HXOPT_ITER_OPTS | HXOPT_ITER_ARGS``.
+
+``HXOPT_DUP_ARGS``
+ ``result->dup_argv`` will be filled with copies of leftover arguments,
+ and ``result->nargs`` will contain the string count. dup_argv will
+ include the original argv[0]. dup_argv will also include a NULL
+ sentinel (not counted in nargs). You can move ``dup_argv`` out of the
+ result struct and free it yourself with ``HX_zvecfree`.
+
+The return value of HX_getopt6 can be one of the following:
``HXOPT_ERR_SUCCESS``
Parsing was successful.
@@ -325,17 +376,15 @@ The return value can be one of the following:
``HXOPT_ERR_AMBIG``
An abbreviation of a long option was ambiguous.
+``HXOPT_ERR_FLAGS``
+ HX_getopt6 was called with a ``flags`` value that contained illegal or
+ silly bit combinations.
+
negative non-zero
Failure on behalf of lower-level calls; errno.
-``HX_getopt`` is an older API where ``argv`` is both used for input and output.
-It recognizes additional flags/has additional behavior:
-
-``HXOPT_KEEP_ARGV``
- ``argc`` and ``argv`` is not updated.
-
-``HXOPT_DESTROY_OLD``
- Call ``HX_zvecfree`` on ``argv`` before updating it.
+Upon HXOPT_ERR_SUCCESS, ``HX_getopt6_clean`` must be called to release
+resources.
Pitfalls
@@ -358,11 +407,12 @@ The following is an example of a possible pitfall regarding ``HXTYPE_STRDQ``:
.help = "Add name"},
HXOPT_TABLEEND,
};
- if (HX_getopt5(options_table, *argv, &argc, &argv,
+ struct HXopt6_result result;
+ if (HX_getopt6(options_table, -1, *argv, &result,
HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
return EXIT_FAILURE;
/* ... */
- HX_zvecfree(argv);
+ HX_getopt6_clean(&result);
return EXIT_SUCCESS;
}
@@ -379,38 +429,32 @@ Limitations
The HX option parser has been influenced by both popt and Getopt::Long, but
eventually, there are differences:
-* Long options with a single dash (``-foo bar``). This unsupported
- syntax clashes easily with support for option bundling or squashing. In case
- of bundling, ``-foo`` might actually be ``-f -o -o``, or ``-f oo`` in case of
- squashing. It also introduces redundant ways to specify options, which is not
- in the spirit of the author.
+* Long options with a single dash (``-foo bar``) are not supported in HXopt.
+ This syntax clashes easily with support for option bundling or squashing. In
+ case of bundling, ``-foo`` might actually be ``-f -o -o``, or ``-f oo`` in
+ case of squashing. It also introduces redundant ways to specify options,
+ which is not in the spirit of the author.
-* Options using a ``+`` as a prefix, as in ``+foo``. Xterm for
- example uses it as a way to negate an option. In the author's opinion, using
- one character to specify options is enough — by GNU standards, a negator is
- named ``--no-foo``.
+* Options using a ``+`` as a prefix, as in ``+foo`` are not supported in HXopt.
+ Xterm for example uses it as a way to negate an option. In the author's
+ opinion, using one character to specify options is enough — by GNU standards,
+ a negator is named ``--no-foo``.
-* Table nesting like implemented in popt. HXopt has no provision for nested
- tables, as the need has not come up yet. It does however support chained
- processing. You cannot do nested tables even with callbacks, as the new argv
- array is only put in place shortly before ``HX_getopt`` returns.
+* Table nesting (like in popt) is not supported in HXopt. The need
+ has not come up yet. It does however support some forms of chained
+ processing, e.g. by using the option terminator, "--".
Examples
========
-Basic example
--------------
-
-The following code snippet should provide an equivalent of the
-GNU getopt sample.[#f5]
-
-.. [#f5] http://www.gnu.org/software/libtool/manual/libc/Example-of-Getopt.html\#Example-of-Getopt
+Storing through pointers
+------------------------
.. code-block:: c
#include <stdio.h>
- #include <stdilb.h>
+ #include <stdlib.h>
#include <libHX/option.h>
int main(int argc, char **argv)
@@ -418,7 +462,6 @@ GNU getopt sample.[#f5]
int aflag = 0;
int bflag = 0;
char *cflag = NULL;
-
struct HXoption options_table[] = {
{.sh = 'a', .type = HXTYPE_NONE, .ptr = &aflag},
{.sh = 'b', .type = HXTYPE_NONE, .ptr = &bflag},
@@ -427,20 +470,121 @@ GNU getopt sample.[#f5]
HXOPT_TABLEEND,
};
- if (HX_getopt5(options_table, argv, &argc, &argv,
- HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
+ if (HX_getopt6(options_table, argc, argv, nullptr,
+ HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS) {
+ free(cflag);
return EXIT_FAILURE;
+ }
printf("aflag = %d, bflag = %d, cvalue = %s\n",
- aflag, bflag, cvalue);
+ aflag, bflag, cflag != NULL ? cflag : "(null)");
+ free(cflag);
+ return EXIT_SUCCESS;
+ }
+
+Note how HXTYPE_STRING in conjunction with ``.ptr=&cflag`` will allocate a
+buffer that needs to be freed.
+
+Storing via iteration
+---------------------
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <libHX/option.h>
- while (*++argv != NULL)
- printf("Non-option argument %s\n", *argv);
+ int main(int argc, char **argv)
+ {
+ int aflag = 0;
+ int bflag = 0;
+ char *cflag = NULL;
+ struct HXoption options_table[] = {
+ {.sh = 'a', .type = HXTYPE_NONE},
+ {.sh = 'b', .type = HXTYPE_NONE},
+ {.sh = 'c', .type = HXTYPE_STRING},
+ HXOPT_AUTOHELP,
+ HXOPT_TABLEEND,
+ };
+
+ struct HXopt6_result result;
+ if (HX_getopt6(options_table, argc, argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_OPTS) != HXOPT_ERR_SUCCESS)
+ return EXIT_FAILURE;
+ for (int i = 1; i < result.nopts; ++i) {
+ switch (result.desc[i]->sh) {
+ case 'a':
+ aflag = 1;
+ break;
+ case 'b':
+ bflag = 1;
+ break;
+ case 'c':
+ cflag = result.oarg[i];
+ break;
+ }
+ }
+ printf("aflag = %d, bflag = %d, cvalue = %s\n",
+ aflag, bflag, cflag ? cflag : "(null)");
+ HX_getopt6_clean(&result);
+ return EXIT_SUCCESS;
+ }
+
+Note that the pointers in ``oarg`` point to the original argv and so should not
+be freed. Upon success of HX_getopt6, HX_getopt6_clean must be called.
+
+Obtaining non-option arguments
+------------------------------
+
+.. code-block:: c
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <libHX/option.h>
+
+ int main(int argc, char **argv)
+ {
+ int aflag = 0;
+ int bflag = 0;
+ char *cflag = NULL;
+ struct HXoption options_table[] = {
+ {.sh = 'a', .type = HXTYPE_NONE, .ptr = &aflag},
+ {.sh = 'b', .type = HXTYPE_NONE, .ptr = &bflag},
+ {.sh = 'c', .type = HXTYPE_STRING, .ptr = &cflag},
+ HXOPT_AUTOHELP,
+ HXOPT_TABLEEND,
+ };
- HX_zvecfree(argv);
+ struct HXopt6_result result;
+ if (HX_getopt6(options_table, argc, argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_ARGS) != HXOPT_ERR_SUCCESS) {
+ free(cflag);
+ return EXIT_FAILURE;
+ }
+ printf("aflag = %d, bflag = %d, cvalue = %s\n",
+ aflag, bflag, cflag);
+ for (int i = 1; i < result.nargs; ++i)
+ printf("Non-option argument %s\n", result.uarg[i]);
+ free(cflag);
+ HX_getopt6_clean(&result);
return EXIT_SUCCESS;
}
+C++ extension
+-------------
+
+.. code-block:: c++
+
+ {
+ struct HXopt6_auto_result result;
+ auto ret = HX_getopt6(&table, argc, argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_ARGS);
+ if (ret != HXOPT_ERR_SUCCESS)
+ return ret;
+ }
+
+
+For C++ mode, a struct "HXopt6_auto_result" is offered with a constructor for
+zero initialization and a destructor invoking HX_getopt6_clean.
+
Verbosity levels
----------------
@@ -504,8 +648,8 @@ Mask operations
What this options table does is ``cpu_mask &= ~x`` and ``net_mask |= y``, the
classic operations of clearing and setting bits.
-Support for non-standard actions
---------------------------------
+Callbacks
+---------
Supporting additional types or custom storage formats is easy, by simply using
``HXTYPE_STRING``, ``NULL`` as the data pointer (usually by not specifying it
@@ -539,53 +683,3 @@ the callback function in ``cb``.
.uptr = &number, .help = "Do this or that",
HXOPT_TABLEEND,
};
-
-Chained argument processing
----------------------------
-
-On the first run, only ``--cake`` and ``--fruit`` is considered, which is then
-used to select the next set of accepted options.
-
-.. code-block:: c
-
- static int get_cakes(int *argc, char ***argv)
- {
- struct HXoption cake_table[] = {
- ...
- };
- if (HX_getopt5(cake_table, *argv, &argc, &argv,
- HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
- return EXIT_FAILURE;
- /* ... */
- HX_zvecfree(argv);
- return EXIT_SUCCESS;
- }
-
- static int fruit_main(int argc, char **argv)
- {
- struct HXoption fruit_table[] = {
- ...
- };
- if (HX_getopt5(fruit_table, *argv, &argc, &argv,
- HXOPT_PTHRU) != HXOPT_ERR_SUCCESS)
- return EXIT_FAILURE;
- /* ... */
- HX_zvecfree(argv);
- return EXIT_SUCCESS;
- }
-
- int main(int argc, char **argv)
- {
- int cake = 0, fruit = 0;
- struct HXoption option_table[] = {
- {.ln = "cake", .type = HXTYPE_NONE, .ptr = &cake},
- {.ln = "fruit", .type = HXTYPE_NONE, .ptr = &fruit},
- HXOPT_TABLEEND,
- };
- if (HX_getopt5(option_table, *argv, &argc, &argv,
- HXOPT_PTHRU) != HXOPT_ERR_SUCCESS)
- return EXIT_FAILURE;
- int ret = cake ? cake_main(argc, argv) : fruit_main(argc, argv);
- HX_zvecfree(argv);
- return EXIT_FAILURE;
- }
diff --git a/doc/string_ops.rst b/doc/string_ops.rst
index aea4896..ab7f19b 100644
--- a/doc/string_ops.rst
+++ b/doc/string_ops.rst
@@ -102,7 +102,6 @@ In-place transformations
char *HX_chomp(char *s);
size_t HX_strltrim(char *s);
- char *HX_stpltrim(const char *s);
char *HX_strlower(char *s);
char *HX_strrev(char *s);
size_t HX_strrtrim(char *s);
@@ -117,9 +116,6 @@ In-place transformations
on the left edge of the string. Returns the number of characters that
were stripped.
-``HX_stpltrim``
- Returns a pointer to the first non-whitespace character in ``s``.
-
``HX_strlower``
Transforms all characters in the string ``s`` into lowercase using
``tolower``(3). Returns the original argument.
@@ -184,18 +180,6 @@ Possible values for type:
``HXQUOTE_URIENC``
Escapes the string so that it becomes a valid part for an URI.
-``HXQUOTE_SQLSQUOTE``
- Escapes all single quotes in the string by double single-quotes, as
- required for using it in a single-quoted SQL string. No surrounding
- quotes will be generated to facilitate concatenating of HX_strquote
- results.
-
-``HXQUOTE_SQLBQUOTE``
- Escape all backticks in the string by double backticks, as required for
- using it in a backtick-quoted SQL string (used for table names and
- columns). No surrounding ticks will be generated to facilitate
- concatenation.
-
.. _RFC 4514: http://tools.ietf.org/html/rfc4514
.. _RFC 4515: http://tools.ietf.org/html/rfc4515
.. _RFC 4648: http://tools.ietf.org/html/rfc4648
@@ -246,7 +230,6 @@ Tokenizing
char **HX_split(const char *s, const char *delimiters, size_t *fields, int max);
char **HX_split_inplace(char *s, const char *delimiters, int *fields, int max);
int HX_split_fixed(char *s, const char *delimiters, int max, char **arr);
- char *HX_strsep(char **sp, const char *delimiters);
char *HX_strsep2(char **sp, const char *dstr);
``HX_split``
@@ -277,20 +260,15 @@ Tokenizing
.. [#fixfoot] An implementation may however decide to put ``NULL`` in the
unassigned fields, but this is implementation-dependent.
-``HX_strsep``
- Extract tokens from a string. This implementation of strsep has been
- added since the function is non-standard (according to the manpage,
- conforms to BSD4.4 only) and may not be available on every operating
- system. This function extracts tokens, separated by one of the
- characters in ``delimiters``. The string is modified in-place and thus
- must be mutable. The delimiters in the string are then overwritten with
- ``'\0'``, ``*sp`` is advanced to the character after the delimiter, and
- the original pointer is returned. After the final token, ``HX_strsep``
- will return ``NULL``.
-
``HX_strsep2``
- Like ``HX_strsep``, but ``dstr`` is not an array of delimiting
- characters, but an entire substring that acts as one delimiter.
+ strsep is a string tokenization function from BSD4.4; the POSIX
+ replacement is
+
+ strsep(&string, delim) <=>
+ strtok_r(nullptr, delim, &string).
+
+ Whereas strsep/strtok would split on any character in ``delim``,
+ our strsep2 splits only on the entire ``delim`` string.
Size-bounded string operations
@@ -303,7 +281,6 @@ Size-bounded string operations
char *HX_strlcat(char *dest, const char *src, size_t length);
char *HX_strlcpy(char *dest, const char *src, size_t length);
char *HX_strlncat(char *dest, const char *src, size_t dlen, size_t slen);
- size_t HX_strnlen(const char *src, size_t max);
``HX_strlcat`` and ``HX_strlcpy`` provide implementations of the
BSD-originating ``strlcat``(3) and ``strlcpy``(3) functions. ``strlcat`` and
@@ -312,10 +289,6 @@ they always take the length of the entire buffer specified by ``dest``, instead
of just the length that is to be written. The functions guarantee that the
buffer is ``'\0'``-terminated.
-``HX_strnlen`` will return the length of the input string or the upper bound
-given by ``max``, whichever is less. It will not attempt to access more than
-this many bytes in the input buffer.
-
Allocation-related
==================
@@ -462,7 +435,7 @@ Conversion from/to human-readable durations with units
unsigned int flags);
``HX_strtoull_sec`` and ``HX_strtoull_nsec`` convert a time duration with
-units, such as ``"15min30s"`` into an all-seconds and all-nanoseconds value,
+units, such as ``15min30s`` into an all-seconds and all-nanoseconds value,
respectively. The recognized unit strings are: ``years``, ``year``, ``y``,
``months``, ``month``, ``days``, ``day``, ``d``, ``hours``, ``hour``, ``h``,
``minutes``, ``minute``, ``min``, ``seconds``, ``second``, ``s``, the empty
@@ -471,8 +444,15 @@ string (to mean seconds), ``msec``, ``ms``, ``µsec``, ``µs``, ``nsec`` and
implementation-defined. When parsing stops at any point, ``*end`` is set to the
location, similar to how the ``strtoull`` C function would.
-One year is defined to be 365.25 days of 86400 seconds; one month is defined to
-be 1/12 such a year. This is consistent with the units employed by systemd.
+One day is defined as 86400 seconds. One year is defined to be 365.25 days of
+86400 seconds. One month is defined to be 1/12 such a year (30.4375 days). This
+is consistent with the units employed by systemd.
+
+In addition, HX_strtoull_sec recognizes the most common ISO 8601-style period
+syntax, e.g. ``PT15M30S``. Time lengths are applied as mentioned above, so
+``P1M`` is treated as 2629800 seconds, *not* as a "calendaric month" that would
+expand to 28—31 days relative to some start date. There is no function offered
+to return a ``struct tm``.
``HX_unit_seconds`` is the reverse and transforms the duration given by
``seconds`` into a string representation broken into days, hours, minutes, and
@@ -555,21 +535,3 @@ full-fledged ``HX_split`` that allocates space for each substring.
callme(line);
HX_zvecfree(field);
}
-
-Using HX_strsep
----------------
-
-``HX_strsep`` provides for thread- and reentrant-safe tokenizing a string where
-strtok from the C standard would otherwise fail.
-
-.. code-block:: c
-
- #include <stdio.h>
- #include <libHX/string.h>
-
- char line[] = "root:x:0:0:root:/root:/bin/bash";
- char *wp, *p;
-
- wp = line;
- while ((p = HX_strsep(&wp, ":")) != NULL)
- printf("%s\n", p)
diff --git a/include/Makefile.in b/include/Makefile.in
index 7c0e74c..3f3227d 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.17 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2024 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -428,6 +428,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/include/libHX/defs.h b/include/libHX/defs.h
index 2ef5769..638ec15 100644
--- a/include/libHX/defs.h
+++ b/include/libHX/defs.h
@@ -18,10 +18,10 @@ template<typename Dst, typename Src> static inline auto containerof_cxx(Src *var
using K = typename std::is_const<typename std::remove_pointer<Src>::type>;
using Ch = typename std::conditional<K::value, const char, char>::type;
using D2 = typename std::conditional<K::value, const Dst, Dst>::type;
- return reinterpret_cast<D2 *>(reinterpret_cast<Ch *>(var) + ofs);
+ return reinterpret_cast<D2 *>(reinterpret_cast<Ch *>(var) - ofs);
}
}
-# define containerof(var, D1, member) containerof_cxx<D1>(var, -offsetof(D1, member))
+# define containerof(var, D1, member) containerof_cxx<D1>(var, offsetof(D1, member))
# endif
#else
# define HXsizeof_member(type, member) sizeof(((type *)NULL)->member)
diff --git a/include/libHX/deque.h b/include/libHX/deque.h
index f43def9..11fdd2a 100644
--- a/include/libHX/deque.h
+++ b/include/libHX/deque.h
@@ -25,7 +25,7 @@ struct HXdeque {
struct HXdeque_node *first;
void *ptr;
struct HXdeque_node *last;
- unsigned int items;
+ size_t items;
};
extern struct HXdeque *HXdeque_init(void);
@@ -39,7 +39,8 @@ extern void *HXdeque_get(struct HXdeque *, const void *);
extern void *HXdeque_del(struct HXdeque_node *);
extern void HXdeque_free(struct HXdeque *);
extern void HXdeque_genocide2(struct HXdeque *, void (*)(void *));
-extern void **HXdeque_to_vec(const struct HXdeque *, unsigned int *);
+extern void **HXdeque_to_vec(const struct HXdeque *, size_t *);
+extern void **HXdeque_to_vecx(const struct HXdeque *, size_t *);
static __inline__ void HXdeque_genocide(struct HXdeque *dq)
{
@@ -48,39 +49,6 @@ static __inline__ void HXdeque_genocide(struct HXdeque *dq)
#ifdef __cplusplus
} /* extern "C" */
-
-extern "C++" {
-
-template<typename type> static __inline__ type HXdeque_pop(struct HXdeque *dq)
-{
- return reinterpret_cast<type>(HXdeque_pop(dq));
-}
-
-template<typename type> static __inline__ type
-HXdeque_shift(struct HXdeque *dq)
-{
- return reinterpret_cast<type>(HXdeque_shift(dq));
-}
-
-template<typename type> static __inline__ type
-HXdeque_get(struct HXdeque *dq, const void *ptr)
-{
- return reinterpret_cast<type>(HXdeque_get(dq, ptr));
-}
-
-template<typename type> static __inline__ type
-HXdeque_del(struct HXdeque_node *nd)
-{
- return reinterpret_cast<type>(HXdeque_del(nd));
-}
-
-template<typename type> static __inline__ type *
-HXdeque_to_vec(struct HXdeque *dq, unsigned int *n)
-{
- return reinterpret_cast<type *>(HXdeque_to_vec(dq, n));
-}
-
-} /* extern "C++" */
#endif
#endif /* _LIBHX_DEQUE_H */
diff --git a/include/libHX/io.h b/include/libHX/io.h
index 7a6e921..e1d182d 100644
--- a/include/libHX/io.h
+++ b/include/libHX/io.h
@@ -45,7 +45,7 @@ extern ssize_t HXio_fullread(int, void *, size_t);
extern ssize_t HXio_fullwrite(int, const void *, size_t);
#ifndef HX_HEXDUMP_DECLARATION
#define HX_HEXDUMP_DECLARATION 1
-extern void HX_hexdump(FILE *, const void *, unsigned int);
+extern void HX_hexdump(FILE *, const void *, size_t);
#endif
#ifdef __cplusplus
diff --git a/include/libHX/list.h b/include/libHX/list.h
index f226bec..fc43e20 100644
--- a/include/libHX/list.h
+++ b/include/libHX/list.h
@@ -55,6 +55,12 @@ static __inline__ void HXlist_del(struct HXlist_head *entry)
entry->next->prev = entry->prev;
entry->next = NULL;
entry->prev = NULL;
+ /*
+ * The node is now not connected to any (true) list head, so setting
+ * ``entry->next = entry;`` does not make much sense. You can call
+ * HXlist_init if needed, and the compiler will optimize the extraneous
+ * assignemtns from HXlist_del away.
+ */
}
static __inline__ bool HXlist_empty(const struct HXlist_head *head)
@@ -104,7 +110,7 @@ struct HXclist_head {
struct HXlist_head *next, *prev;
};
};
- unsigned int items;
+ size_t items;
};
#define HXCLIST_HEAD_INIT(name) {{{&(name).list, &(name).list}}, 0}
diff --git a/include/libHX/map.h b/include/libHX/map.h
index ecbf703..d6e7a0c 100644
--- a/include/libHX/map.h
+++ b/include/libHX/map.h
@@ -73,7 +73,9 @@ struct HXmap_trav;
* @flags: flags for this map
*/
struct HXmap {
- unsigned int items, flags;
+ size_t items;
+ unsigned int flags;
+ /* extended by HXmap_private, check it too */
};
struct HXmap_ops {
diff --git a/include/libHX/misc.h b/include/libHX/misc.h
index ac381dc..b2d5de8 100644
--- a/include/libHX/misc.h
+++ b/include/libHX/misc.h
@@ -63,7 +63,7 @@ extern float HX_flprf(float, float);
extern double HX_flpr(double, double);
#ifndef HX_HEXDUMP_DECLARATION
#define HX_HEXDUMP_DECLARATION 1
-extern void HX_hexdump(FILE *, const void *, unsigned int);
+extern void HX_hexdump(FILE *, const void *, size_t);
#endif
extern bool HX_timespec_isneg(const struct timespec *);
extern struct timespec *HX_timespec_neg(struct timespec *,
@@ -104,16 +104,6 @@ static __inline__ unsigned int HX_zveclen(const char *const *args)
#ifdef __cplusplus
} /* extern "C" */
-
-extern "C++" {
-
-template<typename type> static __inline__ type
-HX_dlsym(void *handle, const char *symbol)
-{
- return reinterpret_cast<type>(HX_dlsym(handle, symbol));
-}
-
-} /* extern "C++" */
#endif
#endif /* _LIBHX_MISC_H */
diff --git a/include/libHX/option.h b/include/libHX/option.h
index ef9c626..9eff6a9 100644
--- a/include/libHX/option.h
+++ b/include/libHX/option.h
@@ -28,12 +28,9 @@ extern struct HXformat_map *HXformat_init(void);
extern void HXformat_free(struct HXformat_map *);
extern int HXformat_add(struct HXformat_map *, const char *, const void *,
unsigned int);
-#define HXformat_aprintf(a, b, c) HXformat3_aprintf((a), (b), (c))
-#define HXformat_fprintf(a, b, c) HXformat3_fprintf((a), (b), (c))
-#define HXformat_sprintf(a, b, c, d) HXformat3_sprintf((a), (b), (c), (d))
-extern ssize_t HXformat3_aprintf(const struct HXformat_map *, hxmc_t **, const char *);
-extern ssize_t HXformat3_fprintf(const struct HXformat_map *, FILE *, const char *);
-extern ssize_t HXformat3_sprintf(const struct HXformat_map *, char *, size_t, const char *);
+extern ssize_t HXformat_aprintf(const struct HXformat_map *, hxmc_t **, const char *);
+extern ssize_t HXformat_fprintf(const struct HXformat_map *, FILE *, const char *);
+extern ssize_t HXformat_sprintf(const struct HXformat_map *, char *, size_t, const char *);
/*
* OPT.C
@@ -60,7 +57,7 @@ extern ssize_t HXformat3_sprintf(const struct HXformat_map *, char *, size_t, co
* %HXTYPE_FLOAT: [fo] (float *) Read a floating point number
* %HXTYPE_DOUBLE: [fo] (double *) Read a floating point number
* %HXTYPE_STRING: [fo] (char **) Any string.
- * %HXTYPE_STRP: [f-] (const char *const *) A string.
+ * %HXTYPE_STRP: [fo] (const char *const *) A string.
* %HXTYPE_STRDQ: [-o] (struct HXdeque *) A string.
* %HXTYPE_UINT8: [-o] (uint8_t *) An integer.
* %HXTYPE_UINT16: [-o] (uint8_t *) An integer.
@@ -135,24 +132,32 @@ enum {
};
/**
- * Flags (4th arg) to HX_getopt.
- * %HXOPT_PTHRU: pass-through unknown options to new argv
- * %HXOPT_DESTROY_OLD: destroy old argv after parsing is successful
+ * Flags to HX_getopt.
* %HXOPT_QUIET: do not output any warnings to stderr
* %HXOPT_HELPONERR: print out help when a parsing error occurs
* %HXOPT_USAGEONERR: print out short usage when a parsing error occurs
- * %HXOPT_RQ_ORDER: require option order/POSIX mode:
- * first non-option terminates option processing
- * %HXOPT_KEEP_ARGV: do not replace argc/argv at all
+ * %HXOPT_RQ_ORDER: Options and non-options must not be mixed (first
+ * non-option stops parsing) and the environment variable
+ * POSIXLY_CORRECT is ignored.
+ * %HXOPT_ANY_ORDER: Options and non-options may be mixed and the
+ * environment variable POSIXLY_CORRECT is ignored.
+ * %HXOPT_CONST_INPUT: User declaration that elements in input argv can NOT
+ * be reordered by the parser.
+ * %HXOPT_ITER_OPTS: (HX_getopt6 only) Populate result.desc and .oarg.
+ * %HXOPT_ITER_ARGS: (HX_getopt6 only) Populate result.uarg.
+ * %HXOPT_DUP_ARGS: (HX_getopt6 only) Populate result.dup_argv.
*/
enum {
- HXOPT_PTHRU = 1 << 0,
- HXOPT_DESTROY_OLD = 1 << 1,
- HXOPT_QUIET = 1 << 2,
- HXOPT_HELPONERR = 1 << 3,
- HXOPT_USAGEONERR = 1 << 4,
- HXOPT_RQ_ORDER = 1 << 5,
- HXOPT_KEEP_ARGV = 1 << 6,
+ HXOPT_QUIET = 0x4U,
+ HXOPT_HELPONERR = 0x8U,
+ HXOPT_USAGEONERR = 0x10U,
+ HXOPT_RQ_ORDER = 0x20U,
+ HXOPT_ANY_ORDER = 0x80U,
+ HXOPT_CONST_INPUT = 0x100U,
+ HXOPT_ITER_OPTS = 0x200U,
+ HXOPT_ITER_ARGS = 0x400U,
+ HXOPT_ITER_OA = HXOPT_ITER_OPTS | HXOPT_ITER_ARGS,
+ HXOPT_DUP_ARGS = 0x800U,
};
/**
@@ -162,6 +167,7 @@ enum {
* %HXOPT_ERR_VOID: long option takes no value
* %HXOPT_ERR_MIS: option requires a value argument
* %HXOPT_ERR_AMBIG: long option abbreviation was ambiguous
+ * %HXOPT_ERR_FLAGS: illegal flag combination (API misuse)
*/
enum {
HXOPT_ERR_SUCCESS = 0,
@@ -169,6 +175,7 @@ enum {
HXOPT_ERR_VOID,
HXOPT_ERR_MIS,
HXOPT_ERR_AMBIG,
+ HXOPT_ERR_FLAGS,
};
/**
@@ -229,13 +236,28 @@ struct HXoption {
const char *help, *htyp;
};
-#ifndef LIBHX_ZVECFREE_DECLARATION
-#define LIBHX_ZVECFREE_DECLARATION
-extern void HX_zvecfree(char **);
-#endif
-extern int HX_getopt(const struct HXoption *, int *, char ***, unsigned int);
-extern int HX_getopt5(const struct HXoption *, char **argv, int *nargc, char ***nargv, unsigned int flags);
-#define HX_getopt(a, b, c, d) HX_getopt((a), (b), const_cast3(char ***, (c)), (d))
+/**
+ * @nopts: Number of options found.
+ * @nargs: Number of non-option arguments found.
+ * @desc: Under %HXOPT_ITER_OPTS, filled with pointers to options, else %nullptr.
+ * @oarg: Under %HXOPT_ITER_OPTS, filled with pointers to optargs, else %nullptr.
+ * @uarg: Under %HXOPT_ITER_ARGS, filled with pointers to non-opt args
+ * (always orig_argv, never dup_argv), else %nullptr.
+ * @dup_argc: String count for dup_argv.
+ * @dup_argv: Filled with copies of non-option arguments if %HXOPT_DUP_ARGS.
+ * dup_argv[0] will be the program name (useful for feeding to
+ * another HX_getopt6 call).
+ */
+struct HXopt6_result {
+ int nopts, nargs;
+ const struct HXoption **desc;
+ char **oarg, **uarg;
+ int dup_argc;
+ char **dup_argv;
+};
+
+extern int HX_getopt6(const struct HXoption *, int, char **argv, struct HXopt6_result *, unsigned int flags);
+extern void HX_getopt6_clean(struct HXopt6_result *);
extern void HX_getopt_help(const struct HXoptcb *, FILE *);
extern void HX_getopt_help_cb(const struct HXoptcb *);
extern void HX_getopt_usage(const struct HXoptcb *, FILE *);
@@ -265,6 +287,20 @@ extern void HX_shconfig_free(const struct HXoption *);
{"usage", 0, HXTYPE_NONE, NULL, NULL, HX_getopt_usage_cb, \
0, "Display brief usage message"}
# define HXOPT_TABLEEND {NULL, 0, HXTYPE_XSNTMARK}
+
+struct HXopt6_auto_result : public HXopt6_result {
+ HXopt6_auto_result() : HXopt6_result() {}
+ ~HXopt6_auto_result() { HX_getopt6_clean(this); }
+ /*
+ * Unlike the unique_tie class, no operator~ is provided for
+ * HXopt6_auto_result, because reusing a result is not outright
+ * possible;
+ * auto ret = HX_getopt6(&table, argc, argv, &result, HXOPT_ITER_ARGS);
+ * ret = HX_getopt6(&table, result.nargs, result.uarg, &~result, HXOPT_ITER_ARGS):
+ * would kill off result before nargs/uarg is loaded.
+ */
+};
+
#endif
#endif /* _LIBHX_OPTION_H */
diff --git a/include/libHX/string.h b/include/libHX/string.h
index 4da3619..707a2a9 100644
--- a/include/libHX/string.h
+++ b/include/libHX/string.h
@@ -26,8 +26,6 @@ enum {
HXQUOTE_LDAPRDN,
HXQUOTE_BASE64,
HXQUOTE_URIENC,
- HXQUOTE_SQLSQUOTE,
- HXQUOTE_SQLBQUOTE,
HXQUOTE_BASE64URL,
HXQUOTE_BASE64IMAP,
_HXQUOTE_MAX,
@@ -63,6 +61,10 @@ extern hxmc_t *HXmc_memins(hxmc_t **, size_t, const void *, size_t);
extern hxmc_t *HXmc_memdel(hxmc_t *, size_t, size_t);
extern void HXmc_free(hxmc_t *);
extern void HXmc_zvecfree(hxmc_t **);
+#ifndef LIBHX_ZVECFREE_DECLARATION
+#define LIBHX_ZVECFREE_DECLARATION
+extern void HX_zvecfree(char **);
+#endif
/*
* STRING.C
@@ -87,15 +89,12 @@ extern char *HX_strlcpy(char *, const char *, size_t);
extern char *HX_strlncat(char *, const char *, size_t, size_t);
extern char *HX_strlower(char *);
extern size_t HX_strltrim(char *);
-extern char *HX_stpltrim(const char *);
extern char *HX_strmid(const char *, long, long);
extern char *HX_strndup(const char *, size_t);
-extern size_t HX_strnlen(const char *, size_t);
extern char *HX_strquote(const char *, unsigned int, char **);
extern size_t HX_strrcspn(const char *, const char *);
extern char *HX_strrev(char *);
extern size_t HX_strrtrim(char *);
-extern char *HX_strsep(char **, const char *);
extern char *HX_strsep2(char **, const char *);
extern char *HX_strupper(char *);
extern double HX_strtod_unit(const char *, char **, unsigned int exponent);
@@ -104,6 +103,7 @@ extern char *HX_unit_size(char *out, size_t bufsize, unsigned long long size, un
extern char *HX_unit_size_cu(char *out, size_t bufsize, unsigned long long size, unsigned int divisor);
extern unsigned long long HX_strtoull_sec(const char *s, char **);
extern unsigned long long HX_strtoull_nsec(const char *s, char **);
+extern unsigned long long HX_strtoull8601p_sec(const char *s, char **);
extern char *HX_unit_seconds(char *out, size_t bufsize, unsigned long long seconds, unsigned int flags);
static __inline__ void *HX_memdup(const void *buf, size_t len)
@@ -118,16 +118,4 @@ static __inline__ void *HX_memdup(const void *buf, size_t len)
} /* extern "C" */
#endif
-#ifdef __cplusplus
-extern "C++" {
-
-template<typename type> static __inline__ type
-HX_memdup(const void *data, size_t n)
-{
- return reinterpret_cast<type>(HX_memdup(data, n));
-}
-
-} /* extern "C++" */
-#endif
-
#endif /* _LIBHX_STRING_H */
diff --git a/m4/gcc4_visibility.m4 b/m4/gcc4_visibility.m4
index 708d42b..e58a0d7 100644
--- a/m4/gcc4_visibility.m4
+++ b/m4/gcc4_visibility.m4
@@ -19,3 +19,24 @@ AC_DEFUN([CHECK_GCC_FVISIBILITY], [
CFLAGS="$saved_CFLAGS"
AC_LANG_POP([C])
])
+
+AC_DEFUN([CHECK_LD_SYMVERS], [
+ AC_MSG_CHECKING([linker support for symbol maps])
+ echo '{global:*;};' >conftest.map
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([ int main() { return 0; } ])],
+ [with_ldsym=yes], [with_ldsym=no])
+ LDFLAGS="$saved_LDFLAGS"
+ rm conftest.map
+ AM_CONDITIONAL([WITH_LDSYM], [test "$with_ldsym" = yes])
+ AS_IF([test -n "$LD" && $LD -z help >/dev/null 2>/dev/null], [with_sun_ld=yes], [with_sun_ld=no])
+ AM_CONDITIONAL([WITH_SUN_LD], [test "$with_sun_ld" = yes])
+ AS_IF([test "$with_ldsym" = yes], [
+ AC_MSG_RESULT([-Wl,--version-script])
+ ], [test "$with_sun_ld" = yes], [
+ AC_MSG_RESULT([-M])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 717e769..8d323b3 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,6 +1,6 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
+# Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software
# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
@@ -9,13 +9,13 @@
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool 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 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -32,7 +32,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
-# serial 59 LT_INIT
+# serial 63 LT_INIT
# LT_PREREQ(VERSION)
@@ -60,7 +60,7 @@ esac
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+[AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -616,7 +616,7 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
+# AC_OUTPUT is called), in case it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
@@ -651,9 +651,9 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2011 Free Software Foundation, Inc.
+Copyright (C) 2024 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
+gives unlimited permission to copy, distribute and modify it."
while test 0 != $[#]
do
@@ -974,6 +974,7 @@ _lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
+
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
@@ -1024,6 +1025,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -f conftest.*
fi])
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ AC_CACHE_CHECK([for -no_fixup_chains linker flag],
+ [lt_cv_support_no_fixup_chains],
+ [ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([],[])],
+ lt_cv_support_no_fixup_chains=yes,
+ lt_cv_support_no_fixup_chains=no
+ )
+ LDFLAGS=$save_LDFLAGS
+ ]
+ )
+
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -1048,7 +1064,7 @@ _LT_EOF
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -1073,13 +1089,32 @@ _LT_EOF
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains'])
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -1125,7 +1160,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
-[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+[ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
@@ -1255,7 +1290,9 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
@@ -1367,7 +1404,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -1382,7 +1419,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
@@ -1411,7 +1448,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*)
@@ -1494,7 +1531,7 @@ _LT_DECL([], [AR], [1], [The archiver])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
-# higher priority because thats what people were doing historically (setting
+# higher priority because that's what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
@@ -1544,7 +1581,7 @@ AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_REQUIRE([AC_PROG_RANLIB])
test -z "$RANLIB" && RANLIB=:
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])
@@ -1555,15 +1592,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -1695,14 +1725,14 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -1724,7 +1754,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1884,11 +1914,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -1945,7 +1975,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -2313,7 +2343,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -2371,7 +2401,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -2446,7 +2476,7 @@ aix[[4-9]]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -2540,7 +2570,7 @@ bsdi[[45]]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -2551,15 +2581,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -2572,7 +2616,7 @@ cygwin* | mingw* | pw32* | cegcc*)
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
@@ -2591,7 +2635,7 @@ m4_if([$1], [],[
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -2698,7 +2742,21 @@ freebsd* | dragonfly* | midnightbsd*)
need_version=yes
;;
esac
- shlibpath_var=LD_LIBRARY_PATH
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int test_pointer_size[sizeof (void *) - 5];
+ ]])],
+ [shlibpath_var=LD_LIBRARY_PATH],
+ [shlibpath_var=LD_32_LIBRARY_PATH])
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -2728,8 +2786,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -2839,7 +2898,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -2851,8 +2910,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -2886,7 +2946,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -2906,6 +2966,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -2924,6 +2996,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -2943,7 +3027,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -3003,6 +3087,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -3100,6 +3195,21 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ _LT_COMPILER_PIC($1)='-fPIC'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ ;;
+
*)
dynamic_linker=no
;;
@@ -3275,7 +3385,7 @@ if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -3384,7 +3494,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -3456,7 +3566,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -3483,7 +3592,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -3492,7 +3601,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -3565,7 +3674,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -3583,7 +3696,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
@@ -3599,6 +3712,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3647,7 +3764,7 @@ file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -3699,7 +3816,7 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
@@ -3790,7 +3907,7 @@ lt_cv_sharedlib_from_linklib_cmd,
[lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -3822,16 +3939,16 @@ _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
m4_defun([_LT_PATH_MANIFEST_TOOL],
[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool],
+ [lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&AS_MESSAGE_LOG_FD
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
@@ -3860,7 +3977,7 @@ AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
@@ -3935,7 +4052,7 @@ case $host_os in
aix*)
symcode='[[BCDT]]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
@@ -3950,7 +4067,7 @@ osf*)
symcode='[[BCDEGQRST]]'
;;
solaris*)
- symcode='[[BDRT]]'
+ symcode='[[BCDRT]]'
;;
sco3.2v5*)
symcode='[[DT]]'
@@ -4014,7 +4131,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -4065,13 +4182,14 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -4241,7 +4359,7 @@ m4_if([$1], [CXX], [
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4317,7 +4435,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4443,7 +4561,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4473,6 +4593,8 @@ m4_if([$1], [CXX], [
;;
psos*)
;;
+ serenity*)
+ ;;
solaris*)
case $cc_basename in
CC* | sunCC*)
@@ -4565,7 +4687,7 @@ m4_if([$1], [CXX], [
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4669,7 +4791,7 @@ m4_if([$1], [CXX], [
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4711,6 +4833,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -4793,6 +4921,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
+ *-mlibc)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -4809,6 +4943,9 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -4944,7 +5081,7 @@ m4_if([$1], [CXX], [
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
case $cc_basename in
cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
@@ -5002,7 +5139,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
@@ -5014,9 +5151,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5117,7 +5251,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -5127,6 +5261,7 @@ _LT_EOF
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5146,7 +5281,7 @@ _LT_EOF
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
os2*)
@@ -5173,7 +5308,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -5252,6 +5387,7 @@ _LT_EOF
case $cc_basename in
tcc*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -5272,7 +5408,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -5574,7 +5715,7 @@ _LT_EOF
_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -5591,14 +5732,14 @@ _LT_EOF
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
@@ -5810,11 +5951,15 @@ _LT_EOF
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -5836,7 +5981,7 @@ _LT_EOF
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -5879,7 +6024,7 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -5915,6 +6060,9 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test yes = "$GCC"; then
@@ -6173,7 +6321,7 @@ _LT_TAGDECL([], [hardcode_direct], [0],
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
[Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting $shlibpath_var if the
+ "absolute", i.e. impossible to change by setting $shlibpath_var if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -6231,7 +6379,7 @@ _LT_TAGVAR(objext, $1)=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
_LT_TAG_COMPILER
# Save the default compiler, since it gets overwritten when the other
@@ -6420,8 +6568,7 @@ if test yes != "$_lt_caught_CXX_error"; then
wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
@@ -6441,7 +6588,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
GXX=no
@@ -6650,7 +6797,7 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
@@ -6703,6 +6850,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6749,7 +6897,7 @@ if test yes != "$_lt_caught_CXX_error"; then
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
@@ -6790,7 +6938,7 @@ if test yes != "$_lt_caught_CXX_error"; then
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
hpux9*)
@@ -6817,7 +6965,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -6882,7 +7030,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -7114,6 +7262,10 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
+ *-mlibc)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
@@ -7130,7 +7282,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -7221,7 +7373,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# FIXME: insert proper C++ library support
@@ -7236,6 +7388,9 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=no
;;
+ serenity*)
+ ;;
+
sunos4*)
case $cc_basename in
CC*)
@@ -7305,7 +7460,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -7316,7 +7471,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
@@ -7554,10 +7709,11 @@ if AC_TRY_EVAL(ac_compile); then
case $prev$p in
-L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
+ # Some compilers place space between "-{L,R,l}" and the path.
# Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
+ if test x-L = x"$p" ||
+ test x-R = x"$p" ||
+ test x-l = x"$p"; then
prev=$p
continue
fi
@@ -8215,7 +8371,7 @@ AC_SUBST([DLLTOOL])
# ----------------
# Check for a file(cmd) program that can be used to detect file type and magic
m4_defun([_LT_DECL_FILECMD],
-[AC_CHECK_TOOL([FILECMD], [file], [:])
+[AC_CHECK_PROG([FILECMD], [file], [file], [:])
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
])# _LD_DECL_FILECMD
@@ -8231,73 +8387,6 @@ _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f "$lt_ac_sed" && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test 10 -lt "$lt_ac_count" && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test "$lt_ac_count" -gt "$lt_ac_max"; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_SED], [])
@@ -8344,7 +8433,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
[case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -8357,7 +8446,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -8383,9 +8472,9 @@ AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
[#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index b0b5e9c..25caa89 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -1,6 +1,6 @@
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free
# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@@ -8,7 +8,7 @@
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 8 ltoptions.m4
+# serial 10 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -128,7 +128,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -323,29 +323,39 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
-# implement the --with-aix-soname flag, and support the `aix-soname=aix'
-# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
-# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+# implement the --enable-aix-soname configure option, and support the
+# `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options.
+# DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
- AC_ARG_WITH([aix-soname],
- [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ AC_ARG_ENABLE([aix-soname],
+ [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
- [case $withval in
- aix|svr4|both)
- ;;
- *)
- AC_MSG_ERROR([Unknown argument to --with-aix-soname])
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname],
- [AC_CACHE_VAL([lt_cv_with_aix_soname],
- [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
- with_aix_soname=$lt_cv_with_aix_soname])
+ [case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --enable-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname],
+ [_AC_ENABLE_IF([with], [aix-soname],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)])
+ enable_aix_soname=$lt_cv_with_aix_soname])
+ with_aix_soname=$enable_aix_soname
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
@@ -376,30 +386,50 @@ LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+[AC_ARG_ENABLE([pic],
+ [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [pic_mode=m4_default([$1], [default])])
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [dnl Continue to support --with-pic and --without-pic, for backward
+ dnl compatibility.
+ _AC_ENABLE_IF([with], [pic],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])]
+ )
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
index 902508b..5b5c80a 100644
--- a/m4/ltsugar.m4
+++ b/m4/ltsugar.m4
@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index b155d0a..228df3f 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -1,6 +1,6 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
+# Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation,
# Inc.
# Written by Scott James Remnant, 2004
#
@@ -10,15 +10,15 @@
# @configure_input@
-# serial 4245 ltversion.m4
+# serial 4441 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.7])
-m4_define([LT_PACKAGE_REVISION], [2.4.7])
+m4_define([LT_PACKAGE_VERSION], [2.5.4])
+m4_define([LT_PACKAGE_REVISION], [2.5.4])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.7'
-macro_revision='2.4.7'
+[macro_version='2.5.4'
+macro_revision='2.5.4'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
index 0f7a875..22b5346 100644
--- a/m4/lt~obsolete.m4
+++ b/m4/lt~obsolete.m4
@@ -1,6 +1,6 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free
# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
diff --git a/src/Makefile.am b/src/Makefile.am
index f28c0a6..2e26d7e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,8 +9,8 @@ libHX_la_SOURCES = deque.c dl.c format.c io.c map.c \
mc.c misc.c opt.c proc.c \
rand.c socket.c string.c time.c
libHX_la_LIBADD = ${libdl_LIBS} -lm ${libpthread_LIBS} ${librt_LIBS} ${libsocket_LIBS}
-libHX_la_LDFLAGS = -no-undefined -version-info 40:0:8
-if WITH_GNU_LD
+libHX_la_LDFLAGS = -no-undefined -version-info 43:0:0
+if WITH_LDSYM
libHX_la_LDFLAGS += -Wl,--version-script=${srcdir}/libHX.map
endif
if WITH_SUN_LD
@@ -60,7 +60,7 @@ if HAVE_CXX
check_PROGRAMS += tx-compile tx-cast tx-deque tx-dir \
tx-intdiff tx-list tx-list2 \
tx-misc tx-netio \
- tx-option tx-proc tx-rand tx-strchr2 tx-string \
+ tx-proc tx-rand tx-strchr2 tx-string \
tx-strquote tx-time
TESTS += tx-strchr2 tx-strquote
tx_cast_SOURCES = tx-cast.cpp
@@ -80,8 +80,6 @@ tx_misc_SOURCES = tx-misc.cpp
tx_misc_LDADD = libHX.la
tx_netio_SOURCES = tx-netio.cpp
tx_netio_LDADD = libHX.la ${libsocket_LIBS}
-tx_option_SOURCES = tx-option.cpp
-tx_option_LDADD = libHX.la
tx_proc_SOURCES = tx-proc.cpp
tx_proc_LDADD = libHX.la
tx_rand_SOURCES = tx-rand.cpp
diff --git a/src/Makefile.in b/src/Makefile.in
index 0768775..9cbd614 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.17 from Makefile.am.
+# Makefile.in generated by automake 1.18.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2024 Free Software Foundation, Inc.
+# Copyright (C) 1994-2025 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -92,7 +92,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@WITH_GNU_LD_TRUE@am__append_1 = -Wl,--version-script=${srcdir}/libHX.map
+@WITH_LDSYM_TRUE@am__append_1 = -Wl,--version-script=${srcdir}/libHX.map
@WITH_SUN_LD_TRUE@am__append_2 = -Wl,-M,${srcdir}/libHX.map
@MINGW32_TRUE@am__append_3 = ux-file.c ux-mmap.c
@MINGW32_TRUE@am__append_4 = -lws2_32
@@ -110,7 +110,7 @@ TESTS = tc-format$(EXEEXT) tc-option$(EXEEXT) tc-strchr2$(EXEEXT) \
@HAVE_CXX_TRUE@am__append_5 = tx-compile tx-cast tx-deque tx-dir \
@HAVE_CXX_TRUE@ tx-intdiff tx-list tx-list2 \
@HAVE_CXX_TRUE@ tx-misc tx-netio \
-@HAVE_CXX_TRUE@ tx-option tx-proc tx-rand tx-strchr2 tx-string \
+@HAVE_CXX_TRUE@ tx-proc tx-rand tx-strchr2 tx-string \
@HAVE_CXX_TRUE@ tx-strquote tx-time
@HAVE_CXX_TRUE@am__append_6 = tx-strchr2 tx-strquote
@@ -131,10 +131,10 @@ CONFIG_CLEAN_VPATH_FILES =
@HAVE_CXX_TRUE@ tx-deque$(EXEEXT) tx-dir$(EXEEXT) \
@HAVE_CXX_TRUE@ tx-intdiff$(EXEEXT) tx-list$(EXEEXT) \
@HAVE_CXX_TRUE@ tx-list2$(EXEEXT) tx-misc$(EXEEXT) \
-@HAVE_CXX_TRUE@ tx-netio$(EXEEXT) tx-option$(EXEEXT) \
-@HAVE_CXX_TRUE@ tx-proc$(EXEEXT) tx-rand$(EXEEXT) \
-@HAVE_CXX_TRUE@ tx-strchr2$(EXEEXT) tx-string$(EXEEXT) \
-@HAVE_CXX_TRUE@ tx-strquote$(EXEEXT) tx-time$(EXEEXT)
+@HAVE_CXX_TRUE@ tx-netio$(EXEEXT) tx-proc$(EXEEXT) \
+@HAVE_CXX_TRUE@ tx-rand$(EXEEXT) tx-strchr2$(EXEEXT) \
+@HAVE_CXX_TRUE@ tx-string$(EXEEXT) tx-strquote$(EXEEXT) \
+@HAVE_CXX_TRUE@ tx-time$(EXEEXT)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -296,10 +296,6 @@ am__tx_netio_SOURCES_DIST = tx-netio.cpp
@HAVE_CXX_TRUE@am_tx_netio_OBJECTS = tx-netio.$(OBJEXT)
tx_netio_OBJECTS = $(am_tx_netio_OBJECTS)
@HAVE_CXX_TRUE@tx_netio_DEPENDENCIES = libHX.la $(am__DEPENDENCIES_1)
-am__tx_option_SOURCES_DIST = tx-option.cpp
-@HAVE_CXX_TRUE@am_tx_option_OBJECTS = tx-option.$(OBJEXT)
-tx_option_OBJECTS = $(am_tx_option_OBJECTS)
-@HAVE_CXX_TRUE@tx_option_DEPENDENCIES = libHX.la
am__tx_proc_SOURCES_DIST = tx-proc.cpp
@HAVE_CXX_TRUE@am_tx_proc_OBJECTS = tx-proc.$(OBJEXT)
tx_proc_OBJECTS = $(am_tx_proc_OBJECTS)
@@ -360,11 +356,11 @@ am__depfiles_remade = ./$(DEPDIR)/deque.Plo ./$(DEPDIR)/dl.Plo \
./$(DEPDIR)/tx-deque.Po ./$(DEPDIR)/tx-dir.Po \
./$(DEPDIR)/tx-intdiff.Po ./$(DEPDIR)/tx-list.Po \
./$(DEPDIR)/tx-misc.Po ./$(DEPDIR)/tx-netio.Po \
- ./$(DEPDIR)/tx-option.Po ./$(DEPDIR)/tx-proc.Po \
- ./$(DEPDIR)/tx-rand.Po ./$(DEPDIR)/tx-strchr2.Po \
- ./$(DEPDIR)/tx-string.Po ./$(DEPDIR)/tx-strquote.Po \
- ./$(DEPDIR)/tx-time.Po ./$(DEPDIR)/tx_list2-tx-list2.Po \
- ./$(DEPDIR)/ux-file.Plo ./$(DEPDIR)/ux-mmap.Plo
+ ./$(DEPDIR)/tx-proc.Po ./$(DEPDIR)/tx-rand.Po \
+ ./$(DEPDIR)/tx-strchr2.Po ./$(DEPDIR)/tx-string.Po \
+ ./$(DEPDIR)/tx-strquote.Po ./$(DEPDIR)/tx-time.Po \
+ ./$(DEPDIR)/tx_list2-tx-list2.Po ./$(DEPDIR)/ux-file.Plo \
+ ./$(DEPDIR)/ux-mmap.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -410,9 +406,8 @@ SOURCES = $(libHX_la_SOURCES) tc-cast.c tc-compile.c tc-deque.c \
$(tx_cast_SOURCES) $(tx_compile_SOURCES) $(tx_deque_SOURCES) \
$(tx_dir_SOURCES) $(tx_intdiff_SOURCES) $(tx_list_SOURCES) \
$(tx_list2_SOURCES) $(tx_misc_SOURCES) $(tx_netio_SOURCES) \
- $(tx_option_SOURCES) $(tx_proc_SOURCES) $(tx_rand_SOURCES) \
- $(tx_strchr2_SOURCES) $(tx_string_SOURCES) \
- $(tx_strquote_SOURCES) $(tx_time_SOURCES)
+ $(tx_proc_SOURCES) $(tx_rand_SOURCES) $(tx_strchr2_SOURCES) \
+ $(tx_string_SOURCES) $(tx_strquote_SOURCES) $(tx_time_SOURCES)
DIST_SOURCES = $(am__libHX_la_SOURCES_DIST) tc-cast.c tc-compile.c \
tc-deque.c tc-dir.c tc-format.c tc-io.c tc-list.c tc-list2.c \
tc-map.c tc-memmem.c tc-misc.c tc-netio.c tc-option.c \
@@ -423,10 +418,9 @@ DIST_SOURCES = $(am__libHX_la_SOURCES_DIST) tc-cast.c tc-compile.c \
$(am__tx_dir_SOURCES_DIST) $(am__tx_intdiff_SOURCES_DIST) \
$(am__tx_list_SOURCES_DIST) $(am__tx_list2_SOURCES_DIST) \
$(am__tx_misc_SOURCES_DIST) $(am__tx_netio_SOURCES_DIST) \
- $(am__tx_option_SOURCES_DIST) $(am__tx_proc_SOURCES_DIST) \
- $(am__tx_rand_SOURCES_DIST) $(am__tx_strchr2_SOURCES_DIST) \
- $(am__tx_string_SOURCES_DIST) $(am__tx_strquote_SOURCES_DIST) \
- $(am__tx_time_SOURCES_DIST)
+ $(am__tx_proc_SOURCES_DIST) $(am__tx_rand_SOURCES_DIST) \
+ $(am__tx_strchr2_SOURCES_DIST) $(am__tx_string_SOURCES_DIST) \
+ $(am__tx_strquote_SOURCES_DIST) $(am__tx_time_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -563,7 +557,7 @@ am__common_driver_flags = \
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
-# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
@@ -780,7 +774,7 @@ libHX_la_SOURCES = deque.c dl.c format.c io.c map.c mc.c misc.c opt.c \
proc.c rand.c socket.c string.c time.c $(am__append_3)
libHX_la_LIBADD = ${libdl_LIBS} -lm ${libpthread_LIBS} ${librt_LIBS} \
${libsocket_LIBS} $(am__append_4)
-libHX_la_LDFLAGS = -no-undefined -version-info 40:0:8 $(am__append_1) \
+libHX_la_LDFLAGS = -no-undefined -version-info 43:0:0 $(am__append_1) \
$(am__append_2)
EXTRA_libHX_la_DEPENDENCIES = libHX.map
EXTRA_DIST = internal.h map_int.h libHX.map uxcompat.h analyze.sh
@@ -825,8 +819,6 @@ tc_time_LDADD = libHX.la
@HAVE_CXX_TRUE@tx_misc_LDADD = libHX.la
@HAVE_CXX_TRUE@tx_netio_SOURCES = tx-netio.cpp
@HAVE_CXX_TRUE@tx_netio_LDADD = libHX.la ${libsocket_LIBS}
-@HAVE_CXX_TRUE@tx_option_SOURCES = tx-option.cpp
-@HAVE_CXX_TRUE@tx_option_LDADD = libHX.la
@HAVE_CXX_TRUE@tx_proc_SOURCES = tx-proc.cpp
@HAVE_CXX_TRUE@tx_proc_LDADD = libHX.la
@HAVE_CXX_TRUE@tx_rand_SOURCES = tx-rand.cpp
@@ -1041,10 +1033,6 @@ tx-netio$(EXEEXT): $(tx_netio_OBJECTS) $(tx_netio_DEPENDENCIES) $(EXTRA_tx_netio
@rm -f tx-netio$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(tx_netio_OBJECTS) $(tx_netio_LDADD) $(LIBS)
-tx-option$(EXEEXT): $(tx_option_OBJECTS) $(tx_option_DEPENDENCIES) $(EXTRA_tx_option_DEPENDENCIES)
- @rm -f tx-option$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tx_option_OBJECTS) $(tx_option_LDADD) $(LIBS)
-
tx-proc$(EXEEXT): $(tx_proc_OBJECTS) $(tx_proc_DEPENDENCIES) $(EXTRA_tx_proc_DEPENDENCIES)
@rm -f tx-proc$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(tx_proc_OBJECTS) $(tx_proc_LDADD) $(LIBS)
@@ -1119,7 +1107,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-list.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-misc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-netio.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-option.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-proc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-rand.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tx-strchr2.Po@am__quote@ # am--include-marker
@@ -1513,6 +1500,7 @@ tx-strquote.log: tx-strquote$(EXEEXT)
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -1640,7 +1628,6 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/tx-list.Po
-rm -f ./$(DEPDIR)/tx-misc.Po
-rm -f ./$(DEPDIR)/tx-netio.Po
- -rm -f ./$(DEPDIR)/tx-option.Po
-rm -f ./$(DEPDIR)/tx-proc.Po
-rm -f ./$(DEPDIR)/tx-rand.Po
-rm -f ./$(DEPDIR)/tx-strchr2.Po
@@ -1739,7 +1726,6 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/tx-list.Po
-rm -f ./$(DEPDIR)/tx-misc.Po
-rm -f ./$(DEPDIR)/tx-netio.Po
- -rm -f ./$(DEPDIR)/tx-option.Po
-rm -f ./$(DEPDIR)/tx-proc.Po
-rm -f ./$(DEPDIR)/tx-rand.Po
-rm -f ./$(DEPDIR)/tx-strchr2.Po
diff --git a/src/deque.c b/src/deque.c
index bc39e0e..4124d1a 100644
--- a/src/deque.c
+++ b/src/deque.c
@@ -1,6 +1,6 @@
/*
* Double-ended queues
- * Copyright Jan Engelhardt, 2002-2008
+ * Copyright Jan Engelhardt, 2025
*
* This file is part of libHX. libHX is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser
@@ -8,7 +8,9 @@
* either version 2.1 or (at your option) any later version.
*/
#include <errno.h>
+#include <limits.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <libHX/deque.h>
@@ -162,22 +164,62 @@ EXPORT_SYMBOL void HXdeque_genocide2(struct HXdeque *dq, void (*xfree)(void *))
free(dq);
}
-EXPORT_SYMBOL void **
-HXdeque_to_vec(const struct HXdeque *dq, unsigned int *num)
+static void **
+HXdeque_to_veci(const struct HXdeque *dq, size_t *num, bool sentinel)
{
const struct HXdeque_node *trav;
void **ret, **p;
- ret = malloc((dq->items + 1) * sizeof(void *));
+ ret = malloc((dq->items + sentinel) * sizeof(void *));
if (ret == NULL)
return NULL;
p = ret;
for (trav = dq->first; trav != NULL; trav = trav->next)
*p++ = trav->ptr;
- *p = NULL;
+ if (sentinel)
+ *p = NULL;
if (num != NULL)
*num = dq->items;
return ret;
}
+
+EXPORT_SYMBOL void **
+HXdeque_to_vec(const struct HXdeque *dq, size_t *num)
+{
+ return HXdeque_to_veci(dq, num, true);
+}
+
+EXPORT_SYMBOL void **
+HXdeque_to_vecx(const struct HXdeque *dq, size_t *num)
+{
+ return HXdeque_to_veci(dq, num, false);
+}
+
+char **HXdeque_to_vec_strdup(const struct HXdeque *dq, size_t *num)
+{
+ const struct HXdeque_node *iter;
+ char **ret, **p;
+ int se;
+
+ ret = malloc((dq->items + 1) * sizeof(char *));
+ if (ret == nullptr)
+ return nullptr;
+ p = ret;
+ for (iter = dq->first; iter != nullptr; ++p, iter = iter->next) {
+ *p = strdup(iter->ptr);
+ if (*p == nullptr)
+ goto out;
+ }
+ *p = nullptr;
+ if (num != nullptr)
+ *num = dq->items;
+ return ret;
+
+ out:
+ se = errno;
+ HX_zvecfree(ret);
+ errno = se;
+ return nullptr;
+}
diff --git a/src/format.c b/src/format.c
index e924c6a..985a527 100644
--- a/src/format.c
+++ b/src/format.c
@@ -20,9 +20,6 @@
#undef HXformat_aprintf
#undef HXformat_fprintf
#undef HXformat_sprintf
-extern int HXformat_aprintf(const struct HXformat_map *, hxmc_t **, const char *);
-extern int HXformat_sprintf(const struct HXformat_map *, char *, size_t, const char *);
-extern int HXformat_fprintf(const struct HXformat_map *, FILE *, const char *);
/* To make it easier on the highlighter */
#define C_OPEN '('
@@ -380,7 +377,7 @@ static hxmc_t *HXformat2_xcall(const char *name, const char **pptr,
hxmc_t *ret, *ret2, **argv;
struct HXdeque *dq;
const char *s, *delim;
- int err = 0;
+ ssize_t err = 0;
dq = HXdeque_init();
if (dq == NULL)
@@ -563,13 +560,13 @@ HXformat2_xany(const char **pptr, const struct HXformat_map *blk)
/* Closing parenthesis - variable */
const struct fmt_entry *entry;
hxmc_t *new_name = NULL;
- int eret;
+ ssize_t eret;
*pptr = ++s;
eret = HXformat_aprintf(blk, &new_name, name);
if (eret <= 0) {
ret = NULL;
- } else if (*new_name == '\0') {
+ } else if (new_name == nullptr || *new_name == '\0') {
ret = &HXformat2_nexp;
} else {
entry = HXmap_get(blk->vars, new_name);
@@ -630,14 +627,7 @@ EXPORT_SYMBOL struct HXformat_map *HXformat_init(void)
return NULL;
}
-EXPORT_SYMBOL int HXformat_aprintf(const struct HXformat_map *blk,
- hxmc_t **resultp, const char *fmt)
-{
- ssize_t ret = HXformat3_aprintf(blk, resultp, fmt);
- return ret > INT_MAX ? INT_MAX : ret;
-}
-
-EXPORT_SYMBOL ssize_t HXformat3_aprintf(const struct HXformat_map *blk,
+EXPORT_SYMBOL ssize_t HXformat_aprintf(const struct HXformat_map *blk,
hxmc_t **resultp, const char *fmt)
{
hxmc_t *ex, *ts, *out;
@@ -686,20 +676,13 @@ EXPORT_SYMBOL ssize_t HXformat3_aprintf(const struct HXformat_map *blk,
return ret;
}
-EXPORT_SYMBOL int HXformat_fprintf(const struct HXformat_map *ftable,
- FILE *filp, const char *fmt)
-{
- ssize_t ret = HXformat3_fprintf(ftable, filp, fmt);
- return ret > INT_MAX ? INT_MAX : ret;
-}
-
-EXPORT_SYMBOL ssize_t HXformat3_fprintf(const struct HXformat_map *ftable,
+EXPORT_SYMBOL ssize_t HXformat_fprintf(const struct HXformat_map *ftable,
FILE *filp, const char *fmt)
{
hxmc_t *str;
ssize_t ret;
- if ((ret = HXformat3_aprintf(ftable, &str, fmt)) <= 0)
+ if ((ret = HXformat_aprintf(ftable, &str, fmt)) <= 0)
return ret;
errno = 0;
if (fputs(str, filp) < 0)
@@ -708,14 +691,7 @@ EXPORT_SYMBOL ssize_t HXformat3_fprintf(const struct HXformat_map *ftable,
return ret;
}
-EXPORT_SYMBOL int HXformat_sprintf(const struct HXformat_map *ftable,
- char *dest, size_t size, const char *fmt)
-{
- ssize_t ret = HXformat3_sprintf(ftable, dest, size, fmt);
- return ret > INT_MAX ? INT_MAX : ret;
-}
-
-EXPORT_SYMBOL ssize_t HXformat3_sprintf(const struct HXformat_map *ftable,
+EXPORT_SYMBOL ssize_t HXformat_sprintf(const struct HXformat_map *ftable,
char *dest, size_t size, const char *fmt)
{
hxmc_t *str = nullptr;
diff --git a/src/internal.h b/src/internal.h
index f7d83d8..2f5aa8f 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -50,9 +50,11 @@ struct memcont {
char data[];
};
+struct HXdeque;
struct timespec;
struct timeval;
+extern char **HXdeque_to_vec_strdup(const struct HXdeque *, size_t *);
extern hxmc_t *HXparse_dequote_fmt(const char *, const char *, const char **);
extern size_t HX_substr_helper(size_t, long, long, size_t *);
diff --git a/src/io.c b/src/io.c
index b9041e0..ee47f5a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -65,8 +65,14 @@ static int mkdir_gen(const char *d, unsigned int mode)
if (mkdir(d, mode) == 0) /* use umask() for permissions */
#endif
return 1;
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ /* Undocumented extra error codes */
+ if (errno != EEXIST && errno != EISDIR)
+ return -errno;
+#else
if (errno != EEXIST)
return -errno;
+#endif
if (stat(d, &sb) == 0) {
#if defined(_WIN32)
if (sb.st_mode & S_IFDIR)
@@ -98,7 +104,7 @@ EXPORT_SYMBOL struct HXdir *HXdir_open(const char *s)
* and bug-concealing "char d_name[256]", while on Solaris, it is a
* proper "char d_name[]".
*/
- size_t size = sizeof(*d);
+ size_t size = offsetof(struct dirent, d_name);
ssize_t name_max;
DIR *tmp_dh = opendir(s);
if (tmp_dh == NULL)
@@ -110,7 +116,6 @@ EXPORT_SYMBOL struct HXdir *HXdir_open(const char *s)
*/
name_max = fpathconf(dirfd(tmp_dh), _PC_NAME_MAX);
if (name_max > 0) {
- size -= sizeof(struct dirent) - offsetof(struct dirent, d_name);
size += name_max + 1;
} else {
#ifdef NAME_MAX
@@ -378,6 +383,8 @@ EXPORT_SYMBOL int HX_readlink(hxmc_t **target, const char *path)
HXmc_setlen(target, ret); // \0 set here anyway
return ret;
}
+ if (linkbuf_size > SIZE_MAX / 2)
+ return -E2BIG;
linkbuf_size *= 2;
if (HXmc_setlen(target, linkbuf_size) == NULL) {
int saved_errno = errno;
@@ -483,7 +490,10 @@ EXPORT_SYMBOL int HX_getcwd(hxmc_t **target)
return 1;
}
if (errno == ERANGE) {
- if (HXmc_setlen(target, linkbuf_size *= 2) != nullptr)
+ if (linkbuf_size > SIZE_MAX / 2)
+ return -E2BIG;
+ linkbuf_size *= 2;
+ if (HXmc_setlen(target, linkbuf_size) != nullptr)
continue;
/* errno already set by realloc, fall into next if block */
}
@@ -777,16 +787,18 @@ EXPORT_SYMBOL char *HX_slurp_fd(int fd, size_t *outsize)
char *buf = malloc(bufsize);
if (buf == nullptr)
return nullptr;
- ssize_t rdret;
- while ((rdret = read(fd, buf + offset, bufsize - 1 - offset)) > 0) {
+ do {
+ assert(offset < bufsize);
+ ssize_t rdret = read(fd, buf + offset, bufsize - 1 - offset);
+ if (rdret <= 0)
+ break;
offset += rdret;
- /*
- * Make it so that the next read call is not called
- * with an exceptionally small size.
- */
if (bufsize - offset >= 4095)
+ /* 4K room still, just continue reading. */
continue;
- if (bufsize > SSIZE_MAX)
+
+ /* Less than 4K room, enlarge now */
+ if (bufsize > SIZE_MAX / 2)
/* No more doubling */
break;
bufsize *= 2;
@@ -798,7 +810,7 @@ EXPORT_SYMBOL char *HX_slurp_fd(int fd, size_t *outsize)
return nullptr;
}
buf = nbuf;
- }
+ } while (true);
buf[offset] = '\0';
if (outsize != nullptr)
*outsize = offset;
diff --git a/src/libHX.map b/src/libHX.map
index 922cc3c..1154304 100644
--- a/src/libHX.map
+++ b/src/libHX.map
@@ -1,4 +1,4 @@
-LIBHX_3.25 {
+LIBHX_5.0 {
global:
HX_basename;
HX_basename_exact;
@@ -15,7 +15,6 @@ global:
HX_ffs;
HX_fls;
HX_getl;
- HX_getopt;
HX_getopt_help;
HX_getopt_help_cb;
HX_getopt_usage;
@@ -36,7 +35,6 @@ global:
HX_split;
HX_split_fixed;
HX_split_inplace;
- HX_stpltrim;
HX_strbchr;
HX_strchr2;
HX_strclone;
@@ -54,7 +52,6 @@ global:
HX_strrev;
HX_strrtrim;
HX_strsep2;
- HX_strsep;
HX_strupper;
HX_time_compare;
HX_timespec_add;
@@ -123,68 +120,35 @@ global:
HXproc_run_async;
HXproc_run_sync;
HXproc_wait;
-local:
- *;
-};
-
-LIBHX_3.27 {
-global:
HX_socket_from_env;
HX_slurp_fd;
HX_slurp_file;
HXproc_switch_user;
HXproc_top_fd;
-} LIBHX_3.25;
-
-LIBHX_4.2 {
-global:
HX_strtod_unit;
HX_strtoull_unit;
HX_unit_size;
HX_unit_size_cu;
-} LIBHX_3.27;
-
-LIBHX_4.3 {
-global:
HX_sendfile;
HX_unit_seconds;
HX_strtoull_sec;
-} LIBHX_4.2;
-
-LIBHX_4.9 {
-global:
- HXformat3_aprintf;
- HXformat3_fprintf;
- HXformat3_sprintf;
+ HXformat_aprintf;
+ HXformat_fprintf;
+ HXformat_sprintf;
HX_ipaddr_is_local;
HX_sockaddr_is_local;
-} LIBHX_4.3;
-
-LIBHX_4.11 {
-global:
HX_addrport_split;
HX_inet_connect;
HX_inet_listen;
HX_local_listen;
-} LIBHX_4.9;
-
-LIBHX_4.15 {
-global:
HX_flpr;
HX_flprf;
-} LIBHX_4.11;
-
-LIBHX_4.16 {
-global:
HX_strtoull_nsec;
-} LIBHX_4.15;
-
-LIBHX_4.18 {
-global:
- HX_getopt5;
-} LIBHX_4.16;
-
-LIBHX_4.24 {
-global:
HX_getcwd;
-} LIBHX_4.18;
+ HX_strtoull8601p_sec;
+ HX_getopt6;
+ HX_getopt6_clean;
+ HXdeque_to_vecx;
+local:
+ *;
+};
diff --git a/src/map_int.h b/src/map_int.h
index 6e95c69..b7d74f8 100644
--- a/src/map_int.h
+++ b/src/map_int.h
@@ -14,7 +14,8 @@ extern "C" {
*/
struct HXmap_private {
/* from struct HXmap */
- unsigned int items, flags;
+ size_t items;
+ unsigned int flags;
/* private: */
enum HXmap_type type;
diff --git a/src/misc.c b/src/misc.c
index c138f23..e0f39fd 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -51,24 +51,24 @@ static __inline__ void hexdump_ascii(FILE *fp, unsigned char c, bool tty)
fprintf(fp, ".");
}
-EXPORT_SYMBOL void HX_hexdump(FILE *fp, const void *vptr, unsigned int len)
+EXPORT_SYMBOL void HX_hexdump(FILE *fp, const void *vptr, size_t len)
{
const unsigned char *ptr = vptr;
- unsigned int i, j;
+ size_t i;
bool tty = isatty(fileno(fp));
- fprintf(fp, "Dumping %u bytes\n", len);
+ fprintf(fp, "Dumping %zu bytes\n", len);
for (i = 0; i < len / 16; ++i) {
- fprintf(fp, "%04x | ", i * 16);
- for (j = 0; j < 16; ++j)
+ fprintf(fp, "%04zx | ", i * 16);
+ for (unsigned int j = 0; j < 16; ++j)
fprintf(fp, "%02x%c", *ptr++, (j == 7) ? '-' : ' ');
ptr -= 16;
fprintf(fp, "| ");
- for (j = 0; j < 16; ++j)
+ for (unsigned int j = 0; j < 16; ++j)
hexdump_ascii(fp, *ptr++, tty);
fprintf(fp, "\n");
}
- fprintf(fp, "%04x | ", i * 16);
+ fprintf(fp, "%04zx | ", i * 16);
len -= i * 16;
for (i = 0; i < len; ++i)
fprintf(fp, "%02x%c", ptr[i], (i == 7) ? '-' : ' ');
diff --git a/src/opt.c b/src/opt.c
index ab482ad..118c159 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -1,6 +1,6 @@
/*
* libHX/opt.c
- * Copyright Jan Engelhardt, 2002-2011
+ * Copyright Jan Engelhardt, 2025
*
* This file is part of libHX. libHX is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser
@@ -8,6 +8,7 @@
* either version 2.1 or (at your option) any later version.
*/
#include <errno.h>
+#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
@@ -119,13 +120,15 @@ enum {
/**
* struct HX_getopt_vars - option parser working variable set
* @arg0: saved program name
- * @remaining: list of extracted non-options
+ * @desc: list of extracted options
+ * @oarg: list of extracted options
+ * @uarg: list of extracted non-options
* @cbi: callback info
* @flags: flags setting the behavior for HX_getopt
*/
struct HX_getopt_vars {
const char *arg0;
- struct HXdeque *remaining;
+ struct HXdeque *desc, *oarg, *uarg;
struct HXoptcb cbi;
unsigned int flags;
};
@@ -218,6 +221,10 @@ static void do_assign(struct HXoptcb *cbi, const char *arg0)
if (opt->ptr != NULL)
*static_cast(char **, opt->ptr) = HX_strdup(cbi->data);
break;
+ case HXTYPE_STRP:
+ if (opt->ptr != nullptr)
+ *static_cast(const char **, opt->ptr) = cbi->data;
+ break;
case HXTYPE_STRDQ:
HXdeque_push(opt->ptr, HX_strdup(cbi->data));
break;
@@ -237,6 +244,15 @@ static void do_assign(struct HXoptcb *cbi, const char *arg0)
opt->cb(cbi);
}
+static int do_assign_front(struct HX_getopt_vars *par)
+{
+ if (HXdeque_push(par->desc, par->cbi.current) == nullptr ||
+ HXdeque_push(par->oarg, par->cbi.data) == nullptr)
+ return -errno;
+ do_assign(&par->cbi, par->arg0);
+ return 0;
+}
+
static __inline__ const struct HXoption *
lookup_short(const struct HXoption *table, char opt)
{
@@ -494,27 +510,14 @@ static int HX_getopt_error(int err, const char *key, unsigned int flags)
return HXOPT_I_ERROR;
}
-static int HX_getopt_twolong(const char *const *opt,
+static int HX_getopt_twolong(const char *key, const char *value,
struct HX_getopt_vars *par)
{
- const char *key = opt[0], *value = opt[1];
-
par->cbi.current = lookup_long_pfx(par->cbi.table, key + 2);
if (par->cbi.current == &HXopt_ambig_prefix)
return HX_getopt_error(HXOPT_E_AMBIG_PREFIX, key, par->flags);
- if (par->cbi.current == NULL) {
- if (par->flags & HXOPT_PTHRU) {
- char *tmp = HX_strdup(key);
- if (tmp == NULL)
- return -errno;
- if (HXdeque_push(par->remaining, tmp) == NULL) {
- free(tmp);
- return -errno;
- }
- return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
- }
+ if (par->cbi.current == nullptr)
return HX_getopt_error(HXOPT_E_LONG_UNKNOWN, key, par->flags);
- }
par->cbi.flags = HXOPTCB_BY_LONG;
if (takes_void(par->cbi.current->type)) {
@@ -550,11 +553,21 @@ static int HX_getopt_long(const char *cur, struct HX_getopt_vars *par)
return -errno;
value = strchr(key, '=');
if (value == nullptr) {
- /* Cannot happen because state is always !S_TWOLONG */
+ /*
+ * Cannot happen because state is always !S_TWOLONG, but make
+ * static analyzers happy.
+ */
free(key);
return -EINVAL;
}
- *value++ = '\0';
+ *value = '\0';
+ value = strchr(cur, '=');
+ if (value == nullptr) {
+ /* Cannot happen either */
+ free(key);
+ return -EINVAL;
+ }
+ ++value;
par->cbi.current = lookup_long_pfx(par->cbi.table, key + 2);
if (par->cbi.current == &HXopt_ambig_prefix) {
ret = HX_getopt_error(HXOPT_E_AMBIG_PREFIX, key, par->flags);
@@ -562,15 +575,6 @@ static int HX_getopt_long(const char *cur, struct HX_getopt_vars *par)
return ret;
}
if (par->cbi.current == NULL) {
- if (par->flags & HXOPT_PTHRU) {
- /* Undo nuke of '=' and reuse alloc */
- value[-1] = '=';
- if (HXdeque_push(par->remaining, key) == NULL) {
- free(key);
- return -errno;
- }
- return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
- }
ret = HX_getopt_error(HXOPT_E_LONG_UNKNOWN, key, par->flags);
free(key);
return ret;
@@ -585,58 +589,48 @@ static int HX_getopt_long(const char *cur, struct HX_getopt_vars *par)
return ret;
}
+ free(key);
par->cbi.flags = HXOPTCB_BY_LONG;
par->cbi.data = value;
- /* Not possible to use %HXOPT_I_ASSIGN due to transience of @key. */
- do_assign(&par->cbi, par->arg0);
- free(key);
+ /*
+ * Not possible to use %HXOPT_I_ASSIGN due to transience of @key. Thus
+ * manually call do_assign now rather than in the superordinate
+ * function.
+ */
+ ret = do_assign_front(par);
+ if (ret < 0)
+ return ret;
return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
}
-static int HX_getopt_short(const char *const *opt, const char *cur,
+static int HX_getopt_short(const char *key, const char *value,
struct HX_getopt_vars *par)
{
- char op = *cur;
+ char op = *key;
if (op == '\0')
return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
par->cbi.current = lookup_short(par->cbi.table, op);
- if (par->cbi.current == NULL) {
- if (par->flags & HXOPT_PTHRU) {
- /*
- * @cur-1 is always valid: it is either the previous
- * char, or it is '-'.
- */
- char *buf = HX_strdup(cur - 1);
- if (buf != NULL)
- *buf = '-';
- if (HXdeque_push(par->remaining, buf) == NULL) {
- free(buf);
- return -errno;
- }
- return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
- }
+ if (par->cbi.current == nullptr)
return HX_getopt_error(HXOPT_E_SHORT_UNKNOWN, &op, par->flags);
- }
par->cbi.flags = HXOPTCB_BY_SHORT;
if (takes_void(par->cbi.current->type)) {
/* -A */
par->cbi.data = NULL;
return HXOPT_S_SHORT | HXOPT_I_ASSIGN | HXOPT_I_ADVCHAR;
- } else if (cur[1] != '\0') {
+ } else if (key[1] != '\0') {
/* -Avalue */
- par->cbi.data = cur + 1;
+ par->cbi.data = key + 1;
return HXOPT_S_NORMAL | HXOPT_I_ASSIGN | HXOPT_I_ADVARG;
}
- cur = *++opt;
if (par->cbi.current->type & HXOPT_OPTIONAL) {
- if (cur == NULL || *cur != '-' ||
- (cur[0] == '-' && cur[1] == '\0')) {
+ if (value == nullptr || *value != '-' ||
+ (value[0] == '-' && value[1] == '\0')) {
/* -f - -f bla */
- par->cbi.data = cur;
+ par->cbi.data = value;
return HXOPT_S_NORMAL | HXOPT_I_ASSIGN | HXOPT_I_ADVARG2;
} else {
/* -f -a-file --another --file -- endofoptions */
@@ -645,41 +639,28 @@ static int HX_getopt_short(const char *const *opt, const char *cur,
}
} else {
/* -A value */
- if (cur == NULL)
+ if (value == nullptr)
return HX_getopt_error(HXOPT_E_SHORT_MISSING, &op, par->flags);
- par->cbi.data = cur;
+ par->cbi.data = value;
return HXOPT_S_NORMAL | HXOPT_I_ASSIGN | HXOPT_I_ADVARG2;
}
}
static int HX_getopt_term(const char *cur, const struct HX_getopt_vars *par)
{
- char *tmp = HX_strdup(cur);
- if (tmp == NULL)
- return -errno;
- if (HXdeque_push(par->remaining, tmp) == NULL) {
- free(tmp);
+ if (HXdeque_push(par->uarg, cur) == nullptr)
return -errno;
- }
return HXOPT_S_TERMINATED | HXOPT_I_ADVARG;
}
static int HX_getopt_normal(const char *cur, const struct HX_getopt_vars *par)
{
if (cur[0] == '-' && cur[1] == '\0') {
- /* Note to popt developers: A single dash is NOT an option! */
- HXdeque_push(par->remaining, HX_strdup(cur));
+ HXdeque_push(par->uarg, cur);
return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
}
- if (cur[0] == '-' && cur[1] == '-' && cur[2] == '\0') {
- /*
- * Double dash. If passthrough is on, "--" must be copied into
- * @remaining. This is done in the next round.
- */
- if (!(par->flags & HXOPT_PTHRU))
- return HXOPT_S_TERMINATED | HXOPT_I_ADVARG;
- return HXOPT_S_TERMINATED;
- }
+ if (cur[0] == '-' && cur[1] == '-' && cur[2] == '\0')
+ return HXOPT_S_TERMINATED | HXOPT_I_ADVARG;
if (cur[0] == '-' && cur[1] == '-') { /* long option */
if (strchr(cur + 2, '=') == NULL)
return HXOPT_S_TWOLONG;
@@ -692,62 +673,71 @@ static int HX_getopt_normal(const char *cur, const struct HX_getopt_vars *par)
if (par->flags & HXOPT_RQ_ORDER)
/* POSIX: first non-option implies option termination */
return HXOPT_S_TERMINATED;
- cur = HX_strdup(cur);
- if (cur == NULL || HXdeque_push(par->remaining, cur) == NULL)
+ if (HXdeque_push(par->uarg, cur) == nullptr)
return -errno;
return HXOPT_S_NORMAL | HXOPT_I_ADVARG;
}
-EXPORT_SYMBOL int HX_getopt5(const struct HXoption *table, char **orig_argv,
- int *new_argc, char ***new_argv, unsigned int flags)
+EXPORT_SYMBOL void HX_getopt6_clean(struct HXopt6_result *r)
+{
+ free(r->desc);
+ free(r->oarg);
+ free(r->uarg);
+ HX_zvecfree(r->dup_argv);
+ r->desc = nullptr;
+ r->oarg = nullptr;
+ r->uarg = nullptr;
+ r->dup_argv = nullptr;
+}
+
+EXPORT_SYMBOL int HX_getopt6(const struct HXoption *table, int argc,
+ char **argv, struct HXopt6_result *result, unsigned int flags)
{
struct HX_getopt_vars ps;
- const char **opt = const_cast(const char **, orig_argv);
+ const char **opt = const_cast(const char **, argv);
int state = HXOPT_S_NORMAL;
int ret = -ENOMEM;
- unsigned int argk = 0;
- if (new_argc != nullptr)
- *new_argc = 0;
- if (new_argv != nullptr)
- *new_argv = nullptr;
+ if ((flags & (HXOPT_RQ_ORDER | HXOPT_ANY_ORDER)) == (HXOPT_RQ_ORDER | HXOPT_ANY_ORDER))
+ return -EINVAL;
+ if (result == nullptr && flags & (HXOPT_ITER_OPTS | HXOPT_ITER_ARGS | HXOPT_DUP_ARGS))
+ return -EINVAL;
+ if (result != nullptr)
+ memset(result, 0, sizeof(*result));
memset(&ps, 0, sizeof(ps));
- ps.remaining = HXdeque_init();
- if (ps.remaining == NULL) {
+ ps.desc = HXdeque_init();
+ ps.oarg = HXdeque_init();
+ ps.uarg = HXdeque_init();
+ if (ps.desc == nullptr || ps.oarg == nullptr || ps.uarg == nullptr) {
ret = -errno;
goto out;
}
ps.flags = flags;
- ps.arg0 = *opt;
- ps.cbi.table = table;
-
- if (*opt != NULL) {
- /* put argv[0] back */
- char *arg = HX_strdup(*opt++);
- if (arg == NULL) {
- ret = -errno;
- goto out;
- }
- if (HXdeque_push(ps.remaining, arg) == NULL) {
- free(arg);
- ret = -errno;
- goto out;
- }
+ if (argc < 0) {
+ argc = 0;
+ for (const char **p = opt; *p != nullptr; ++p)
+ ++argc;
}
+ if (argc > 0) {
+ ps.arg0 = *opt++;
+ --argc;
+ }
+ ps.cbi.table = table;
- if (posix_me_harder())
+ if (!(ps.flags & HXOPT_ANY_ORDER) && posix_me_harder())
ps.flags |= HXOPT_RQ_ORDER;
- for (const char *cur = *opt; cur != NULL; ) {
+ const char *op0 = argc > 0 ? opt[0] : nullptr;
+ while (argc > 0) {
if (state == HXOPT_S_TWOLONG)
- state = HX_getopt_twolong(opt, &ps);
+ state = HX_getopt_twolong(op0, argc > 1 ? opt[1] : nullptr, &ps);
else if (state == HXOPT_S_LONG)
- state = HX_getopt_long(cur, &ps);
+ state = HX_getopt_long(op0, &ps);
else if (state == HXOPT_S_SHORT)
- state = HX_getopt_short(opt, cur, &ps);
+ state = HX_getopt_short(op0, argc > 1 ? opt[1] : nullptr, &ps);
else if (state == HXOPT_S_TERMINATED)
- state = HX_getopt_term(cur, &ps);
+ state = HX_getopt_term(op0, &ps);
else if (state == HXOPT_S_NORMAL)
- state = HX_getopt_normal(cur, &ps);
+ state = HX_getopt_normal(op0, &ps);
if (state < 0) {
ret = state;
@@ -757,31 +747,62 @@ EXPORT_SYMBOL int HX_getopt5(const struct HXoption *table, char **orig_argv,
ret = state & ~HXOPT_I_ERROR;
goto out;
}
- if (state & HXOPT_I_ASSIGN)
- do_assign(&ps.cbi, ps.arg0);
- if (state & HXOPT_I_ADVARG)
- cur = *++opt;
- else if (state & HXOPT_I_ADVARG2)
- cur = *(opt += 2);
- else if (state & HXOPT_I_ADVCHAR)
- ++cur;
+ if (state & HXOPT_I_ASSIGN) {
+ ret = do_assign_front(&ps);
+ if (ret < 0)
+ goto out;
+ }
+ if (state & HXOPT_I_ADVARG) {
+ --argc;
+ if (argc > 0)
+ op0 = *++opt;
+ } else if (state & HXOPT_I_ADVARG2) {
+ opt += 2;
+ argc -= 2;
+ if (argc > 0)
+ op0 = *opt;
+ } else if (state & HXOPT_I_ADVCHAR) {
+ ++op0;
+ }
state &= ~HXOPT_I_MASK;
}
- if (new_argv != nullptr) {
- *new_argv = reinterpret_cast(char **, HXdeque_to_vec(ps.remaining, &argk));
- if (*new_argv == nullptr) {
+ if (flags & HXOPT_ITER_OPTS) {
+ size_t nelem = 0;
+ result->desc = reinterpret_cast(const struct HXoption **, HXdeque_to_vec(ps.desc, &nelem));
+ result->oarg = reinterpret_cast(char **, HXdeque_to_vec(ps.oarg, &nelem));
+ if (result->desc == nullptr || result->oarg == nullptr) {
+ ret = -errno;
+ goto out;
+ }
+ result->nopts = nelem < INT_MAX ? nelem : INT_MAX;
+ }
+ if (flags & HXOPT_ITER_ARGS) {
+ size_t nelem = 0;
+ result->uarg = reinterpret_cast(char **, HXdeque_to_vecx(ps.uarg, &nelem));
+ if (result->uarg == nullptr) {
+ ret = -errno;
+ goto out;
+ }
+ result->nargs = nelem < INT_MAX ? nelem : INT_MAX;
+ }
+ if (flags & HXOPT_DUP_ARGS) {
+ if (ps.arg0 != nullptr && HXdeque_unshift(ps.uarg, ps.arg0) == nullptr) {
ret = -errno;
goto out;
}
- if (new_argc != nullptr)
- *new_argc = argk;
- /* pointers are owned by new_argv now, so free only the deque head */
- HXdeque_free(ps.remaining);
- ps.remaining = nullptr;
+ size_t nelem = 0;
+ result->dup_argv = HXdeque_to_vec_strdup(ps.uarg, &nelem);
+ if (result->dup_argv == nullptr) {
+ ret = -errno;
+ goto out;
+ }
+ result->dup_argc = nelem < INT_MAX ? nelem : INT_MAX;
}
ret = HXOPT_ERR_SUCCESS;
out:
+ if (ret != HXOPT_ERR_SUCCESS && result != nullptr)
+ HX_getopt6_clean(result);
if (ret == HXOPT_ERR_SUCCESS) {
} else if (ret < 0) {
if (!(ps.flags & HXOPT_QUIET))
@@ -793,28 +814,12 @@ EXPORT_SYMBOL int HX_getopt5(const struct HXoption *table, char **orig_argv,
else if (ps.flags & HXOPT_USAGEONERR)
HX_getopt_usage(&ps.cbi, stderr);
}
- if (ps.remaining != nullptr)
- HXdeque_genocide2(ps.remaining, free);
- return ret;
-}
-
-EXPORT_SYMBOL int HX_getopt(const struct HXoption *table, int *argc,
- char ***argv, unsigned int flags)
-{
- int new_argc = 0;
- char **new_argv = nullptr;
- int ret = HX_getopt5(table, *argv, &new_argc,
- flags & HXOPT_KEEP_ARGV ? nullptr : &new_argv, flags);
- if (ret != HXOPT_ERR_SUCCESS)
- return ret;
- if (flags & HXOPT_KEEP_ARGV)
- // NO_CREATE_NEW / DESTROY_NEW
- new_argv = *argv;
- else if (flags & HXOPT_DESTROY_OLD)
- HX_zvecfree(*argv);
- if (argc != nullptr)
- *argc = new_argc;
- *argv = new_argv;
+ if (ps.uarg != nullptr)
+ HXdeque_free(ps.uarg);
+ if (ps.oarg != nullptr)
+ HXdeque_free(ps.oarg);
+ if (ps.desc != nullptr)
+ HXdeque_free(ps.desc);
return ret;
}
diff --git a/src/string.c b/src/string.c
index 3a85fa8..e9c162d 100644
--- a/src/string.c
+++ b/src/string.c
@@ -41,6 +41,26 @@ struct HX_quote_rule {
const char *chars;
};
+/* years, months, weeks, days, hours, minutes, seconds, msecs, musecs, nsecs; */
+enum period_idx {
+ PERIDX_YEARS = 0,
+ PERIDX_MONTHS,
+ PERIDX_WEEKS,
+ PERIDX_DAYS,
+ PERIDX_HOURS,
+ PERIDX_MIN,
+ PERIDX_SEC,
+ PERIDX_MSEC,
+ PERIDX_MUSEC,
+ PERIDX_NSEC,
+ PERIDX_MAX,
+};
+
+struct HX_unit_desc {
+ const char name[8];
+ uint8_t len, pidx;
+};
+
static const char HX_hexenc[] = "0123456789ABCDEF";
EXPORT_SYMBOL char *HX_basename(const char *s)
@@ -217,13 +237,11 @@ EXPORT_SYMBOL char **HX_split(const char *str, const char *delim,
ret[*cp] = NULL;
{
- char *seg, *wp = HX_strdup(str), *bg = wp;
+ char *wp = HX_strdup(str), *bg = wp;
size_t i = 0;
- while (--max > 0) {
- seg = HX_strsep(&wp, delim);
- ret[i++] = HX_strdup(seg);
- }
+ while (--max > 0)
+ ret[i++] = HX_strdup(strtok_r(nullptr, delim, &wp));
ret[i++] = HX_strdup(wp);
free(bg);
@@ -374,13 +392,6 @@ EXPORT_SYMBOL size_t HX_strltrim(char *expr)
return diff;
}
-EXPORT_SYMBOL char *HX_stpltrim(const char *p)
-{
- while (HX_isspace(*p))
- ++p;
- return const_cast1(char *, p);
-}
-
/**
* Helper for substr() function for dealing with negative off/len values
* @z: total length of string
@@ -442,14 +453,6 @@ EXPORT_SYMBOL char *HX_strndup(const char *src, size_t size)
return ret;
}
-EXPORT_SYMBOL size_t HX_strnlen(const char *src, size_t size)
-{
- const char *ptr = src;
- for (; *ptr != '\0' && size > 0; --size, ++ptr)
- ;
- return ptr - src;
-}
-
EXPORT_SYMBOL size_t HX_strrcspn(const char *s, const char *rej)
{
size_t n = strlen(s);
@@ -483,35 +486,6 @@ EXPORT_SYMBOL size_t HX_strrtrim(char *expr)
return s;
}
-EXPORT_SYMBOL char *HX_strsep(char **sp, const char *d)
-{
- char *begin, *end;
-
- if (*sp == NULL || **sp == '\0')
- return NULL;
- begin = *sp;
-
- if (d[0] == '\0' || d[1] == '\0') {
- if (*begin == *d)
- end = begin;
- else if (*begin == '\0')
- end = NULL;
- else
- end = strchr(begin + 1, *d);
- } else {
- end = strpbrk(begin, d);
- }
-
- if (end == NULL) {
- *sp = NULL;
- } else {
- *end++ = '\0';
- *sp = end;
- }
-
- return begin;
-}
-
EXPORT_SYMBOL char *HX_strsep2(char **wp, const char *str)
{
char *ptr, *ret;
@@ -534,8 +508,6 @@ static const struct HX_quote_rule HX_quote_rules[] = {
[HXQUOTE_LDAPFLT] = {HXQUOTE_REJECT, "\n*()\\"},
[HXQUOTE_LDAPRDN] = {HXQUOTE_REJECT, "\n \"#+,;<=>\\"},
[HXQUOTE_URIENC] = {HXQUOTE_ACCEPT, "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"},
- [HXQUOTE_SQLSQUOTE] = {HXQUOTE_REJECT, "'"},
- [HXQUOTE_SQLBQUOTE] = {HXQUOTE_REJECT, "`"},
};
/**
@@ -605,30 +577,6 @@ static char *HX_quote_backslash(char *dest, const char *src, const char *qc)
return ret;
}
-static char *
-HX_quote_sqlbackslash(char *dest, const char *src, const char *trm)
-{
- char *ret = dest;
- size_t len;
-
- while (*src != '\0') {
- len = strcspn(src, trm);
- if (len > 0) {
- memcpy(dest, src, len);
- dest += len;
- src += len;
- if (*src == '\0')
- break;
- }
- *dest++ = *trm;
- *dest++ = *trm;
- ++src;
- }
-
- *dest = '\0';
- return ret;
-}
-
/**
* Encode @src into BASE-64 according to RFC 4648 and write result to @dest,
* which must be of appropriate size, plus one for a trailing NUL.
@@ -782,8 +730,6 @@ static size_t HX_quoted_size(const char *s, unsigned int type)
switch (type) {
case HXQUOTE_SQUOTE:
case HXQUOTE_DQUOTE:
- case HXQUOTE_SQLSQUOTE:
- case HXQUOTE_SQLBQUOTE:
return HX_qsize_bsr(s, HX_quote_rules[type].chars, 1);
case HXQUOTE_HTML:
return HX_qsize_html(s);
@@ -862,9 +808,6 @@ EXPORT_SYMBOL char *HX_strquote(const char *src, unsigned int type,
return HX_quote_base64(*free_me, src, '+', ',');
case HXQUOTE_URIENC:
return HX_quote_urlenc(*free_me, src);
- case HXQUOTE_SQLSQUOTE:
- case HXQUOTE_SQLBQUOTE:
- return HX_quote_sqlbackslash(*free_me, src, rule->chars);
}
return NULL;
}
@@ -1068,47 +1011,169 @@ EXPORT_SYMBOL unsigned long long HX_strtoull_unit(const char *s,
return neg ? -ipart : ipart;
}
+static const struct HX_unit_desc txtperiod_utab[] = {
+ {"seconds", 7, PERIDX_SEC},
+ {"second", 6, PERIDX_SEC},
+ {"sec", 3, PERIDX_SEC},
+ {"s", 1, PERIDX_SEC},
+ {"minutes", 7, PERIDX_MIN},
+ {"minute", 6, PERIDX_MIN},
+ {"min", 3, PERIDX_MIN},
+ {"hours", 5, PERIDX_HOURS},
+ {"hour", 4, PERIDX_HOURS},
+ {"h", 1, PERIDX_HOURS},
+ {"days", 4, PERIDX_DAYS},
+ {"day", 3, PERIDX_DAYS},
+ {"d", 1, PERIDX_DAYS},
+ {"weeks", 5, PERIDX_WEEKS},
+ {"week", 4, PERIDX_WEEKS},
+ {"months", 6, PERIDX_MONTHS},
+ {"month", 5, PERIDX_MONTHS},
+ {"years", 5, PERIDX_YEARS},
+ {"year", 4, PERIDX_YEARS},
+ {"y", 1, PERIDX_YEARS},
+ {"msec", 4, PERIDX_MSEC},
+ {"ms", 2, PERIDX_MSEC},
+ {"µsec", 5, PERIDX_MUSEC},
+ {"µs", 3, PERIDX_MUSEC},
+ {"nsec", 4, PERIDX_NSEC},
+ {"ns", 2, PERIDX_NSEC},
+};
+
+static const struct HX_unit_desc iso8601p_dtab[] = {
+ {"D", 1, PERIDX_DAYS},
+ {"M", 1, PERIDX_MONTHS},
+ {"Y", 1, PERIDX_YEARS},
+};
+
+static const struct HX_unit_desc iso8601p_ttab[] = {
+ {"S", 1, PERIDX_SEC},
+ {"M", 1, PERIDX_MIN},
+ {"H", 1, PERIDX_HOURS},
+};
+
/* Numbers also used by systemd — the focus is on longterm averages */
#define SECONDS_PER_YEAR 31557600 /* 365.25 days */
#define SECONDS_PER_MONTH 2629800 /* 1/12th of that year = 30.4375 days */
#define NSEC_PER_SECOND 1000000000ULL
-static const struct {
- const char name[8];
- unsigned int len;
- uint32_t s_mult;
- uint64_t ns_mult;
-} time_multiplier[] = {
- {"seconds", 7, 1, 1 * NSEC_PER_SECOND},
- {"second", 6, 1, 1 * NSEC_PER_SECOND},
- {"sec", 3, 1, 1 * NSEC_PER_SECOND},
- {"s", 1, 1, 1 * NSEC_PER_SECOND},
- {"minutes", 7, 60, 60 * NSEC_PER_SECOND},
- {"minute", 6, 60, 60 * NSEC_PER_SECOND},
- {"min", 3, 60, 60 * NSEC_PER_SECOND},
- {"hours", 5, 3600, 3600 * NSEC_PER_SECOND},
- {"hour", 4, 3600, 3600 * NSEC_PER_SECOND},
- {"h", 1, 3600, 3600 * NSEC_PER_SECOND},
- {"days", 4, 86400, 86400 * NSEC_PER_SECOND},
- {"day", 3, 86400, 86400 * NSEC_PER_SECOND},
- {"d", 1, 86400, 86400 * NSEC_PER_SECOND},
- {"weeks", 5, 604800, 604800 * NSEC_PER_SECOND},
- {"week", 4, 604800, 604800 * NSEC_PER_SECOND},
- {"months", 6, SECONDS_PER_MONTH, SECONDS_PER_MONTH * NSEC_PER_SECOND},
- {"month", 5, SECONDS_PER_MONTH, SECONDS_PER_MONTH * NSEC_PER_SECOND},
- {"years", 5, SECONDS_PER_YEAR, SECONDS_PER_YEAR * NSEC_PER_SECOND},
- {"year", 4, SECONDS_PER_YEAR, SECONDS_PER_YEAR * NSEC_PER_SECOND},
- {"y", 1, SECONDS_PER_YEAR, SECONDS_PER_YEAR * NSEC_PER_SECOND},
- {"msec", 4, 0, 1000000},
- {"ms", 2, 0, 1000000},
- {"µsec", 5, 0, 1000},
- {"µs", 3, 0, 1000},
- {"nsec", 4, 0, 1},
- {"ns", 2, 0, 1},
+static const uint64_t sec_mult[PERIDX_MAX] = {
+ [PERIDX_YEARS] = SECONDS_PER_YEAR,
+ [PERIDX_MONTHS] = SECONDS_PER_MONTH,
+ [PERIDX_WEEKS] = 604800,
+ [PERIDX_DAYS] = 86400,
+ [PERIDX_HOURS] = 3600,
+ [PERIDX_MIN] = 60,
+ [PERIDX_SEC] = 1,
+ [PERIDX_MSEC] = 0,
+ [PERIDX_MUSEC] = 0,
+ [PERIDX_NSEC] = 0,
+};
+
+static const uint64_t nsec_mult[PERIDX_MAX] = {
+ [PERIDX_YEARS] = NSEC_PER_SECOND * SECONDS_PER_YEAR,
+ [PERIDX_MONTHS] = NSEC_PER_SECOND * SECONDS_PER_MONTH,
+ [PERIDX_WEEKS] = NSEC_PER_SECOND * 604800,
+ [PERIDX_DAYS] = NSEC_PER_SECOND * 86400,
+ [PERIDX_HOURS] = NSEC_PER_SECOND * 3600,
+ [PERIDX_MIN] = NSEC_PER_SECOND * 60,
+ [PERIDX_SEC] = NSEC_PER_SECOND,
+ [PERIDX_MSEC] = 1000000,
+ [PERIDX_MUSEC] = 1000,
+ [PERIDX_NSEC] = 1,
};
-static unsigned long long HX_strtoull_time(const char *s, char **out_end, bool nsec)
+/**
+ * Take a textual period string ("1 minute 5 seconds") and break it down.
+ * @s: input string
+ * @utab: allowed unit suffixes
+ * @mtab: multiplication table
+ * @out_end: parsing stopping point
+ *
+ * Returns an errno.
+ */
+static unsigned long long HX_strtoull_period(const char *s,
+ const struct HX_unit_desc *utab, size_t usize, const uint64_t *mtab,
+ size_t msize, char **out_end)
+{
+ unsigned long long quant = 0;
+
+ while (*s != '\0') {
+ while (HX_isspace(*s))
+ ++s;
+ const char *numbegin = s;
+ if (*s == '-')
+ break;
+ char *end = nullptr;
+ unsigned long long num = strtoull(s, &end, 10);
+ if (num == ULLONG_MAX && errno == ERANGE)
+ return num;
+ double frac = 0;
+ bool have_frac = *end == '.';
+ if (have_frac)
+ frac = strtod(s, &end);
+ if (end == s)
+ break;
+ s = end;
+ while (HX_isspace(*s))
+ ++s;
+ unsigned int i;
+ for (i = 0; i < usize; ++i)
+ if (strncasecmp(s, utab[i].name, utab[i].len) == 0 &&
+ /* Ensure a word boundary is present */
+ !HX_isalpha(s[utab[i].len]))
+ break;
+ if (i == usize) {
+ if ((!have_frac && num == 0) || (have_frac && frac == 0))
+ /* 0 is the same no matter what unit, take it */
+ continue;
+ s = numbegin;
+ break;
+ }
+ unsigned long long mult = mtab[utab[i].pidx];
+ if (have_frac) {
+ double v = frac * mult;
+ if (v >= static_cast(double, ULLONG_MAX)) {
+ /*
+ * As ULLONG_MAX gets promoted to double, its
+ * value may _increase_, therefore here we use
+ * >= and not >.
+ */
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, numbegin);
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+ num = v;
+ } else {
+ if (mult > 0 && num > ULLONG_MAX / mult) {
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, numbegin);
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+ num *= mult;
+ }
+ if (num > ULLONG_MAX - quant) {
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, numbegin);
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+ quant += num;
+ s += utab[i].len;
+ }
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, s);
+ errno = 0;
+ return quant;
+}
+
+static unsigned long long HX_strtoull_iso8601p_2(const char *s,
+ const uint64_t *mtab, size_t msize, char **out_end)
{
+ const struct HX_unit_desc *utab = iso8601p_dtab;
+ size_t usize = ARRAY_SIZE(iso8601p_dtab);
unsigned long long quant = 0;
while (*s != '\0') {
@@ -1117,6 +1182,14 @@ static unsigned long long HX_strtoull_time(const char *s, char **out_end, bool n
const char *numbegin = s;
if (*s == '-')
break;
+ if (HX_toupper(*s) == 'T') {
+ if (utab != iso8601p_dtab)
+ break;
+ utab = iso8601p_ttab;
+ usize = ARRAY_SIZE(iso8601p_ttab);
+ ++s;
+ continue;
+ }
char *end = nullptr;
unsigned long long num = strtoull(s, &end, 10);
if (num == ULLONG_MAX && errno == ERANGE)
@@ -1131,45 +1204,92 @@ static unsigned long long HX_strtoull_time(const char *s, char **out_end, bool n
while (HX_isspace(*s))
++s;
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(time_multiplier); ++i)
- if (strncmp(s, time_multiplier[i].name,
- time_multiplier[i].len) == 0 &&
- !HX_isalpha(s[time_multiplier[i].len]))
+ /* No word boundary check for 8601 mode */
+ for (i = 0; i < usize; ++i)
+ if (strncmp(s, utab[i].name, utab[i].len) == 0)
break;
- if (i == ARRAY_SIZE(time_multiplier)) {
+ if (i == usize) {
if ((!have_frac && num == 0) || (have_frac && frac == 0))
/* 0 is the same no matter what unit, take it */
continue;
s = numbegin;
break;
}
- unsigned long long mult = nsec ? time_multiplier[i].ns_mult : time_multiplier[i].s_mult;
+ unsigned long long mult = mtab[utab[i].pidx];
if (have_frac) {
- quant += frac * mult;
+ double v = frac * mult;
+ if (v >= static_cast(double, ULLONG_MAX)) {
+ /*
+ * As ULLONG_MAX gets promoted to double, its
+ * value may _increase_, therefore here we use
+ * >= and not >.
+ */
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, numbegin);
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+ num = v;
} else {
- if (mult > 0 && num >= ULLONG_MAX / mult) {
+ if (mult > 0 && num > ULLONG_MAX / mult) {
if (out_end != nullptr)
*out_end = const_cast(char *, numbegin);
errno = ERANGE;
return ULLONG_MAX;
}
- quant += num * mult;
+ num *= mult;
}
- s += time_multiplier[i].len;
+ if (num > ULLONG_MAX - quant) {
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, numbegin);
+ errno = ERANGE;
+ return ULLONG_MAX;
+ }
+ quant += num;
+ s += utab[i].len;
}
if (out_end != nullptr)
*out_end = const_cast(char *, s);
+ errno = 0;
return quant;
}
+static bool looks_like_iso8601(const char *s)
+{
+ if (s[0] != 'P')
+ return false;
+ if (HX_isdigit(s[1]))
+ return true;
+ if (s[1] == 'T' && HX_isdigit(s[2]))
+ return true;
+ return false;
+}
+
EXPORT_SYMBOL unsigned long long HX_strtoull_sec(const char *s, char **out_end)
{
- return HX_strtoull_time(s, out_end, false);
+ if (looks_like_iso8601(s))
+ return HX_strtoull_iso8601p_2(&s[1], sec_mult, ARRAY_SIZE(sec_mult), out_end);
+ return HX_strtoull_period(s,
+ txtperiod_utab, ARRAY_SIZE(txtperiod_utab),
+ sec_mult, ARRAY_SIZE(sec_mult), out_end);
}
EXPORT_SYMBOL unsigned long long HX_strtoull_nsec(const char *s, char **out_end)
{
- return HX_strtoull_time(s, out_end, true);
+ if (looks_like_iso8601(s))
+ return HX_strtoull_iso8601p_2(&s[1], nsec_mult, ARRAY_SIZE(nsec_mult), out_end);
+ return HX_strtoull_period(s,
+ txtperiod_utab, ARRAY_SIZE(txtperiod_utab),
+ nsec_mult, ARRAY_SIZE(nsec_mult), out_end);
+}
+
+EXPORT_SYMBOL unsigned long long HX_strtoull8601p_sec(const char *s, char **out_end)
+{
+ if (*s == 'P')
+ return HX_strtoull_iso8601p_2(&s[1], sec_mult, ARRAY_SIZE(sec_mult), out_end);
+ if (out_end != nullptr)
+ *out_end = const_cast(char *, s);
+ return 0;
}
EXPORT_SYMBOL char *HX_unit_seconds(char *out, size_t outsize,
diff --git a/src/tc-list.c b/src/tc-list.c
index d31a5c7..abb0944 100644
--- a/src/tc-list.c
+++ b/src/tc-list.c
@@ -81,7 +81,7 @@ static void l_dump(bool pop)
#endif
}
- printf("Remaining elements: %u\n", strings_ct.items);
+ printf("Remaining elements: %zu\n", strings_ct.items);
}
static void l_empty(void)
diff --git a/src/tc-map.c b/src/tc-map.c
index e9e896f..5ad7dfe 100644
--- a/src/tc-map.c
+++ b/src/tc-map.c
@@ -107,7 +107,7 @@ static void tmap_flush(struct HXmap *map, bool verbose)
const struct HXmap_node *node;
struct HXmap_trav *iter;
- tmap_printf("Flushing %u elements (with traversal)\n", map->items);
+ tmap_printf("Flushing %zu elements (with traversal)\n", map->items);
tmap_ipush();
while (map->items != 0) {
/* May need to reload traverser due to deletion */
@@ -141,7 +141,7 @@ static void tmap_add_speed(struct HXmap *map)
tmap_time(&stop);
HX_timespec_sub(&delta, &stop, &start);
} while (!(delta.tv_sec >= 1 || map->items >= 1000000));
- tmap_printf("%u elements in " HX_TIMESPEC_FMT
+ tmap_printf("%zu elements in " HX_TIMESPEC_FMT
" (plus time measurement overhead)\n",
map->items, HX_TIMESPEC_EXP(&delta));
threshold = map->items;
@@ -151,7 +151,7 @@ static void tmap_add_speed(struct HXmap *map)
tmap_add_rand(map, threshold);
tmap_time(&stop);
HX_timespec_sub(&delta, &stop, &start);
- tmap_printf("%u elements in " HX_TIMESPEC_FMT " (w/o overhead)\n",
+ tmap_printf("%zu elements in " HX_TIMESPEC_FMT " (w/o overhead)\n",
map->items, HX_TIMESPEC_EXP(&delta));
tmap_ipop();
}
@@ -176,14 +176,14 @@ static void tmap_trav_speed(struct HXmap *map)
tmap_time(&stop);
HX_timespec_sub(&delta, &stop, &start);
HXmap_travfree(iter);
- tmap_printf("Open traversal of %u nodes: " HX_TIMESPEC_FMT "s\n",
+ tmap_printf("Open traversal of %zu nodes: " HX_TIMESPEC_FMT "s\n",
map->items, HX_TIMESPEC_EXP(&delta));
tmap_time(&start);
HXmap_qfe(map, tmap_each_fn, NULL);
tmap_time(&stop);
HX_timespec_sub(&delta, &stop, &start);
- tmap_printf("QFE traversal of %u nodes: " HX_TIMESPEC_FMT "s\n",
+ tmap_printf("QFE traversal of %zu nodes: " HX_TIMESPEC_FMT "s\n",
map->items, HX_TIMESPEC_EXP(&delta));
tmap_ipop();
@@ -200,7 +200,7 @@ static void tmap_trav_speed(struct HXmap *map)
start = delta;
stop = delta2;
HX_timespec_sub(&delta, &stop, &start);
- tmap_printf("Lookup of %u nodes: " HX_TIMESPEC_FMT "s\n",
+ tmap_printf("Lookup of %zu nodes: " HX_TIMESPEC_FMT "s\n",
map->items, HX_TIMESPEC_EXP(&delta));
tmap_ipop();
}
@@ -210,7 +210,7 @@ static int tmap_flat(const struct HXmap *map)
struct HXmap_node *nodes;
unsigned int i;
- tmap_printf("Retrieving flattened list of %u elements:\n", map->items);
+ tmap_printf("Retrieving flattened list of %zu elements:\n", map->items);
tmap_ipush();
nodes = HXmap_keysvalues(map);
if (nodes == NULL) {
@@ -430,7 +430,7 @@ static void tmap_hmap_test_1a(const char *map_type,
u.map = HXmap_init5(HXMAPT_HASH, HXMAP_SCKEY,
&intstr_ops, 0, 0);
tmap_new_perfect_tree(u.map, power, 2);
- tmap_printf("%s, intstr, %u items/%u buckets, "
+ tmap_printf("%s, intstr, %zu items/%u buckets, "
"agglomeration: %.2f%%\n", map_type,
u.map->items, HXhash_primes[u.hmap->power],
hmap_agg_index(u.hmap, false));
@@ -441,13 +441,13 @@ static void tmap_hmap_test_1a(const char *map_type,
while (u.map->items < 1 << max_power) {
/* Fill up just right up to the maximum load */
tmap_add_rand(u.map, u.hmap->max_load - u.map->items);
- tmap_printf("%s, words, %u items/%u buckets, "
+ tmap_printf("%s, words, %zu items/%u buckets, "
"agglomeration: %.2f%%\n", map_type,
u.map->items, HXhash_primes[u.hmap->power],
hmap_agg_index(u.hmap, false));
/* trigger resize */
tmap_add_rand(u.map, 1);
- tmap_printf("%s, words, %u items/%u buckets, "
+ tmap_printf("%s, words, %zu items/%u buckets, "
"agglomeration: %.2f%%\n", map_type,
u.map->items, HXhash_primes[u.hmap->power],
hmap_agg_index(u.hmap, false));
@@ -535,7 +535,7 @@ static void rbt_height_check(const struct HXrbtree *tree)
max = 2 * log(tree->super.items + 1) / log(2);
avg = log((pow(2, min) + pow(2, max)) / 2) / log(2);
tmap_ipush();
- tmap_printf("%u items; height %u; min/avg/max %.2f/%.2f/%.2f\n",
+ tmap_printf("%zu items; height %u; min/avg/max %.2f/%.2f/%.2f\n",
tree->super.items, rbt_tree_height(tree->root),
min, avg, max);
tmap_ipop();
diff --git a/src/tc-option.c b/src/tc-option.c
index 8e99b19..860f9d2 100644
--- a/src/tc-option.c
+++ b/src/tc-option.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
-// SPDX-FileCopyrightText: 2022 Jan Engelhardt
+// SPDX-FileCopyrightText: 2025 Jan Engelhardt
/*
* option parser test program
*/
@@ -14,17 +14,22 @@
#include "internal.h"
static int opt_v = 0, opt_mask = 0;
-static char *opt_kstr = NULL;
+static char *opt_kstr, *opt_strp;
static long opt_klong = 0;
static double opt_kdbl = 0;
static int opt_kflag = 0, opt_kint = 0;
static int opt_dst = 0;
static hxmc_t *opt_mcstr = NULL;
+static inline const char *znul(const char *s)
+{
+ return s != nullptr ? s : "(null)";
+}
+
static void opt_cbf(const struct HXoptcb *cbi)
{
printf("cbf was called... with \"%s\"/'%c'\n",
- cbi->current->ln, cbi->current->sh);
+ znul(cbi->current->ln), cbi->current->sh);
}
static const char *opt_eitheror[] = {"neither", "either", "or"};
@@ -59,83 +64,159 @@ static struct HXoption table[] = {
.cb = opt_cbf, .help = "XOR mask test", .htyp = "value"},
{.sh = 'G', .type = HXTYPE_NONE, .help = "Just a flag", .cb = opt_cbf},
{.sh = 'H', .type = HXTYPE_NONE, .help = "Just a flag", .cb = opt_cbf},
- {.sh = 'I', .type = HXTYPE_NONE, .help = "Just a flag", .cb = opt_cbf},
+ {.sh = 'I', .type = HXTYPE_NONE, .ptr = nullptr, .help = "Just a flag", .cb = opt_cbf},
HXOPT_AUTOHELP,
{.sh = 'J', .type = HXTYPE_NONE, .help = "Just a flag", .cb = opt_cbf},
+ {.ln = "strp", .sh = 'Z', .type = HXTYPE_STRP, .ptr = &opt_strp,
+ .help = "String pointer", .cb = opt_cbf},
HXOPT_TABLEEND,
};
-static void dump_argv(char **v)
+static int t_empty_argv(void)
{
- while (*v != NULL)
- printf("[%s] ", *v++);
- printf("\n");
-}
+ char *zero_argv[] = {nullptr};
+ struct HXopt6_result result;
-static int t_pthru(void)
-{
- const char *argv[] = {
- "ARGV0", "-Zomg", "-GZfoo", "bar",
- "--unknown-f=13.37", "--unknown-a",
- "foo", "bar", NULL
- };
- char **nargv = nullptr;
- int nargc = 0;
-
- printf("PTHRU test:\n");
- if (HX_getopt5(table, const_cast(char **, argv), &nargc, &nargv,
- HXOPT_USAGEONERR | HXOPT_PTHRU) != HXOPT_ERR_SUCCESS)
+ printf("...with argv={NULL}\n");
+ if (HX_getopt6(table, 0, zero_argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_OA | HXOPT_DUP_ARGS) != HXOPT_ERR_SUCCESS)
return EXIT_FAILURE;
- printf("argc = %d\n", nargc);
- dump_argv(nargv);
- printf("\n");
- HX_zvecfree(nargv);
- return EXIT_SUCCESS;
+ bool ok = result.nopts == 0 && result.nargs == 0 && result.dup_argc == 0;
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+ return ok ? EXIT_SUCCESS : EXIT_FAILURE;
}
-static int t_empty_argv(void)
+static int runner(int argc, char **argv)
{
- char *zero_argv[] = {nullptr};
- char **new_argv = nullptr;
+ printf("== HX_getopt6 ==\n");
+ int ret = HX_getopt6(table, argc, argv, nullptr, HXOPT_USAGEONERR);
+ printf("Return value of HX_getopt: %d\n", ret);
+ printf("Either-or is: %s\n", opt_eitheror[opt_dst]);
+ printf("values: D=%lf I=%d L=%ld S=%p/%s strp=%p/%s\n",
+ opt_kdbl, opt_kint, opt_klong,
+ opt_kstr, znul(opt_kstr), opt_strp, znul(opt_strp));
+ printf("Verbosity level: %d\n", opt_v);
+ printf("Mask: 0x%08X\n", opt_mask);
+ printf("mcstr: >%s<\n", znul(opt_mcstr));
+ free(opt_kstr);
+ opt_kstr = nullptr;
- printf("Testing argv={NULL}\n");
- if (HX_getopt5(table, zero_argv, nullptr, &new_argv,
- HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
- return EXIT_FAILURE;
- HX_zvecfree(new_argv);
+ ret = t_empty_argv();
+ if (ret != EXIT_SUCCESS)
+ return ret;
return EXIT_SUCCESS;
}
-static int t_keep_argv(void)
+static int t_getopt6_aflags(int unused_argc, char **unused_argv)
{
- static const char *const one_argv[] = {"what", nullptr};
- const char **argv = const_cast2(const char **, one_argv);
- if (HX_getopt(table, nullptr, &argv, HXOPT_KEEP_ARGV) != HXOPT_ERR_SUCCESS)
+ struct HXopt6_result result;
+ char *argv[] = {"./prog", "-q", "foo", "-qS", "quux", "bar", "--NIL", nullptr};
+
+ printf("== ANY_ORDER ==\n");
+ int ret = HX_getopt6(table, 6, argv, &result, HXOPT_ANY_ORDER);
+ if (ret != HXOPT_ERR_SUCCESS ||
+ result.uarg != nullptr || result.dup_argv != nullptr)
+ return EXIT_FAILURE;
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+
+ /* T: Asking for DUP should produce data */
+ /* T: Limit strings -- NIL must not be processed */
+ printf("== ANY_ORDER/DUP_ARGS ==\n");
+ ret = HX_getopt6(table, 6, argv, &result, HXOPT_ANY_ORDER | HXOPT_DUP_ARGS);
+ if (ret != HXOPT_ERR_SUCCESS ||
+ result.uarg != nullptr ||
+ result.dup_argv == nullptr || result.dup_argc != 3)
+ return EXIT_FAILURE;
+ if (strcmp(result.dup_argv[0], argv[0]) != 0 ||
+ strcmp(result.dup_argv[1], argv[2]) != 0 ||
+ strcmp(result.dup_argv[2], argv[5]) != 0)
+ return EXIT_FAILURE;
+ for (int i = 0; i < result.dup_argc; ++i)
+ printf(" %s", result.dup_argv[i]);
+ printf("\n");
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+
+ /* T: POSIX order */
+ printf("== RQ_ORDER/DUP_ARGS ==\n");
+ ret = HX_getopt6(table, 6, argv, &result, HXOPT_RQ_ORDER | HXOPT_DUP_ARGS);
+ if (ret != HXOPT_ERR_SUCCESS ||
+ result.uarg != nullptr ||
+ result.dup_argv == nullptr || result.dup_argc != 5)
+ return EXIT_FAILURE;
+ if (strcmp(result.dup_argv[0], argv[0]) != 0 ||
+ strcmp(result.dup_argv[1], argv[2]) != 0 ||
+ strcmp(result.dup_argv[2], argv[3]) != 0 ||
+ strcmp(result.dup_argv[3], argv[4]) != 0 ||
+ strcmp(result.dup_argv[4], argv[5]) != 0)
return EXIT_FAILURE;
- return argv == one_argv ? EXIT_SUCCESS : EXIT_FAILURE;
+ for (int i = 0; i < result.dup_argc; ++i)
+ printf(" %s", result.dup_argv[i]);
+ printf("\n");
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+
+ /* T: Asking for ITER should produce data */
+ printf("== ANY_ORDER/ITER_ARGS ==\n");
+ ret = HX_getopt6(table, 6, argv, &result, HXOPT_ANY_ORDER | HXOPT_ITER_ARGS);
+ if (ret != HXOPT_ERR_SUCCESS || result.dup_argv != nullptr ||
+ result.nargs != 2 || result.uarg == nullptr)
+ return EXIT_FAILURE;
+ if (strcmp(result.uarg[0], argv[2]) != 0 ||
+ strcmp(result.uarg[1], argv[5]) != 0)
+ return EXIT_FAILURE;
+ for (int i = 0; i < result.nargs; ++i)
+ printf(" %s", result.uarg[i]);
+ printf("\n");
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+
+ /* T: Asking for ITER should produce data */
+ printf("== ANY_ORDER/ITER_OPTS ==\n");
+ ret = HX_getopt6(table, 6, argv, &result, HXOPT_ANY_ORDER | HXOPT_ITER_OPTS);
+ if (ret != HXOPT_ERR_SUCCESS || result.nopts != 3 ||
+ result.desc == nullptr || result.oarg == nullptr)
+ return EXIT_FAILURE;
+ if (result.desc[0]->sh != 'q' || result.oarg[0] != nullptr ||
+ result.desc[1]->sh != 'q' || result.oarg[1] != nullptr ||
+ result.desc[2]->sh != 'S' || result.oarg[2] == nullptr ||
+ strcmp(result.oarg[2], argv[4]) != 0)
+ return EXIT_FAILURE;
+ printf(" %s", argv[0]);
+ for (int i = 0; i < result.nopts; ++i) {
+ printf(" -%c", result.desc[i]->sh);
+ if (result.oarg[i] != nullptr)
+ printf(" %s", result.oarg[i]);
+ }
+ printf("\n");
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+ return EXIT_SUCCESS;
}
-static int runner(int argc, char **argv)
+static int t_getopt6_eq(void)
{
- char **nargv = nullptr;
- int ret = HX_getopt5(table, argv, &argc, &nargv, HXOPT_USAGEONERR);
- printf("Return value of HX_getopt: %d\n", ret);
- if (ret == EXIT_SUCCESS)
- HX_zvecfree(nargv);
- ret = t_empty_argv();
- if (ret != EXIT_SUCCESS)
- return ret;
- ret = t_keep_argv();
- if (ret != EXIT_SUCCESS)
- return ret;
-
- printf("Either-or is: %s\n", opt_eitheror[opt_dst]);
- printf("values: D=%lf I=%d L=%ld S=%s\n",
- opt_kdbl, opt_kint, opt_klong, opt_kstr);
- printf("Verbosity level: %d\n", opt_v);
- printf("Mask: 0x%08X\n", opt_mask);
- printf("mcstr: >%s<\n", opt_mcstr);
- return t_pthru();
+ printf("== getopt6_eq ==\n");
+ char *argv[] = {"./prog", "--strp", "bar", "--strp=bar"};
+ struct HXopt6_result result;
+ int ret = HX_getopt6(table, ARRAY_SIZE(argv), argv, &result,
+ HXOPT_ITER_OPTS | HXOPT_USAGEONERR);
+ if (ret != HXOPT_ERR_SUCCESS || result.nopts != 2)
+ return EXIT_FAILURE;
+ if (strcmp(result.oarg[0], result.oarg[1]) != 0)
+ return EXIT_FAILURE;
+ HX_getopt6_clean(&result);
+ free(opt_kstr);
+ opt_kstr = nullptr;
+ return EXIT_SUCCESS;
}
int main(int argc, char **argv)
@@ -145,6 +226,12 @@ int main(int argc, char **argv)
int ret = runner(argc, argv);
if (ret != EXIT_SUCCESS)
printf("FAILED\n");
+ ret = t_getopt6_aflags(argc, argv);
+ if (ret != EXIT_SUCCESS)
+ printf("FAILED\n");
+ ret = t_getopt6_eq();
+ if (ret != EXIT_SUCCESS)
+ printf("FAILED\n");
HX_exit();
return ret;
}
diff --git a/src/tc-realpath.c b/src/tc-realpath.c
index 4d6b79f..e4933a5 100644
--- a/src/tc-realpath.c
+++ b/src/tc-realpath.c
@@ -10,36 +10,14 @@
#include <libHX/string.h>
#include "internal.h"
-static unsigned int rp_flags;
-static unsigned int rp_absolute;
-static unsigned int rp_no_parent, rp_no_self;
-
static const struct HXoption rp_option_table[] = {
- {.sh = 'a', .type = HXTYPE_NONE, .ptr = &rp_absolute,
- .help = "Produce an absolute path"},
- {.sh = 'p', .type = HXTYPE_NONE, .ptr = &rp_no_parent,
- .help = "Deactivate resolution of \"..\" entries"},
- {.sh = 's', .type = HXTYPE_NONE, .ptr = &rp_no_self,
- .help = "Deactivate resolution of \".\" entries"},
+ {.sh = 'a', .type = HXTYPE_NONE, .help = "Produce an absolute path"},
+ {.sh = 'p', .type = HXTYPE_NONE, .help = "Deactivate resolution of \"..\" entries"},
+ {.sh = 's', .type = HXTYPE_NONE, .help = "Deactivate resolution of \".\" entries"},
HXOPT_AUTOHELP,
HXOPT_TABLEEND,
};
-static bool rp_get_options(char **oargv, int *argc, char ***argv)
-{
- if (HX_getopt5(rp_option_table, oargv, argc, argv, HXOPT_USAGEONERR) !=
- HXOPT_ERR_SUCCESS)
- return false;
- rp_flags = HX_REALPATH_DEFAULT;
- if (rp_absolute)
- rp_flags |= HX_REALPATH_ABSOLUTE;
- if (rp_no_parent)
- rp_flags &= ~HX_REALPATH_PARENT;
- if (rp_no_self)
- rp_flags &= ~HX_REALPATH_SELF;
- return true;
-}
-
static void t_1(void)
{
hxmc_t *tmp = HXmc_strinit("");
@@ -57,20 +35,28 @@ static void t_2(void)
HXmc_free(tmp);
}
-int main(int argc, char **oargv)
+int main(int argc, char **argv)
{
- char **argv = nullptr;
hxmc_t *res;
int ret;
-
- if (!rp_get_options(oargv, &argc, &argv))
- return EXIT_FAILURE;
+ struct HXopt6_result result;
+ if (HX_getopt6(rp_option_table, argc, argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_OA) != HXOPT_ERR_SUCCESS)
+ return false;
+ unsigned int rp_flags = HX_REALPATH_DEFAULT;
+ for (int i = 0; i < result.nopts; ++i) {
+ switch (result.desc[i]->sh) {
+ case 'a': rp_flags |= HX_REALPATH_ABSOLUTE; break;
+ case 'p': rp_flags &= ~HX_REALPATH_PARENT; break;
+ case 's': rp_flags &= ~HX_REALPATH_SELF; break;
+ }
+ }
t_1();
t_2();
res = NULL;
- for (int i = 1; i < argc; ++i) {
- ret = HX_realpath(&res, argv[argc], rp_flags);
+ for (int i = 0; i < result.nargs; ++i) {
+ ret = HX_realpath(&res, result.uarg[i], rp_flags);
if (ret < 0) {
perror("HX_realpath");
printf("\n");
@@ -78,6 +64,6 @@ int main(int argc, char **oargv)
printf("%s\n", res);
}
}
- HX_zvecfree(argv);
+ HX_getopt6_clean(&result);
return EXIT_SUCCESS;
}
diff --git a/src/tc-string.c b/src/tc-string.c
index d777268..1c67ede 100644
--- a/src/tc-string.c
+++ b/src/tc-string.c
@@ -108,23 +108,22 @@ static void t_strncat(void)
printf("String: >%s<\n", data);
}
-static void t_strnlen(void)
-{
- static const char s[] = "Hello world";
- printf("# strnlen: %" HX_SIZET_FMT "u %" HX_SIZET_FMT "u "
- "%" HX_SIZET_FMT "u %" HX_SIZET_FMT "u %" HX_SIZET_FMT "u\n",
- HX_strnlen(s, -1), HX_strnlen(s, 0), HX_strnlen(s, 1),
- HX_strnlen(s, strlen(s)), HX_strnlen(s, 999));
-}
-
static void t_strsep(void)
{
- char b[] = "jengelh:x:1500:100:Jan Engelhardt:/home/jengelh:/bin/bash";
+ char orig[] = "jengelh:x:1500:100:Jan Engelhardt:/home/jengelh:/bin/bash";
+ char b[sizeof(orig)];
char *wp = b, *ret;
printf("# strsep\n");
+ memcpy(b, orig, sizeof(orig));
while ((ret = HX_strsep2(&wp, ":")) != NULL)
printf("%s\n", ret);
+
+ printf("# strtok_r\n");
+ memcpy(b, orig, sizeof(orig));
+ wp = b;
+ while ((ret = strtok_r(nullptr, ":", &wp)) != nullptr)
+ printf("%s\n", ret);
}
static void t_strtrim(void)
@@ -132,11 +131,6 @@ static void t_strtrim(void)
char a[] = " a and b ", aexp[] = "a and b ";
char b[] = " a and b ", bexp[] = " a and b";
char c[] = "a&b", cexp[] = "a&b";
- const char *r;
-
- r = HX_stpltrim(a);
- printf("HX_stpltrim(\"%s\") = \"%s\"\n", a, r);
- assert(strcmp(r, aexp) == 0);
printf("HX_strltrim(\"%s\") = ", a);
printf("\"%s\"\n", (HX_strltrim(a), a));
@@ -146,7 +140,6 @@ static void t_strtrim(void)
printf("\"%s\"\n", (HX_strrtrim(b), b));
assert(strcmp(b, bexp) == 0);
- assert(strcmp(cexp, HX_stpltrim(c)) == 0);
assert(strcmp(cexp, (HX_strltrim(c), c)) == 0);
assert(strcmp(cexp, (HX_strrtrim(c), c)) == 0);
}
@@ -399,14 +392,19 @@ static int t_time_units(void)
static int t_time_strto(void)
{
#define NS_PER_S 1000000000ULL
+ #define S_PER_Y 31557600
+ enum {
+ NO_NSEC = 0x2U,
+ };
static const struct {
const char *input;
unsigned long long expect_s, expect_ns;
const char expect_rem[16];
+ unsigned int flags;
} vt[] = {
{"29µs", 0, 29000, ""},
- {"1y", 31557600, NS_PER_S * 31557600, ""},
- {"1y1month1week1d1h1min1s ", 31557600+2629800+86400*8+3600+60+1, NS_PER_S * (31557600+2629800+86400*8+3600+60+1), ""},
+ {"1y", S_PER_Y, NS_PER_S * S_PER_Y, ""},
+ {"1y1month1week1d1h1min1s ", S_PER_Y+2629800+86400*8+3600+60+1, NS_PER_S * (S_PER_Y+2629800+86400*8+3600+60+1), ""},
{" -1d", 0, 0, "-1d"},
{"1 -", 0, 0, "1 -"},
{"12.5 hours .5 hours 240 minutes 25200 seconds", 86400, NS_PER_S * 86400, ""},
@@ -418,23 +416,42 @@ static int t_time_strto(void)
{"1s0.0", 1, NS_PER_S, ""},
{"1s1s", 2, 2 * NS_PER_S, ""},
{"1s1", 1, 1 * NS_PER_S, "1"},
+ {"584542046090y", 584542046090ULL * S_PER_Y, ULLONG_MAX, "", NO_NSEC},
+ {"584542046090y19767615s", ULLONG_MAX, ULLONG_MAX, "", NO_NSEC},
+ {"584542046090y19767616s", ULLONG_MAX, ULLONG_MAX, "19767616s", NO_NSEC},
+ {"584542046090y", 584542046090ULL * S_PER_Y, ULLONG_MAX, "", NO_NSEC},
{"584542046091y", ULLONG_MAX, ULLONG_MAX, "584542046091y"},
+ {"584542046091.0y", ULLONG_MAX, ULLONG_MAX, "584542046091.0y"},
+ {"P1M", S_PER_Y / 12, S_PER_Y / 12 * NS_PER_S, ""},
+ {"p1m", 0, 0, "p1m"},
+ {"PT1M", 60, 60 * NS_PER_S, ""},
+ {"P584542046090Y", 584542046090ULL * S_PER_Y, ULLONG_MAX, "", NO_NSEC},
+ {"P0DT0H0M0.0S", 0, 0},
+ {"P0DT12H45M0.0S", 12 * 3600 + 45 * 60, (12 * 3600 + 45 * 60) * NS_PER_S},
+ {"P1D", 86400, 86400 * NS_PER_S},
};
- char *end;
printf("===== t_time_strto\n");
for (size_t i = 0; i < ARRAY_SIZE(vt); ++i) {
+ char *end, *end_ns;
unsigned long long q = HX_strtoull_sec(vt[i].input, &end);
- unsigned long long qn = HX_strtoull_nsec(vt[i].input, &end);
- printf("Observed: \"%s\" => %llus [%lluns] + \"%s\"\n", vt[i].input, q, qn, end);
- if (q != vt[i].expect_s || qn != vt[i].expect_ns) {
- printf("Expected: %llus [%lluns]\n", vt[i].expect_s, vt[i].expect_ns);
+ unsigned long long qn = HX_strtoull_nsec(vt[i].input, &end_ns);
+ printf("Observed: \"%s\" => %llus + \"%s\" [%lluns + \"%s\"]\n",
+ vt[i].input, q, end, qn, end_ns);
+ if (q != vt[i].expect_s || strcmp(end, vt[i].expect_rem) != 0) {
+ printf("-!- Expected: %llus + \"%s\"\n", vt[i].expect_s, vt[i].expect_rem);
return EXIT_FAILURE;
}
- if (strcmp(end, vt[i].expect_rem) != 0) {
- printf("Expected: remainder \"%s\"\n", vt[i].expect_rem);
+ if (vt[i].flags & NO_NSEC)
+ continue;
+ if (qn != vt[i].expect_ns || strcmp(end_ns, vt[i].expect_rem) != 0) {
+ printf("-!- Expected: %llus + \"%s\"\n", vt[i].expect_ns, vt[i].expect_rem);
return EXIT_FAILURE;
}
}
+ if (HX_strtoull8601p_sec("P1D", nullptr) != 86400) {
+ printf("8601p_sec failed\n");
+ return EXIT_FAILURE;
+ }
return EXIT_SUCCESS;
}
@@ -496,7 +513,6 @@ static int runner(int argc, char **argv)
if (ret != EXIT_SUCCESS)
return EXIT_FAILURE;
t_strncat();
- t_strnlen();
t_strdup();
t_strsep();
t_strtrim();
diff --git a/src/tc-strquote.c b/src/tc-strquote.c
index ef357d1..c96aa19 100644
--- a/src/tc-strquote.c
+++ b/src/tc-strquote.c
@@ -10,7 +10,6 @@
static const char input1[] = "\"Good\" ol' \\'escaped\\' strings";
static const char output1a[] = "\"Good\" ol\\' \\\\\\'escaped\\\\\\' strings";
static const char output1b[] = "\\\"Good\\\" ol' \\\\'escaped\\\\' strings";
-static const char output1c[] = "\"Good\" ol'' \\''escaped\\'' strings";
static const char input2[] = "<p style=\"height: 1;\">Foo &amp; \"bar\"</p>";
static const char output2[] =
"&lt;p style=&quot;height: 1;&quot;&gt;Foo &amp;amp; &quot;bar&quot;&lt;/p&gt;";
@@ -20,8 +19,6 @@ static const char output3b[] = "\\20\\23o\\3Dfoo(*)\\2Cba\\5Cr\\20";
static const char output3c[] = "ICNvPWZvbygqKSxiYVxyIA==";
static const char input4[] = "http://user:pass@host.de/~path/file(msvc);stuff.php?query[phpindex]=value&another=one;stuff";
static const char output4[] = "http%3A%2F%2Fuser%3Apass%40host.de%2F~path%2Ffile%28msvc%29%3Bstuff.php%3Fquery%5Bphpindex%5D%3Dvalue%26another%3Done%3Bstuff";
-static const char input5[] = "echo hello `echo world`";
-static const char output5[] = "echo hello ``echo world``";
static const char input6[] = "\xfb\xef\xff";
static const char output6[] = "++//";
static const char input7[] = "\xfb\xef\xff";
@@ -58,13 +55,11 @@ int main(void)
return EXIT_FAILURE;
tst(input1, HXQUOTE_SQUOTE, output1a);
tst(input1, HXQUOTE_DQUOTE, output1b);
- tst(input1, HXQUOTE_SQLSQUOTE, output1c);
tst(input2, HXQUOTE_HTML, output2);
tst(input3, HXQUOTE_LDAPFLT, output3a);
tst(input3, HXQUOTE_LDAPRDN, output3b);
tst(input3, HXQUOTE_BASE64, output3c);
tst(input4, HXQUOTE_URIENC, output4);
- tst(input5, HXQUOTE_SQLBQUOTE, output5);
tst(input6, HXQUOTE_BASE64, output6);
tst(input7, HXQUOTE_BASE64URL, output7);
return 0;
diff --git a/src/tc-switchuser.c b/src/tc-switchuser.c
index e5d2c25..379dfff 100644
--- a/src/tc-switchuser.c
+++ b/src/tc-switchuser.c
@@ -10,19 +10,28 @@
#include <libHX/defs.h>
#include <libHX/option.h>
#include <libHX/proc.h>
+#include "internal.h"
#if defined(HAVE_INITGROUPS)
-static char *user_name, *group_name;
static const struct HXoption options_table[] = {
- {.sh = 'u', .type = HXTYPE_STRING, .ptr = &user_name},
- {.sh = 'g', .type = HXTYPE_STRING, .ptr= &group_name},
+ {.sh = 'u', .type = HXTYPE_STRING},
+ {.sh = 'g', .type = HXTYPE_STRING},
HXOPT_TABLEEND,
};
static int runner(int argc, char **argv)
{
- if (HX_getopt(options_table, &argc, &argv, HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
+ char *user_name = nullptr, *group_name = nullptr;
+ struct HXopt6_result result;
+
+ if (HX_getopt6(options_table, argc, argv, &result,
+ HXOPT_USAGEONERR | HXOPT_ITER_OPTS) != HXOPT_ERR_SUCCESS)
return EXIT_FAILURE;
+ for (int i = 0; i < result.nopts; ++i) {
+ if (result.desc[i]->sh == 'u') user_name = result.oarg[i];
+ if (result.desc[i]->sh == 'g') group_name = result.oarg[i];
+ }
+
const char *user = user_name != NULL ? user_name : "-";
const char *group = group_name != NULL ? group_name : "-";
switch (HXproc_switch_user(user_name, group_name)) {
@@ -63,7 +72,7 @@ static int runner(int argc, char **argv)
break;
}
}
- HX_zvecfree(argv);
+ HX_getopt6_clean(&result);
return EXIT_SUCCESS;
}
diff --git a/src/tc-time.c b/src/tc-time.c
index e810233..e1ec12b 100644
--- a/src/tc-time.c
+++ b/src/tc-time.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
+#include <sys/time.h>
#include <libHX/defs.h>
#include <libHX/init.h>
#include <libHX/misc.h>
diff --git a/src/tx-option.cpp b/src/tx-option.cpp
deleted file mode 100644
index 248ab7c..0000000
--- a/src/tx-option.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __cplusplus
-# include <stdlib.h>
-#else
-# include <cstdlib>
-#endif
-#include <libHX/option.h>
-
-static unsigned int g_verbose;
-static const struct HXoption t[] = {
- {nullptr, 'v', HXTYPE_NONE | HXOPT_INC, &g_verbose},
- HXOPT_AUTOHELP,
- HXOPT_TABLEEND,
-};
-
-int main(int argc, char **argv)
-{
- if (HX_getopt(t, &argc, &argv, HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS)
- return EXIT_FAILURE;
- HX_zvecfree(argv);
- return EXIT_SUCCESS;
-}