termux-packages/packages/ldc/ldc-llvm-config.patch.in

69 lines
4.4 KiB
Diff
Raw Normal View History

2017-07-01 02:43:00 +02:00
diff --git a/cmake/Modules/FindLLVM.cmake b/cmake/Modules/FindLLVM.cmake
index a6a0b0b7..06d6c1c1 100644
--- a/cmake/Modules/FindLLVM.cmake
+++ b/cmake/Modules/FindLLVM.cmake
@@ -35,11 +35,12 @@ set(llvm_config_names llvm-config-5.0 llvm-config50
2017-09-13 09:26:46 +02:00
llvm-config-3.8 llvm-config38
llvm-config-3.7 llvm-config37
2017-07-01 02:43:00 +02:00
llvm-config)
-find_program(LLVM_CONFIG
- NAMES ${llvm_config_names}
- PATHS ${LLVM_ROOT_DIR}/bin NO_DEFAULT_PATH
- DOC "Path to llvm-config tool.")
-find_program(LLVM_CONFIG NAMES ${llvm_config_names})
+set(LLVM_CONFIG "/bin/ls")
+#find_program(LLVM_CONFIG
+# NAMES ${llvm_config_names}
+# PATHS ${LLVM_ROOT_DIR}/bin NO_DEFAULT_PATH
+# DOC "Path to llvm-config tool.")
+#find_program(LLVM_CONFIG NAMES ${llvm_config_names})
# Prints a warning/failure message depending on the required/quiet flags. Copied
# from FindPackageHandleStandardArgs.cmake because it doesn't seem to be exposed.
@@ -175,12 +176,12 @@ else()
endif()
endmacro()
- llvm_set(VERSION_STRING version)
- llvm_set(CXXFLAGS cxxflags)
- llvm_set(HOST_TARGET host-target)
- llvm_set(INCLUDE_DIRS includedir true)
- llvm_set(ROOT_DIR prefix true)
- llvm_set(ENABLE_ASSERTIONS assertion-mode)
2017-07-10 13:02:12 +02:00
+ set(LLVM_VERSION_STRING "4.0.1")
+ set(LLVM_CXXFLAGS "-I@TERMUX_PKG_SRC@/llvm/include -I@TERMUX_PKG_BUILD@/llvm/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
2017-07-01 02:43:00 +02:00
+ set(LLVM_HOST_TARGET "armv7-none-linux-android")
+ set(LLVM_INCLUDE_DIRS "@TERMUX_PKG_SRC@/llvm/include")
+ set(LLVM_ROOT_DIR "@TERMUX_PKG_BUILD@/llvm")
+ set(LLVM_ENABLE_ASSERTIONS "OFF")
2017-09-13 09:26:46 +02:00
if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-8][\\.0-9A-Za-z]*")
# Versions below 3.9 do not support components debuginfocodeview, globalisel
@@ -207,13 +208,13 @@ else()
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "debuginfomsf" index)
2017-07-01 02:43:00 +02:00
endif()
- llvm_set(LDFLAGS ldflags)
+ set(LLVM_LIBRARY_DIRS "${LLVM_ROOT_DIR}/lib")
+ set(LLVM_LDFLAGS "-L${LLVM_LIBRARY_DIRS}")
2017-09-13 09:26:46 +02:00
# In LLVM 3.5+, the system library dependencies (e.g. "-lz") are accessed
# using the separate "--system-libs" flag.
- llvm_set(SYSTEM_LIBS system-libs)
+ set(LLVM_SYSTEM_LIBS "-ldl -lncurses -lz -lm")
string(REPLACE "\n" " " LLVM_LDFLAGS "${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBS}")
2017-07-01 02:43:00 +02:00
- llvm_set(LIBRARY_DIRS libdir true)
- llvm_set_libs(LIBRARIES libs)
+ set(LLVM_LIBRARIES "-lLLVMTableGen;-lLLVMLibDriver;-lLLVMOption;-lLLVMSymbolize;-lLLVMDebugInfoPDB;-lLLVMDebugInfoDWARF;-lLLVMAArch64Disassembler;-lLLVMAArch64CodeGen;-lLLVMAArch64AsmParser;-lLLVMAArch64Desc;-lLLVMAArch64Info;-lLLVMAArch64AsmPrinter;-lLLVMAArch64Utils;-lLLVMARMDisassembler;-lLLVMARMCodeGen;-lLLVMARMAsmParser;-lLLVMARMDesc;-lLLVMARMInfo;-lLLVMARMAsmPrinter;-lLLVMLineEditor;-lLLVMMIRParser;-lLLVMLTO;-lLLVMPasses;-lLLVMObjCARCOpts;-lLLVMOrcJIT;-lLLVMInterpreter;-lLLVMObjectYAML;-lLLVMX86Disassembler;-lLLVMX86AsmParser;-lLLVMX86CodeGen;-lLLVMGlobalISel;-lLLVMSelectionDAG;-lLLVMAsmPrinter;-lLLVMDebugInfoCodeView;-lLLVMDebugInfoMSF;-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;-lLLVMCoverage;-lLLVMProfileData;-lLLVMObject;-lLLVMMCParser;-lLLVMMC;-lLLVMBitReader;-lLLVMCore;-lLLVMSupport;-lLLVMDemangle")
2017-07-01 02:43:00 +02:00
# LLVM bug: llvm-config --libs tablegen returns -lLLVM-3.8.0
# but code for it is not in shared library
if("${LLVM_FIND_COMPONENTS}" MATCHES "tablegen")
@@ -223,7 +224,7 @@ else()
set(LLVM_LIBRARIES "${LLVM_LIBRARIES};-lLLVMTableGen")
endif()
endif()
- llvm_set(TARGETS_TO_BUILD targets-built)
+ set(LLVM_TARGETS_TO_BUILD "AArch64 ARM X86")
2017-07-01 02:43:00 +02:00
string(REGEX MATCHALL "${pattern}[^ ]+" LLVM_TARGETS_TO_BUILD ${LLVM_TARGETS_TO_BUILD})
endif()