[libvirt] [libvirt-php][PATCH 0/4] Fix build again

There were some problems with my build fixes. Hopefully, these will make it work for everybody again. Michal Privoznik (4): Get php cflags at configure Get rid of $DEFINES src: Distribute config.m4 libvirt-php.so: Avoid versioning library configure.ac | 5 +++++ src/Makefile.am | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) -- 2.7.3

Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- configure.ac | 5 +++++ src/Makefile.am | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7a634ca..2d05465 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,11 @@ if test "x$PHPIZE" = "xno"; then AC_MSG_ERROR([phpize not found; please install the PHP SDK]) fi +PHP_CFLAGS=$($PHPCONFIG --includes) +PHP_LDFLAGS=$($PHPCONFIG --ldflags) +AC_SUBST(PHP_CFLAGS) +AC_SUBST(PHP_LDFLAGS) + LIBVIRT_CHECK_PHP_EXTENSIONDIR LIBVIRT_CHECK_PHP_CONFDIR diff --git a/src/Makefile.am b/src/Makefile.am index 05ae534..d988a32 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,15 +1,15 @@ -PHPINC=$(shell $(PHPCONFIG) --includes) DEFINES=-DHAVE_CONFIG_H WL=@WL@ SHLIB_FLAGS=@SHLIB_FLAGS@ AM_CFLAGS = \ - $(PHPINC) $(LIBXML_CFLAGS) \ + $(PHP_CFLAGS) $(LIBXML_CFLAGS) \ $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) $(DEFINES) \ -I$(top_srcdir)/winsrc AM_LDFLAGS = \ $(SHLIB_LDFLAGS) \ + $(PHP_LDFLAGS) \ $(LIBXML_LIBS) \ $(LIBVIRT_LIBS) \ $(QEMU_LIBS) -- 2.7.3

Looks good here. On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- configure.ac | 5 +++++ src/Makefile.am | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac index 7a634ca..2d05465 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,11 @@ if test "x$PHPIZE" = "xno"; then AC_MSG_ERROR([phpize not found; please install the PHP SDK]) fi
+PHP_CFLAGS=$($PHPCONFIG --includes) +PHP_LDFLAGS=$($PHPCONFIG --ldflags) +AC_SUBST(PHP_CFLAGS) +AC_SUBST(PHP_LDFLAGS) + LIBVIRT_CHECK_PHP_EXTENSIONDIR LIBVIRT_CHECK_PHP_CONFDIR
diff --git a/src/Makefile.am b/src/Makefile.am index 05ae534..d988a32 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,15 +1,15 @@ -PHPINC=$(shell $(PHPCONFIG) --includes) DEFINES=-DHAVE_CONFIG_H WL=@WL@ SHLIB_FLAGS=@SHLIB_FLAGS@
AM_CFLAGS = \ - $(PHPINC) $(LIBXML_CFLAGS) \ + $(PHP_CFLAGS) $(LIBXML_CFLAGS) \ $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) $(DEFINES) \ -I$(top_srcdir)/winsrc
AM_LDFLAGS = \ $(SHLIB_LDFLAGS) \ + $(PHP_LDFLAGS) \ $(LIBXML_LIBS) \ $(LIBVIRT_LIBS) \ $(QEMU_LIBS) -- 2.7.3
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- 真実はいつも一つ!/ Always, there's only one truth!

This variable only defines -DHAVE_CONFIG_H which is defined by libtool anyway. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index d988a32..15a4ac4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,9 @@ -DEFINES=-DHAVE_CONFIG_H WL=@WL@ SHLIB_FLAGS=@SHLIB_FLAGS@ AM_CFLAGS = \ $(PHP_CFLAGS) $(LIBXML_CFLAGS) \ - $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) $(DEFINES) \ + $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) \ -I$(top_srcdir)/winsrc AM_LDFLAGS = \ -- 2.7.3

On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
This variable only defines -DHAVE_CONFIG_H which is defined by libtool anyway.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index d988a32..15a4ac4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,9 @@ -DEFINES=-DHAVE_CONFIG_H WL=@WL@ SHLIB_FLAGS=@SHLIB_FLAGS@
AM_CFLAGS = \ $(PHP_CFLAGS) $(LIBXML_CFLAGS) \ - $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) $(DEFINES) \ + $(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) \ -I$(top_srcdir)/winsrc
AM_LDFLAGS = \ -- 2.7.3
Okay for me. -- 真実はいつも一つ!/ Always, there's only one truth!

