diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2022-05-13 23:33:40 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2022-05-19 22:48:45 +0200 |
commit | 26eb876839eb70d7e74d600bc584d4e407053c00 (patch) | |
tree | 580fe1208aa8cc3bdd1dad9e381f5f82ea792ace /configure.ac | |
parent | c7c5d4cc808844a4114b1ee664da4b5402c0d66d (diff) | |
download | libgphoto2-26eb876839eb70d7e74d600bc584d4e407053c00.tar.gz |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 1 insertions, 2 deletions
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]) |