patch for Helmut Grohne to fix FTCBFS
authormirabilos <m@mirbsd.org>
Tue, 8 Nov 2016 22:25:35 +0000 (23:25 +0100)
committermirabilos <m@mirbsd.org>
Tue, 8 Nov 2016 22:25:35 +0000 (23:25 +0100)
debian/changelog
debian/rules

index 247d59e..b3eeeca 100644 (file)
@@ -8,8 +8,9 @@ cvs (2:1.12.13+real-19) UNRELEASED; urgency=medium
     - Apply TCP_NODELAY patch from CVS mailing list
   * Switch (experimentally) to debhelper compat 10
   * Enhances cvs2svn (>= 2.4.0-4~) as it’s added relevant patches
+  * Make cross-buildable (Closes: #842847)
 
- -- Thorsten Glaser <tg@mirbsd.de>  Tue, 08 Nov 2016 23:20:33 +0100
+ -- Thorsten Glaser <tg@mirbsd.de>  Tue, 08 Nov 2016 23:25:15 +0100
 
 cvs (2:1.12.13+real-18) unstable; urgency=low
 
index ff0feae..3538a61 100755 (executable)
@@ -1,6 +1,22 @@
 #!/usr/bin/make -f
 
-CC?=                   gcc
+DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
+ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+endif
+
+# is ${CC} defined anywhere (other than implicit rules?)
+ifneq (,$(findstring $(origin CC),default undefined))
+# no - then default to gcc (or cross-gcc)
+ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+CC=                    ${DEB_HOST_GNU_TYPE}-gcc
+else
+CC=                    gcc
+endif
+endif
+
 CONFIGURE_ENV:=                CC='${CC}'
 EXTRA_CFLAGS=          -Wall -fno-strict-aliasing -Wformat
 # addresses part of #698908
@@ -63,6 +79,11 @@ CONFIGURE_ARGS:=     --prefix=/usr \
                        --with-umask=002 \
                        --with-cvs-admin-group=_cvsadmin
 
+ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+CONFIGURE_ARGS+=       --build=${DEB_BUILD_GNU_TYPE} \
+                       --host=${DEB_HOST_GNU_TYPE}
+endif
+
 MAKE_ARGS:=            MAKEINFO=makeinfo
 MAKE_ARGS+=            MAKEINFOFLAGS=--no-split