X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Flibiscsi%2F0003-Fix-CUnit-test-for-cross-compilation.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Flibiscsi%2F0003-Fix-CUnit-test-for-cross-compilation.patch;h=dd4eb4a61122476f8076e4c5f2c15d934c781a5c;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/libiscsi/0003-Fix-CUnit-test-for-cross-compilation.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/libiscsi/0003-Fix-CUnit-test-for-cross-compilation.patch new file mode 100644 index 0000000..dd4eb4a --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/libiscsi/0003-Fix-CUnit-test-for-cross-compilation.patch @@ -0,0 +1,56 @@ +From 3271dd69b731c0320ab0b3b0a0609e64b00f1a56 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 2 Sep 2014 22:41:32 +0200 +Subject: [PATCH 3/4] Fix CUnit test for cross-compilation + +The current test in configure.ac for CUnit uses AC_TRY_RUN, which +doesn't work in a cross-compilation context, because we can't run on +the build machine the binaries that are built for the target. In +addition, the current logic assumes CUnit is available when the +AC_TRY_RUN test cannot be used (e.g in a cross-compilation case). + +Since we actually don't care about *running* but only about testing +whether a simple program include the CUnit header file and linking +against the cunit library works, simply use AC_TRY_LINK() instead of +AC_TRY_RUN(). + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +diff --git a/configure.ac b/configure.ac +index eb9d995..0ee2d9b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -91,25 +91,14 @@ if test x"$libiscsi_cv_HAVE_SOCKADDR_IN6" = x"yes"; then + AC_DEFINE(HAVE_SOCKADDR_IN6,1,[Whether we have IPv6 support]) + fi + +- + AC_MSG_CHECKING(whether libcunit is available) + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS -lcunit" +-AC_TRY_RUN([ +-/* +- * Just see if we can compile/link with libcunit +- */ ++AC_TRY_LINK([ + #include +- +-int main(int argc, const char *argv[]) +-{ +- return 0; +-} +-], ac_cv_have_cunit=yes, ac_cv_have_cunit=no, +- [echo $ac_n "compile with CUNIT. Assuming OK... $ac_c" +- ac_cv_have_cunit=yes]) ++], [], [ac_cv_have_cunit=yes], [ac_cv_have_cunit=no]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + if test "$ac_cv_have_cunit" = yes ; then +-- +2.0.0 +