You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Roy T. Fielding" <fi...@ebuilt.com> on 2001/03/06 20:47:05 UTC
Re: cvs commit: apr CHANGES configure.in
On Tue, Mar 06, 2001 at 04:54:49AM -0000, rbb@apache.org wrote:
> +++ configure.in 2001/03/06 04:54:49 1.256
> @@ -350,6 +350,13 @@
> dnl threaded poll() and we don't want to use sendfile on early FreeBSD
> dnl systems if we are also using threads.
>
> +AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off],
> + [ if test "$withval" = "yes"; then
> + sendfile="1"
> + else
> + sendfile="0"
> + fi ] )
> +
This seems to say that --with-sendfile means --without-sendfile. I think
that --with options should always default to "yes" if no =value is given.
Otherwise, the option should be --disable-sendfile.
....Roy
Re: cvs commit: apr CHANGES configure.in
Posted by Greg Stein <gs...@lyra.org>.
Boolean switches should use AC_ARG_ENABLE(). AC_ARG_WITH is to allow you to
specify "configure with <this> package". The code below should fall out
simply as:
AC_ARG_ENABLE(sendfile, [ --enable-sendfile Enable or disable sendfile support]
[ if test "$enable_sendfile" = "yes"; then
sendfile="1"
else
sendfile="0"
fi
])
No switch leaves sendfile unset (e.g. default to the platform availability).
--enable-sendfile sets it to 1, and --disable-sendfile sets it to 0.
Users expect AC_ARG_ENABLE type switches for these things.
(--with-debug and --with-maintainer-mode need to switch, too, for that
matter)
Cheers,
-g
On Tue, Mar 06, 2001 at 12:10:42PM -0800, rbb@covalent.net wrote:
> On Tue, 6 Mar 2001, Roy T. Fielding wrote:
>
> > On Tue, Mar 06, 2001 at 04:54:49AM -0000, rbb@apache.org wrote:
> > > +++ configure.in 2001/03/06 04:54:49 1.256
> > > @@ -350,6 +350,13 @@
> > > dnl threaded poll() and we don't want to use sendfile on early FreeBSD
> > > dnl systems if we are also using threads.
> > >
> > > +AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off],
> > > + [ if test "$withval" = "yes"; then
> > > + sendfile="1"
> > > + else
> > > + sendfile="0"
> > > + fi ] )
> > > +
> >
> > This seems to say that --with-sendfile means --without-sendfile. I think
> > that --with options should always default to "yes" if no =value is given.
> > Otherwise, the option should be --disable-sendfile.
>
> The way that autoconf works, by using AC_ARG_WITH, we get multiple
> options:
>
> --with-sendfile=yes
> --with-sendfile
> --with-sendfile=no
> --without-sendfile
>
> The first two are the same, as are the last two.
>
> The logic in that file makes --with-sendfile force sendfile to be on, and
> --without-sendfile to force it to be off.
>
> Ryan
>
> _______________________________________________________________________________
> Ryan Bloom rbb@apache.org
> 406 29th St.
> San Francisco, CA 94131
> -------------------------------------------------------------------------------
--
Greg Stein, http://www.lyra.org/
Re: cvs commit: apr CHANGES configure.in
Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> The way that autoconf works, by using AC_ARG_WITH, we get multiple
> options:
>
> --with-sendfile=yes
> --with-sendfile
> --with-sendfile=no
> --without-sendfile
Oh, I see it now -- the option parser for configure adds a value of "yes"
if the with value is not given, and adds a value of "no" if a without
value is not given, so the macro doesn't need to worry about it at all.
Never mind.
....Roy
Re: cvs commit: apr CHANGES configure.in
Posted by rb...@covalent.net.
On Tue, 6 Mar 2001, Roy T. Fielding wrote:
> On Tue, Mar 06, 2001 at 04:54:49AM -0000, rbb@apache.org wrote:
> > +++ configure.in 2001/03/06 04:54:49 1.256
> > @@ -350,6 +350,13 @@
> > dnl threaded poll() and we don't want to use sendfile on early FreeBSD
> > dnl systems if we are also using threads.
> >
> > +AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off],
> > + [ if test "$withval" = "yes"; then
> > + sendfile="1"
> > + else
> > + sendfile="0"
> > + fi ] )
> > +
>
> This seems to say that --with-sendfile means --without-sendfile. I think
> that --with options should always default to "yes" if no =value is given.
> Otherwise, the option should be --disable-sendfile.
The way that autoconf works, by using AC_ARG_WITH, we get multiple
options:
--with-sendfile=yes
--with-sendfile
--with-sendfile=no
--without-sendfile
The first two are the same, as are the last two.
The logic in that file makes --with-sendfile force sendfile to be on, and
--without-sendfile to force it to be off.
Ryan
_______________________________________________________________________________
Ryan Bloom rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------