[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AS_CASE vs case/esac
From: |
Ralf Wildenhues |
Subject: |
Re: AS_CASE vs case/esac |
Date: |
Thu, 13 Mar 2008 21:39:43 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
* NightStrike wrote on Thu, Mar 13, 2008 at 09:20:06PM CET:
> Should AS_CASE
> (http://www.gnu.org/software/autoconf/manual/autoconf.html#index-AS_005fCASE-1116)
> always be used instead of case/esac inside configure.ac, some local
> package m4 script, or AC_DEFUN macros?
Most of the time that is purely an aesthetic question.
It however matters if, inside AS_CASE arguments, you put
AC_DEFUN'ed macros which themselves AC_REQUIRE other macros.
They will then be expanded outside of the AS_CASE construct.
Example:
AC_INIT
AC_DEFUN([FOO], [echo foo])
AC_DEFUN([BAR], [AC_REQUIRE([FOO])
echo bar])
x=zork
AS_CASE([$x], [y*], [BAR])
will print 'foo' because FOO will be expanded outside of the AS_CASE.
Note that with AS_IF of Autoconf's 2.61 and newer, the same holds
(before 2.61, AS_IF was not m4_defun'ed, only m4_define'd, so the
expansion of required macros was not pushed outside of it).
Hope that helps.
Cheers,
Ralf
- AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac,
Ralf Wildenhues <=
- Re: AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac, Ralf Wildenhues, 2008/03/13
- Re: AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac, Ralf Wildenhues, 2008/03/13
- Re: AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac, Ralf Wildenhues, 2008/03/13
- Re: AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac, Ralf Wildenhues, 2008/03/13
- Re: AS_CASE vs case/esac, NightStrike, 2008/03/13
- Re: AS_CASE vs case/esac, Ralf Wildenhues, 2008/03/13