From 3fe3da5ab4ef9b1045b1ab3d9d6b159fc613f802 Mon Sep 17 00:00:00 2001 From: Yohan Chatelain Date: Wed, 17 Apr 2024 20:00:53 -0400 Subject: [PATCH] Use if then else in RUN --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9fdf0913..e78d7a91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,14 +42,16 @@ ENV CXX=g++-${GCC_VERSION} COPY . /build/verificarlo/ WORKDIR /build/verificarlo -ENV FLANG_OPTION $( [[ "$WITH_FLANG" = "flang" ]] && echo "--with-flang" || echo "--without-flang" ) -RUN { ./autogen.sh && \ +RUN if [ "$WITH_FLANG" = "flang" ]; then \ + export FLANG_OPTION="--with-flang"; \ + else \ + export FLANG_OPTION="--without-flang"; \ + fi && \ + ./autogen.sh && \ ./configure \ --with-llvm=$(llvm-config-${LLVM_VERSION} --prefix) \ - ${FLANG_OPTION} ; } \ - || { cat config.log; exit 1; } - + $FLANG_OPTION || { cat config.log; exit 1; } # Build verificarlo RUN make && make install