Saturday, March 02, 2019

use ports llvm-config in lang/flang

Prepare for llvm-config in base and use ports llvm-config to avoid a
build error.

-- Found LLVM_CONFIG as /usr/bin/llvm-config
CMake Error at CMakeLists.txt:72 (message):
Not found: /usr/lib/cmake/llvm/LLVMConfig.cmake


-- Configuring incomplete, errors occurred!
See also "/usr/obj/ports/flang-driver-7.0.1.20190215/build-amd64/CMakeFiles/CMakeOutput.log".

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/flang/driver/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile 16 Feb 2019 20:39:46 -0000 1.15
+++ Makefile 3 Mar 2019 02:45:52 -0000
@@ -20,7 +20,8 @@ MODULES = devel/cmake \
BUILD_DEPENDS = devel/llvm \
textproc/libxml

-CONFIGURE_ARGS = -DLIBCLANG_BUILD_STATIC=On
+CONFIGURE_ARGS = -DLIBCLANG_BUILD_STATIC=On \
+ -DLLVM_CONFIG="${LOCALBASE}/bin/llvm-config"

pre-configure:
@${SUBST_CMD} ${WRKSRC}/lib/Driver/ToolChains/OpenBSD.cpp
@@ -28,7 +29,7 @@ pre-configure:
# Don't use the LLVM shared library.
post-configure:
sed -i \
- 's,-lLLVM-7,`llvm-config --libs all --link-static --ignore-libllvm` -lz,g' \
+ 's,-lLLVM-7,`${LOCALBASE}/bin/llvm-config --libs all --link-static --ignore-libllvm` -lz,g' \
${WRKBUILD}/build.ninja

# We don't want yet another copy of clang and its utilities on the system.

No comments:

Post a Comment