Skip to content

Commit

Permalink
fix: can not install 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yacchi committed Jul 9, 2021
1 parent 62264d3 commit c8faf82
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ $(TEST_GOALS):

test-all: $(TEST_GOALS)

clean: $(TEST_CACHE_DIR)
clean:
rm -rf $(TEST_CACHE_DIR)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ install & manage versions.
When installing GNU Make using `asdf install`, you can pass custom configure options with the following env vars:
* `MAKE_CHECK_SIGNATURES` - `strict` is default. Other values are `no`.
* `MAKE_PRINT_BUILD_LOG` - `no` is default. Other value are `yes`.
* `MAKE_BUILD_OPTIONS` - `--with-guile=no` is default.

# Contributing
Contributions of any kind welcome! See the [contributing guide](contributing.md).
Expand Down
22 changes: 19 additions & 3 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TOOL_TEST="make --version"

MAKE_CHECK_SIGNATURES="${MAKE_CHECK_SIGNATURES:-strict}"
MAKE_PRINT_BUILD_LOG="${MAKE_PRINT_BUILD_LOG:-no}"
MAKE_BUILD_OPTIONS="${MAKE_BUILD_OPTIONS:---with-guile=no}"

current_script_path=${BASH_SOURCE[0]}
# shellcheck disable=SC2046
Expand Down Expand Up @@ -97,6 +98,17 @@ patch_source() {
esac
}

patch_build_sh() {
local version="$1"
local comparable_version
comparable_version=$(echo "$version" | awk -F . '{printf "%2d%02d%02d", $1, $2, $3}')

if [[ $comparable_version -eq 40000 && ${MAKE_BUILD_OPTIONS} =~ --with-guile=no ]]; then
# shellcheck disable=SC2016
sed -i.bak -e 's/guile.${OBJEXT}//' build.sh
fi
}

install_version() {
local install_type="$1"
local version="$2"
Expand Down Expand Up @@ -130,16 +142,20 @@ install_version() {
# At this time, can speed up second time configure by enabling configure caching (-C).
if [[ "${MAKE_PRINT_BUILD_LOG}" == "yes" ]]; then
{
./configure -C --prefix="$install_path"
# shellcheck disable=SC2086
./configure -C --prefix="$install_path" ${MAKE_BUILD_OPTIONS}
patch_build_sh "$version"
./build.sh &&
PATH=$ASDF_DOWNLOAD_PATH:$PATH ./configure -C --prefix="$install_path" &&
./make install
} 2>&1 | tee "$install_log"
else
{
./configure -C --prefix="$install_path"
# shellcheck disable=SC2086
./configure -C --prefix="$install_path" ${MAKE_BUILD_OPTIONS}
patch_build_sh "$version"
./build.sh &&
PATH=$ASDF_DOWNLOAD_PATH:$PATH ./configure -C --prefix="$install_path" &&
PATH=$ASDF_DOWNLOAD_PATH:$PATH ./configure -C --prefix="$install_path" ${MAKE_BUILD_OPTIONS} &&
./make install
} &>"$install_log"
fi
Expand Down

0 comments on commit c8faf82

Please sign in to comment.