]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issues with bundled pjproject cached download. 09/4109/2
authorCorey Farrell <git@cfware.com>
Fri, 14 Oct 2016 05:18:50 +0000 (01:18 -0400)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 14 Oct 2016 12:48:32 +0000 (07:48 -0500)
Previously when testing I had a preexisting makeopts in ASTTOPDIR.  The
ordering of configure.ac causes --with-externals-cache to be processed
after third-party configure.  In cases where the Asterisk clone is
cleaned it would cause pjproject to be downloaded to /tmp.  This
moves processing of the externals cache and sounds cache to happen
before third-party configure.

This also addresses a possible issue with the third-party Makefile.  If
TMPDIR is set by the environment it would override the path given to
--with-externals-cache.

ASTERISK-26416

Change-Id: Ifab7f35bfcd5a31a31a3a4353cc26a68c8c6592d

configure
configure.ac
third-party/pjproject/Makefile
third-party/pjproject/configure.m4

index 907faca130f5b194b63e854145af4d7e881778a7..c4d772e1b9e3ec3e83da42e82299de51f11af16e 100755 (executable)
--- a/configure
+++ b/configure
@@ -807,8 +807,6 @@ PBX_SPANDSP
 SPANDSP_DIR
 SPANDSP_INCLUDE
 SPANDSP_LIB
-EXTERNALS_CACHE_DIR
-SOUNDS_CACHE_DIR
 PBX_SDL_IMAGE
 SDL_IMAGE_DIR
 SDL_IMAGE_INCLUDE
@@ -1179,6 +1177,8 @@ AST_CLANG_BLOCKS
 AST_CLANG_BLOCKS_LIBS
 AST_NESTED_FUNCTIONS
 AST_CODE_COVERAGE
+EXTERNALS_CACHE_DIR
+SOUNDS_CACHE_DIR
 AST_DEVMODE_STRICT
 AST_DEVMODE
 NOISY_BUILD
@@ -1330,6 +1330,8 @@ ac_user_opts='
 enable_option_checking
 with_gnu_ld
 enable_dev_mode
+with_sounds_cache
+with_externals_cache
 enable_coverage
 with_pjproject_bundled
 with_asound
@@ -1390,8 +1392,6 @@ with_radius
 with_resample
 with_sdl
 with_SDL_image
-with_sounds_cache
-with_externals_cache
 with_spandsp
 with_ss7
 with_speex
@@ -2072,6 +2072,10 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sounds-cache=PATH
+                          use cached sound tarfiles in PATH
+  --with-externals-cache=PATH
+                          use cached external module tarfiles in PATH
   --with-pjproject-bundled
                           Use bundled pjproject libraries
   --with-asound=PATH      use Advanced Linux Sound Architecture files in PATH
@@ -2136,10 +2140,6 @@ Optional Packages:
   --with-resample=PATH    use LIBRESAMPLE files in PATH
   --with-sdl=PATH         use Sdl files in PATH
   --with-SDL_image=PATH   use Sdl Image files in PATH
-  --with-sounds-cache=PATH
-                          use cached sound tarfiles in PATH
-  --with-externals-cache=PATH
-                          use cached external module tarfiles in PATH
   --with-spandsp=PATH     use SPANDSP files in PATH
   --with-ss7=PATH         use ISDN SS7 files in PATH
   --with-speex=PATH       use Speex files in PATH
@@ -8942,6 +8942,55 @@ fi
 
 
 
+
+
+# Check whether --with-sounds-cache was given.
+if test "${with_sounds_cache+set}" = set; then :
+  withval=$with_sounds_cache;
+       case ${withval} in
+       n|no)
+               unset SOUNDS_CACHE_DIR
+               ;;
+       *)
+               if test "x${withval}" = "x"; then
+                       :
+               else
+                       SOUNDS_CACHE_DIR="${withval}"
+               fi
+               ;;
+       esac
+
+else
+  :
+fi
+
+
+
+
+
+# Check whether --with-externals-cache was given.
+if test "${with_externals_cache+set}" = set; then :
+  withval=$with_externals_cache;
+       case ${withval} in
+       n|no)
+               unset EXTERNALS_CACHE_DIR
+               ;;
+       *)
+               if test "x${withval}" = "x"; then
+                       :
+               else
+                       EXTERNALS_CACHE_DIR="${withval}"
+               fi
+               ;;
+       esac
+
+else
+  :
+fi
+
+
+
+
 AST_CODE_COVERAGE=no
 # Check whether --enable-coverage was given.
 if test "${enable_coverage+set}" = set; then :
 
 
 
