17
17
AC_INIT([libclamavc++],[devel],[http://bugs.clamav.net])
18
18
AC_CONFIG_AUX_DIR([config])
19
AC_CONFIG_SRCDIR([llvm/configure])
20
19
AC_CONFIG_MACRO_DIR([m4])
21
20
AC_CONFIG_HEADER([clamavcxx-config.h])
22
21
AC_CANONICAL_TARGET
81
AC_ARG_WITH([llvm-linking], [AC_HELP_STRING([--with-llvm-linking],
82
[specifies method to linking llvm @<:@static|dynamic@:>@, only valid with --with-system-llvm])],
84
if test "x$llvmconfig" = "x"; then
85
AC_MSG_ERROR([Failed to configure LLVM, and LLVM linking was specified without valid llvm-config])
92
llvm_linking="dynamic"
95
AC_MSG_ERROR([Invalid argument to --with-llvm-linking])
81
100
AC_MSG_CHECKING([for supported LLVM version])
82
101
if test "x$llvmconfig" = "x"; then
83
102
dnl macro not available in older autotools
113
132
dnl aquire the required flags to properly link in external LLVM
114
133
if test "x$llvmconfig" != "x"; then
115
134
AC_SUBST(LLVMCONFIG_CXXFLAGS, [`$llvmconfig --cxxflags`])
116
if test $llvmver_test -ge 350; then
117
dnl LLVM 3.5.0 and after splits linker flags into two sets
118
ldflags=`$llvmconfig --ldflags`
119
syslibs=`$llvmconfig --system-libs`
120
AC_SUBST(LLVMCONFIG_LDFLAGS, ["$ldflags $syslibs"])
136
if test "x$llvm_linking" = "xdynamic"; then
137
AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
138
AC_SUBST(LLVMCONFIG_LIBS, [-lLLVM-$llvmver])
139
AC_SUBST(LLVMCONFIG_LIBFILES, [])
122
AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
141
if test $llvmver_test -ge 350; then
142
dnl LLVM 3.5.0 and after splits linker flags into two sets
143
ldflags=`$llvmconfig --ldflags`
144
syslibs=`$llvmconfig --system-libs`
145
AC_SUBST(LLVMCONFIG_LDFLAGS, ["$ldflags $syslibs"])
147
AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
149
AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs jit nativecodegen scalaropts ipo`])
150
AC_SUBST(LLVMCONFIG_LIBFILES, [`$llvmconfig --libfiles jit nativecodegen scalaropts ipo`])
124
153
AC_SUBST(LLVMCONFIG_LIBS, [-lLLVM-$llvmver])
125
154
AC_SUBST(LLVMCONFIG_LIBFILES, [])
126
156
AC_MSG_NOTICE([CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS])
127
157
AC_MSG_NOTICE([LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS])
128
158
AC_MSG_NOTICE([LIBS from llvm-config: $LLVMCONFIG_LIBS])