diff --git a/chocpkg/modules/build_autotools.sh b/chocpkg/modules/build_autotools.sh index fce63ff..7e174db 100644 --- a/chocpkg/modules/build_autotools.sh +++ b/chocpkg/modules/build_autotools.sh @@ -14,6 +14,17 @@ build_autotools::need_autoreconf() { [ ! -e configure ] || [ $configure_ac -nt configure ] } +# BSD systems usually have their own less-capable version of make, while +# GNU make is installed as `gmake`. If a command named gmake is found, +# prefer that over `make`. +build_autotools::make() { + if chocpkg::have_tool gmake; then + gmake "$@" + else + make "$@" + fi +} + # This function encapsulates the "./configure; make" process that does the # actual build of the package. This should work for most autotools-based # packages but the intention is that this can be overrriden by packages. @@ -45,7 +56,7 @@ do_build() { chocpkg::abort "Failed to configure package $PACKAGE_NAME for build." ) - make $MAKE_OPTS || ( + build_autotools::make $MAKE_OPTS || ( chocpkg::abort "Failed to build package $PACKAGE_NAME." ) } @@ -57,7 +68,7 @@ do_install() { cd "$AUTOTOOLS_BUILD_PATH" fi - make install || ( + build_autotools::make install || ( chocpkg::abort "Failed to install package $PACKAGE_NAME." ) }