ldc: Update from 1.8 to 1.9
[termux-packages] / packages / ldc / llvm-config.in
1 #!/bin/sh
2 show_help () {
3 echo "usage: llvm-config <OPTION>... [<COMPONENT>...]
4
5 Get various configuration information needed to compile programs which use
6 LLVM. Typically called from 'configure' scripts. Examples:
7 llvm-config --cxxflags
8 llvm-config --ldflags
9 llvm-config --libs engine bcreader scalaropts
10
11 Options:
12 --version Print LLVM version.
13 --prefix Print the installation prefix.
14 --src-root Print the source root LLVM was built from.
15 --obj-root Print the object root used to build LLVM.
16 --bindir Directory containing LLVM executables.
17 --includedir Directory containing LLVM headers.
18 --libdir Directory containing LLVM libraries.
19 --cppflags C preprocessor flags for files that include LLVM headers.
20 --cflags C compiler flags for files that include LLVM headers.
21 --cxxflags C++ compiler flags for files that include LLVM headers.
22 --ldflags Print Linker flags.
23 --system-libs System Libraries needed to link against LLVM components.
24 --libs Libraries needed to link against LLVM components.
25 --libnames Bare library names for in-tree builds.
26 --libfiles Fully qualified library filenames for makefile depends.
27 --components List of all possible components.
28 --targets-built List of all targets currently built.
29 --host-target Target triple used to configure LLVM.
30 --build-mode Print build mode of LLVM tree (e.g. Debug or Release).
31 --assertion-mode Print assertion mode of LLVM tree (ON or OFF).
32 --build-system Print the build system used to build LLVM (always cmake).
33 --has-rtti Print whether or not LLVM was built with rtti (YES or NO).
34 --has-global-isel Print whether or not LLVM was built with global-isel support (YES or NO).
35 --shared-mode Print how the provided components can be collectively linked (\`shared\` or \`static\`).
36 --link-shared Link the components as shared libraries.
37 --link-static Link the component libraries statically.
38 Typical components:
39 all All LLVM libraries (default).
40 engine Either a native JIT or a bitcode interpreter."
41 }
42
43 arch=@TERMUX_ARCH@
44 version=@LLVM_VERSION@
45 prefix=@LLVM_BUILD_DIR@
46 has_rtti=NO
47 CPPFLAGS="-I@TERMUX_PKG_SRCDIR@/llvm/include -I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
48 CFLAGS="${CPPFLAGS} -Os -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers"
49 CFLAGS="${CFLAGS} -pedantic -Wno-long-long -Wdelete-non-virtual-dtor -Werror=date-time -ffunction-sections"
50 CFLAGS="${CFLAGS} -fdata-sections -DNDEBUG"
51 CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -Wcast-qual -Wnon-virtual-dtor -std=c++11 -fno-exceptions"
52 if [ "$has_rtti" != "YES" ]; then CXXFLAGS="$CXXFLAGS -fno-rtti"; fi
53 LDFLAGS="-L${prefix}/lib"
54 LIBFILE="${prefix}/lib/libLLVM-$version.so"
55 LLVM_LIBRARIES="-lLLVMTableGen -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMTestingSupport -lLLVMCoverage -lLLVMLineEditor -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMOrcJIT -lLLVMObjectYAML -lLLVMFuzzMutate -lLLVMInterpreter -lLLVMWindowsManifest -lLLVMMIRParser -lLLVMLibDriver -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMRuntimeDyld -lgtest_main -lgtest -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMDlltoolDriver -lLLVMOption -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
56
57 components="aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter binaryformat bitreader bitwriter codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel gtest gtest_main instcombine instrumentation interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcjit passes profiledata runtimedyld scalaropts selectiondag support symbolize tablegen target testingsupport transformutils vectorize windowsmanifest x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils"
58
59 handle_args () {
60 case "${1##--}" in
61 version) echo "$version";;
62 prefix) echo "$prefix";;
63 src-root) echo "@TERMUX_PKG_SRCDIR@";;
64 obj-root) echo "$prefix";;
65 bindir) echo "$prefix/bin";;
66 includedir) echo "@TERMUX_PKG_SRCDIR@/llvm/include";;
67 libdir) echo "$prefix/lib";;
68 cppflags) echo "$CPPFLAGS";;
69 cflags) echo "$CFLAGS";;
70 cxxflags) echo "$CXXFLAGS";;
71 ldflags) echo "$LDFLAGS";;
72 system-libs) echo "-lc -ldl -lncurses -lz -lm";;
73 libs) echo "$LLVM_LIBRARIES";;
74 libnames) echo "libLLVM-$version.so";;
75 libfiles) echo "$LIBFILE";;
76 components) echo "$components";;
77 targets-built) echo "@LLVM_TARGETS@";;
78 host-target) echo "@LLVM_DEFAULT_TARGET_TRIPLE@";;
79 build-mode) echo "Release";;
80 assertion-mode) echo "OFF";;
81 build-system) echo "cmake";;
82 has-rtti) echo "$has_rtti";;
83 has-global-isel) echo "OFF";;
84 shared-mode) echo "shared";;
85 cmakedir) echo "$prefix/lib/cmake/llvm";;
86 # don't know what these do
87 link-shared) ;;
88 link-static) ;;
89 *) show_help >&2;;
90 esac
91 }
92
93 for arg in $@; do handle_args $arg; done
94