[libvirt] [PATCH] let "configure --disable-shared" work once again

Per this thread: http://thread.gmane.org/gmane.comp.emulators.libvirt/19672 here's a patch that solves both problems:
From 1b330b3070f904dfc1c380151afa3aaf2a121cd3 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Thu, 7 Jan 2010 21:07:42 +0100 Subject: [PATCH] let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would evoke a "can not build a shared library" failure for libvirtmod.la. However, without the -shared link option in python/Makefile.am, it was possible to install non-functional python support. Instead, make --disable-shared also disable building python. * configure.ac: Make --disable-shared imply --without-python and silently override --with-python. * python/Makefile.am (libvirtmod_la_LDFLAGS): Do not use -shared. This reverts 8838ee39ab1c2bb7fffe93bfda220692664e8be6. --- configure.in | 4 ++++ python/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 3f2f8ff..3e98035 100644 --- a/configure.in +++ b/configure.in @@ -1813,6 +1813,10 @@ AC_ARG_WITH([qemu-group], AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) +if test "$enable_shared:$with_python" = no:yes; then + AC_MSG_WARN([you've used --disable-shared; so disabling python support]) + with_python=no +fi # Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball. diff --git a/python/Makefile.am b/python/Makefile.am index 58c6729..04342b7 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -39,7 +39,7 @@ libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c libvirt.c libvirt.h # need extra flags here libvirtmod_la_CFLAGS = @WARN_PYTHON_CFLAGS@ -libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \ +libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \ @CYGWIN_EXTRA_LDFLAGS@ libvirtmod_la_LIBADD = $(mylibs) \ @CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@ -- 1.6.6.425.g4dc2d

On Fri, Jan 08, 2010 at 09:05:25AM +0100, Jim Meyering wrote:
Per this thread:
http://thread.gmane.org/gmane.comp.emulators.libvirt/19672
here's a patch that solves both problems:
From 1b330b3070f904dfc1c380151afa3aaf2a121cd3 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Thu, 7 Jan 2010 21:07:42 +0100 Subject: [PATCH] let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would evoke a "can not build a shared library" failure for libvirtmod.la. However, without the -shared link option in python/Makefile.am, it was possible to install non-functional python support. Instead, make --disable-shared also disable building python.
* configure.ac: Make --disable-shared imply --without-python and
configure.in actually
silently override --with-python.
Looks fine
* python/Makefile.am (libvirtmod_la_LDFLAGS): Do not use -shared. This reverts 8838ee39ab1c2bb7fffe93bfda220692664e8be6.
I still don't understand why this need to be reverted. With the configure.in change, then ./autogen.sh --disable-shared && make should not try to build the python shared lib
configure.in | 4 ++++ python/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3f2f8ff..3e98035 100644 --- a/configure.in +++ b/configure.in @@ -1813,6 +1813,10 @@ AC_ARG_WITH([qemu-group], AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
+if test "$enable_shared:$with_python" = no:yes; then + AC_MSG_WARN([you've used --disable-shared; so disabling python support]) + with_python=no +fi
# Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball.
Seems to me just that part is sufficient, no ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel Veillard wrote:
On Fri, Jan 08, 2010 at 09:05:25AM +0100, Jim Meyering wrote:
Per this thread:
http://thread.gmane.org/gmane.comp.emulators.libvirt/19672
here's a patch that solves both problems:
From 1b330b3070f904dfc1c380151afa3aaf2a121cd3 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Thu, 7 Jan 2010 21:07:42 +0100 Subject: [PATCH] let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would evoke a "can not build a shared library" failure for libvirtmod.la. However, without the -shared link option in python/Makefile.am, it was possible to install non-functional python support. Instead, make --disable-shared also disable building python.
* configure.ac: Make --disable-shared imply --without-python and
configure.in actually
silently override --with-python.
Looks fine
* python/Makefile.am (libvirtmod_la_LDFLAGS): Do not use -shared. This reverts 8838ee39ab1c2bb7fffe93bfda220692664e8be6.
I still don't understand why this need to be reverted. With the configure.in change, then ./autogen.sh --disable-shared && make should not try to build the python shared lib
Using -shared in python/ would now be a little misleading, since it's useful only when building with --disable-shared, and python/ is no longer built with --disable-shared. Technically, it need not be reverted, but reverting it is fine, and imho, slightly better, since using -shared there merely encodes the current limitation that statically-linked python libraries are useless. We've already done that via configure, so if ever it's relaxed, there's only one place to modify.

Il giorno ven, 08/01/2010 alle 12.12 +0100, Jim Meyering ha scritto:
Using -shared in python/ would now be a little misleading, since it's useful only when building with --disable-shared, and python/ is no longer built with --disable-shared.
Not at all. It was needed to avoid building the static archive.
Technically, it need not be reverted, but reverting it is fine, and imho, slightly better, since using -shared there merely encodes the current limitation that statically-linked python libraries are useless. We've already done that via configure, so if ever it's relaxed, there's only one place to modify.
Again, no, in the configure you avoid the configuration case where you disable shared and want python. The -shared option tells you *not to build a static copy of that module* since it makes no sense. Please refer to my original link about the option itself: http://www.flameeyes.eu/autotools-mythbuster/libtool/index.html#libtool.plug... -- Diego Elio Pettenò — “Flameeyes” http://blog.flameeyes.eu/ If you found a .asc file in this mail and know not what it is, it's a GnuPG digital signature: http://www.gnupg.org/

Diego Elio “Flameeyes” Pettenò wrote:
Il giorno ven, 08/01/2010 alle 12.12 +0100, Jim Meyering ha scritto:
Using -shared in python/ would now be a little misleading, since it's useful only when building with --disable-shared, and python/ is no longer built with --disable-shared.
Not at all. It was needed to avoid building the static archive.
Oh, I see what you mean, finally. I had read only the first description of -shared in libtool documentation, and hadn't realized that was only for *compile mode*. There's a slightly different description following that, in the *link mode* options section. Thanks for persevering. Here's the revised patch.
From 25dd0609205b28d8ffc2b07873b8abb75f39f2d9 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Thu, 7 Jan 2010 21:07:42 +0100 Subject: [PATCH] let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would evoke a "can not build a shared library" failure for libvirtmod.la due to the new use of libtool's -shared link option in python/Makefile.am. Now, --disable-shared also disables building python. * configure.in: Make --disable-shared imply --without-python and silently override --with-python. --- configure.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index 3f2f8ff..3e98035 100644 --- a/configure.in +++ b/configure.in @@ -1813,6 +1813,10 @@ AC_ARG_WITH([qemu-group], AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) +if test "$enable_shared:$with_python" = no:yes; then + AC_MSG_WARN([you've used --disable-shared; so disabling python support]) + with_python=no +fi # Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball. -- 1.6.6.425.g4dc2d

Il giorno ven, 08/01/2010 alle 12.44 +0100, Jim Meyering ha scritto:
Oh, I see what you mean, finally. I had read only the first description of -shared in libtool documentation, and hadn't realized that was only for *compile mode*. There's a slightly different description following that, in the *link mode* options section.
We all love libtool's black magic and vague documentation ;)
Thanks for persevering. Here's the revised patch.
If you see I should have sent one some less than an hour ago moving the check further up in the file, so that it does not even spend time to check for Python before disabling it (faster ./configure is a win). -- Diego Elio Pettenò — “Flameeyes” http://blog.flameeyes.eu/ If you found a .asc file in this mail and know not what it is, it's a GnuPG digital signature: http://www.gnupg.org/

On Fri, Jan 08, 2010 at 12:44:49PM +0100, Jim Meyering wrote:
Diego Elio “Flameeyes” Pettenò wrote:
Il giorno ven, 08/01/2010 alle 12.12 +0100, Jim Meyering ha scritto:
Using -shared in python/ would now be a little misleading, since it's useful only when building with --disable-shared, and python/ is no longer built with --disable-shared.
Not at all. It was needed to avoid building the static archive.
Oh, I see what you mean, finally. I had read only the first description of -shared in libtool documentation, and hadn't realized that was only for *compile mode*. There's a slightly different description following that, in the *link mode* options section.
Thanks for persevering. Here's the revised patch.
From 25dd0609205b28d8ffc2b07873b8abb75f39f2d9 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Thu, 7 Jan 2010 21:07:42 +0100 Subject: [PATCH] let "configure --disable-shared" work once again
Without this change, ./autogen.sh --disable-shared && make would evoke a "can not build a shared library" failure for libvirtmod.la due to the new use of libtool's -shared link option in python/Makefile.am. Now, --disable-shared also disables building python.
* configure.in: Make --disable-shared imply --without-python and silently override --with-python. --- configure.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/configure.in b/configure.in index 3f2f8ff..3e98035 100644 --- a/configure.in +++ b/configure.in @@ -1813,6 +1813,10 @@ AC_ARG_WITH([qemu-group], AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
+if test "$enable_shared:$with_python" = no:yes; then + AC_MSG_WARN([you've used --disable-shared; so disabling python support]) + with_python=no +fi
# Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball.
Sure, ACK :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel Veillard wrote: ...
Sure, ACK :-)
Thanks. Diego proposed an improvement, so I expect to push this instead: http://thread.gmane.org/gmane.comp.emulators.libvirt/19696/focus=19710

Il giorno ven, 08/01/2010 alle 09.05 +0100, Jim Meyering ha scritto:
* python/Makefile.am (libvirtmod_la_LDFLAGS): Do not use -shared. This reverts 8838ee39ab1c2bb7fffe93bfda220692664e8be6.
Not really necessary at this point. -- Diego Elio Pettenò — “Flameeyes” http://blog.flameeyes.eu/ If you found a .asc file in this mail and know not what it is, it's a GnuPG digital signature: http://www.gnupg.org/
participants (3)
-
Daniel Veillard
-
Diego Elio “Flameeyes” Pettenò
-
Jim Meyering