root/mpich2/branches/dev/kumudb/confdb/aclocal_enable.m4 @ 4870

Revision 4870, 1.2 KB (checked in by kumudb, 5 months ago)

Merge from trunk to kumudb r4748:r4869

Line 
1dnl
2dnl NOT YET READY
3dnl
4dnl This contains some helper macros to help handle complex enable values
5dnl such as
6dnl  --enable-g=g,mem=trace
7dnl and
8dnl  --enable-g=all
9dnl
10dnl for --enable-name, use
11dnl PAC_ARG_ENABLE_PARSE(name)
12dnl
13dnl Not done:
14dnl Provide a list of allowed values (to allow checking for missed values)
15dnl Provide an option to automatically define a value.  We currently
16dnl set HAVE_ENABLE_NAME_SUBNAME=value.  For example
17dnl --enable-g=g,mem=trace
18dnl would set the variables
19dnl HAVE_ENABLE_G_G=yes
20dnl HAVE_ENABLE_G_MEM=trace
21dnl
22AC_DEFUN([PAC_ARG_ENABLE_PARSE],[
23    eval ac_e_parse=${enable}_$1
24    save_IFS="$IFS"
25    IFS=","
26    for ac_opt in $ac_e_parse ; do
27        dnl handle ac_opt has a value
28        case "$ac_opt" in
29        *=*) ac_optname=`echo "$ac_opt" | sed 's/=.*//'`
30             ac_optarg=`echo "$ac_opt" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
31        *)   ac_optname=$ac_opt
32             ac_optarg=yes ;;
33        esac
34        dnl Still need to upcase the name
35        changequote(<<,>>)dnl
36        define(<<AC_VAR_NAME>>, translit($1,[a-z],[A-Z]))dnl
37        ac_opt_name_caps=`echo $ac_opt_name | tr a-z A-Z`
38        changequote([,])dnl
39        ac_opt_name=HAVE_ENABLE_[]AC_VAR_NAME[]_${ac_opt_name_caps}
40        eval $ac_opt_name=$ac_optarg
41    done
42])
Note: See TracBrowser for help on using the browser.