[Asterisk-code-review] build : Fix cross-compilation errors (asterisk[16])

Joshua C. Colp asteriskteam at digium.com
Thu Jan 24 08:23:06 CST 2019


Joshua C. Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/10917 )

Change subject: build : Fix cross-compilation errors
......................................................................

build : Fix cross-compilation errors

Bundled pjproject and jansson must be configured with the host and build
parameters provided to the configure script.
Autotools do not permit to check for the existence of local header files, so
the control of hrirs.h must not be done when cross-compiling.

ASTERISK-28250

Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880
---
M configure
M configure.ac
M third-party/jansson/configure.m4
M third-party/pjproject/configure.m4
4 files changed, 16 insertions(+), 10 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua C. Colp: Looks good to me, approved; Approved for Submit



diff --git a/configure b/configure
index a69ba62..d8e1cbf 100755
--- a/configure
+++ b/configure
@@ -9270,10 +9270,10 @@
 
 	this_host=$(./config.sub $(./config.guess))
 	if test "$build" != "$this_host" ; then
-		JANSSON_CONFIGURE_OPTS+=" --build=$build"
+		JANSSON_CONFIGURE_OPTS+=" --build=$build_alias"
 	fi
 	if test "$host" != "$this_host" ; then
-		JANSSON_CONFIGURE_OPTS+=" --host=$host"
+		JANSSON_CONFIGURE_OPTS+=" --host=$host_alias"
 	fi
 
 	export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
@@ -9391,10 +9391,10 @@
 
 	this_host=$(./config.sub $(./config.guess))
 	if test "$build" != "$this_host" ; then
-		PJPROJECT_CONFIGURE_OPTS+=" --build=$build"
+		PJPROJECT_CONFIGURE_OPTS+=" --build=$build_alias"
 	fi
 	if test "$host" != "$this_host" ; then
-		PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
+		PJPROJECT_CONFIGURE_OPTS+=" --host=$host_alias"
 	fi
 	# This was a copy of the autoconf generated code from the root ./configure.
 	# Hopefully, when you read this, the code is still the same.
@@ -34577,7 +34577,9 @@
 fi
 
 # conf_bridge (binaural rendering): check if HRIRs are available
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bridges/bridge_softmix/include/hrirs.h" >&5
+# this check does not work when cross-compiling
+if test "${cross_compiling}" = "no"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bridges/bridge_softmix/include/hrirs.h" >&5
 $as_echo_n "checking for bridges/bridge_softmix/include/hrirs.h... " >&6; }
 if ${ac_cv_file_bridges_bridge_softmix_include_hrirs_h+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -34600,6 +34602,7 @@
 
 fi
 
+fi
 
 ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts"
 
diff --git a/configure.ac b/configure.ac
index 9a016f4..7acfcbc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2811,7 +2811,10 @@
 fi
 
 # conf_bridge (binaural rendering): check if HRIRs are available
-AC_CHECK_FILES([bridges/bridge_softmix/include/hrirs.h])
+# this check does not work when cross-compiling
+if test "${cross_compiling}" = "no"; then
+    AC_CHECK_FILES([bridges/bridge_softmix/include/hrirs.h])
+fi
 
 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
 AST_CHECK_MANDATORY
diff --git a/third-party/jansson/configure.m4 b/third-party/jansson/configure.m4
index 9b10cad..4570de1 100644
--- a/third-party/jansson/configure.m4
+++ b/third-party/jansson/configure.m4
@@ -49,10 +49,10 @@
 	AC_ARG_VAR([JANSSON_CONFIGURE_OPTS],[Additional configure options to pass to bundled jansson])
 	this_host=$(./config.sub $(./config.guess))
 	if test "$build" != "$this_host" ; then
-		JANSSON_CONFIGURE_OPTS+=" --build=$build"
+		JANSSON_CONFIGURE_OPTS+=" --build=$build_alias"
 	fi
 	if test "$host" != "$this_host" ; then
-		JANSSON_CONFIGURE_OPTS+=" --host=$host"
+		JANSSON_CONFIGURE_OPTS+=" --host=$host_alias"
 	fi
 
 	export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4
index 8541710..9175a11 100644
--- a/third-party/pjproject/configure.m4
+++ b/third-party/pjproject/configure.m4
@@ -49,10 +49,10 @@
 	AC_ARG_VAR([PJPROJECT_CONFIGURE_OPTS],[Additional configure options to pass to bundled pjproject])
 	this_host=$(./config.sub $(./config.guess))
 	if test "$build" != "$this_host" ; then
-		PJPROJECT_CONFIGURE_OPTS+=" --build=$build"
+		PJPROJECT_CONFIGURE_OPTS+=" --build=$build_alias"
 	fi
 	if test "$host" != "$this_host" ; then
-		PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
+		PJPROJECT_CONFIGURE_OPTS+=" --host=$host_alias"
 	fi
 	# This was a copy of the autoconf generated code from the root ./configure.
 	# Hopefully, when you read this, the code is still the same.

-- 
To view, visit https://gerrit.asterisk.org/10917
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880
Gerrit-Change-Number: 10917
Gerrit-PatchSet: 1
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190124/4fd91ad3/attachment.html>


More information about the asterisk-code-review mailing list