[Asterisk-code-review] autoconf: Remove use of m4 ifblank. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Sat Dec 2 15:57:49 CST 2017


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7422


Change subject: autoconf: Remove use of m4_ifblank.
......................................................................

autoconf: Remove use of m4_ifblank.

The m4_ifblank macro is not available on CentOS 6, revserse conditionals
to allow use of m4_ifval instead.  ./bootstrap.sh was run but this patch
does not result in any difference to the generated configure script.

Change-Id: I280785deb872ed8d3339d99cce63a2b54d5f1438
---
M autoconf/ast_check_pwlib.m4
M autoconf/ast_ext_lib.m4
M autoconf/ast_gcc_attribute.m4
3 files changed, 13 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/22/7422/1

diff --git a/autoconf/ast_check_pwlib.m4 b/autoconf/ast_check_pwlib.m4
index 4588fa3..8ec2d58 100644
--- a/autoconf/ast_check_pwlib.m4
+++ b/autoconf/ast_check_pwlib.m4
@@ -200,7 +200,7 @@
 		$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
 		$2_VER=$((${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}))
 		$2_REQ=$(($4*10000+$5*100+$6))
-		$2_MAX=m4_ifblank([$10], [9999999], [$(($8*10000+$9*100+$10))])
+		$2_MAX=m4_ifval([$10], [$(($8*10000+$9*100+$10))], [9999999])
 
 		AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
 		if test ${$2_VER} -lt ${$2_REQ}; then
diff --git a/autoconf/ast_ext_lib.m4 b/autoconf/ast_ext_lib.m4
index e8ce201..080b8c3 100644
--- a/autoconf/ast_ext_lib.m4
+++ b/autoconf/ast_ext_lib.m4
@@ -117,14 +117,14 @@
          pbxlibdir="-L${$1_DIR}"
       fi
    fi
-   m4_ifblank([$3], [
-      # empty lib, assume only headers
-      AST_$1_FOUND=yes
-   ], [
+   m4_ifval([$3], [
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $6"
       AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], [${pbxlibdir} $5])
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   ], [
+      # empty lib, assume only headers
+      AST_$1_FOUND=yes
    ])
 
    # now check for the header.
@@ -135,21 +135,21 @@
          $1_INCLUDE="-I${$1_DIR}/include"
       fi
       $1_INCLUDE="${$1_INCLUDE} $6"
-      m4_ifblank([$4], [
-         # no header, assume found
-         $1_HEADER_FOUND="1"
-      ], [
+      m4_ifval([$4], [
          # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
          AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      ], [
+         # no header, assume found
+         $1_HEADER_FOUND="1"
       ])
       if test "x${$1_HEADER_FOUND}" = "x0" ; then
          $1_LIB=""
          $1_INCLUDE=""
       else
-         m4_ifblank([$3], [
+         m4_ifval([$3], [], [
             # only checking headers -> no library
             $1_LIB=""
          ])
diff --git a/autoconf/ast_gcc_attribute.m4 b/autoconf/ast_gcc_attribute.m4
index 9d5a320..0286853 100644
--- a/autoconf/ast_gcc_attribute.m4
+++ b/autoconf/ast_gcc_attribute.m4
@@ -11,9 +11,9 @@
 
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM(
-		m4_ifblank([$2],
-			[$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
-			[$3 void __attribute__(($2)) *test(void *muffin, ...) ;]))],
+		m4_ifval([$2],
+			[$3 void __attribute__(($2)) *test(void *muffin, ...) ;],
+			[$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}]))],
 	AC_MSG_RESULT(yes)
 	m4_ifval([$4],$4=1)
 	ax_cv_have_func_attribute_$1=1

-- 
To view, visit https://gerrit.asterisk.org/7422
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I280785deb872ed8d3339d99cce63a2b54d5f1438
Gerrit-Change-Number: 7422
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171202/c660909d/attachment.html>


More information about the asterisk-code-review mailing list