In a71cb51dd we tried to adapt to phpize (build system used by php). Unfortunately, we missed the file in EXTRA_DIST therefore while it is in git, it's not in distributed .tar.gz. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 15a4ac4..ba374c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,4 +26,5 @@ libvirt_php_la_CFLAGS = \ php_confdir = $(confdir) php_conf_DATA = libvirt-php.ini -EXTRA_DIST = $(php_conf_DATA) +EXTRA_DIST = $(php_conf_DATA) \ + config.m4 -- 2.7.3

On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
In a71cb51dd we tried to adapt to phpize (build system used by php). Unfortunately, we missed the file in EXTRA_DIST therefore while it is in git, it's not in distributed .tar.gz.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 15a4ac4..ba374c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,4 +26,5 @@ libvirt_php_la_CFLAGS = \ php_confdir = $(confdir) php_conf_DATA = libvirt-php.ini
-EXTRA_DIST = $(php_conf_DATA) +EXTRA_DIST = $(php_conf_DATA) \ + config.m4 -- 2.7.3
Yes! Thank you, that brings the file back when doing `make dist`! All good! -- 真実はいつも一つ!/ Always, there's only one truth!

This is just a plugin so there's no need to version its name like .so.X.Y.Z. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index ba374c8..182a759 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,9 @@ libvirt_php_la_SOURCES = \ libvirt_php_la_CFLAGS = \ $(AM_CFLAGS) \ -DCOMPILE_DL_LIBVIRT=1 +libvirt_php_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -module -avoid-version php_confdir = $(confdir) php_conf_DATA = libvirt-php.ini -- 2.7.3

On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
This is just a plugin so there's no need to version its name like .so.X.Y.Z.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/Makefile.am | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/Makefile.am b/src/Makefile.am index ba374c8..182a759 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,9 @@ libvirt_php_la_SOURCES = \ libvirt_php_la_CFLAGS = \ $(AM_CFLAGS) \ -DCOMPILE_DL_LIBVIRT=1 +libvirt_php_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -module -avoid-version
php_confdir = $(confdir) php_conf_DATA = libvirt-php.ini -- 2.7.3
All good here! -- 真実はいつも一つ!/ Always, there's only one truth!

On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
There were some problems with my build fixes. Hopefully, these will make it work for everybody again.
Michal Privoznik (4): Get php cflags at configure Get rid of $DEFINES src: Distribute config.m4 libvirt-php.so: Avoid versioning library
configure.ac | 5 +++++ src/Makefile.am | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-)
-- 2.7.3
The patch set works as advertised and appears to fix the issues I encountered when updating the Fedora and EPEL packages. Please apply this along with Christopher's patch to bump the required libvirt version[1] in both configure.ac and src/config.m4[2] and make a new release. [1]: https://www.redhat.com/archives/libvir-list/2016-April/msg01415.html [2]: https://www.redhat.com/archives/libvir-list/2016-April/msg01442.html -- 真実はいつも一つ!/ Always, there's only one truth!

On 21.04.2016 13:27, Neal Gompa wrote:
On Thu, Apr 21, 2016 at 5:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
There were some problems with my build fixes. Hopefully, these will make it work for everybody again.
Michal Privoznik (4): Get php cflags at configure Get rid of $DEFINES src: Distribute config.m4 libvirt-php.so: Avoid versioning library
configure.ac | 5 +++++ src/Makefile.am | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-)
-- 2.7.3
The patch set works as advertised and appears to fix the issues I encountered when updating the Fedora and EPEL packages. Please apply this along with Christopher's patch to bump the required libvirt version[1] in both configure.ac and src/config.m4[2] and make a new release.
Well, if I would do a new release, the build would certainly require some more fixes, e.g. fixing some corner cases in VPATH build. So if you want to help with that, you're welcome. Michal
participants (2)
-
Michal Privoznik
-
Neal Gompa