[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clean up AC_ARG_ENABLE and AC_ARG_WITH
From: |
Martin Waitz |
Subject: |
Re: Clean up AC_ARG_ENABLE and AC_ARG_WITH |
Date: |
Thu, 18 Aug 2005 09:57:11 +0200 |
User-agent: |
Mutt/1.5.9i |
hoi :)
On Wed, Aug 17, 2005 at 07:46:54PM +0200, Stepan Kasal wrote:
> +# _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
> +# -------------------------------------------------------------------
> +# Common code for AC_ARG_ENABLE and AC_ARG_WITH.
> +# OPTION is either "enable" or "with".
> +#
> +m4_define([_AC_ENABLE_IF],
> +[# Check whether --$1-$2 was given.
> +_AC_ENABLE_IF_ACTION([$1], m4_bpatsubst([$2], -, _), [$3], [$4])[]dnl
> +])
> +
> +m4_define([_AC_ENABLE_IF_ACTION],
> +[if test "${$1_$2+set}" = set; then
> + $1val=$$1_$2
> + $3
> +m4_ifvaln([$4], [else
> + $4])dnl
> +fi[]dnl
> +])
so why don't you merge $1-$2 to one argument to make it even more
general?
> +_AC_ENABLE_IF([enable], [$1], [$3], [$4])
you could then simply use:
_AC_ENABLE_IF([enable-$1], [$3], [$4]) > ])
--
Martin Waitz
signature.asc
Description: Digital signature