The configure test for timespec under OpenBSD fails. This failure causes timespec to be redefined and compilation stops. I believe timespec is defined under <sys/time.h> but when I attempted to add that to configure it still failed to find timespec. Unfortunately I don't have time to figure out why the test fails.
I am also gettting this error with OpenBSD 3.7 Here is what I get. r0065728# make Using FLAGS = -O -D_SAMBA_BUILD_ -I./popt -Iinclude -I/tmp/samba- 3.0.20/source/include -I/tmp/samba-3.0.20/source/ubiqx -I. -I/tmp/samba- 3.0.20/source LIBS = -lresolv LDSHFLAGS = -shared LDFLAGS = PIE_CFLAGS = PIE_LDFLAGS = Generating smbd/build_options.c Building include/proto.h creating /tmp/samba-3.0.20/source/include/proto.h Building include/wrepld_proto.h creating /tmp/samba-3.0.20/source/include/wrepld_proto.h Building include/build_env.h creating /tmp/samba-3.0.20/source/nsswitch/winbindd_proto.h creating /tmp/samba-3.0.20/source/web/swat_proto.h creating /tmp/samba-3.0.20/source/client/client_proto.h creating /tmp/samba-3.0.20/source/utils/net_proto.h creating /tmp/samba-3.0.20/source/utils/ntlm_auth_proto.h Compiling dynconfig.c In file included from dynconfig.c:21: include/includes.h:799: error: redefinition of `struct timespec' *** Error code 1 Stop in /tmp/samba-3.0.20/source (line 781 of Makefile).
I am getting the same error on OpenBSD 3.7 for Sparc64: bash-3.00# make Using FLAGS = -O -D_SAMBA_BUILD_ -Iinclude -I/root/samba-3.0.20/source include -I/root/ samba-3.0.20/source/ubiqx -I. -I/usr/local/include -I/root/samba-3.0.20/source LIBS = -lresolv -liconv LDSHFLAGS = -shared -L/usr/local/lib LDFLAGS = -L/usr/local/lib PIE_CFLAGS = PIE_LDFLAGS = Generating smbd/build_options.c Building include/proto.h creating /root/samba-3.0.20/source/include/proto.h Building include/wrepld_proto.h creating /root/samba-3.0.20/source/include/wrepld_proto.h Building include/build_env.h creating /root/samba-3.0.20/source/nsswitch/winbindd_proto.h creating /root/samba-3.0.20/source/web/swat_proto.h creating /root/samba-3.0.20/source/client/client_proto.h creating /root/samba-3.0.20/source/utils/net_proto.h Compiling dynconfig.c In file included from dynconfig.c:21: include/includes.h:799: error: redefinition of `struct timespec' *** Error code 1 Stop in /root/samba-3.0.20/source (line 781 of Makefile). bash-3.00#
Also fails under NetBSD (2.0.2) and OpenBSD-3.8-beta. This bug is due to an already declared timespec struct in the system includes (either time.h or sys/time.h I can't remember which). Removing the struct and ifdef's from the source/includes/includes.h file enables successful compilation under BSD, but is not a real fix for the problem.
Patch from Steve Williams <steve@celineandsteve.com> posted to the samba-technical list fixes the problem.