From 03155a287616668081a42afa06015ec7eabbc8b4 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Mon, 18 Jul 2016 00:02:30 -0400 Subject: [PATCH] RAII_VAR: Fix configure for clang on Fedora 23. Add a new check for libBlocksRuntime.a to be linked using -Wl,-lBlocksRuntime. ASTERISK-26205 #close Change-Id: I0f3ba75b55fe1663905a8c8035aa942314ae314b --- autoconf/ast_check_raii.m4 | 4 ++++ configure | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/autoconf/ast_check_raii.m4 b/autoconf/ast_check_raii.m4 index e39a43d..44ea0b4 100644 --- a/autoconf/ast_check_raii.m4 +++ b/autoconf/ast_check_raii.m4 @@ -41,6 +41,10 @@ AC_DEFUN([AST_CHECK_RAII], [ AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime" AST_CLANG_BLOCKS="-fblocks" AC_MSG_RESULT(yes) + elif test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c - -Wl,-lBlocksRuntime 2>&1`" = ""; then + AST_CLANG_BLOCKS_LIBS="-Wl,-lBlocksRuntime" + AST_CLANG_BLOCKS="-fblocks" + AC_MSG_RESULT(yes) else AC_MSG_ERROR([BlocksRuntime is required for clang, please install libblocksruntime]) fi diff --git a/configure b/configure index 1d37b7d..ef38fae 100755 --- a/configure +++ b/configure @@ -8733,6 +8733,11 @@ $as_echo "yes" >&6; } AST_CLANG_BLOCKS="-fblocks" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + elif test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c - -Wl,-lBlocksRuntime 2>&1`" = ""; then + AST_CLANG_BLOCKS_LIBS="-Wl,-lBlocksRuntime" + AST_CLANG_BLOCKS="-fblocks" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else as_fn_error $? "BlocksRuntime is required for clang, please install libblocksruntime" "$LINENO" 5 fi @@ -13987,7 +13992,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -14033,7 +14038,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -14057,7 +14062,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -14102,7 +14107,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -14126,7 +14131,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -- 2.5.5