]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5819: configure fix for new clang detection and adjust cflags for building with...
authorMichael Jerris <mike@jerris.com>
Tue, 15 Oct 2013 16:16:36 +0000 (09:16 -0700)
committerMichael Jerris <mike@jerris.com>
Tue, 15 Oct 2013 16:16:36 +0000 (09:16 -0700)
build/config/ax_compiler_vendor.m4
configure.in

index a24a58da0f75d08f3650921f1ea8a098914809fa..b506b78aae98754799db1d187a1bd231dbf58661 100644 (file)
@@ -3,7 +3,7 @@ AC_DEFUN([AX_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__ 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)
index c24897e5e4b53e9012f78025fca52c3a71d6b8e2..ecca14cf111eed7a50532732e8a2171b870102e2 100644 (file)
@@ -172,11 +172,19 @@ SWITCH_AM_LDFLAGS="-lm"
 #set SOLINK variable based on compiler and host
 if test "x${ax_cv_c_compiler_vendor}"  =  "xsun" ; then
     SOLINK="-Bdynamic -dy -G"
-elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
+elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
     case "$host" in
-        *darwin12.*|*darwin11.*|*darwin10.*)
+        *darwin*)
             SOLINK="-dynamic -force-flat-namespace"
         ;;
+        *)
+            AC_ERROR([Please update configure.in with SOLINK values for your compiler])
+        ;;
+
+    esac
+elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
+    case "$host" in
+# older Xcode test for darwin, Xcode 4/5 use clang above
         *darwin*)
             SOLINK="-dynamic -bundle -force-flat-namespace"
         ;;
@@ -190,7 +198,6 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
 else
     AC_ERROR([Please update configure.in with SOLINK values for your compiler])
 fi
-
 # set DYNAMIC_LIB_EXTEN
 # we should really be using libtool so we don't need to do this
 case "$host" in
@@ -727,6 +734,16 @@ if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
 fi
 CFLAGS="$saved_CFLAGS"
 
+# Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
+AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
+AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
+])
+AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
+if test x"$ac_cv_clang_extended_offsetof" = xyes; then
+    APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
+fi
+
+
 # Tested and fixed lot of modules, but some are untested.  Will be added back when the core team decide it ready
 # Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp 
 #                    mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed