Hi,

I resolved the issue regarding the compile failure of the dbus-python
part in SUNWdbus-bindings.
The problem is two sided and the explanation is below. Please review
the patches.

   - When configure checks if the compiler understands -std=9x
-no-strict-aliasing, cc throws a warning about illegal flags but
produces an executable binary. Configure takes this as the compiler
understanding the -std=9x and -fno-strict-aliasing flags. On compile
stage these warnings result in a non zero exit, which is interpreted
as failure.

Patch 1 resolves the usage of the two incompatible compiler flags.


   - During configure stage, the configure script checks for the
Python version by means of executing /usr/bin/python, which is the 2.4
binary. In a later stage, configure uses python-config to check which
flags to add to the compiler for the Python includues. Since the
vanilla Python 2.4 binaries and source do not provide python-config
but Python 2.5 does, the wrong flags get added, resulting in errors
during the compile stage. Therefor configure should not use
python-config but get the correct CFLAGS from the usuer.

Patch 2 and Diff 1 are needed to resolve this.



Patch1:
--- dbus-python-0.83.0/configure.ac.old 2008-09-14 16:57:13.605507082 +0200
+++ dbus-python-0.83.0/configure.ac     2008-09-14 16:57:28.767537939 +0200
@@ -151,12 +151,10 @@
 JH_ADD_CFLAG([-Wshadow])
 JH_ADD_CFLAG([-Wstrict-prototypes])
 JH_ADD_CFLAG([-Wmissing-prototypes])
 JH_ADD_CFLAG([-Wmissing-declarations])
 JH_ADD_CFLAG([-Wdeprecated-declarations])
-JH_ADD_CFLAG([-std=c9x])
-JH_ADD_CFLAG([-fno-strict-aliasing])

 AC_ARG_ENABLE(Werror,
 AC_HELP_STRING([--enable-Werror],
                [Treat warnings as errors, if the compiler supports it]),
 enable_Werror=$enableval, enable_Werror=no)



Patch2:
--- dbus-python-0.83.0/configure.ac.old 2008-09-14 16:57:13.605507082 +0200
+++ dbus-python-0.83.0/configure.ac     2008-09-14 16:58:50.623426362 +0200
@@ -44,12 +44,10 @@

 AC_PROG_LIBTOOL

 AM_PATH_PYTHON(2.4.0)

-AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
-
 PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"`
 AC_SUBST(PLATFORM)

 dnl Building documentation



Diff1:
===================================================================
--- dbus-python.spec    (revision 15406)
+++ dbus-python.spec    (working copy)
@@ -24,6 +24,8 @@
 Docdir:              %{_defaultdocdir}/doc
 Autoreqprov:  on
 Prereq:       /sbin/ldconfig
+Patch1:       dbuspython-01-fix-incompatible-cc-flags.diff
+Patch2:              dbuspython-02-fix-wrong-python25-includes.diff

 %define python_version 2.4
 BuildRequires: glib2-devel >= %glib2_version
@@ -46,12 +48,14 @@

 %prep
 %setup -q
+%patch1 -p1
+%patch2 -p1

 %build
 aclocal $ACLOCAL_FLAGS -I ./m4
 autoconf
 automake -a -c -f
-export CFLAGS="%optflags -D_REENTRANT"
+export CFLAGS="%optflags -D_REENTRANT -I/usr/include/python2.4"
 export LDFLAGS="%_ldflags"
 ./configure --prefix=%{_prefix}                        \
             --includedir=%{_includedir}





--
Patrick

Reply via email to