diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-30 01:37:55 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-30 01:37:55 +0000 |
commit | a4afeef1863d2dd5e9deb7fa4baeeecf229d5f7c (patch) | |
tree | 497fcf235e1328c2db843505ed3a133a5bff69e6 /autoconf | |
parent | fd6fbec86dec667372d37b096fd4f96010ff1659 (diff) |
[autoconf] Fix m4 quoting for newer autotools
This simply fixes up quoting of macro invocations to appease newer versions of autotools.
http://llvm-reviews.chandlerc.com/D332
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 93 | ||||
-rw-r--r-- | autoconf/m4/huge_val.m4 | 10 | ||||
-rw-r--r-- | autoconf/m4/single_cxx_check.m4 | 20 |
3 files changed, 74 insertions, 49 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index ce360109d2e..3d9b04bc64f 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1237,10 +1237,15 @@ fi dnl Verify that GCC is version 3.0 or higher if test "$GCC" = "yes" then - AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3 -#error Unsupported GCC version -#endif -]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])]) + AC_COMPILE_IFELSE( +[ + AC_LANG_SOURCE([[ + #if !defined(__GNUC__) || __GNUC__ < 3 + #error Unsupported GCC version + #endif + ]]) +], +[], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])]) fi dnl Check for GNU Make. We use its extensions, so don't build without it @@ -1487,18 +1492,23 @@ AC_CHECK_HEADERS([CrashReporterClient.h]) dnl Try to find Darwin specific crash reporting global. AC_MSG_CHECKING([__crashreporter_info__]) AC_LINK_IFELSE( - AC_LANG_SOURCE( - [[extern const char *__crashreporter_info__; - int main() { - __crashreporter_info__ = "test"; - return 0; - } - ]]), - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CRASHREPORTER_INFO, 1, Can use __crashreporter_info__), - AC_MSG_RESULT(no) - AC_DEFINE(HAVE_CRASHREPORTER_INFO, 0, - Define if __crashreporter_info__ exists.)) +[ + AC_LANG_SOURCE([[ + extern const char *__crashreporter_info__; + int main() { + __crashreporter_info__ = "test"; + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_CRASHREPORTER_INFO], [1], [Can use __crashreporter_info__]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_CRASHREPORTER_INFO], [0], [Define if __crashreporter_info__ exists.]) +]) dnl===-----------------------------------------------------------------------=== dnl=== @@ -1561,10 +1571,15 @@ fi dnl Check Win32 API EnumerateLoadedModules. if test "$llvm_cv_os_type" = "MingW" ; then AC_MSG_CHECKING([whether EnumerateLoadedModules() accepts new decl]) - AC_COMPILE_IFELSE([[#include <windows.h> -#include <imagehlp.h> -extern void foo(PENUMLOADED_MODULES_CALLBACK); -extern void foo(BOOL(CALLBACK*)(PCSTR,ULONG_PTR,ULONG,PVOID));]], + AC_COMPILE_IFELSE( +[ + AC_LANG_SOURCE([[ + #include <windows.h> + #include <imagehlp.h> + extern void foo(PENUMLOADED_MODULES_CALLBACK); + extern void foo(BOOL(CALLBACK*)(PCSTR,ULONG_PTR,ULONG,PVOID)); + ]]) +], [ AC_MSG_RESULT([yes]) llvm_cv_win32_elmcb_pcstr="PCSTR" @@ -1605,22 +1620,28 @@ dnl Since we'll be using these atomic builtins in C++ files we should test dnl the C++ compiler. AC_LANG_PUSH([C++]) AC_LINK_IFELSE( - AC_LANG_SOURCE( - [[int main() { - volatile unsigned long val = 1; - __sync_synchronize(); - __sync_val_compare_and_swap(&val, 1, 0); - __sync_add_and_fetch(&val, 1); - __sync_sub_and_fetch(&val, 1); - return 0; - } - ]]), - AC_LANG_POP([C++]) - AC_MSG_RESULT(yes) - AC_DEFINE(LLVM_HAS_ATOMICS, 1, Has gcc/MSVC atomic intrinsics), - AC_MSG_RESULT(no) - AC_DEFINE(LLVM_HAS_ATOMICS, 0, Has gcc/MSVC atomic intrinsics) - AC_MSG_WARN([LLVM will be built thread-unsafe because atomic builtins are missing])) +[ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([LLVM_HAS_ATOMICS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([LLVM_HAS_ATOMICS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([LLVM will be built thread-unsafe because atomic builtins are missing]) +]) +AC_LANG_POP([C++]) dnl===-----------------------------------------------------------------------=== dnl=== diff --git a/autoconf/m4/huge_val.m4 b/autoconf/m4/huge_val.m4 index 6c9a22eab00..d224d7cb64e 100644 --- a/autoconf/m4/huge_val.m4 +++ b/autoconf/m4/huge_val.m4 @@ -7,12 +7,10 @@ AC_DEFUN([AC_HUGE_VAL_CHECK],[ AC_LANG_PUSH([C++]) ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -pedantic" - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [#include <math.h>], - [double x = HUGE_VAL; return x != x; ]), - [ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no], - [ac_cv_huge_val_sanity=yes]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], + [[double x = HUGE_VAL; return x != x;]])], + [ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no], + [ac_cv_huge_val_sanity=yes]) CXXFLAGS=$ac_save_CXXFLAGS AC_LANG_POP([C++]) ]) diff --git a/autoconf/m4/single_cxx_check.m4 b/autoconf/m4/single_cxx_check.m4 index 21efa4bed35..cb473264182 100644 --- a/autoconf/m4/single_cxx_check.m4 +++ b/autoconf/m4/single_cxx_check.m4 @@ -1,10 +1,16 @@ +dnl dnl AC_SINGLE_CXX_CHECK(CACHEVAR, FUNCTION, HEADER, PROGRAM) -dnl $1, $2, $3, $4, -dnl +dnl $1, $2, $3, $4, + AC_DEFUN([AC_SINGLE_CXX_CHECK], - [AC_CACHE_CHECK([for $2 in $3], [$1], - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include $3],[$4]),[$1=yes],[$1=no]) - AC_LANG_POP([C++])]) - ]) +[ + AC_CACHE_CHECK([for $2 in $3], [$1], + [ + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]][$3], [$4])], + [$1][[=yes]], + [$1][[=no]]) + AC_LANG_POP([C++]) + ]) +]) |