Source: xmedcon
Version: 0.15.0+dfsg-2
Tags: patch upstream
User: [email protected]
Usertags: rebootstrap

xmedcon fails to cross build from source, because it abuses
AC_CHECK_FILE. The macro is meant for checking files on the host system,
not for checking files (such as includes) on the build system. For the
latter a simple test -f is ok. The attached patch fixes that part, but
it doesn't make xmedcon cross buildable: It later fails running
libs/dicom/parse, which is built with the host architecture compiler. As
a build tool it needs to be built with the build architecture compiler.
Fixing that likely involves using AX_CC_FOR_BUILD and possibly rewriting
parse.c to avoid relying on dicom.h. Please consider fixing the
AC_CHECK_FILE anyway and close this bug when doing so. It will allow
others to see the real failure.

Helmut
--- xmedcon-0.15.0+dfsg.orig/configure.ac
+++ xmedcon-0.15.0+dfsg/configure.ac
@@ -505,9 +505,9 @@
     ZNZ_LDFLAGS="-L$nifti_prefix/lib -lznz"
     NIFTI_LDFLAGS="-L$nifti_prefix/lib -lniftiio $ZNZ_LDFLAGS"
     NIFTI_CFLAGS=""
-    AC_CHECK_FILE([$nifti_prefix/include/nifti/nifti1_io.h],
-                  [NIFTI_CFLAGS="-I$nifti_prefix/include/nifti"],
-                  [NIFTI_CFLAGS="-I$nifti_prefix/include"])
+    AS_IF([test -f "$nifti_prefix/include/nifti/nifti1_io.h"],
+          [NIFTI_CFLAGS="-I$nifti_prefix/include/nifti"],
+          [NIFTI_CFLAGS="-I$nifti_prefix/include"])
     LDFLAGS="$LDFLAGS -lm $NIFTI_LDFLAGS $ZLIB_LDFLAGS"
     CPPFLAGS="$CPPFLAGS $NIFTI_CFLAGS $ZLIB_LDFLAGS"
 else

Reply via email to