Browse code

Allow LLVM 2.8rc in configure.

You can now build with both the internal (patched) LLVM 2.7,
or an external LLVM 2.8rc.
To build with external do this:
./configure --enable-llvm --with-system-llvm=/path/to/llvm-config

This will link against the external LLVM's .a files (they are PIC), so
LLVM will stay only a build time dependency.

Török Edvin authored on 2010/09/28 20:45:15
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Sep 28 16:25:03 EEST 2010 (edwin)
2
+-------------------------------------
3
+ * libclamav/c++: allow building with external LLVM 2.8rc2.
4
+
1 5
 Tue Sep 28 13:05:53 EEST 2010 (edwin)
2 6
 -------------------------------------
3 7
  * libclamav/bytecode.c: fix memory leak in runlsig (bb #2291)
... ...
@@ -14513,17 +14513,25 @@ if test "${with_system_llvm+set}" = set; then :
14513 14513
   *)
14514 14514
     llvmconfig="$withval"
14515 14515
     llvmver=`$llvmconfig --version`
14516
-    if test "$llvmver" != "2.8" -a "$llvmver" != "2.8svn"; then
14516
+    if test "$llvmver" != "2.8" -a "$llvmver" != "2.8svn" -a "$llvmver" != "2.8rc"; then
14517 14517
 	as_fn_error $? "LLVM 2.8 or 2.8svn required, but \"$llvmver\" found" "$LINENO" 5
14518 14518
     fi
14519 14519
     LLVMCONFIG_CXXFLAGS=`$llvmconfig --cxxflags`
14520 14520
 
14521 14521
     LLVMCONFIG_LDFLAGS=`$llvmconfig --ldflags`
14522 14522
 
14523
-    LLVMCONFIG_LIBS=`$llvmconfig --libs jit nativecodegen`
14523
+    LLVMCONFIG_LIBS=`$llvmconfig --libs jit nativecodegen scalaropts ipo`
14524 14524
 
14525
-    LLVMCONFIG_LIBFILES=`$llvmconfig --libfiles jit nativecodegen`
14525
+    LLVMCONFIG_LIBFILES=`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`
14526 14526
 
14527
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Using external LLVM" >&5
14528
+$as_echo "$as_me: Using external LLVM" >&6;}
14529
+    { $as_echo "$as_me:${as_lineno-$LINENO}: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&5
14530
+$as_echo "$as_me: CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS" >&6;}
14531
+    { $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&5
14532
+$as_echo "$as_me: LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS" >&6;}
14533
+    { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&5
14534
+$as_echo "$as_me: LIBS from llvm-config: $LLVMCONFIG_LIBS" >&6;}
14527 14535
     ;;
14528 14536
   esac
14529 14537
 
... ...
@@ -14578,9 +14586,7 @@ if test "$enable_alltargets" = "yes"; then
14578 14578
 else
14579 14579
     new_args="$ac_configure_args --enable-targets=host-only --enable-bindings=none --enable-libffi=no --without-llvmgcc --without-llvmgxx"
14580 14580
 fi
14581
-echo "$new_args"
14582 14581
 ac_configure_args=`echo $new_args | sed -e 's/-Werror //g'`
14583
-echo "$ac_configure_args"
14584 14582
 
14585 14583
 if test "$enable_llvm" = "auto"; then
14586 14584
                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported C++ compiler version" >&5
... ...
@@ -58,13 +58,17 @@ AC_ARG_WITH([system-llvm], AC_HELP_STRING([-with-system-llvm],
58 58
   *)
59 59
     llvmconfig="$withval"
60 60
     llvmver=`$llvmconfig --version`
61
-    if test "$llvmver" != "2.8" -a "$llvmver" != "2.8svn"; then
61
+    if test "$llvmver" != "2.8" -a "$llvmver" != "2.8svn" -a "$llvmver" != "2.8rc"; then
62 62
 	AC_MSG_ERROR([LLVM 2.8 or 2.8svn required, but "$llvmver" found])
63 63
     fi
64 64
     AC_SUBST(LLVMCONFIG_CXXFLAGS, [`$llvmconfig --cxxflags`])
65 65
     AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
66
-    AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs jit nativecodegen`])
67
-    AC_SUBST(LLVMCONFIG_LIBFILES, [`$llvmconfig --libfiles jit nativecodegen`])
66
+    AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs jit nativecodegen scalaropts ipo`])
67
+    AC_SUBST(LLVMCONFIG_LIBFILES, [`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`])
68
+    AC_MSG_NOTICE([Using external LLVM])
69
+    AC_MSG_NOTICE([CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS])
70
+    AC_MSG_NOTICE([LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS])
71
+    AC_MSG_NOTICE([LIBS from llvm-config: $LLVMCONFIG_LIBS])
68 72
     ;;
69 73
   esac
70 74
 ])
... ...
@@ -98,9 +102,7 @@ if test "$enable_alltargets" = "yes"; then
98 98
 else
99 99
     new_args="$ac_configure_args --enable-targets=host-only --enable-bindings=none --enable-libffi=no --without-llvmgcc --without-llvmgxx"
100 100
 fi
101
-echo "$new_args"
102 101
 ac_configure_args=`echo $new_args | sed -e 's/-Werror //g'`
103
-echo "$ac_configure_args"
104 102
 
105 103
 if test "$enable_llvm" = "auto"; then
106 104
     dnl Do some sanity checks, and don't automatically build on platforms