Skip to content

Commit

Permalink
Add autoconf version update (#196)
Browse files Browse the repository at this point in the history
Signed-off-by: Duncan Ragsdale <88173870+Thistleman@users.noreply.github.com>
  • Loading branch information
Thistleman authored Apr 17, 2024
1 parent 8afa4a0 commit 48f42a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,21 @@ while [ $# -gt 0 ]; do
esac
shift 1
done

OS_NAME=$(uname -s)
OS_VERSION=$(uname -r)

if [ "$OS_NAME" = "Darwin" ] && [ "${OS_VERSION%%.*}" -ge 23 ]; then
REQUIRED_AUTOCONF_VERSION="2.72"
TEST_AUTOCONF_VERSION="2.71"
else
REQUIRED_AUTOCONF_VERSION="2.71"
TEST_AUTOCONF_VERSION="2.70"
fi

mkdir -p /usr/local/opt/gridlabd || error "you do not have permission to create /usr/local/opt/gridlabd"
autoconf --version 1>/dev/null 2>&1 || error "autoconf not installed. Did you run setup.sh?"
test "$(autoconf --version 2>/dev/null | head -n 1 | grep -o '[^ ]*$')" '>' "2.70" || error "autoconf version 2.71 or later required. Did you run setup.sh?"
test "$(autoconf --version 2>/dev/null | head -n 1 | grep -o '[^ ]*$')" '>' "$TEST_AUTOCONF_VERSION" || error "autoconf version $REQUIRED_AUTOCONF_VERSION or later required. Did you run setup.sh?"
git --version 1>/dev/null 2>&1 || error "you must install git to build GridLAB-D"
test -f $SRCDIR/configure.ac || error "you must build from the source directory where configure.ac is located"
test -f $HOME/.gridlabd/bin/activate || error "$HOME/.gridlabd is not found. Run setup.sh again."
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ m4_define([versionname], sbuild_m4_esyscmd_s([build-aux/version.sh --name]))
m4_define([pkginstall], sbuild_m4_esyscmd_s([build-aux/version.sh --install]))
m4_define([pkgorigin],sbuild_m4_esyscmd_s([git rev-parse --abbrev-ref HEAD]))
# Set minimum autoconf version, cannot be conditional
# Build.sh will handle validation of later version for Darwin 23 and later
AC_PREREQ([2.71])
AC_INIT([pkgname],[pkgversion],[gridlabd@gmail.com],[pkg])
AC_CONFIG_SRCDIR([source/gridlabd.h])
Expand Down

0 comments on commit 48f42a0

Please sign in to comment.