<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8493">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: For consistency, avoid double-checking via if clauses.<br><br>In the script ./configure, AST_EXT_LIB_CHECK and AST_PKG_CONFIG_CHECK first test<br>whether parameter 1 was already found. Consequently, an if-test on PBX_ just a<br>line below is redundant, if exactly the same parameter 1 is used again.<br><br>No performance gain is expected by this change. However, because this strategy<br>is used all over in ./configure except for two places, this change aims to<br>create more consistency: Only do something different if there is a reason to do<br>so.<br><br>Change-Id: I4a6f48127b7af3a48168c917e888be1f70625027<br>---<br>M configure<br>M configure.ac<br>2 files changed, 31 insertions(+), 47 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/8493/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/configure b/configure<br>index 3442d57..164c903 100755<br>--- a/configure<br>+++ b/configure<br>@@ -19447,9 +19447,7 @@<br> fi<br> <br> <br>-<br>-if test "${PBX_BFD}" = "0"; then<br>- # Fedora/RedHat/CentOS require extra libraries<br>+# Fedora/RedHat/CentOS require extra libraries<br> <br> if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then<br> pbxlibdir=""<br>@@ -19464,9 +19462,9 @@<br> <br> ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br> CFLAGS="${CFLAGS} "<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_check_format in -lbfd" >&5<br>-$as_echo_n "checking for bfd_check_format in -lbfd... " >&6; }<br>-if ${ac_cv_lib_bfd_bfd_check_format+:} false; then :<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5<br>+$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }<br>+if ${ac_cv_lib_bfd_bfd_openr+:} false; then :<br> $as_echo_n "(cached) " >&6<br> else<br> ac_check_lib_save_LIBS=$LIBS<br>@@ -19480,27 +19478,27 @@<br> #ifdef __cplusplus<br> extern "C"<br> #endif<br>-char bfd_check_format ();<br>+char bfd_openr ();<br> int<br> main ()<br> {<br>-return bfd_check_format ();<br>+return bfd_openr ();<br> ;<br> return 0;<br> }<br> _ACEOF<br> if ac_fn_c_try_link "$LINENO"; then :<br>- ac_cv_lib_bfd_bfd_check_format=yes<br>+ ac_cv_lib_bfd_bfd_openr=yes<br> else<br>- ac_cv_lib_bfd_bfd_check_format=no<br>+ ac_cv_lib_bfd_bfd_openr=no<br> fi<br> rm -f core conftest.err conftest.$ac_objext \<br> conftest$ac_exeext conftest.$ac_ext<br> LIBS=$ac_check_lib_save_LIBS<br> fi<br>-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_check_format" >&5<br>-$as_echo "$ac_cv_lib_bfd_bfd_check_format" >&6; }<br>-if test "x$ac_cv_lib_bfd_bfd_check_format" = xyes; then :<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5<br>+$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }<br>+if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :<br> AST_BFD_FOUND=yes<br> else<br> AST_BFD_FOUND=no<br>@@ -19546,10 +19544,7 @@<br> fi<br> <br> <br>-fi<br>-<br>-if test "${PBX_BFD}" = "0"; then<br>- # openSUSE requires -lz<br>+# openSUSE requires -lz<br> <br> if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then<br> pbxlibdir=""<br>@@ -19564,9 +19559,9 @@<br> <br> ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br> CFLAGS="${CFLAGS} "<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_check_format in -lbfd" >&5<br>-$as_echo_n "checking for bfd_check_format in -lbfd... " >&6; }<br>-if ${ac_cv_lib_bfd_bfd_check_format+:} false; then :<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5<br>+$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }<br>+if ${ac_cv_lib_bfd_bfd_openr+:} false; then :<br> $as_echo_n "(cached) " >&6<br> else<br> ac_check_lib_save_LIBS=$LIBS<br>@@ -19580,27 +19575,27 @@<br> #ifdef __cplusplus<br> extern "C"<br> #endif<br>-char bfd_check_format ();<br>+char bfd_openr ();<br> int<br> main ()<br> {<br>-return bfd_check_format ();<br>+return bfd_openr ();<br> ;<br> return 0;<br> }<br> _ACEOF<br> if ac_fn_c_try_link "$LINENO"; then :<br>- ac_cv_lib_bfd_bfd_check_format=yes<br>+ ac_cv_lib_bfd_bfd_openr=yes<br> else<br>- ac_cv_lib_bfd_bfd_check_format=no<br>+ ac_cv_lib_bfd_bfd_openr=no<br> fi<br> rm -f core conftest.err conftest.$ac_objext \<br> conftest$ac_exeext conftest.$ac_ext<br> LIBS=$ac_check_lib_save_LIBS<br> fi<br>-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_check_format" >&5<br>-$as_echo "$ac_cv_lib_bfd_bfd_check_format" >&6; }<br>-if test "x$ac_cv_lib_bfd_bfd_check_format" = xyes; then :<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5<br>+$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }<br>+if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :<br> AST_BFD_FOUND=yes<br> else<br> AST_BFD_FOUND=no<br>@@ -19646,7 +19641,6 @@<br> fi<br> <br> <br>-fi<br> <br> if test "x${OSARCH}" = "xlinux-gnu" ; then<br> <br>@@ -20461,8 +20455,7 @@<br> fi<br> fi<br> <br>- if test "$PBX_LIBEDIT" != "1"; then<br>- # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br>+ # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br> <br> if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then<br> pbxlibdir=""<br>@@ -20559,9 +20552,8 @@<br> fi<br> <br> <br>- fi<br> if test "$PBX_LIBEDIT" = "1"; then<br>- LIBEDIT_INTERNAL="no"<br>+ LIBEDIT_INTERNAL="no"<br> fi<br> fi<br> if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>diff --git a/configure.ac b/configure.ac<br>index d9148c0..c0099cb 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -1414,16 +1414,10 @@<br> AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])<br> <br> AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])<br>-<br>-if test "${PBX_BFD}" = "0"; then<br>- # Fedora/RedHat/CentOS require extra libraries<br>- AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])<br>-fi<br>-<br>-if test "${PBX_BFD}" = "0"; then<br>- # openSUSE requires -lz<br>- AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])<br>-fi<br>+# Fedora/RedHat/CentOS require extra libraries<br>+AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty])<br>+# openSUSE requires -lz<br>+AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz])<br> <br> if test "x${OSARCH}" = "xlinux-gnu" ; then<br> AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])<br>@@ -1539,12 +1533,10 @@<br> fi<br> if test "${LIBEDIT_SYSTEM}" = "yes"; then<br> AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)<br>- if test "$PBX_LIBEDIT" != "1"; then<br>- # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br>- AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap])<br>- fi<br>+ # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br>+ AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap])<br> if test "$PBX_LIBEDIT" = "1"; then<br>- LIBEDIT_INTERNAL="no"<br>+ LIBEDIT_INTERNAL="no"<br> fi<br> fi<br> if test "${LIBEDIT_INTERNAL}" = "yes"; then<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8493">change 8493</a>. To unsubscribe, 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/8493"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4a6f48127b7af3a48168c917e888be1f70625027 </div>
<div style="display:none"> Gerrit-Change-Number: 8493 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>