Discussion:
enable/disable configure options for subpackages
Bob Rossi
2005-07-14 13:50:08 UTC
Permalink
Hi,

Sorry for all the questions lately, it's just, some of them I don't see
an easy answer for in the manual. If there is an easy answer to this
question, maybe I'll append a small example to the manual.

I already use, AC_CONFIG_SUBDIRS to configure the readline subpackage.
However, by default the readline library builds both shared and static
libraries.
--enable-shared build shared libraries [default=YES]
--enable-static build static libraries [default=YES]

I know that when I am building the readline library, I only want the
static libraries. Is there a way to pass in --disable-shared to the
AC_CONFIG_SUBDIRS?

BTW, CGDB currently doesn't use any shared libraries, so if there is a
global setting I can use, that would currently be fine.

Thanks again,
Bob Rossi
Bob Friesenhahn
2005-07-14 14:48:25 UTC
Permalink
Post by Bob Rossi
I already use, AC_CONFIG_SUBDIRS to configure the readline subpackage.
However, by default the readline library builds both shared and static
libraries.
--enable-shared build shared libraries [default=YES]
--enable-static build static libraries [default=YES]
I know that when I am building the readline library, I only want the
static libraries. Is there a way to pass in --disable-shared to the
AC_CONFIG_SUBDIRS?
I am not aware of any standard way since everything sees the same
configuration. However, if you are using Automake, you can duplicate
the Makefile line that runs libtool and add a libtool option to
disable building shared libraries when libtool is executed.

Bob
======================================
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Stepan Kasal
2005-07-14 14:57:06 UTC
Permalink
Hello,
Is there a way to pass in --disable-shared to the AC_CONFIG_SUBDIRS?
I looked into the source (status.m4, general.m4), and it seems that all --enable-*
arguments are propagated to the subconfigures.

Thus --disable-shared should be propagated automatically. Have you tried it?

(If your configure.ac doesn't declare an enable option, the generated configure script
will silently ignore it; try ./configure --enable-foo=bar.)
BTW, CGDB currently doesn't use any shared libraries,
Yes, that helps here.

Have a nice day,
Stepan Kasal
Bob Friesenhahn
2005-07-14 15:16:28 UTC
Permalink
Post by Stepan Kasal
Hello,
Is there a way to pass in --disable-shared to the AC_CONFIG_SUBDIRS?
I looked into the source (status.m4, general.m4), and it seems that all --enable-*
arguments are propagated to the subconfigures.
Thus --disable-shared should be propagated automatically. Have you tried it?
He is trying to build one subdirectory using different configure
options from the others. With your advice, --disable-shared would be
provided to the whole build, so that shared libraries can't be used
elsewhere.

Bob
======================================
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Bob Rossi
2005-07-14 19:36:48 UTC
Permalink
Post by Stepan Kasal
Hello,
Is there a way to pass in --disable-shared to the AC_CONFIG_SUBDIRS?
I looked into the source (status.m4, general.m4), and it seems that all --enable-*
arguments are propagated to the subconfigures.
Thus --disable-shared should be propagated automatically. Have you tried it?
(If your configure.ac doesn't declare an enable option, the generated configure script
will silently ignore it; try ./configure --enable-foo=bar.)
If I do ./configure --disable-shared on CGDB's configure script then
readline also get's that information and will not build the shared
libraries.

Now I somehow need to make configure think I was invoked this way.
So that readline get's invoked this way. Is there some global I can set
in the CGDB configure.in, or macro to call, to set the option internally?

Thanks,
Bob Rossi
Stepan Kasal
2005-07-15 10:14:44 UTC
Permalink
Hello,
Is there a way to pass in --disable-shared to the AC_CONFIG_SUBDIRS?
I apologize for the wrong answer I gave previously.

No, I don't know about any such solution.

Of course some hacks are possible:
1) fiddle with ac_args before AC_OUTPUT.
Of course this solution may easily break with future versions of autoconf.

2) Read what AC_CONFIG_SUBDIRS does (how it propagates the arguments), and
do the same in configure.ac

3) Simply call the embedded configure, and add features from
AC_CONFIG_SUBDIRS only when someone asks for it.

All these advices are obvious, I know...

Stepan


