dnl AM_PATH_CDRTOOLS([MINIMUM-VERSION,
dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
AC_DEFUN(AM_PATH_CDRTOOLS,
[ AC_ARG_WITH(cdrtools-prefix,
            AC_HELP_STRING([--with-cdrtools-prefix=PFX],
                           [set where the cdrtools are installed - default: PREFIX]),
     cdrtools_config_prefix="$withval", cdrtools_config_prefix="")

    if test "x$cdrtools_config_prefix" = "x"; then
	CDRTOOLS_PREFIX=$prefix
    else 	
    	CDRTOOLS_PREFIX=$cdrtools_config_prefix
    fi
    if test "X$CDRTOOLS_PREFIX" = "XNONE"; then
    	CDRTOOLS_PREFIX="$ac_default_prefix"
    fi 
    AC_SUBST(CDRTOOLS_PREFIX)
])

dnl AM_PATH_XCDRLIBDIR([MINIMUM-VERSION,
dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
AC_DEFUN(AM_PATH_XCDRLIBDIR,
[ AC_ARG_WITH(xcdroast-libdir-prefix,
            AC_HELP_STRING([--with-xcdroast-libdir-prefix=PFX],
                           [set where the utils/images of xcdroast should be installed - default: PREFIX/lib/xcdroast-0.98]),
     xcdrlibdir_config_prefix="$withval", xcdrlibdir_config_prefix="")

    if test "x$xcdrlibdir_config_prefix" = "x"; then
	XCDRLIB_PREFIX="$prefix/lib/xcdroast-0.98"
    else 	
    	XCDRLIB_PREFIX=$xcdrlibdir_config_prefix
    fi
    if test "X$XCDRLIB_PREFIX" = "XNONE/lib/xcdroast-0.98"; then
    	XCDRLIB_PREFIX="$ac_default_prefix/lib/xcdroast-0.98"
    fi 
    AC_SUBST(XCDRLIB_PREFIX)
])

dnl AM_DEP_NONROOTMODE([MINIMUM-VERSION,
dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
AC_DEFUN([AM_DEP_NONROOTMODE],
[AC_ARG_ENABLE(nonrootmode,
	[  --disable-nonrootmode       do not use X-CD-Roast non-root mode],
	USE_NONROOTMODE=$enableval, USE_NONROOTMODE=yes)

    if test "X$USE_NONROOTMODE" = "Xyes"; then
	USE_NONROOTMODE=1
    else
	USE_NONROOTMODE=0
    fi
    AC_SUBST(USE_NONROOTMODE)
])

dnl AM_DEP_ENABLEGTK2([MINIMUM-VERSION,
dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl
AC_DEFUN([AM_DEP_ENABLEGTK2],
[AC_ARG_ENABLE(gtk2,
	[  --enable-gtk2         compile for GTK2 instead for GTK+],
	ENABLE_GTK2=$enableval, ENABLE_GTK2=no)

    if test "X$ENABLE_GTK2" = "Xyes"; then
	ENABLE_GTK2=TRUE
    else
	ENABLE_GTK2=FALSE
    fi
    AC_SUBST(ENABLE_GTK2)
])

