Mising library LLVMObjCARCOpts
[scilab.git] / scilab / m4 / vmkit.m4
1 AC_DEFUN([AC_VMKIT], [
2
3 ######
4 #### VMKIT disabled by default
5 ######
6
7 AC_ARG_WITH(vmkit,
8     AC_HELP_STRING([--with-vmkit],[Uses VMKIT infrastructure]))
9
10 AC_ARG_WITH(vmkit-package,
11     AC_HELP_STRING([--with-vmkit-package],[Uses VMKIT infrastructure with the packages]))
12
13 AC_ARG_WITH(llvm-src,
14     AC_HELP_STRING([--with-llvm-src],[Directory containing the source code of LLVM. Needed with --with-vmkit]))
15
16 AC_ARG_WITH(llvm-bin,
17     AC_HELP_STRING([--with-llvm-bin],[Directory containing the binaries of LLVM. Default is llvm-src/Release+Asserts]))
18
19 AC_ARG_WITH(vmkit-src,
20     AC_HELP_STRING([--with-vmkit-src],[Directory containing the source code of VMKIT. Needed with --with-vmkit]))
21
22 AC_ARG_WITH(vmkit-bin,
23     AC_HELP_STRING([--with-vmkit-bin],[Directory containing the binaries of VMKIT. Default is vmkit-src/Release+Asserts]))
24
25 AM_CONDITIONAL(WITH_VMKIT, test -n "$with_vmkit" -o -n "$with_vmkit_package")
26
27 if test -n "$with_vmkit_package"; then
28    # Hardcode path for Debian and Ubuntu
29    # This will be improved by an automatic detection
30    LLVM_INCLUDE_DIR="/usr/include/llvm-3.3/"
31    LLVM_LIB_DIR="/usr/lib/llvm-3.3/lib/"
32    VMKIT_INCLUDE_DIR="/usr/include/vmkit/"
33    VMKIT_BIN_DIR="/usr/bin/"
34    VMKIT_CPPFLAGS="-I$LLVM_INCLUDE_DIR/ -I$VMKIT_INCLUDE_DIR/ -I$VMKIT_INCLUDE_DIR/MMTk/ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fPIC -Woverloaded-virtual -Wcast-qual"
35    VMKIT_LDFLAGS="-L$LLVM_LIB_DIR/ -lLLVMBitReader -lLLVMipo -lLLVMVectorize -lLLVMInstrumentation -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMObjCARCOpts"
36    VMKIT_LDADD="$VMKIT_BIN_DIR/../lib/libFinalMMTk.a $VMKIT_BIN_DIR/../lib/libJ3.a $VMKIT_BIN_DIR/../lib/libClasspath.a $VMKIT_BIN_DIR/../lib/libVmkit.a $VMKIT_BIN_DIR/../lib/libVmkitCompiler.a $VMKIT_BIN_DIR/../lib/libCommonThread.a"
37    AC_DEFINE([VMKIT_ENABLED],[],[VMKIT Enabled])
38
39 else
40
41 if test -n "$with_vmkit";then
42         if (test "$with_llvm_src" == "" || test "x$with_llvm_src" == "xyes");then
43                 AC_MSG_ERROR([Due the use of --with-vmkit, the use of --with-llvm-src=<dir> is needed])
44         fi
45
46         if (test "$with_vmkit_src" == ""|| test "x$with_vmkit_src" == "xyes");then
47                 AC_MSG_ERROR([Due the use of --with-vmkit, the use of --with-vmkit-src=<dir> is needed])a
48         fi
49
50         LLVM_INCLUDE_DIR="$with_llvm_src"
51         VMKIT_INCLUDE_DIR="$with_vmkit_src"
52         AC_SUBST([LLVM_INCLUDE_DIR])
53         AC_SUBST([VMKIT_INCLUDE_DIR])
54         AC_DEFINE([VMKIT_ENABLED],[],[VMKIT Enabled])
55 fi
56
57 if test -n "$with_llvm_bin";then
58         if (test "$with_llvm_bin" == "" || test "x$with_llvm_bin" == "xyes");then
59                 AC_MSG_ERROR([Use --with-llvm-bin=<dir>])
60         else
61                 LLVM_LIB_DIR="$with_llvm_bin"
62         fi
63 else
64         LLVM_LIB_DIR="$with_llvm_src/Release+Asserts"
65 fi
66 AC_SUBST([LLVM_LIB_DIR])
67
68 if test -n "$with_vmkit_bin";then
69         if (test "$with_vmkit_bin" == "" || test "x$with_vmkit_bin" == "xyes");then
70                 AC_MSG_ERROR([Use --with-vmkit-bin=<dir>])
71         else
72                 VMKIT_BIN_DIR="$with_vmkit_bin"
73         fi
74 else
75         VMKIT_BIN_DIR="$with_vmkit_src/Release+Asserts"
76 fi
77 AC_SUBST([VMKIT_BIN_DIR])
78
79
80 VMKIT_CPPFLAGS="-I$LLVM_INCLUDE_DIR/include -I$LLVM_INCLUDE_DIR/ -I$VMKIT_INCLUDE_DIR/ -I$VMKIT_INCLUDE_DIR/MMTk/ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fPIC -Woverloaded-virtual -Wcast-qual"
81 AC_SUBST([VMKIT_CPPFLAGS])
82
83 VMKIT_LDFLAGS="-L$LLVM_LIB_DIR/lib -lLLVMBitReader -lLLVMipo -lLLVMVectorize -lLLVMInstrumentation -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport"
84 AC_SUBST([VMKIT_LDFLAGS])
85
86
87 VMKIT_LDADD="$VMKIT_BIN_DIR/../lib/libFinalMMTk.a $VMKIT_BIN_DIR/../lib/libJ3.a $VMKIT_BIN_DIR/../lib/libClasspath.a $VMKIT_BIN_DIR/../lib/libVmkit.a $VMKIT_BIN_DIR/../lib/libVmkitCompiler.a $VMKIT_BIN_DIR/../lib/libCommonThread.a"
88 AC_SUBST([VMKIT_LDADD])
89
90 fi
91
92 ])