[dx_cv_flex_found=:
AC_PATH_PROGS_FEATURE_CHECK([FLEX], [flex lex],
[_DX_FLEX_DO_TEST([$ac_path_FLEX],
-[flex_relcmd=${ac_path_FLEX##*/}
-flex_bypath=`command -v "$flex_relcmd"` #''
+[DX_BASENAME([flex_relcmd], ["$ac_path_FLEX"])
+flex_bypath=`{ command -v "$flex_relcmd"; } 2>/dev/null` #''
ac_cv_path_FLEX=$ac_path_FLEX
test x"$flex_bypath" = x"$ac_path_FLEX" && ac_cv_path_FLEX=$flex_relcmd
ac_path_FLEX_found=: