build/clang-plugin/configure

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/clang-plugin/configure	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +# Default srcdir to this directory
     1.7 +srcdir=
     1.8 +
     1.9 +for option; do
    1.10 +  case "$option" in
    1.11 +  -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    1.12 +  *) optarg= ;;
    1.13 +  esac
    1.14 +
    1.15 +  case "$option" in
    1.16 +  --srcdir=*) srcdir="$optarg";;
    1.17 +  esac
    1.18 +done
    1.19 +
    1.20 +if test -z "$CXX"; then
    1.21 +  CXX=`which clang++`
    1.22 +fi
    1.23 +
    1.24 +echo -n "checking for llvm-config... "
    1.25 +
    1.26 +if test -z "$LLVMCONFIG"; then
    1.27 +  LLVMCONFIG=`which llvm-config`
    1.28 +fi
    1.29 +
    1.30 +if test -z "$LLVMCONFIG"; then
    1.31 +  LLVMCONFIG=`dirname $CXX`/llvm-config
    1.32 +fi
    1.33 +
    1.34 +if test ! -x "$LLVMCONFIG"; then
    1.35 +  echo "configure: error: Cannot find an llvm-config binary for building a clang plugin" 1>&2
    1.36 +  exit 1
    1.37 +fi
    1.38 +
    1.39 +echo "$LLVMCONFIG"
    1.40 +
    1.41 +LLVMCXXFLAGS=`$LLVMCONFIG --cxxflags`
    1.42 +LLVMLDFLAGS=`$LLVMCONFIG --ldflags`
    1.43 +CXXFLAGS="$CXXFLAGS $LLVMCXXFLAGS -fno-rtti -fno-exceptions"
    1.44 +LDFLAGS="$LDFLAGS $LLVMLDFLAGS"
    1.45 +
    1.46 +cat $srcdir/Makefile.in | sed \
    1.47 +  -e "s%@CXX@%$CXX%" \
    1.48 +  -e "s%@CXXFLAGS@%$CXXFLAGS%" \
    1.49 +  -e "s%@LDFLAGS@%$LDFLAGS%" \
    1.50 +  -e "s%@srcdir@%$srcdir%" \
    1.51 +  > Makefile

mercurial