Fix build with LLVM 3.5
Reviewed-by: Aaron Watry <[email protected]>
llvm-svn: 198167
diff --git a/libclc/configure.py b/libclc/configure.py
index 1c6929f..2038b11 100755
--- a/libclc/configure.py
+++ b/libclc/configure.py
@@ -10,6 +10,7 @@
from optparse import OptionParser
import os
+import string
from subprocess import *
import sys
@@ -62,8 +63,13 @@
print "Please ensure that llvm-config is in your $PATH, or use --with-llvm-config."
sys.exit(1)
+llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')
+llvm_system_libs = ''
+if (int(llvm_version[0]) == 3 and int(llvm_version[1]) >= 5) or int(llvm_version[0]) > 3:
+ llvm_system_libs = llvm_config(['--system-libs'])
llvm_bindir = llvm_config(['--bindir'])
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \
+ llvm_system_libs + ' ' + \
llvm_config(['--ldflags'])
llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'