Source: regina-rexx
Version: 3.6-2.4
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

regina-rexx fails to cross build from source, because it builds for the
build architecture. Fixing this is not entirely trivial. The obvious fix
of passing --build and --host to configure is insufficient. Beyond that,
the C compiler must be forced via the CC environment variable. Even
then, the build system fails to transfer this assignment over to make.
To make matters worse, it skips checking for --version-script (and thus
symbol versioning) unless the compiler is exactly gcc. I'm attaching a
patch for your convenience.

Helmut
diff --minimal -Nru regina-rexx-3.6/debian/changelog 
regina-rexx-3.6/debian/changelog
--- regina-rexx-3.6/debian/changelog    2021-05-06 18:28:52.000000000 +0200
+++ regina-rexx-3.6/debian/changelog    2022-12-23 23:43:11.000000000 +0100
@@ -1,3 +1,13 @@
+regina-rexx (3.6-2.5) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Pass --build and --host to configure.
+    + Pass CC to configure and make.
+    + cross.patch: Check for --version-script even if the compiler is prefixed.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 23 Dec 2022 23:43:11 +0100
+
 regina-rexx (3.6-2.4) unstable; urgency=medium
 
   * Non-maintainer upload with maintaner agreement.
diff --minimal -Nru regina-rexx-3.6/debian/patches/cross.patch 
regina-rexx-3.6/debian/patches/cross.patch
--- regina-rexx-3.6/debian/patches/cross.patch  1970-01-01 01:00:00.000000000 
+0100
+++ regina-rexx-3.6/debian/patches/cross.patch  2022-12-23 23:43:11.000000000 
+0100
@@ -0,0 +1,33 @@
+--- regina-rexx-3.6.orig/configure.in
++++ regina-rexx-3.6/configure.in
+@@ -346,9 +346,7 @@
+ AC_SUBST(GCI_SHO)
+ AC_SUBST(HAVE_GCI)
+ 
+-if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++"; then
+-   MH_CHECK_GCC_VERSION_SCRIPT
+-fi
++MH_CHECK_GCC_VERSION_SCRIPT
+ 
+ dnl enable_posix_threads="yes"
+ MH_CHECK_POSIX_THREADS
+--- regina-rexx-3.6.orig/configure
++++ regina-rexx-3.6/configure
+@@ -5862,8 +5862,6 @@
+ 
+ 
+ 
+-if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++"; then
+-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands 
--version-script" >&5
+ $as_echo_n "checking whether gcc understands --version-script... " >&6; }
+ if test "${mh_cv_version_script+set}" = set; then :
+@@ -5909,8 +5907,6 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mh_cv_version_script" >&5
+ $as_echo "$mh_cv_version_script" >&6; }
+ 
+-fi
+-
+ 
+ MH_MT_LIBS=""
+ THREADING_COMPILE=""
diff --minimal -Nru regina-rexx-3.6/debian/patches/series 
regina-rexx-3.6/debian/patches/series
--- regina-rexx-3.6/debian/patches/series       2021-05-06 17:13:47.000000000 
+0200
+++ regina-rexx-3.6/debian/patches/series       2022-12-23 23:43:11.000000000 
+0100
@@ -7,3 +7,4 @@
 0000_Makefile.in_Debian-Installation.diff
 2000_regina-config_use-wrapper.diff
 2000_Makefile.in_Do-not-hardcode-FLAGS.diff
+cross.patch
diff --minimal -Nru regina-rexx-3.6/debian/rules regina-rexx-3.6/debian/rules
--- regina-rexx-3.6/debian/rules        2021-05-06 18:28:52.000000000 +0200
+++ regina-rexx-3.6/debian/rules        2022-12-23 23:43:11.000000000 +0100
@@ -18,9 +18,8 @@
 
 rexxpkg=regina-rexx
 
-export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-export DEB_BUILD_ARCH     ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+include /usr/share/dpkg/architecture.mk
+export DEB_HOST_ARCH DEB_BUILD_ARCH DEB_HOST_MULTIARCH
 
 ifeq ($(DEB_BUILD_ARCH), ia64)
        DEB_CFLAGS_MAINT_STRIP=""
@@ -31,7 +30,10 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
+include /usr/share/dpkg/buildtools.mk
+
 confflags=--prefix=/usr \
+       --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
        --with-addon-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/$(rexxpkg)/$(soversion) 
\
        --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
 
@@ -47,7 +49,7 @@
        [ -e "$(CONFIGTGZ)" ] || tar -cvzf $(CONFIGTGZ) $(addprefix 
common/,$(CONFIGS))
        for i in $(CONFIGS); do cp -f /usr/share/misc/$$i common/$$i; done
        # Add here commands to configure the package.
-       ./configure $(confflags)
+       CC=$(CC) ./configure $(confflags)
        touch configure-stamp
 
 build: build-arch build-indep
@@ -57,7 +59,7 @@
        dh_testdir
 
        # Add here commands to compile the package.
-       $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+       $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
        #docbook-to-man debian/pam-encfs.sgml > pam-encfs.1
        cat README.0* README.2* README.3* > $(HISTORY)
 

Reply via email to