diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-17 10:18:31 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-17 10:18:31 -0400 |
commit | 2838fd4a4e7fa40dd9cd95c81eb852190371ec5a (patch) | |
tree | 6cf8af9dd8da5802a76c418bac02087cdd82c24b /config/pkgconf.sh | |
parent | 83bfed52e523ef942da82a083584a4548182aaa4 (diff) | |
download | bfs-2838fd4a4e7fa40dd9cd95c81eb852190371ec5a.tar.xz |
build: Make the config scripts POSIX-compliant
Diffstat (limited to 'config/pkgconf.sh')
-rwxr-xr-x | config/pkgconf.sh | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/config/pkgconf.sh b/config/pkgconf.sh index 361852e..d6c45c7 100755 --- a/config/pkgconf.sh +++ b/config/pkgconf.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Copyright © Tavian Barnes <tavianator@tavianator.com> # SPDX-License-Identifier: 0BSD @@ -8,20 +8,22 @@ set -eu MODE= -if [[ "${1:-}" == --* ]]; then - MODE="$1" - shift -fi +case "${1:-}" in + --*) + MODE="$1" + shift +esac -if (($# < 1)); then +if [ $# -lt 1 ]; then exit fi -if [[ "$XNOLIBS" == [y1] ]]; then - exit 1 -fi +case "$XNOLIBS" in + y|1) + exit 1 +esac -if command -v "${XPKG_CONFIG:-}" &>/dev/null; then +if command -v "${XPKG_CONFIG:-}" >/dev/null 2>&1; then case "$MODE" in "") "$XPKG_CONFIG" "$@" |