Stepan
Bob Rossi
2005-07-27 00:55:30 UTC
Permalink
Post by Stepan Kasal
Hello,
Is there a way to pass in --disable-shared to the AC_CONFIG_SUBDIRS?
I apologize for the wrong answer I gave previously.
No, I don't know about any such solution.
1) fiddle with ac_args before AC_OUTPUT.
Of course this solution may easily break with future versions of autoconf.
2) Read what AC_CONFIG_SUBDIRS does (how it propagates the arguments), and
do the same in configure.ac
3) Simply call the embedded configure, and add features from
AC_CONFIG_SUBDIRS only when someone asks for it.
All these advices are obvious, I know...
These answers are all very helpful. However, I'm wondering if there is a
simple way of sending the --disable-shared option to AC_CONFIG_SUBDIRS
in a way that will be good with future versions of autoconf.

Just wondering if this feature is supported by autoconf? Does autoconf
only pass the explicit arguments down to the lower confurations? or if I
have a --enable-shared=no defaulted option, would that work?

Thanks,
Bob Rossi
Stepan Kasal
2005-07-27 07:55:11 UTC
Permalink
Hello,
Post by Bob Rossi
Does autoconf
only pass the explicit arguments down to the lower confurations? or if I
have a --enable-shared=no defaulted option, would that work?
it passes the options as they were given on the cmdline.
So if you don't give an option explicitely, a subconfigure can have
different default than the upper package.
Post by Bob Rossi
Post by Stepan Kasal
1) fiddle with ac_args before AC_OUTPUT.
Of course this solution may easily break with future versions of autoconf.
2) Read what AC_CONFIG_SUBDIRS does (how it propagates the arguments), and
do the same in configure.ac
3) Simply call the embedded configure, and add features from
AC_CONFIG_SUBDIRS only when someone asks for it.
...
Post by Bob Rossi
These answers are all very helpful. However, I'm wondering if there is a
simple way of sending the --disable-shared option to AC_CONFIG_SUBDIRS
in a way that will be good with future versions of autoconf.
I don't know about any documented way. Any of the above options can be simple.
Post by Bob Rossi
Just wondering if this feature is supported by autoconf?
That's the hard part.
No, I don't think this is available from documented options.
Autoconf and, more importantly, its documentation would have to be enhanced
to support this. Do you feel like writing a patch to this effect?

But a simple hack is much simpler.

And remember, the developpers run autoconf to build the tarball. The users
should just build from this tarball, without any need for Autotools installed.
So it doesn't mind _that_ much if you are not portabale to other versions of
Autoconf.

Have a nice day,
Stepan
Bob Rossi
2005-07-28 01:05:11 UTC
Permalink
Post by Stepan Kasal
Post by Bob Rossi
Post by Stepan Kasal
1) fiddle with ac_args before AC_OUTPUT.
Of course this solution may easily break with future versions of autoconf.
2) Read what AC_CONFIG_SUBDIRS does (how it propagates the arguments), and
do the same in configure.ac
3) Simply call the embedded configure, and add features from
AC_CONFIG_SUBDIRS only when someone asks for it.
...
Post by Bob Rossi
These answers are all very helpful. However, I'm wondering if there is a
simple way of sending the --disable-shared option to AC_CONFIG_SUBDIRS
in a way that will be good with future versions of autoconf.
I don't know about any documented way. Any of the above options can be simple.
Post by Bob Rossi
Just wondering if this feature is supported by autoconf?
That's the hard part.
No, I don't think this is available from documented options.
Autoconf and, more importantly, its documentation would have to be enhanced
to support this. Do you feel like writing a patch to this effect?
But a simple hack is much simpler.
Well, I modified the configure script that came with readline to set the
default for shared libs to be NULL. This solves my problem. However, if
you could guide me in a general purpose way, I would not mind adding a
feature like this to autoconf.
Post by Stepan Kasal
And remember, the developpers run autoconf to build the tarball. The users
should just build from this tarball, without any need for Autotools installed.
So it doesn't mind _that_ much if you are not portabale to other versions of
Autoconf.
Yeah, this goes double for me, since I put the autoconf files in CVS.

Thanks for all your help,
Bob Rossi

Loading...