From 04b87b9f3d10dd64256610b34a9ad32b16127ba3 Mon Sep 17 00:00:00 2001 From: Ilias Tsitsimpis Date: Mon, 17 Feb 2025 09:44:23 +0100 Subject: [PATCH] Allow setting path for LLC/OPT during configuration Patch configure.ac to allow us to modify the path for LLC/OPT during configuration. Gbp-Pq: Name allow-setting-llvm-program --- configure.ac | 8 ++++++-- distrib/configure.ac.in | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 59713a41..b974763d 100644 --- a/configure.ac +++ b/configure.ac @@ -574,14 +574,18 @@ AC_SUBST([ClangCmd]) dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) -FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion]) +if test -z "$LLC"; then + FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion]) +fi LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) -FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) +if test -z "$OPT"; then + FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) +fi OptCmd="$OPT" AC_SUBST([OptCmd]) diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 22f351ea..68a5ad0b 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -152,14 +152,18 @@ LlvmMaxVersion=@LlvmMaxVersion@ dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) -FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion]) +if test -z "$LLC"; then + FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion]) +fi LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) -FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) +if test -z "$OPT"; then + FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) +fi OptCmd="$OPT" AC_SUBST([OptCmd]) -- 2.30.2