[Asterisk-code-review] ast_pkgconfig.m4: AST_PKG_CONFIG_CHECK() relies on sed. (asterisk[master])
Friendly Automation
asteriskteam at digium.com
Sun May 22 16:35:49 CDT 2022
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18556 )
Change subject: ast_pkgconfig.m4: AST_PKG_CONFIG_CHECK() relies on sed.
......................................................................
ast_pkgconfig.m4: AST_PKG_CONFIG_CHECK() relies on sed.
Make sure that we have a working sed before trying to use it.
ASTERISK-30059 #close
Change-Id: I9abad67a5df11b665d480feec304ab9d6f55cc76
---
M autoconf/ast_pkgconfig.m4
M configure
M menuselect/configure
3 files changed, 95 insertions(+), 94 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/autoconf/ast_pkgconfig.m4 b/autoconf/ast_pkgconfig.m4
index 3415ed5..bb9c60c 100644
--- a/autoconf/ast_pkgconfig.m4
+++ b/autoconf/ast_pkgconfig.m4
@@ -2,6 +2,7 @@
# AST_PKG_CONFIG_CHECK([package], [component])
AC_DEFUN([AST_PKG_CONFIG_CHECK],
[
+ AC_REQUIRE([AST_PROG_SED])dnl
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
PKG_CHECK_MODULES($1, $2, [
PBX_$1=1
diff --git a/configure b/configure
index ac26b46..6c913f0 100755
--- a/configure
+++ b/configure
@@ -10210,7 +10210,7 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system openssl > 1.1.0" >&5
printf "%s\n" "$as_me: checking whether system openssl > 1.1.0" >&6;}
- if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
+ if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl >= 1.1.0" >&5
@@ -10301,7 +10301,7 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether alternate openssl11 is installed" >&5
printf "%s\n" "$as_me: checking whether alternate openssl11 is installed" >&6;}
- if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
+ if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl11" >&5
@@ -10397,7 +10397,7 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking fallback system openssl" >&5
printf "%s\n" "$as_me: checking fallback system openssl" >&6;}
- if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
+ if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5
@@ -14832,7 +14832,7 @@
# Find required NetBSD Editline library (libedit).
- if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then
+ if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libedit" >&5
@@ -15293,7 +15293,7 @@
# Find required JSON support if bundled is not enabled.
if test "$JANSSON_BUNDLED" = "no" ; then
- if test "x${PBX_JANSSON}" != "x1" -a "${USE_JANSSON}" != "no"; then
+ if test "x${PBX_JANSSON}" != "x1" -a "${USE_JANSSON}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jansson >= 2.11" >&5
@@ -15611,7 +15611,7 @@
- if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
+ if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0" >&5
@@ -22886,7 +22886,7 @@
fi
if test "${ILBC_SYSTEM}" = "yes"; then
- if test "x${PBX_ILBC}" != "x1" -a "${USE_ILBC}" != "no"; then
+ if test "x${PBX_ILBC}" != "x1" -a "${USE_ILBC}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libilbc" >&5
@@ -25145,7 +25145,7 @@
- if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then
+ if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for netsnmp-agent" >&5
@@ -26572,7 +26572,7 @@
if test "$USE_PJPROJECT" != "no" ; then
if test "$PJPROJECT_BUNDLED" = "no" ; then
- if test "x${PBX_PJPROJECT}" != "x1" -a "${USE_PJPROJECT}" != "no"; then
+ if test "x${PBX_PJPROJECT}" != "x1" -a "${USE_PJPROJECT}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libpjproject" >&5
@@ -27832,7 +27832,7 @@
- if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
+ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python-2.7" >&5
@@ -27920,7 +27920,7 @@
fi
- if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
+ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python2" >&5
@@ -28008,7 +28008,7 @@
fi
- if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
+ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5
@@ -28204,7 +28204,7 @@
- if test "x${PBX_PORTAUDIO}" != "x1" -a "${USE_PORTAUDIO}" != "no"; then
+ if test "x${PBX_PORTAUDIO}" != "x1" -a "${USE_PORTAUDIO}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for portaudio-2.0" >&5
@@ -34122,7 +34122,7 @@
for ver in 3.0 2.6 2.4 2.2 2.0; do
- if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
+ if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmime-$ver" >&5
@@ -35482,7 +35482,7 @@
- if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then
+ if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5
@@ -35593,7 +35593,7 @@
- if test "x${PBX_SYSTEMD}" != "x1" -a "${USE_SYSTEMD}" != "no"; then
+ if test "x${PBX_SYSTEMD}" != "x1" -a "${USE_SYSTEMD}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5
diff --git a/menuselect/configure b/menuselect/configure
index 2f461c4..c387d7f 100755
--- a/menuselect/configure
+++ b/menuselect/configure
@@ -657,9 +657,9 @@
GTK2_LIBS
GTK2_CFLAGS
CONFIG_LIBXML2
-SED
LIBXML2_LIBS
LIBXML2_CFLAGS
+SED
HAVE_NCURSES_SUBDIR
PBX_TINFO
TINFO_DIR
@@ -4945,8 +4945,83 @@
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ 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_prog in sed gsed
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
- if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+
+ if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0" >&5
@@ -5033,81 +5108,6 @@
fi
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-printf %s "checking for a sed that does not truncate output... " >&6; }
-if test ${ac_cv_path_SED+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" | sed 99q >conftest.sed
- $as_unset ac_script || ac_script=
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- 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_prog in sed gsed
- do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- printf %s 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- printf "%s\n" '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-printf "%s\n" "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then
PBX_LIBXML2=0
@@ -5267,7 +5267,7 @@
fi
- if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then
+ if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18556
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I9abad67a5df11b665d480feec304ab9d6f55cc76
Gerrit-Change-Number: 18556
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220522/e4fc68b5/attachment-0001.html>
More information about the asterisk-code-review
mailing list