[build] Don't use non-POSIX escapes in sed regexp.

* builds/unix/configure.raw (ftoption_set, ftoption_unset): Avoid `\>`.

Fixes issue #1358.
This commit is contained in:
Werner Lemberg
2025-09-14 11:34:21 +02:00
parent 66e1ec84d5
commit 03acd8923b

View File

@@ -1112,21 +1112,26 @@ AC_SUBST([wl])
AC_SUBST([build_libtool_libs])
# changing LDFLAGS value should only be done after
# lt_cv_prog_compiler_static_works test
# We cannot use alternation (`\|`) in the `sed` regexp since it is not
# portable.
ftoption_set()
{
regexp="-e \\\"s|.*#.*def.*$1\>.*|#define $1|\\\""
regexp="-e \\\"s|.*#.*def.*$1 .*|#define $1|\\\" \
-e \\\"s|.*#.*def.*$1\$|#define $1|\\\""
FTOPTION_H_SED="$FTOPTION_H_SED $regexp"
}
ftoption_unset()
{
regexp="-e \\\"s|.*#.*def.*$1\>.*|/* #undef $1 */|\\\""
regexp="-e \\\"s|.*#.*def.*$1 .*|/* #undef $1 */|\\\" \
-e \\\"s|.*#.*def.*$1\$|/* #undef $1 */|\\\""
FTOPTION_H_SED="$FTOPTION_H_SED $regexp"
}
# Changing the `LDFLAGS` value should only be done after the
# `lt_cv_prog_compiler_static_works` test.
if test "$have_zlib" != no; then
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
LDFLAGS="$LDFLAGS $ZLIB_LIBS"