]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
github: make sure compiler is defined
authorKarel Zak <kzak@redhat.com>
Tue, 26 Jan 2021 11:39:22 +0000 (12:39 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Jan 2021 11:39:22 +0000 (12:39 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
.github/workflows/cibuild-setup-ubuntu.sh
.github/workflows/cibuild.sh

index 160d0301d61af62e736b021a687a10a71ee7cad1..8c56ea2ac42805b006aab48f32c658f85fda0b0b 100755 (executable)
@@ -36,29 +36,17 @@ if [[ "$COMPILER" == clang ]]; then
     wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
     add-apt-repository -y "deb http://apt.llvm.org/$RELEASE/   llvm-toolchain-$RELEASE-$COMPILER_VERSION  main"
     PACKAGES+=(clang-$COMPILER_VERSION lldb-$COMPILER_VERSION lld-$COMPILER_VERSION clangd-$COMPILER_VERSION)
-    CC="clang-$COMPILER_VERSION"
-    CXX="clang++-$COMPILER_VERSION"
-    AR="llvm-ar-$COMPILER_VERSION"
 elif [[ "$COMPILER" == gcc ]]; then
     # Latest gcc stack deb packages provided by
     # https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
     add-apt-repository -y ppa:ubuntu-toolchain-r/test
     PACKAGES+=(gcc-$COMPILER_VERSION)
-    CC="gcc-$COMPILER_VERSION"
-    CXX="g++-$COMPILER_VERSION"
-    AR="gcc-ar-$COMPILER_VERSION"
 else
     fatal "Unknown compiler: $COMPILER"
 fi
 
-export CC="$CC"
-export CXX="$CXX"
-export AR="$AR"
-
 
 apt-get -y update --fix-missing
 apt-get -y build-dep util-linux
 apt-get -y install "${PACKAGES[@]}"
 apt-get -y install  "${PACKAGES_OPTIONAL[@]}" || true
-
-export PATH="$HOME/.local/bin:$PATH"
index a2dfa34083da5372f45d60d4ad3bfb4ed2693aff..8256be96501651b8557e457b15e94a471d5f0fce 100755 (executable)
@@ -2,9 +2,21 @@
  
 PHASES=(${@:-CONFIGURE MAKE INSTALL CHECK DISTCHECK})
 COMPILER="${COMPILER:?}"
+COMPILER_VERSION="${COMPILER_VERSION:?}"
+
+if [[ "$COMPILER" == clang ]]; then
+    CC="clang"
+    CXX="clang++"
+elif [[ "$COMPILER" == gcc ]]; then
+    CC="gcc"
+    CXX="g++"
+fi
 
 set -ex
 
+export CC="$CC"
+export CXX="$CXX"
+
 for phase in "${PHASES[@]}"; do
     case $phase in
        CONFIGURE)