include/libnet.h requires either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN to be defined at make time. The r3 ebuild was modified to do this automatically using toolchain-funcs.eclass and flag-o-matic.eclass . I know this library is deprecated, but please consider bumping the revision just for the convenience of people like me, who are stuck using old versions :P Please see the attached patch against the ebuild. Reproducible: Always Steps to Reproduce: 1.build (cross-compile?) libnet-1.0.2a-r3 for ARM 2. 3. Actual Results: emake fails include/libnet.h issues a preproccessor error stating that either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN must be defined. Expected Results: build w/o problems used simple existing 'tc-endian' function in toolchain-funcs.eclass
Created attachment 196124 [details, diff] libnet-1.0.2a-fix-endianness.patch patch against libnet-1.0.2a-r3.ebuild - simple fix - I suggest bumping the revision
Why do you use old library net-libs/libnet-1.0.2-r3 instead of newer libnet-1.1.2.1-r1.ebuild which does this detection at configure time? I was going to drop libnet-1.0.2a-r3.ebuild from the tree...
(In reply to comment #2) > Why do you use old library net-libs/libnet-1.0.2-r3 instead of newer > libnet-1.1.2.1-r1.ebuild which does this detection at configure time? I was > going to drop libnet-1.0.2a-r3.ebuild from the tree... net-analyzer/snort depends on it.
arm@ can review the patch. It could (should) be shortened somewhat to perhaps: if [ "$(tc-endian)x" = "${little}x" ]; then append-flags "-DLIBNET_LIL_ENDIAN" else append-flags "-DLIBNET_BIG_ENDIAN" fi
Oh and I think this was the intention. Sorry for the bug spam.
(In reply to comment #4) > arm@ can review the patch. It could (should) be shortened somewhat to perhaps: > > if > [ "$(tc-endian)x" = "${little}x" ]; then > append-flags "-DLIBNET_LIL_ENDIAN" > else > append-flags "-DLIBNET_BIG_ENDIAN" > fi > Looks okay to me
This should be fixed in libnet-1.1.4. Arm, please, retest.
And I just missed, that it is keyworded on arm. So nothing should be done here.
net-libs/libnet-1.0* is still in the tree because many packages will not work with net-libs/libnet-1.1*, so reopening.
(In reply to comment #6) > (In reply to comment #4) > > arm@ can review the patch. It could (should) be shortened somewhat to perhaps: > > > > if > > [ "$(tc-endian)x" = "${little}x" ]; then > > append-flags "-DLIBNET_LIL_ENDIAN" > > else > > append-flags "-DLIBNET_BIG_ENDIAN" > > fi > > > > Looks okay to me Great, could you then apply that and keyword for arm, please?
Christopher, is this really needed? I can compile it without issues natively...
(In reply to comment #11) > Christopher, is this really needed? I can compile it without issues natively... > My target was an ep93xx system with very very few resources in terms of memory, so in that sense, I would must rather cross-compile most packages for this system. Compiling natively is occasionally not really a valid option.
Personally I'd rather see the logic in the source code vs the ebuild. This helps if you have to cd into the dir and do anything manually. #include <endian.h> #if __BYTE_ORDER == __LITTLE_ENDIAN #define LIBNET_LIL_ENDIAN 1 #endif #if __BYTE_ORDER == __BIG_ENDIAN #define LIBNET_BIG_ENDIAN 1 #endif
Good call... +1 for this. (In reply to comment #13) > Personally I'd rather see the logic in the source code vs the ebuild. > This helps if you have to cd into the dir and do anything manually. > > #include <endian.h> > > #if __BYTE_ORDER == __LITTLE_ENDIAN > #define LIBNET_LIL_ENDIAN 1 > #endif > > #if __BYTE_ORDER == __BIG_ENDIAN > #define LIBNET_BIG_ENDIAN 1 > #endif >
Could a patch be prepared for this, please?
Created attachment 255019 [details, diff] patch for libnet.h
Created attachment 255021 [details, diff] patch for ebuild
Applied in -r4. Thanks for reporting and for the patch.