From a92d93836473443d592c710ef53ac2bd8ee8d7d1 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 9 Mar 2015 16:51:35 +0000 Subject: [PATCH] FS-7355: don't do the checks for rpl_realloc and rpl_malloc unless it is gcc compiling as autoconf checks for these don't work quite right on clang --- libs/spandsp/configure.ac | 7 +++++-- libs/spandsp/m4/ax_compiler_vendor.m4 | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/spandsp/configure.ac b/libs/spandsp/configure.ac index ad5ecf148d..305c75a533 100644 --- a/libs/spandsp/configure.ac +++ b/libs/spandsp/configure.ac @@ -152,9 +152,12 @@ AC_ARG_ENABLE(builtin_tiff, AC_FUNC_ERROR_AT_LINE AC_FUNC_VPRINTF -AC_FUNC_MALLOC AC_FUNC_MEMCMP -AC_FUNC_REALLOC +if test "${ax_cv_c_compiler_vendor}" = "gnu" + then + AC_FUNC_REALLOC + AC_FUNC_MALLOC +fi AC_FUNC_SELECT_ARGTYPES AX_C99_FUNC_LRINT diff --git a/libs/spandsp/m4/ax_compiler_vendor.m4 b/libs/spandsp/m4/ax_compiler_vendor.m4 index bab4c2cbb3..a9fc1d4c49 100644 --- a/libs/spandsp/m4/ax_compiler_vendor.m4 +++ b/libs/spandsp/m4/ax_compiler_vendor.m4 @@ -49,10 +49,11 @@ # special exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_COMPILER_VENDOR], -[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, +[ +AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ #if !($vencpp)