Summary: | DBUS_VERSION_STRING not defined (on Windows with CMake/MSVC) | ||
---|---|---|---|
Product: | dbus | Reporter: | rony <rony> |
Component: | core | Assignee: | Ralf Habacker <ralf.habacker> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | normal | ||
Priority: | medium | CC: | hp, ralf.habacker, smcv |
Version: | 1.4.x | Keywords: | patch |
Hardware: | All | ||
OS: | All | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 41033 | ||
Attachments: | cmake fix: install version string |
Description
rony
2011-09-15 02:39:08 UTC
How are you building D-Bus on each platform you mention? This might be a bug in the CMake build-system, rather than in the Windows port as such. The Windows version was built with cmake using the MS compiler set. Is there anything I can upload that would help you? If so, please advise. cmake fetches version numbers from <source-root>/configure.ac by using the following code (from cmake/CMakeLists.txt): ######################################################################### # detect version ######################################################################### file (READ ../configure.ac configure_ac) string (REGEX REPLACE ".*dbus_major_version], .([0-9]+).*" "\\1" DBUS_MAJOR_VERSION ${configure_ac}) string (REGEX REPLACE ".*dbus_minor_version], .([0-9]+).*" "\\1" DBUS_MINOR_VERSION ${configure_ac}) string (REGEX REPLACE ".*dbus_micro_version], .([0-9]+).*" "\\1" DBUS_MICRO_VERSION ${configure_ac}) # used by file version info set (DBUS_PATCH_VERSION "0") set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION}) set (DBUS_VERSION_STRING "${DBUS_VERSION}") .... The resulting DBUS_VERSION_STRING define is placed into <build-root>\config.h as shown below: ... /* Version number of package */ #define DBUS_MAJOR_VERSION 1 #define DBUS_MINOR_VERSION 5 #define DBUS_MICRO_VERSION 7 #define DBUS_VERSION ((1 << 16) | (5 << 8) | (7)) #define DBUS_VERSION_STRING "1.5.7" /* #undef DBUS_ENABLE_STATS */ The only possible error case could be that the sources do not contain configure.ac, which is not supported BTW: A fresh compile with git master using vc90 and cmake 2.8.3 do not show any problems. cmake fetches version numbers from <source-root>/configure.ac by using the following code (from cmake/CMakeLists.txt): ######################################################################### # detect version ######################################################################### file (READ ../configure.ac configure_ac) string (REGEX REPLACE ".*dbus_major_version], .([0-9]+).*" "\\1" DBUS_MAJOR_VERSION ${configure_ac}) string (REGEX REPLACE ".*dbus_minor_version], .([0-9]+).*" "\\1" DBUS_MINOR_VERSION ${configure_ac}) string (REGEX REPLACE ".*dbus_micro_version], .([0-9]+).*" "\\1" DBUS_MICRO_VERSION ${configure_ac}) # used by file version info set (DBUS_PATCH_VERSION "0") set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION}) set (DBUS_VERSION_STRING "${DBUS_VERSION}") .... The resulting DBUS_VERSION_STRING define is placed into <build-root>\config.h as shown below: ... /* Version number of package */ #define DBUS_MAJOR_VERSION 1 #define DBUS_MINOR_VERSION 5 #define DBUS_MICRO_VERSION 7 #define DBUS_VERSION ((1 << 16) | (5 << 8) | (7)) #define DBUS_VERSION_STRING "1.5.7" /* #undef DBUS_ENABLE_STATS */ The only possible error case could be that the sources do not contain configure.ac, which is not supported BTW: A fresh compile with git master using vc90 and cmake 2.8.3 do not show any problems. Ralf, your comments are correct. *However*, config.h is not included when building an application that wishes to include the version of D-Bus as available at compile time (referring to the DBUS_VERSION_STRING definition). For D-Bus applications the installed D-Bus include files get used and in those, there is no DBUS_VERSION_STRING defined. Here the list of include files that got installed after successfully building D-Bus for 32-bit Windows on XP in the target-dir "%ProgramFiles%\dbus\dbus\include" (after running "nmake install"): ------------------ cut here --------------------- 19.09.2011 17:25 2.135 dbus-address.h 19.09.2011 20:51 1.775 dbus-arch-deps.h 19.09.2011 17:25 3.472 dbus-bus.h 19.09.2011 17:25 25.953 dbus-connection.h 19.09.2011 17:25 2.886 dbus-errors.h 19.09.2011 17:25 4.881 dbus-macros.h 19.09.2011 17:25 1.975 dbus-memory.h 19.09.2011 17:25 13.049 dbus-message.h 19.09.2011 17:25 1.609 dbus-misc.h 19.09.2011 17:25 3.124 dbus-pending-call.h 19.09.2011 17:25 23.178 dbus-protocol.h 19.09.2011 17:25 4.794 dbus-server.h 19.09.2011 17:25 5.135 dbus-shared.h 19.09.2011 17:25 3.049 dbus-signature.h 19.09.2011 17:25 9.004 dbus-threads.h 19.09.2011 17:25 3.635 dbus-types.h 19.09.2011 17:25 3.925 dbus.h ------------------ cut here --------------------- It seems that except of "dbus-arch-deps.h" all include files stem from the git master and remained unchanged. Upon further investigation (and comparing with the Linux builds) the Windows version of "dbus-arch-deps.h" is missing the definition of "DBUS_VERSION_STRING", hence it cannot be picked up on Windows at compile time. --- Cf. <source-root>/dbus-arch-deps.h.in: dbus-arch-deps.h.in:#define DBUS_VERSION_STRING "@DBUS_VERSION@" (On Linux "dbus-arch-deps.h" contains the line dbus-arch-deps.h:#define DBUS_VERSION_STRING "1.5.7") (In reply to comment #5) > Upon further investigation (and comparing with the Linux builds) the Windows > version of "dbus-arch-deps.h" is missing the definition of > "DBUS_VERSION_STRING", hence it cannot be picked up on Windows at compile time. Then this is an installation problem - i will take a look into. Created attachment 51386 [details] [review] cmake fix: install version string The appended patch should fix the issue (In reply to comment #7) > Created an attachment (id=51386) > cmake fix: install version string > > The appended patch should fix the issue Looks right, please commit (to dbus-1.4 and merge to master). This is in fact not Windows-specific: it's an equally valid bug when using CMake on Unix. It'd be good to get rid of the other divergence between dbus/dbus-arch-deps.h.in and cmake/dbus/dbus-arch-deps.h.cmake, which are remarkably similar; ideally, both build systems could work from dbus/dbus-arch-deps.h.in by using the same @THING@ substitutions. I'll open a bug for that. commited and bug closed |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.