[RP-PPPoE] [PATCH] cross compilation fix
Bertrand Jacquin
beber at meleeweb.net
Wed Jul 13 12:15:06 EDT 2011
Hi,
D'ar merc'her 13 a viz Gouere 2011 e 17 eur 49, « David F. Skoll » he deus skrivet :
> Hi,
>
> I don't think your patch is correct. The packing order of bit-fields may
> or may not be related to the endian-ness of the machine.
>
> If you want to cross-compile, you need to explicitly set
> rppppoe_cv_pack_bitfields on the command line:
>
> rpppoe_cv_pack_bitfields=normal ./configure
>
> or
>
> rpppoe_cv_pack_bitfields=rev ./configure
This doesn't work as in the cross compile case, there is a explicit exit
:
$ECHO "no defaults for cross-compiling"; exit 0)
So here is an updated patch to use AC_CACHE_CHECK
--
Beber
On Lady Voodoo
-------------- next part --------------
--- configure.in.ori 2011-07-13 18:02:56.227142413 +0200
+++ configure.in 2011-07-13 18:12:23.869661842 +0200
@@ -230,8 +230,8 @@
esac
dnl Figure out packing order of structures
-AC_MSG_CHECKING([packing order of bit fields])
-AC_TRY_RUN([
+AC_CACHE_CHECK([packing order of bit fields], rpppoe_cv_pack_bitfields,
+[AC_TRY_RUN([
union foo {
struct bar {
unsigned int ver:4;
@@ -253,15 +253,15 @@
} else {
return 2;
}
-}], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
-$ECHO "no defaults for cross-compiling"; exit 0)
-
-if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
- AC_MSG_RESULT(reversed)
- AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
-else
- AC_MSG_RESULT(normal)
-fi
+}],
+ rpppoe_cv_pack_bitfields=normal,
+ rpppoe_cv_pack_bitfields=rev,
+ [AC_MSG_ERROR([cross-compiling,
+ presetting rpppoe_cv_pack_bitfields=(normal|rev) will help])]
+)])
+AS_IF([test $rpppoe_cv_pack_bitfields = rev],
+ AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
+)
# Sigh... got to fix this up for tcl
test "x$prefix" = xNONE && prefix=$ac_default_prefix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.roaringpenguin.com/pipermail/rp-pppoe/attachments/20110713/192de581/attachment.pgp>
More information about the RP-PPPoE
mailing list