Bug#946774: dieharder FTCBFS: uses AC_RUN_IFELSE

2019-12-16 Thread Dirk Eddelbuettel


On 15 December 2019 at 17:43, Helmut Grohne wrote:
| Source: dieharder
| Version: 3.31.1-8
| Tags: patch upstream
| User: debian-cr...@lists.debian.org
| Usertags: ftcbfs
| 
| dieharder fails to cross build from source, because its configure script
| uses AC_RUN_IFELSE to discover the endianess. The check included in
| autoconf, AC_C_BIGENDIAN, can be performed without running host code.
| Using it results in better portability and less code. Please consider
| applying the attached patch.

That is a very cool patch, thank you.  Always good to see that the treasure
chest that is configure has something in store :).

The project is pretty dormant upstream, but I'll make the change.

Dirk
 
| Helmut
| x[DELETED ATTACHMENT cross.patch, text/x-diff]

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org



Bug#946774: dieharder FTCBFS: uses AC_RUN_IFELSE

2019-12-15 Thread Helmut Grohne
Source: dieharder
Version: 3.31.1-8
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

dieharder fails to cross build from source, because its configure script
uses AC_RUN_IFELSE to discover the endianess. The check included in
autoconf, AC_C_BIGENDIAN, can be performed without running host code.
Using it results in better portability and less code. Please consider
applying the attached patch.

Helmut
--- dieharder-3.31.1.orig/configure.ac
+++ dieharder-3.31.1/configure.ac
@@ -125,30 +125,7 @@ AC_CHECK_LIB([gsl],[gsl_sf_gamma])
 # brg_endian.h in the build of rng_threefish.  This is a very
 # certain test, and therefore is checked FIRST in this header file.
 #==
-AC_DEFUN([AC_C_ENDIAN],
-[AC_CACHE_CHECK(for endianness, ac_cv_c_endian,
-[
-  AC_RUN_IFELSE(
-[AC_LANG_PROGRAM([], [dnl
-long val = 1;
-char *c = (char *) 
-exit(*c == 1);
-])
-  ],[
-ac_cv_c_endian=big
-  ],[
-ac_cv_c_endian=little
-  ])
-])
-if test $ac_cv_c_endian = big; then
-  AC_SUBST(LITTLE_ENDIAN,0) 
-fi
-if test $ac_cv_c_endian = little; then
-  AC_SUBST(LITTLE_ENDIAN,1) 
-fi
-])
-
-AC_C_ENDIAN
+AC_C_BIGENDIAN([AC_SUBST(LITTLE_ENDIAN,0)],[AC_SUBST(LITTLE_ENDIAN,1)])
  
 
 #==