diff options
author | George Joseph <gjoseph@digium.com> | 2017-06-30 07:31:52 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-06-30 09:00:40 -0500 |
commit | f573e599c0aeeb8807a2f39f636e3920b4aba4cf (patch) | |
tree | a89145a3f3875216337d13f6a4b23604b664a032 /third-party | |
parent | 366971827ab2b76c701cb22609ed778cbf1828d2 (diff) |
pjproject_bundled: Allow passing configure options to bundled
There wasn't any good way to pass options like --host or --build
down to the pjproject configure which makes cross-compiling difficult.
* Added a new PJPROJECT_CONFIGURE_OPTS environment variable which
can be used to pass arbitrary options to pjproject configure.
* Automatically set the pjproject configure --host and --build
options to match those supplied for the asterisk configure.
ASTERISK-27097 #close
Reported-by: Kinsey Moore
Change-Id: I5fa776e110262851173002a26ffe1172e4c35b2e
Diffstat (limited to 'third-party')
-rw-r--r-- | third-party/configure.m4 | 5 | ||||
-rw-r--r-- | third-party/pjproject/Makefile.rules | 5 | ||||
-rw-r--r-- | third-party/pjproject/configure.m4 | 24 |
3 files changed, 29 insertions, 5 deletions
diff --git a/third-party/configure.m4 b/third-party/configure.m4 index 635446638..55b72daf9 100644 --- a/third-party/configure.m4 +++ b/third-party/configure.m4 @@ -1,4 +1,7 @@ - +# +# If this file is changed, be sure to run ASTTOPDIR/bootstrap.sh +# before committing. +# AC_DEFUN([THIRD_PARTY_CONFIGURE], [ diff --git a/third-party/pjproject/Makefile.rules b/third-party/pjproject/Makefile.rules index 3f99c8a8f..acd766218 100644 --- a/third-party/pjproject/Makefile.rules +++ b/third-party/pjproject/Makefile.rules @@ -1,8 +1,11 @@ PJPROJECT_URL ?= https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION) +# PJPROJECT_CONFIGURE_OPTS could come from the command line or could be +# set/modified by configure.m4 if the build or host tuples aren't the same +# as the current build environment (cross-compile). # Even though we're not installing pjproject, we're setting prefix to /opt/pjproject to be safe -PJPROJECT_CONFIG_OPTS = --prefix=/opt/pjproject \ +PJPROJECT_CONFIG_OPTS = $(PJPROJECT_CONFIGURE_OPTS) --prefix=/opt/pjproject \ --disable-speex-codec \ --disable-speex-aec \ --disable-speex-aec \ diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4 index a5e9fca60..709a706a1 100644 --- a/third-party/pjproject/configure.m4 +++ b/third-party/pjproject/configure.m4 @@ -1,3 +1,8 @@ +# +# If this file is changed, be sure to run ASTTOPDIR/bootstrap.sh +# before committing. +# + AC_DEFUN([_PJPROJECT_CONFIGURE], [ if test "${ac_mandatory_list#*PJPROJECT*}" != "$ac_mandatory_list" ; then @@ -35,17 +40,30 @@ AC_DEFUN([_PJPROJECT_CONFIGURE], AC_MSG_ERROR(cat is required to build bundled pjproject) fi + 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" + fi + if test "$host" != "$this_host" ; then + PJPROJECT_CONFIGURE_OPTS+=" --host=$host" + fi + export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT - ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} configure + export NOISY_BUILD + ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \ + PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \ + EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" \ + configure if test $? -ne 0 ; then AC_MSG_RESULT(failed) AC_MSG_NOTICE(Unable to configure ${PJPROJECT_DIR}) - AC_MSG_ERROR(Run "${GNU_MAKE} -C ${PJPROJECT_DIR} NOISY_BUILD=yes configure" to see error details.) + AC_MSG_ERROR(Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details.) fi AC_MSG_CHECKING(for bundled pjproject) - PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} echo_cflags) + PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" echo_cflags) PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE" PBX_PJPROJECT=1 |