[RP-PPPoE] [PATCH] cross compilation fix

Bertrand Jacquin beber at meleeweb.net
Sun Jul 10 05:47:29 EDT 2011


configure try to detect endianess at build time but explicitaly failed when cross compiling :

>>> Source unpacked in /usr/i586-alix-linux-gnu/tmp/portage/net-dialup/rp-pppoe-3.10-r1/work
>>> Compiling source in /usr/i586-alix-linux-gnu/tmp/portage/net-dialup/rp-pppoe-3.10-r1/work/rp-pppoe-3.10 ...
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=i586-alix-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share 
--sysconfdir=/etc --localstatedir=/var/lib --enable-plugin=../../ppp-2.4.4
configure: loading site script /usr/share/config.site
configure: loading site script /usr/share/crossdev/include/site/linux
checking for i586-alix-linux-gnu-gcc... i586-alix-linux-gnu-gcc
...
checking for setsid... /usr/bin/setsid
checking for id... /usr/bin/id
checking for Linux 2.4.X kernel-mode PPPoE support... (cached) yes
checking packing order of bit fields... no defaults for cross-compiling
make -j1 
make: *** No targets specified and no makefile found.  Stop.
emake failed
 * ERROR: net-dialup/rp-pppoe-3.10-r1 failed (compile phase):
 *   emake failed

So here is a fix to use standard AC_C_BIGENDIAN

Regards,
Bertrand

-- 
Beber
-------------- next part --------------
--- rp-pppoe-3.10/src/configure.in.ori	2011-07-10 00:49:30.000000000 +0200
+++ rp-pppoe-3.10/src/configure.in	2011-07-10 11:35:58.000000000 +0200
@@ -230,37 +230,10 @@
 esac
 
 dnl Figure out packing order of structures
-AC_MSG_CHECKING([packing order of bit fields])
-AC_TRY_RUN([
-union foo {
-    struct bar {
-	unsigned int ver:4;
-	unsigned int type:4;
-    } bb;
-    unsigned char baz;
-};
+AC_C_BIGENDIAN()
 
-int
-main(void)
-{
-    union foo x;
-    x.bb.ver = 1;
-    x.bb.type = 2;
-    if (x.baz == 0x21) {
-	return 1;
-    } else if (x.baz == 0x12) {
-	return 0;
-    } 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)
+if test "$ac_cv_c_bigendian" = "yes" ; then
 	AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
-else
-	AC_MSG_RESULT(normal)
 fi
 
 # Sigh... got to fix this up for tcl
-------------- 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/20110710/fd79ca31/attachment.pgp>


More information about the RP-PPPoE mailing list