Bug 11984 - failed to compile on Mac OS X.
failed to compile on Mac OS X.
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.4.4
All Mac OS X
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-21 04:44 UTC by hirochachacha
Modified: 2016-06-24 14:10 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hirochachacha 2016-06-21 04:44:23 UTC
I found two issues about building samba on darwin.

First error is:

[1307/3646] Compiling lib/dbwrap/dbwrap.c
In file included from ../lib/dbwrap/dbwrap.c:26:
In file included from ../lib/dbwrap/dbwrap.h:27:
In file included from ../lib/param/loadparm.h:259:
default/lib/param/param_local.h:141:1: error: field has incomplete type 'struct timespec'
LOADPARM_EXTRA_LOCALS
^
../lib/param/loadparm.h:253:18: note: expanded from macro 'LOADPARM_EXTRA_LOCALS'
        struct timespec usershare_last_mod;                             \
                        ^
default/lib/param/param_local.h:141:1: note: forward declaration of 'struct timespec'
../lib/param/loadparm.h:253:9: note: expanded from macro 'LOADPARM_EXTRA_LOCALS'
        struct timespec usershare_last_mod;                             \
               ^
1 error generated.
Waf: Leaving directory `/Users/hiro/work/samba/bin'
Build failed:  -> task failed (err #1):
	{task: cc dbwrap.c -> dbwrap_1.o}


It can be fixed by adding '#include "system/time.h"' to lib/param/loadparam.h


Second error is:

[3590/3646] Linking default/source4/torture/smbtorture
clang: warning: argument unused during compilation: '-pie'
Undefined symbols for architecture x86_64:
  "_getgrent_r", referenced from:
      _test_enum_r_group in nss_tests_1.o
  "_getpwent_r", referenced from:
      _test_enum_r_passwd in nss_tests_1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Because of OS X doesn't have getgrent_r and getpwent_r,
I used HAVE_GETGRENT_R and HAVE_GETPWENT_R to skip tests at source4/torture/local/nss_tests.

I also confirmed above issues on latest source code.
Comment 1 hirochachacha 2016-06-24 13:16:37 UTC
First error is duplicate of https://bugzilla.samba.org/show_bug.cgi?id=11811