<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7298">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Build: Fix OSX build issues.<br><br>OSX does not support 'readlink -f' or 'sed -r'. Replace readlink with<br>the GNU make macro 'realpath'. Replace sed with grep in one place, cut<br>in the other.<br><br>ASTERISK-27332<br><br>Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748<br>---<br>M build_tools/list_valid_installed_externals<br>M configure<br>M configure.ac<br>M makeopts.in<br>M third-party/Makefile.rules<br>M third-party/pjproject/Makefile<br>M third-party/pjproject/apply_patches<br>M third-party/pjproject/configure.m4<br>8 files changed, 68 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/98/7298/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/build_tools/list_valid_installed_externals b/build_tools/list_valid_installed_externals<br>index ed36274..c371022 100755<br>--- a/build_tools/list_valid_installed_externals<br>+++ b/build_tools/list_valid_installed_externals<br>@@ -6,7 +6,7 @@<br> set -e<br> <br> ASTTOPDIR=${ASTTOPDIR:-.}<br>-export make=`sed -n -r -e "s/^MAKE\s*=\s*//gp" ${ASTTOPDIR}/makeopts`<br>+export make=`sed -n -e "s/^MAKE\s*=\s*//gp" ${ASTTOPDIR}/makeopts`<br> <br> getvar() {<br> $make --quiet --no-print-directory -f- <<EOF<br>diff --git a/configure b/configure<br>index 70553fc..c3d3f1e 100755<br>--- a/configure<br>+++ b/configure<br>@@ -1277,6 +1277,7 @@<br> FIND<br> PYTHON<br> FLEX<br>+CUT<br> CAT<br> CMP<br> BISON<br>@@ -6865,6 +6866,47 @@<br> fi<br> <br> <br>+# Extract the first word of "cut", so it can be a program name with args.<br>+set dummy cut; ac_word=$2<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5<br>+$as_echo_n "checking for $ac_word... " >&6; }<br>+if ${ac_cv_path_CUT+:} false; then :<br>+ $as_echo_n "(cached) " >&6<br>+else<br>+ case $CUT in<br>+ [\\/]* | ?:[\\/]*)<br>+ ac_cv_path_CUT="$CUT" # Let the user override the test with a path.<br>+ ;;<br>+ *)<br>+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR<br>+for as_dir in $PATH<br>+do<br>+ IFS=$as_save_IFS<br>+ test -z "$as_dir" && as_dir=.<br>+ for ac_exec_ext in '' $ac_executable_extensions; do<br>+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then<br>+ ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext"<br>+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5<br>+ break 2<br>+ fi<br>+done<br>+ done<br>+IFS=$as_save_IFS<br>+<br>+ test -z "$ac_cv_path_CUT" && ac_cv_path_CUT=":"<br>+ ;;<br>+esac<br>+fi<br>+CUT=$ac_cv_path_CUT<br>+if test -n "$CUT"; then<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5<br>+$as_echo "$CUT" >&6; }<br>+else<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+fi<br>+<br>+<br> # Extract the first word of "flex", so it can be a program name with args.<br> set dummy flex; ac_word=$2<br> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5<br>@@ -9343,6 +9385,12 @@<br> if test "${CAT}" = ":" ; then<br> as_fn_error $? "cat is required to build bundled pjproject" "$LINENO" 5<br> fi<br>+ if test "${CUT}" = ":" ; then<br>+ as_fn_error $? "cut is required to build bundled pjproject" "$LINENO" 5<br>+ fi<br>+ if test "${GREP}" = ":" ; then<br>+ as_fn_error $? "grep is required to build bundled pjproject" "$LINENO" 5<br>+ fi<br> <br> <br> this_host=$(./config.sub $(./config.guess))<br>@@ -9353,7 +9401,7 @@<br> PJPROJECT_CONFIGURE_OPTS+=" --host=$host"<br> fi<br> <br>- export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT<br>+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP<br> export NOISY_BUILD<br> ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \<br> PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \<br>diff --git a/configure.ac b/configure.ac<br>index f5c160c..146e634 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -264,6 +264,7 @@<br> AC_PATH_PROG([BISON], [bison], :)<br> AC_PATH_PROG([CMP], [cmp], :)<br> AC_PATH_PROG([CAT], [cat], :)<br>+AC_PATH_PROG([CUT], [cut], :)<br> AC_PATH_PROG([FLEX], [flex], :)<br> AC_PATH_PROG([GREP], [grep], :)<br> AC_PATH_PROG([PYTHON], [python], :)<br>diff --git a/makeopts.in b/makeopts.in<br>index e25b614..2792164 100644<br>--- a/makeopts.in<br>+++ b/makeopts.in<br>@@ -49,6 +49,7 @@<br> SED=@SED@<br> NM=@NM@<br> CAT=@CAT@<br>+CUT=@CUT@<br> <br> BUILD_PLATFORM=@BUILD_PLATFORM@<br> BUILD_CPU=@BUILD_CPU@<br>diff --git a/third-party/Makefile.rules b/third-party/Makefile.rules<br>index f8b72ba..8306869 100644<br>--- a/third-party/Makefile.rules<br>+++ b/third-party/Makefile.rules<br>@@ -28,6 +28,8 @@<br> export NM<br> export MD5<br> export CAT<br>+export CUT<br>+export GREP<br> export DOWNLOAD<br> export DOWNLOAD_TO_STDOUT<br> export DOWNLOAD_TIMEOUT<br>diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile<br>index 7a42edc..6ebd685 100644<br>--- a/third-party/pjproject/Makefile<br>+++ b/third-party/pjproject/Makefile<br>@@ -93,9 +93,9 @@<br> <br> define verify_tarball<br> ($(SHELL_ECHO_PREFIX) Verifying $(TARBALL) &&\<br>- tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(SED) -n -r -e "s/^([^ ]+)\s+.*/\1/gp") ;\<br>- required_sum=$$($(SED) -n -r -e "s/^([^ ]+)\s+$(TARBALL_FILE)/\1/gp" $(PJMD5SUM)) ;\<br>- if [ "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\<br>+ tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(CUT) -d' ' -f1) ;\<br>+ required_sum=$$($(GREP) -e $(TARBALL_FILE) $(PJMD5SUM) | $(CUT) -d' ' -f1) ;\<br>+ if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\<br> else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )<br> endef<br> <br>@@ -127,8 +127,8 @@<br> -@rm -rf source pjproject-* >/dev/null 2>&1<br> $(CMD_PREFIX) $(TAR) -xjf $<<br> @mv pjproject-$(PJPROJECT_VERSION) source<br>- $(ECHO_PREFIX) Applying patches<br>- $(CMD_PREFIX) ./apply_patches $(QUIET_CONFIGURE) patches source<br>+ $(ECHO_PREFIX) Applying patches "$(realpath patches)" "$(realpath .)/source"<br>+ $(CMD_PREFIX) ./apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"<br> -@touch source/.unpacked<br> <br> source/version.mak: source/.unpacked<br>@@ -150,7 +150,8 @@<br> $(CMD_PREFIX) (cd source ; ./aconfigure $(QUIET_CONFIGURE) $(PJPROJECT_CONFIG_OPTS))<br> <br> build.mak: source/build.mak<br>- $(CMD_PREFIX) $(SED) -r -e "/prefix|export PJ_SHARED_LIBRARIES|MACHINE_NAME|OS_NAME|HOST_NAME|CC_NAME|CROSS_COMPILE|LINUX_POLL/d" source/build.mak > build.mak<br>+ $(CMD_PREFIX) $(GREP) -v -e prefix -e "export PJ_SHARED_LIBRARIES" -e MACHINE_NAME \<br>+ -e OS_NAME -e HOST_NAME -e CC_NAME -e CROSS_COMPILE -e LINUX_POLL $< > $@<br> <br> configure: source/build.mak<br> <br>diff --git a/third-party/pjproject/apply_patches b/third-party/pjproject/apply_patches<br>index 5f9fde2..134bd30 100755<br>--- a/third-party/pjproject/apply_patches<br>+++ b/third-party/pjproject/apply_patches<br>@@ -10,9 +10,6 @@<br> patchdir=${1:?You must supply a patches directory}<br> sourcedir=${2?:You must supply a source directory}<br> <br>-patchdir=`readlink -f $patchdir`<br>-sourcedir=`readlink -f $sourcedir`<br>-<br> if [ ! -d "$patchdir" ] ; then<br> echo "$patchdir is not a directory" >&2<br> exit 1<br>diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4<br>index 2d33534..7388704 100644<br>--- a/third-party/pjproject/configure.m4<br>+++ b/third-party/pjproject/configure.m4<br>@@ -39,6 +39,12 @@<br> if test "${CAT}" = ":" ; then<br> AC_MSG_ERROR(cat is required to build bundled pjproject)<br> fi<br>+ if test "${CUT}" = ":" ; then<br>+ AC_MSG_ERROR(cut is required to build bundled pjproject)<br>+ fi<br>+ if test "${GREP}" = ":" ; then<br>+ AC_MSG_ERROR(grep is required to build bundled pjproject)<br>+ fi<br> <br> AC_ARG_VAR([PJPROJECT_CONFIGURE_OPTS],[Additional configure options to pass to bundled pjproject])<br> this_host=$(./config.sub $(./config.guess))<br>@@ -49,7 +55,7 @@<br> PJPROJECT_CONFIGURE_OPTS+=" --host=$host"<br> fi<br> <br>- export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT<br>+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP<br> export NOISY_BUILD<br> ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \<br> PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7298">change 7298</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/7298"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748 </div>
<div style="display:none"> Gerrit-Change-Number: 7298 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>