|
1 #!/bin/sh |
|
2 |
|
3 # Default srcdir to this directory |
|
4 srcdir= |
|
5 |
|
6 for option; do |
|
7 case "$option" in |
|
8 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
|
9 *) optarg= ;; |
|
10 esac |
|
11 |
|
12 case "$option" in |
|
13 --srcdir=*) srcdir="$optarg";; |
|
14 esac |
|
15 done |
|
16 |
|
17 if test -z "$CXX"; then |
|
18 CXX=`which clang++` |
|
19 fi |
|
20 |
|
21 echo -n "checking for llvm-config... " |
|
22 |
|
23 if test -z "$LLVMCONFIG"; then |
|
24 LLVMCONFIG=`which llvm-config` |
|
25 fi |
|
26 |
|
27 if test -z "$LLVMCONFIG"; then |
|
28 LLVMCONFIG=`dirname $CXX`/llvm-config |
|
29 fi |
|
30 |
|
31 if test ! -x "$LLVMCONFIG"; then |
|
32 echo "configure: error: Cannot find an llvm-config binary for building a clang plugin" 1>&2 |
|
33 exit 1 |
|
34 fi |
|
35 |
|
36 echo "$LLVMCONFIG" |
|
37 |
|
38 LLVMCXXFLAGS=`$LLVMCONFIG --cxxflags` |
|
39 LLVMLDFLAGS=`$LLVMCONFIG --ldflags` |
|
40 CXXFLAGS="$CXXFLAGS $LLVMCXXFLAGS -fno-rtti -fno-exceptions" |
|
41 LDFLAGS="$LDFLAGS $LLVMLDFLAGS" |
|
42 |
|
43 cat $srcdir/Makefile.in | sed \ |
|
44 -e "s%@CXX@%$CXX%" \ |
|
45 -e "s%@CXXFLAGS@%$CXXFLAGS%" \ |
|
46 -e "s%@LDFLAGS@%$LDFLAGS%" \ |
|
47 -e "s%@srcdir@%$srcdir%" \ |
|
48 > Makefile |