-
-# Check whether --with-sounds-cache was given.
-if test "${with_sounds_cache+set}" = set; then :
-  withval=$with_sounds_cache;
-       case ${withval} in
-       n|no)
-               unset SOUNDS_CACHE_DIR
-               ;;
-       *)
-               if test "x${withval}" = "x"; then
-                       :
-               else
-                       SOUNDS_CACHE_DIR="${withval}"
-               fi
-               ;;
-       esac
-
-else
-  :
-fi
-
-
-
-
-
-# Check whether --with-externals-cache was given.
-if test "${with_externals_cache+set}" = set; then :
-  withval=$with_externals_cache;
-       case ${withval} in
-       n|no)
-               unset EXTERNALS_CACHE_DIR
-               ;;
-       *)
-               if test "x${withval}" = "x"; then
-                       :
-               else
-                       EXTERNALS_CACHE_DIR="${withval}"
-               fi
-               ;;
-       esac
-
-else
-  :
-fi
-
-
-
-
     SPANDSP_DESCRIP="SPANDSP"
     SPANDSP_OPTION="spandsp"
     PBX_SPANDSP=0
index b47bc596f25a6495105c50ef64c5ed66afb2f339..42320e4f2647029f417741445465b449dd53de76 100644 (file)
@@ -402,6 +402,9 @@ AC_SUBST(NOISY_BUILD)
 AC_SUBST(AST_DEVMODE)
 AC_SUBST(AST_DEVMODE_STRICT)
 
+AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
+AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
+
 AST_CODE_COVERAGE=no
 AC_ARG_ENABLE([coverage],
        [AS_HELP_STRING([--enable-coverage],
@@ -541,8 +544,6 @@ AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
 AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
 AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
 AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
-AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
-AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
 AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
index 3fd3be735565b3394abeab7d33d8c308fa09c875..65875224f94a6fe0b1478b286fe3715d2d0ec0e4 100644 (file)
@@ -74,13 +74,13 @@ ECHO_PREFIX := $(ECHO_PREFIX) echo '[pjproject] '
 
 _all: $(TARGETS)
 
-TMPDIR ?= $(or $(EXTERNALS_CACHE_DIR),$(wildcard /tmp),.)
+EXTERNALS_CACHE_DIR ?= $(or $(TMPDIR),$(wildcard /tmp),.)
 
-$(TMPDIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2 : ../versions.mak
+$(EXTERNALS_CACHE_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2 : ../versions.mak
        $(ECHO_PREFIX) Downloading $(PJPROJECT_URL)/$(@F) to $@
        $(CMD_PREFIX) $(DOWNLOAD_TO_STDOUT) $(PJPROJECT_URL)/$(@F) > $@
 
-source/.unpacked: $(TMPDIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
+source/.unpacked: $(EXTERNALS_CACHE_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
        $(ECHO_PREFIX) Unpacking $<
        -@rm -rf source >/dev/null 2>&1
        -@mkdir source >/dev/null 2>&1
index 386035bace9a21ae8c9cd47c01bc5744669c6b5a..7b62c0f16f5925eb92fc088cd6f48deefe52db5a 100644 (file)
@@ -9,7 +9,7 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
 
        AC_MSG_CHECKING(for embedded pjproject (may have to download))
        AC_MSG_RESULT(configuring)
-       
+
        if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
                AC_MSG_ERROR(A download utility (wget, curl or fetch) is required to download bundled pjproject)
        fi
@@ -28,7 +28,7 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
        if test "${NM}" = ":" ; then
                AC_MSG_ERROR(nm is required to build bundled pjproject)
        fi
-       
+
        export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT
        ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} configure
        if test $? -ne 0 ; then
@@ -42,7 +42,7 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
        PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} echo_cflags)
        PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
        PBX_PJPROJECT=1
-       
+
        AC_DEFINE([HAVE_PJPROJECT], 1, [Define if your system has PJPROJECT])
        AC_DEFINE([HAVE_PJPROJECT_BUNDLED], 1, [Define if your system has PJPROJECT_BUNDLED])
 
@@ -70,4 +70,3 @@ AC_DEFUN([PJPROJECT_CONFIGURE],
                _PJPROJECT_CONFIGURE()
        fi
 ])
-       
\ No newline at end of file