Bug 3052 - samba 3.0.20 does not build under OpenBSD - timespec not detected
samba 3.0.20 does not build under OpenBSD - timespec not detected
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.20
x86 OpenBSD
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-29 13:40 UTC by samba_bugzilla
Modified: 2005-09-07 04:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description samba_bugzilla 2005-08-29 13:40:38 UTC
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.
Comment 1 FiveO 2005-09-01 07:56:48 UTC
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).
Comment 2 Tyler Backman 2005-09-02 13:37:22 UTC
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#
Comment 3 Rene Badalassi 2005-09-06 18:12:54 UTC
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.
Comment 4 Gerald (Jerry) Carter 2005-09-07 04:20:46 UTC
Patch from Steve Williams <steve@celineandsteve.com> posted to the 
samba-technical list fixes the problem.