From 26eb876839eb70d7e74d600bc584d4e407053c00 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Fri, 13 May 2022 23:33:40 +0200 Subject: Allow overriding build tools from configure command line Introduce GP_CHECK_PROG macro to allow users to override the autodetection of tools, instead of the autodetection overriding the user's explicit wish. GP_CHECK_PROG([SORT, [sort], [text line sorting tool]) will now allow calling ./configure SORT="mysort" and have subsequent builds use that given value without checking PATH. When calling `configure` without SORT=, AC_PATH_PROG will look for `sort` in `PATH` and set `SORT` to the value it has found. For comparison, here is the old buggy method: AC_ARG_VAR([SORT], [sort], [text line sorting tool]) AC_PATH_PROG([SORT], [sort], [no]) When called as `configure SORT="mysort"`, the expanded AC_PATH_PROG will just look in `PATH` for `sort` and set `SORT` to the `sort` it found, completely ignoring the SORT= value given on the `configure` command line. --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b6852871e..b38d15bac 100644 --- a/configure.ac +++ b/configure.ac @@ -124,8 +124,7 @@ AM_CONDITIONAL([HAVE_CXX], [test "x$CXX" != "x" && test "x$CXX" != "xno"]) dnl Not strictly necessary, but helps pulling translations. -AC_ARG_VAR([RSYNC], [rsync file copying command]) -AC_PATH_PROG([RSYNC], [rsync], [no]) +GP_CHECK_PROG([RSYNC], [rsync], [file copying command]) AM_CONDITIONAL([HAVE_RSYNC], [test "x$RSYNC" != xno]) -- cgit v1.2.1