Bug#283640: dpkg: [PATCH] cross build
Package: dpkg
Version: 1.10.25
Severity: wishlist
Cross-building (with dpkg-cross), I encountered a problem.
Following patch fix the problem.
Problem is that in the configure script, AC_TRY_RUN is not
enclosed with AC_CACHE_VAL. Enclosing with AC_CACHE_VAL,
we can supply configure variable to avoid AC_TRY_RUN.
Note that you need regenerate configure after applying this patch.
* Enclose AC_TRY_RUN with AC_CACHE_VAL.
-- NIIBE Yutaka <gniibe@fsij.org> Tue, 30 Nov 2004 20:53:43 +0900
--- dpkg-1.10.25/configure.in 2004-11-12 05:10:47.000000000 +0900
+++ dpkg-1.10.25/configure.in 2004-11-30 20:55:56.000000000 +0900
@@ -250,21 +250,26 @@
# OpenBSD passes AC_TRY_COMPILE for va_copy even though
# it doesn't seem to exist, which is odd. We need to use
# AC_TRY_RUN.
-AC_TRY_RUN([
-#include <stdarg.h>
-main(){
-va_list v1,v2;
-va_copy(v1, v2);
-exit(0);}
-], [AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_VA_COPY,,[Whether the va_copy macro exists])],[AC_MSG_RESULT(no)
-AC_MSG_CHECKING([for va_list assignment copy])
-AC_TRY_COMPILE([
-#include <stdarg.h>
-],[
-va_list v1,v2;
-v1 = v2;
-], AC_MSG_RESULT(yes),AC_MSG_ERROR(no))])
+AC_CACHE_VAL(dpkg_cv_va_copy,
+ AC_TRY_RUN([
+ #include <stdarg.h>
+ main(){
+ va_list v1,v2;
+ va_copy(v1, v2);
+ exit(0);}
+ ],dpkg_cv_va_copy=yes,dpkg_cv_va_copy=no,dpkg_cv_va_copy=no))
+AC_MSG_RESULT($dpkg_cv_va_copy)
+if test "$dpkg_cv_va_copy" = yes; then
+ AC_DEFINE(HAVE_VA_COPY,,[Whether the va_copy macro exists])
+else
+ AC_MSG_CHECKING([for va_list assignment copy])
+ AC_TRY_COMPILE([
+ #include <stdarg.h>
+ ],[
+ va_list v1,v2;
+ v1 = v2;
+ ], AC_MSG_RESULT(yes),AC_MSG_ERROR(no))
+fi
DPKG_C_GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.],
DPKG_C_GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
Reply to: