2017-07-01 02:41:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
show_help () {
|
|
|
|
echo "usage: llvm-config <OPTION>... [<COMPONENT>...]
|
|
|
|
|
|
|
|
Get various configuration information needed to compile programs which use
|
|
|
|
LLVM. Typically called from 'configure' scripts. Examples:
|
|
|
|
llvm-config --cxxflags
|
|
|
|
llvm-config --ldflags
|
|
|
|
llvm-config --libs engine bcreader scalaropts
|
|
|
|
|
|
|
|
Options:
|
|
|
|
--version Print LLVM version.
|
|
|
|
--prefix Print the installation prefix.
|
|
|
|
--src-root Print the source root LLVM was built from.
|
|
|
|
--obj-root Print the object root used to build LLVM.
|
|
|
|
--bindir Directory containing LLVM executables.
|
|
|
|
--includedir Directory containing LLVM headers.
|
|
|
|
--libdir Directory containing LLVM libraries.
|
|
|
|
--cppflags C preprocessor flags for files that include LLVM headers.
|
|
|
|
--cflags C compiler flags for files that include LLVM headers.
|
|
|
|
--cxxflags C++ compiler flags for files that include LLVM headers.
|
|
|
|
--ldflags Print Linker flags.
|
|
|
|
--system-libs System Libraries needed to link against LLVM components.
|
|
|
|
--libs Libraries needed to link against LLVM components.
|
|
|
|
--libnames Bare library names for in-tree builds.
|
|
|
|
--libfiles Fully qualified library filenames for makefile depends.
|
|
|
|
--components List of all possible components.
|
|
|
|
--targets-built List of all targets currently built.
|
|
|
|
--host-target Target triple used to configure LLVM.
|
|
|
|
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
|
|
|
|
--assertion-mode Print assertion mode of LLVM tree (ON or OFF).
|
|
|
|
--build-system Print the build system used to build LLVM (always cmake).
|
|
|
|
--has-rtti Print whether or not LLVM was built with rtti (YES or NO).
|
|
|
|
--has-global-isel Print whether or not LLVM was built with global-isel support (YES or NO).
|
|
|
|
--shared-mode Print how the provided components can be collectively linked (\`shared\` or \`static\`).
|
|
|
|
--link-shared Link the components as shared libraries.
|
|
|
|
--link-static Link the component libraries statically.
|
|
|
|
Typical components:
|
|
|
|
all All LLVM libraries (default).
|
|
|
|
engine Either a native JIT or a bitcode interpreter."
|
|
|
|
}
|
|
|
|
|
|
|
|
arch=@TERMUX_ARCH@
|
2018-04-07 00:50:40 +02:00
|
|
|
version=@TERMUX_PKG_VERSION@
|
2017-07-01 02:41:21 +02:00
|
|
|
prefix=@TERMUX_PREFIX@
|
|
|
|
has_rtti=NO
|
|
|
|
CPPFLAGS="-I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
|
2019-03-21 05:42:58 +01:00
|
|
|
CFLAGS="${CPPFLAGS} ${CFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
|
2017-07-01 02:41:21 +02:00
|
|
|
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -Wcast-qual -Wnon-virtual-dtor -std=c++11 -fno-exceptions"
|
|
|
|
if [ "$has_rtti" != "YES" ]; then CXXFLAGS="$CXXFLAGS -fno-rtti"; fi
|
|
|
|
LDFLAGS="-L${prefix}/lib"
|
|
|
|
LIBFILE="${prefix}/lib/libLLVM-$version.so"
|
2018-04-07 00:50:40 +02:00
|
|
|
components="aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc \
|
2019-03-21 05:42:58 +01:00
|
|
|
aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu \
|
|
|
|
amdgpuasmparser amdgpuasmprinter amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils \
|
|
|
|
analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo armutils asmparser \
|
|
|
|
asmprinter binaryformat bitreader bitwriter bpf bpfasmparser bpfasmprinter bpfcodegen bpfdesc \
|
|
|
|
bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf \
|
|
|
|
debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser \
|
|
|
|
hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo \
|
|
|
|
irreader lanai lanaiasmparser lanaiasmprinter lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver \
|
|
|
|
lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen \
|
|
|
|
mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430asmprinter msp430codegen \
|
|
|
|
msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxasmprinter nvptxcodegen \
|
|
|
|
nvptxdesc nvptxinfo objcarcopts object objectyaml option optremarks orcjit passes powerpc \
|
|
|
|
powerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo \
|
|
|
|
profiledata riscv riscvasmparser riscvasmprinter riscvcodegen riscvdesc riscvdisassembler riscvinfo \
|
|
|
|
riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparcasmprinter sparccodegen sparcdesc \
|
|
|
|
sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzasmprinter systemzcodegen \
|
|
|
|
systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly \
|
|
|
|
webassemblyasmparser webassemblyasmprinter webassemblycodegen webassemblydesc webassemblydisassembler \
|
|
|
|
webassemblyinfo windowsmanifest x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info \
|
|
|
|
x86utils xcore xcoreasmprinter xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray"
|
|
|
|
static_libs="-lLLVMObjectYAML -lLLVMDlltoolDriver -lLLVMLineEditor -lLLVMFuzzMutate -lLLVMCoroutines \
|
|
|
|
-lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMTextAPI -lLLVMCoverage -lLLVMXRay -lLLVMInterpreter \
|
|
|
|
-lLLVMMIRParser -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMRISCVDisassembler \
|
|
|
|
-lLLVMRISCVCodeGen -lLLVMRISCVAsmParser -lLLVMRISCVDesc -lLLVMRISCVInfo -lLLVMRISCVAsmPrinter \
|
|
|
|
-lLLVMRISCVUtils -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter \
|
|
|
|
-lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils \
|
|
|
|
-lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc -lLLVMWebAssemblyAsmPrinter -lLLVMWebAssemblyAsmParser \
|
|
|
|
-lLLVMWebAssemblyInfo -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo \
|
|
|
|
-lLLVMSystemZAsmPrinter -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo \
|
|
|
|
-lLLVMSparcAsmPrinter -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo \
|
|
|
|
-lLLVMPowerPCAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMSP430Disassembler \
|
|
|
|
-lLLVMMSP430CodeGen -lLLVMMSP430AsmParser -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMMipsDisassembler \
|
|
|
|
-lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen \
|
|
|
|
-lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiAsmPrinter -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen \
|
|
|
|
-lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFAsmParser -lLLVMBPFDesc \
|
|
|
|
-lLLVMBPFInfo -lLLVMBPFAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo \
|
|
|
|
-lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize \
|
|
|
|
-lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUInfo -lLLVMAMDGPUAsmPrinter \
|
|
|
|
-lLLVMAMDGPUUtils -lLLVMLibDriver -lLLVMOption -lLLVMWindowsManifest -lLLVMAArch64Disassembler -lLLVMMCDisassembler -lLLVMAArch64AsmParser \
|
|
|
|
-lLLVMMCJIT -lLLVMTableGen -lLLVMOrcJIT -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOptRemarks -lLLVMMCA -lLLVMAArch64CodeGen -lLLVMGlobalISel \
|
|
|
|
-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine \
|
|
|
|
-lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMAArch64Desc \
|
|
|
|
-lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMAArch64Utils \
|
|
|
|
-lLLVMSupport -lLLVMDemangle"
|
2018-04-07 00:50:40 +02:00
|
|
|
shared_libs="-lLLVM-$version"
|
|
|
|
libs=$shared_libs
|
2017-07-01 02:41:21 +02:00
|
|
|
handle_args () {
|
|
|
|
case "${1##--}" in
|
2018-04-07 00:50:40 +02:00
|
|
|
link-shared) libs=$shared_libs ;;
|
|
|
|
link-static) libs=$static_libs ;;
|
|
|
|
version) echo "$version\n";;
|
2017-07-01 02:41:21 +02:00
|
|
|
prefix) echo "$prefix";;
|
|
|
|
src-root) echo "@TERMUX_PKG_SRCDIR@";;
|
|
|
|
obj-root) echo "$prefix";;
|
|
|
|
bindir) echo "$prefix/bin";;
|
|
|
|
includedir) echo "$prefix/include";;
|
|
|
|
libdir) echo "$prefix/lib";;
|
|
|
|
cppflags) echo "$CPPFLAGS";;
|
|
|
|
cflags) echo "$CFLAGS";;
|
|
|
|
cxxflags) echo "$CXXFLAGS";;
|
|
|
|
ldflags) echo "$LDFLAGS";;
|
|
|
|
system-libs) echo "-lc -ldl -lcurses -lz -lm";;
|
2018-04-07 00:50:40 +02:00
|
|
|
libs) echo "$libs";;
|
2017-07-01 02:41:21 +02:00
|
|
|
libnames) echo "libLLVM-$version.so";;
|
|
|
|
libfiles) echo "$LIBFILE";;
|
2018-04-07 00:50:40 +02:00
|
|
|
components) echo "$components";;
|
|
|
|
targets-built) echo "AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC Sparc SystemZ X86 XCore WebAssembly";;
|
2017-07-01 02:41:21 +02:00
|
|
|
host-target) echo "@LLVM_DEFAULT_TARGET_TRIPLE@";;
|
|
|
|
build-mode) echo "Release";;
|
|
|
|
assertion-mode) echo "OFF";;
|
|
|
|
build-system) echo "cmake";;
|
|
|
|
has-rtti) echo "$has_rtti";;
|
|
|
|
has-global-isel) echo "OFF";;
|
|
|
|
shared-mode) echo "shared";;
|
|
|
|
cmakedir) echo "$prefix/lib/cmake/llvm";;
|
|
|
|
*) show_help >&2;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
for arg in $@; do handle_args $arg; done
|
|
|
|
|