autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple --with-foo possible?


From: Ralf Wildenhues
Subject: Re: Multiple --with-foo possible?
Date: Sun, 6 Apr 2008 15:39:26 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

Hi Tho,as

On Sun, Apr 06, 2008 at 12:50:13PM +0200, Thomas Schwinge wrote:
> 
> AC_ARG_WITH([module],
> dnl TODO.  Want to use commas instead of exclamation marks, but aclocal 
> doesn't
> dnl like that.  TODO.  Squared brackets are not being shown in help output.
>           AS_HELP_STRING([--with-module-ID=PATH!PRIORITY!SHARE[!COMMAND 
> LINE]],
>                          [add a module]))

For example like this (untested):

AC_ARG_WITH([module],
            [AS_HELP_STRING([--with-module-ID=PATH,PRIORITY,SHARE[[,COMMAND 
LINE]]],
                            [add a module])])

If you need non-nested brackets, you can still use quadrigraphs,
see 'info Autoconf Quadrigraphs'.

> [rm -f modules.h modules-1.h modules.S modules-files &&
> for m in $(
>   set |
>     grep ^with_module_ |

This breaks if the user of your configure script does
  some_var="let's fool configure:
with_module_foo=bar"
  export some_var
  ./configure

>       { IFS== &&
>         while read m r; do
>           echo $m
>         done
>       }
> )
> do
>   eval v=\$$m &&
>   m=$(expr $m : with_module_\\\(.\*\\\)) &&
>   echo $m,"$v" |
>     { IFS=, &&
>       read m f p s c &&

This code does not necessarily execute in a subshell, so you need to
save and restore IFS here, for example like this:

  save_IFS=$IFS &&
  IFS=, &&
  read m f p s c &&
  IFS=$save_IFS &&


> done &&
> cat >> modules.h <<EOS &&
> struct module modules[] = {

This pair of brackets looks underquoted, too.

> EOS
> cat >> modules.h < modules-1.h &&
> rm -f modules-1.h &&
> cat >> modules.h <<EOS &&
> };
> EOS
> MODULES_FILES=$(echo $(cat modules-files)) &&
> rm -f modules-files]
> AC_SUBST([MODULES_FILES])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]