]> git.draconx.ca Git - dxcommon.git/blobdiff - m4/gob2.m4
Avoid nonportable ${x##y} substitutions in program tests.
[dxcommon.git] / m4 / gob2.m4
index 48a503c54a01d8eb9e7c4b3e4e47df03100f8f37..3e95ab46d5ca9cbf52e954da3da2f1d8b53aa31f 100644 (file)
@@ -8,8 +8,8 @@ dnl
 dnl Search PATH for a working gob2 utility with the given minimum version,
 dnl which may be empty to accept any version.  If found, the GOB2 variable
 dnl (which is substituted with AC_SUBST) is set with the result, and
-dnl action-if-found is executed.  Otherwise, action-if-found is executed
-dnl if nonempty, else configure will exit with a fatal error.
+dnl action-if-found is executed.  Otherwise, action-if-not-found is
+dnl executed if nonempty, else configure will exit with a fatal error.
 
 AC_DEFUN([DX_PROG_GOB2], [AC_ARG_VAR([GOB2], [GOBject Builder command])dnl
 AC_PREREQ([2.62])dnl
@@ -25,8 +25,8 @@ AC_CACHE_CHECK([for GObject Builder], [ac_cv_path_GOB2],
 AC_PATH_PROGS_FEATURE_CHECK([GOB2], [gob2],
 [rm -f conftest.c
 $ac_path_GOB2 conftest.gob >&AS_MESSAGE_LOG_FD 2>&1 && test -f conftest.c && {
-  gob_relcmd=${ac_path_GOB2##*/}
-  gob_bypath=`command -v "$gob_relcmd"` # ''
+  DX_BASENAME([gob_relcmd], ["$ac_path_GOB2"])
+  gob_bypath=`{ command -v "$gob_relcmd"; } 2>/dev/null` # ''
   ac_cv_path_GOB2=$ac_path_GOB2
   test x"$gob_bypath" = x"$ac_path_GOB2" && ac_cv_path_GOB2=$gob_relcmd
   ac_path_GOB2_found=:
@@ -48,5 +48,5 @@ AS_IF([test x"$dx_cv_gob_works" = x"yes"],
 
 The latest version may be found at <https://draconx.ca/projects/gob-dx/>.
 ])])])
-rm -f conftest*
+rm -f conftest.c conftest.gob
 ])