[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf and optional arguments for the configure script
From: |
Bernd Lachner |
Subject: |
Re: Autoconf and optional arguments for the configure script |
Date: |
Sat, 25 Jun 2005 07:40:47 +0200 |
User-agent: |
KMail/1.8.1 |
Hi,
thank you for your help, but now I have some more questions.
> >
> > I need some optional arguments for a configure script. I have seen the
> > macros AC_ARG_WITH and AC_ARG_ENABLE in the autoconf manual. As far I can
> > see, I can add arguments like this to the configure script:
> >
> > --enable-option=yes
> > --with-option
>
> --enable-option[=xyz]
> --with-option[=xyz]
>
Ok. I'm new to write configure.ac scripts so I didn't know that I can choose
xyz instead yes and no. Is there any site with examples or tutorials to
autoconf?
> > But I want more this two types of arguments for the configure script:
> >
> > 1)
> > --device=x where x can be devicea, deviceb, ....
>
> --enable-devicea or --enable-deviceb
> or
> --enable-devicea_or_b=devicea (Here device_a_or_b is a good
> description for the group. Example --enable-sounddevice=/dev/sound1)
>
Ok. But I don't know if I understand this right. Is it possible to give
AC_ARG_ENABLE more than two arguments to choose. That means in configure the
following should be possible:
configure --enable-device=devicea
or
configure --enable-device=deviceb
or
configure --enable-device=devicec
or
....
If yes it should work fine for me and I have to do some experiments with
AC_ARG_ENABLE.
> > 2)
> > --devicexresoluton=x
> > --deviceyresolution=y
>
> --enable-devicexresolution=x
>
> > or even better
> >
> > --deviceres=x*y
>
> This is up to you. But '*' is spaned by the shell, and your users will
> have to escape it: --deviceres=x\*y.
> Probably you want: --devicers=AxB
>
Yes AxB is Ok for this too. But that means that I must define any possible
resolution in configure.ac, right?
And the resoultution is not give like this to config.h
#define XRES 320
#define YRES 240
but like this
#define RES320X240
or
#define RES640X480
Do I understand right? Ok it is not so flexible but I think I can live with
this. It seams my problems can be solved with AC_ARG_ENABLE and AC_ARG_WITH,
at least if it is possible to have more than 2 options and only yes and no.
Maybe I "only" have to learn more about this. Some examples to this or a
tutorial page would be helpfull.