GNOME Bugzilla – Bug 693328
Difficult to compile due to unexpected errors
Last modified: 2013-02-14 06:51:10 UTC
For users or developers not really used to autoconf and Gnome development infrastructure, compiling pygobject is sometimes a bit daunting. I'm running on bd54b8ab30fc957849e7f57e9ee4c4b41aa37013 at the moment (Debian sid). If the (newly added) gnome-common package is not present, configure fails with the following message: checking whether to enable threading in pygobject... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.16... yes checking for GLIB - version >= 2.34.2... yes (version 2.34.3) checking for ffi... checking for FFI... yes checking for GIO... yes checking for GI... yes checking for CAIRO... yes checking for PYCAIRO... yes ./configure: line 14196: syntax error near unexpected token `maximum' ./configure: line 14196: `GNOME_COMPILE_WARNINGS(maximum)' which looks like there's something wrong in the generated configure script. Hopefully, the change is correctly present in the NEWS file, but it would have been helpful to have a better error message, or just to skip the configuration setting if gnome-common is not present (it doesn't seem to be required anyway, is it?) Passing this error, configure reaches the end with the following output (from the beginning of ./autogen.sh to the end of ./configure): lcov not installed, not enabling code coverage autoreconf: Entering directory `.' [...] checking whether gcc understands -Wno-sign-compare... yes checking what warning flags to pass to the C compiler... -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare checking what language compliance flags to pass to the C compiler... ./configure: line 14308: GNOME_CODE_COVERAGE: command not found checking whether gcc understands -Wall... yes [...] config.status: executing depfiles commands config.status: executing libtool commands pygobject 3.7.6 Using python interpreter: /usr/bin/python3 libffi support: yes cairo support: yes thread support: yes code coverage support: So, no coverage, but there's still an error, although it keeps running. Then, running make fails with the following: $ make Makefile:1060: *** missing separator. Stop. $ Which is due to the presence of "@GNOME_CODE_COVERAGE_RULES@" line 1060. So removing this allows make to do its job and everything's fine. My knowledge of autoconf sucks badly, but is there a way to make things easier for newcomers? Thanks.
For the record, this is not affecting the official release tarballs, as they contain the pre-generated autoconf stuff. This only affects you when you build from git with ./autogen.sh. I'll make it so that autogen.sh bails out with a proper error message if gnome-common isn't installed.
Fixed in master: http://git.gnome.org/browse/pygobject/commit/?id=2384769810a61d6ed08d8742b7ae976ebfaa8cb5
There's also the problem about something related to Gnome and Coverage in the second part of this bug report. I still have this "@GNOME_CODE_COVERAGE_RULES@" line in my Makefile, if I remove it, it builds fine, and I don't have any clue how to get rid of this beside doing a sed at the end of ./configure ...
(In reply to comment #3) > I still have this "@GNOME_CODE_COVERAGE_RULES@" line in my Makefile Perhaps your Makefiles are stale from the older build? Try "git clean -fdx", and re-run ./autogen.sh.
I did use "git clean -fdx" and regenerates the build files, but I still have this line, along with: ./configure: line 14308: GNOME_CODE_COVERAGE: command not found during the ./configure phase.
So I guess your gnome-common version is too old? Which version are you using? It's not easy to detect that in autogen.sh, as gnome-common has no builtin version information. Perhaps it has some way to check features like GNOME_CODE_COVERAGE, but I don't know about them. Does anyone else? If there isn't, I'd just like to close this again, as there is not that much that we can do.
Ok, so this is something which is coming with gnome-common 3.6 (I upgraded my package from Debian Sid to the one in Debian experimental). However, something along this way allows to build with gnome-common 3.4 without the error message: diff --git a/configure.ac b/configure.ac index 9b7a72e..3d54366 100644 --- a/configure.ac +++ b/configure.ac @@ -228,7 +228,15 @@ AC_SUBST(INTROSPECTION_COMPILER) # compiler warnings, errors, required cflags, and code coverage support GNOME_COMPILE_WARNINGS([maximum]) -GNOME_CODE_COVERAGE +AC_MSG_CHECKING(for Gnome code coverage support) +m4_ifdef([GNOME_CODE_COVERAGE], + [AC_MSG_RESULT(yes) + GNOME_CODE_COVERAGE], + [AC_MSG_RESULT(no) + GNOME_CODE_COVERAGE_RULES='' + AC_SUBST([GNOME_CODE_COVERAGE_RULES]) + enable_code_coverage="no"] + ) if test "x$GCC" = "xyes"; then JH_ADD_CFLAG([-Wall]) JH_ADD_CFLAG([-Werror=unused-variable]) I agree it's kind of ugly, so, if there's no better ways to do it, I guess you can close this then.
Splendid, thank you! I committed that: http://git.gnome.org/browse/pygobject/commit/?id=f6d4d2da676ae63d7a24dd172775b488ce665fe4