Bug#778025: Proposed fixes for netrek-client-cow: ftbfs with GCC-5

Thavatchai Makphaibulchoke thavatchai.makpahibulchoke at hp.com
Mon Aug 3 18:10:40 UTC 2015


I'm looking at Bug report # 778025, netrek-client-cow: ftbfs with GCC-5.

Looks like in addition to the -std=gnu89 work around in debian/rules
file, we also need -P gcc-5 preprocessor option in the configure phase
to work around the "The preprocessor started to emit line markers to
properly distinguish whether a macro token comes from a system header,
or from a normal header" issue.

I may have missed something, but omparing both the configure.in and the
configure script(which is included with the source package itself),
looks like the configure script is not generated from the configure.in,
as it should.  Here is the reason.

In configure.in file, we have

# Checking forNCS="$INCS"
SAVEINCS="$INCS $XINCLUDES"
AC_EGREP_CPP("gmp=.*2", [
  #include <gmp.h>
  gmp=__GNU_MP__
  ],AC_DEFINE(HAVE_GMP2_H))
INCS="$SAVEINCS"

Whereas the corresponding pattern in configure script does not quite
match the above ("gmp=.*2" vs "gmp=.*[02-9]") as shown here,

# Checking for GMP 2
SAVEINCS="$INCS"
INCS="$INCS $XINCLUDES"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

  #include <gmp.h>
  gmp=__GNU_MP__

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP ""gmp=.*[02-9]"" >/dev/null 2>&1; then
  cat >>confdefs.h <<\_ACEOF
#define HAVE_GMP2_H 1
_ACEOF

fi
rm -f conftest*

INCS="$SAVEINCS"

I also ran autogen.sh script.  The generated configure does not seem to
match the one comes with the source package either.

Please let me know what you think about this discrepancy.

Regardless of how the configure script is created, I propose that we fix
configure.in (not the configure script) with the patch listed below,
including the change in the above pattern,

$ diff -urN configure.in.orig configure.in
--- configure.in.orig	2009-06-16 11:14:39.000000000 +0000
+++ configure.in	2015-07-28 23:03:36.644212802 +0000
@@ -275,11 +275,14 @@
 # Checking for GMP 2
 SAVEINCS="$INCS"
 INCS="$INCS $XINCLUDES"
-AC_EGREP_CPP("gmp=.*2", [
+SAVECPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -P"
+AC_EGREP_CPP("gmp=.*[[02-9]]", [
   #include <gmp.h>
   gmp=__GNU_MP__
   ],AC_DEFINE(HAVE_GMP2_H))
 INCS="$SAVEINCS"
+CPPFLAGS="$OLDCPPFLAGS"

 if test "$MPLIB" = nope; then
   if test "$search" = true; then

Please let me know what you think.

Thanks in advance.

Thansk,
Mak.


For completeness, a patch for the debian/rules file is also listed here,

$ diff -urN debian/rules.orig debian/rules
--- debian/rules.orig	2015-07-28 23:20:08.436233328 +0000
+++ debian/rules	2015-07-28 23:21:53.032235493 +0000
@@ -7,6 +7,7 @@
 CFLAGS:=	$(shell dpkg-buildflags --get CFLAGS)
 CPPFLAGS:=	$(shell dpkg-buildflags --get CPPFLAGS)
 LDFLAGS:=	$(shell dpkg-buildflags --get LDFLAGS)
+CFLAGS:=	$(CFLAGS) -std=gnu89

 ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
 EXTRACFLAGS+=	-Werror



More information about the Pkg-games-devel mailing list