dnl CF_INSTALL_PREFIX version: 2 updated: 2025/10/18 11:14:21
dnl -----------------
dnl Special option for use by system-builders: the install-prefix is used to
dnl adjust the location into which the actual install is done, so that an
dnl archive can be built without modifying the host system's configuration.
AC_DEFUN([CF_INSTALL_PREFIX],[
AC_MSG_CHECKING(for an installation directory prefix)
AC_ARG_WITH(install-prefix,
	[  --with-install-prefix=DESTDIR use DESTDIR as installation directory prefix],
	[case "x$withval" in
	(xyes|xno)
		;;
	(*)	DESTDIR="$withval"
		;;
	esac])
AC_MSG_RESULT([${DESTDIR:-(none)}])
AC_SUBST(DESTDIR)

SET_DESTDIR=
test -n "$DESTDIR" && SET_DESTDIR="DESTDIR=$DESTDIR"
AC_SUBST(SET_DESTDIR)

AC_MSG_CHECKING(if installation directory prefix should be merged)
CF_ARG_ENABLE(install-prefix,
	[  --enable-install-prefix merge DESTDIR with installation prefix],
	cf_install_prefix=yes,
	cf_install_prefix=no)
AC_MSG_RESULT($cf_install_prefix)

if test "$cf_install_prefix" = yes ; then
	MERGE_PREFIX=':$(prefix)%=%'
else
	MERGE_PREFIX=''
fi

AC_SUBST(MERGE_PREFIX)
])dnl
