<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14177">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
George Joseph: Looks good to me, but someone else must approve
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: Search for Python/C API when possibly needed only.<br><br>The Python/C API is used only if the Test Framework was enabled in Asterisk<br>'make menuselect'. The Test Framework is available only if the Developer Mode<br>was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API<br>is used only if the PJProject was found and not disabled in Asterisk; the user<br>did not go for './configure --without-pjproject'.<br><br>Furthermore, because version 2 of that Python/C API is required (currently) and<br>because some platforms do not offer a generic version 2, the script searches<br>for 2.7 explicitly as well.<br><br>To avoid version mismatch between the Python/C API and the Python environment,<br>the script searches for the latter in the same versions, in the same the order<br>as well. Because this Python/C API is just for (some) Asterisk contributors,<br>the script also goes for the Python 3 environment as a last resort for all<br>other Asterisk users. This allows 'make full' even on minimal installations of<br>Ubuntu 18.04 LTS and newer.<br><br>Because the Python/C API is Asterisk contributor specific, the Python packages<br>are removed from the script './contrib/scripts/install_prereq' as this script<br>is intended for Asterisk users. Asterisk contributors have to install much more<br>packages in any case, like:<br>sudo apt install autoconf automake git git-review python2.7-dev<br><br>ASTERISK-28824<br>ASTERISK-27717<br><br>Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876<br>---<br>M configure<br>M configure.ac<br>M contrib/scripts/install_prereq<br>3 files changed, 222 insertions(+), 17 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure b/configure</span><br><span>index c76cb47..840d7f8 100755</span><br><span>--- a/configure</span><br><span>+++ b/configure</span><br><span>@@ -6806,8 +6806,10 @@</span><br><span> fi</span><br><span> </span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# Extract the first word of "python", so it can be a program name with args.</span><br><span style="color: hsl(0, 100%, 40%);">-set dummy python; ac_word=$2</span><br><span style="color: hsl(120, 100%, 40%);">+for ac_prog in python2.7 python2 python python3</span><br><span style="color: hsl(120, 100%, 40%);">+do</span><br><span style="color: hsl(120, 100%, 40%);">+ # Extract the first word of "$ac_prog", so it can be a program name with args.</span><br><span style="color: hsl(120, 100%, 40%);">+set dummy $ac_prog; ac_word=$2</span><br><span> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5</span><br><span> $as_echo_n "checking for $ac_word... " >&6; }</span><br><span> if ${ac_cv_path_PYTHON+:} false; then :</span><br><span>@@ -6833,7 +6835,6 @@</span><br><span> done</span><br><span> IFS=$as_save_IFS</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON=":"</span><br><span> ;;</span><br><span> esac</span><br><span> fi</span><br><span>@@ -6847,6 +6848,10 @@</span><br><span> fi</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ test -n "$PYTHON" && break</span><br><span style="color: hsl(120, 100%, 40%);">+done</span><br><span style="color: hsl(120, 100%, 40%);">+test -n "$PYTHON" || PYTHON=":"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # Extract the first word of "find", so it can be a program name with args.</span><br><span> set dummy find; ac_word=$2</span><br><span> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5</span><br><span>@@ -25944,10 +25949,187 @@</span><br><span> </span><br><span> </span><br><span> fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x$PBX_PJPROJECT" = "x1" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${AST_DEVMODE}" = "xyes" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+pkg_failed=no</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHONDEV" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for PYTHONDEV... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$PYTHONDEV_CFLAGS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_CFLAGS="$PYTHONDEV_CFLAGS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "python-2.7") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_CFLAGS=`$PKG_CONFIG --cflags "python-2.7" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$PYTHONDEV_LIBS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_LIBS="$PYTHONDEV_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "python-2.7") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_LIBS=`$PKG_CONFIG --libs "python-2.7" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span> fi</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+if test $pkg_failed = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ if test $_pkg_short_errors_supported = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python-2.7" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python-2.7" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ # Put the nasty error message in config.log where it belongs</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "$PYTHONDEV_PKG_ERRORS" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+elif test $pkg_failed = untried; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_CFLAGS=$pkg_cv_PYTHONDEV_CFLAGS</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_LIBS=$pkg_cv_PYTHONDEV_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "yes" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=1</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_INCLUDE=$(echo ${PYTHONDEV_CFLAGS} | $SED -e "s|-std=c99||g")</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_LIB="$PYTHONDEV_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "#define HAVE_PYTHONDEV 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+pkg_failed=no</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHONDEV" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for PYTHONDEV... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$PYTHONDEV_CFLAGS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_CFLAGS="$PYTHONDEV_CFLAGS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "python2") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_CFLAGS=`$PKG_CONFIG --cflags "python2" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$PYTHONDEV_LIBS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_LIBS="$PYTHONDEV_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "python2") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_PYTHONDEV_LIBS=`$PKG_CONFIG --libs "python2" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test $pkg_failed = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ if test $_pkg_short_errors_supported = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python2" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python2" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ # Put the nasty error message in config.log where it belongs</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "$PYTHONDEV_PKG_ERRORS" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+elif test $pkg_failed = untried; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_CFLAGS=$pkg_cv_PYTHONDEV_CFLAGS</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_LIBS=$pkg_cv_PYTHONDEV_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "yes" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_PYTHONDEV=1</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_INCLUDE=$(echo ${PYTHONDEV_CFLAGS} | $SED -e "s|-std=c99||g")</span><br><span style="color: hsl(120, 100%, 40%);">+ PYTHONDEV_LIB="$PYTHONDEV_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "#define HAVE_PYTHONDEV 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then</span><br><span> </span><br><span>@@ -26036,6 +26218,16 @@</span><br><span> fi</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ # The PJProject offers a C extension to Python. That wrapper is used by the</span><br><span style="color: hsl(120, 100%, 40%);">+ # Asterisk Test Framework, which requires Asterisk to be in Developer Mode.</span><br><span style="color: hsl(120, 100%, 40%);">+ # However, the used wrapper (called 'PJSUA Python') is deprecated and was not</span><br><span style="color: hsl(120, 100%, 40%);">+ # ported from Python 2.7 to Python 3.x. This is confirmed; it simply does not</span><br><span style="color: hsl(120, 100%, 40%);">+ # build. For more see <http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial>.</span><br><span style="color: hsl(120, 100%, 40%);">+ # Therefore, the C libraries for Python 3 are of no help in Asterisk:</span><br><span style="color: hsl(120, 100%, 40%);">+ #AST_PKG_CONFIG_CHECK([PYTHONDEV], [python3])</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> </span><br><span> </span><br><span> if test "x${PBX_POPT}" != "x1" -a "${USE_POPT}" != "no"; then</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index dc94fdd..71d3eb4 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -264,7 +264,7 @@</span><br><span> AC_PATH_PROG([CUT], [cut], :)</span><br><span> AC_PATH_PROG([FLEX], [flex], :)</span><br><span> AC_PATH_PROG([GREP], [grep], :)</span><br><span style="color: hsl(0, 100%, 40%);">-AC_PATH_PROG([PYTHON], [python], :)</span><br><span style="color: hsl(120, 100%, 40%);">+AC_PATH_PROGS([PYTHON], [python2.7 python2 python python3], :)</span><br><span> AC_PATH_PROG([FIND], [find], :)</span><br><span> AC_PATH_PROG([BASENAME], [basename], :)</span><br><span> AC_PATH_PROG([DIRNAME], [dirname], :)</span><br><span>@@ -2431,11 +2431,24 @@</span><br><span> AST_EXT_LIB_CHECK([PJSIP_AUTH_CLT_DEINIT], [pjsip], [pjsip_auth_clt_deinit], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])</span><br><span> AST_EXT_LIB_CHECK([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip], [pjsip_tsx_layer_find_tsx2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])</span><br><span> fi</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-AC_SUBST([PYTHONDEV_LIB])</span><br><span style="color: hsl(0, 100%, 40%);">-AC_SUBST([PYTHONDEV_INCLUDE])</span><br><span style="color: hsl(0, 100%, 40%);">-AST_PKG_CONFIG_CHECK([PYTHONDEV], [python])</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x$PBX_PJPROJECT" = "x1" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${AST_DEVMODE}" = "xyes" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_SUBST([PYTHONDEV_LIB])</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_SUBST([PYTHONDEV_INCLUDE])</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_PKG_CONFIG_CHECK([PYTHONDEV], [python-2.7])</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_PKG_CONFIG_CHECK([PYTHONDEV], [python2])</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_PKG_CONFIG_CHECK([PYTHONDEV], [python])</span><br><span style="color: hsl(120, 100%, 40%);">+ # The PJProject offers a C extension to Python. That wrapper is used by the</span><br><span style="color: hsl(120, 100%, 40%);">+ # Asterisk Test Framework, which requires Asterisk to be in Developer Mode.</span><br><span style="color: hsl(120, 100%, 40%);">+ # However, the used wrapper (called 'PJSUA Python') is deprecated and was not</span><br><span style="color: hsl(120, 100%, 40%);">+ # ported from Python 2.7 to Python 3.x. This is confirmed; it simply does not</span><br><span style="color: hsl(120, 100%, 40%);">+ # build. For more see <http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial>.</span><br><span style="color: hsl(120, 100%, 40%);">+ # Therefore, the C libraries for Python 3 are of no help in Asterisk:</span><br><span style="color: hsl(120, 100%, 40%);">+ #AST_PKG_CONFIG_CHECK([PYTHONDEV], [python3])</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> </span><br><span> AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])</span><br><span> </span><br><span>diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq</span><br><span>index 3f1f58f..323d7a7 100755</span><br><span>--- a/contrib/scripts/install_prereq</span><br><span>+++ b/contrib/scripts/install_prereq</span><br><span>@@ -31,7 +31,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_DEBIAN="$PACKAGES_DEBIAN wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch python-dev"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_RH="make gcc gcc-c++ pkgconfig"</span><br><span>@@ -46,7 +46,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_RH="$PACKAGES_RH wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_RH="$PACKAGES_RH bzip2 patch python-devel"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_RH="$PACKAGES_RH bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_SUSE="make gcc gcc-c++ pkg-config"</span><br><span>@@ -61,7 +61,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_SUSE="$PACKAGES_SUSE wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_SUSE="$PACKAGES_SUSE bzip2 patch python-devel"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_SUSE="$PACKAGES_SUSE bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_ARCH="make gcc pkg-config"</span><br><span>@@ -76,7 +76,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_ARCH="$PACKAGES_ARCH wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_ARCH="$PACKAGES_ARCH bzip2 patch python2"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_ARCH="$PACKAGES_ARCH bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_GENTOO="sys-devel/make sys-devel/gcc dev-util/pkgconfig"</span><br><span>@@ -91,7 +91,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_GENTOO="$PACKAGES_GENTOO net-misc/wget dev-vcs/subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_GENTOO="$PACKAGES_GENTOO app-arch/bzip2 sys-devel/patch dev-lang/python:2.7"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_GENTOO="$PACKAGES_GENTOO app-arch/bzip2 sys-devel/patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_NBSD="gmake pkg-config"</span><br><span>@@ -106,7 +106,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_NBSD="$PACKAGES_NBSD wget subversion-base"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_NBSD="$PACKAGES_NBSD bzip2 patch python27"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_NBSD="$PACKAGES_NBSD bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_OBSD="gmake"</span><br><span>@@ -121,7 +121,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_OBSD="$PACKAGES_OBSD wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_OBSD="$PACKAGES_OBSD bzip2 python%2"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_OBSD="$PACKAGES_OBSD bzip2"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_FBSD="gmake pkgconf"</span><br><span>@@ -136,7 +136,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_FBSD="$PACKAGES_FBSD wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch python"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch"</span><br><span> </span><br><span> # Basic build system:</span><br><span> PACKAGES_DBSD="gmake pkgconf"</span><br><span>@@ -151,7 +151,7 @@</span><br><span> # Asterisk: for the unpackaged below:</span><br><span> PACKAGES_DBSD="$PACKAGES_DBSD wget subversion"</span><br><span> # Asterisk: for ./configure --with-pjproject-bundled:</span><br><span style="color: hsl(0, 100%, 40%);">-PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch python"</span><br><span style="color: hsl(120, 100%, 40%);">+PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch"</span><br><span> </span><br><span> KVERS=`uname -r`</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14177">change 14177</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14177"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876 </div>
<div style="display:none"> Gerrit-Change-Number: 14177 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>