Search code examples
autoconfm4

How to pack multiple statements


I'd like to regroup multiple statements in a []:

AC_ARG_WITH(
    [float],
    [AS_HELP_STRING(
        [--with-float],
        [use float instead of doubles to store polynoms coefficients])],
    [real=float], <--- here I'd like to add an AC_DEFINE
    [real=double])

My problem is, I'm not sure of the best way to do that. I guess I can use ;, but this does not seem really idiomatic for a m4sh script.


Solution

  • Use newlines:

    AC_ARG_WITH(
        [float],
        [AS_HELP_STRING(
            [--with-float],
            [use float instead of doubles to store polynoms coefficients])],
        [real=float]
        [AC_DEFINE....],
        [real=double])
    

    It's also common to write it as:

     AC_ARG_WITH([
            float
            ],[
            AS_HELP_STRING(
                [--with-float],
                [use float instead of doubles to store polynoms coefficients])
            ],[
            real=float
            AC_DEFINE....
            ],[
            real=double
    ])