Build environment: Cygwin (latest), gcc 4.5.3 Running configure doesn't try to detect header byteswap.h, then building fails with: [ 541/3345] Compiling lib/ntdb/check.c ../lib/ntdb/check.c:1:0: warning: -fPIC ignored for target (all code is position independent) In file included from ../lib/ntdb/private.h:28:0, from ../lib/ntdb/check.c:18: ../lib/ccan/endian/endian.h:18:24: error: redefinition of 'bswap_16' /usr/include/byteswap.h:19:1: note: previous definition of 'bswap_16' was here ../lib/ccan/endian/endian.h:32:24: error: redefinition of 'bswap_32' /usr/include/byteswap.h:25:1: note: previous definition of 'bswap_32' was here ../lib/ccan/endian/endian.h:51:24: error: redefinition of 'bswap_64' /usr/include/byteswap.h:31:1: note: previous definition of 'bswap_64' was here Waf: Leaving directory `/home/rberber/samba-4.0.0rc2/bin' Build failed: -> task failed (err #1): {task: cc check.c -> check_1.o} Makefile:7: recipe for target `all' failed The point of failure is guarded by: #if HAVE_BYTESWAP_H #include <byteswap.h> #else ... but HAVE_BYTESWAP_H was never defined.
Add HAVE_BSWAP_64 to the variables that need a test and be defined.
rusty, you should make sure that the defines that you use in ccan are being set in configure
Huh, waf *should* detect this: lib/ccan/wscript: conf.CHECK_HEADERS('byteswap.h') That should set HAVE_BYTESWAP_H. That's been there for a year: commit 029654897d721308c9ee782aee420abddce7edee Author: Rusty Russell <rusty@rustcorp.com.au> Date: Sun Oct 14 16:05:58 2012 +1030 ccan: check for all the used config.h defines In particular, not checking for byteswap.h meant we defined duplicates: https://bugzilla.samba.org/show_bug.cgi?id=9286 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Oct 17 01:55:14 CEST 2012 on sn-devel-104