Mercurial > hg > octave-nkf
changeset 14994:bbc825cb2ea0
Use -I instead of -isystem if -isystem is not avaiable
* configure.ac: Do check for -isystem before using it with llvm
* m4/acinclude.m4 (OCTAVE_CC_FLAG): Allow spaces in flag
author | Max Brister <max@2bass.com> |
---|---|
date | Fri, 20 Jul 2012 14:30:07 -0500 |
parents | 06f2e9bdade6 |
children | 0ef151f9fdc9 |
files | configure.ac m4/acinclude.m4 |
diffstat | 2 files changed, 23 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac +++ b/configure.ac @@ -737,30 +737,34 @@ LLVM_LDFLAGS= LLVM_LIBS= -dnl llvm-config is messed up -if test -n "$LLVM_CONFIG"; then +if test "x$ac_cv_env_LLVM_CONFIG_set" = "xset"; then + # We use -isystem if avaiable because we do not want to see warnings in llvm + LLVM_INCLUDE_FLAG=-I + OCTAVE_CC_FLAG(-isystem ., [ + LLVM_INCLUDE_FLAG=-isystem + AC_MSG_NOTICE([using -isystem for llvm headers])]) + LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`" LLVM_LIBS=`$LLVM_CONFIG --libs` dnl Use -isystem so we don't get warnings from llvm headers - LLVM_CPPFLAGS="-isystem `$LLVM_CONFIG --includedir`" + LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`" LLVM_CXXFLAGS= -fi + + save_CPPFLAGS="$CPPFLAGS" + save_CXXFLAGS="$CXXFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" -save_CPPFLAGS="$CPPFLAGS" -save_CXXFLAGS="$CXXFLAGS" -save_LIBS="$LIBS" -save_LDFLAGS="$LDFLAGS" -dnl -dnl We define some extra flags that llvm requires in order to include headers. -dnl Idealy we should get these from llvm-config, but llvm-config isn't very -dnl helpful. -dnl -CPPFLAGS="-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS $LLVM_CPPFLAGS $CPPFLAGS" -CXXFLAGS="$LLVM_CXXFLAGS $CXXFLAGS" -LIBS="$LLVM_LIBS $LIBS" -LDFLAGS="$LLVM_LDFLAGS $LDFLAGS" + dnl + dnl We define some extra flags that llvm requires in order to include headers. + dnl Idealy we should get these from llvm-config, but llvm-config isn't very + dnl helpful. + dnl + CPPFLAGS="-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS $LLVM_CPPFLAGS $CPPFLAGS" + CXXFLAGS="$LLVM_CXXFLAGS $CXXFLAGS" + LIBS="$LLVM_LIBS $LIBS" + LDFLAGS="$LLVM_LDFLAGS $LDFLAGS" -if test "x$ac_cv_env_LLVM_CONFIG_set" = "xset"; then AC_LANG_PUSH(C++) AC_CHECK_HEADER([llvm/LLVMContext.h], [ AC_MSG_CHECKING([for llvm::getGlobalContext in llvm/LLVMContext.h])
--- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -286,7 +286,7 @@ dnl dnl OCTAVE_CC_FLAG AC_DEFUN([OCTAVE_CC_FLAG], [ - ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` + ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'` AC_MSG_CHECKING([whether ${CC-cc} accepts $1]) AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [ AC_LANG_PUSH(C)