-AC_ARG_VAR([DEFAULT_RMT_COMMAND],
- [Define full pathname of rmt program.])
+AC_ARG_VAR([DEFAULT_RMT_DIR],
+ [Define full file name of the directory where to install `rmt'. (default: $(libexecdir))])
+if test "x$DEFAULT_RMT_DIR" != x; then
+ DEFAULT_RMT_COMMAND=$DEFAULT_RMT_DIR/rmt
+else
+ DEFAULT_RMT_DIR='$(libexecdir)'
+fi
+
+AC_MSG_CHECKING([whether to build rmt])
+AC_ARG_WITH([rmt],
+ AC_HELP_STRING([--with-rmt=FILE],
+ [Use FILE as the default `rmt' program. Do not build included copy of `rmt'.]),
+ [case $withval in
+ yes|no) AC_MSG_ERROR([Invalid argument to --with-rmt]);;
+ /*) DEFAULT_RMT_COMMAND=$withval
+ AC_MSG_RESULT([no, use $withval instead]);;
+ *) AC_MSG_ERROR([Argument to --with-rmt must be an absolute file name]);;
+ esac],
+ [AC_MSG_RESULT([yes])
+ enable_rmt
+ if test "$RMT" = ""; then
+ AC_MSG_WARN([not building rmt, required header files are missing])
+ fi])
+
+AC_SUBST(DEFAULT_RMT_COMMAND)