On 12/06/2016 09:28 PM, Adam Williamson wrote:
Well, assuming you're including ldb and tdb in 'samba', no, I don't
think we know that yet.
libldb and libtdb use waf, the Samba build system, and are closely
related to Samba.
If it were just Samba, fixing Samba would be the right course of action.
Assuming they're all sharing some kind of bad check in their waf
scripts and we can fix that and they'll all build properly again, I
guess, sure, we could do that and see whether anything else breaks.
libldb and libtdb seem to contain many configure tests from samba, which
needs the attached patch.
But we need to revert this (both aspects, implicit int and implicit
function declarations). It's pretty much hopeless; the breakage is not
restricted to Samba. We can keep the C/C++ flag separation in
redhat-rpm-config.
Florian
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 795d130..0e08cf4 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -351,7 +351,7 @@ def CHECK_VALUEOF(conf, v, headers=None, define=None):
execute=True,
define_ret=True,
quote=False,
- headers=headers,
+ headers=TO_LIST(headers) + ["<stdio.h>"],
local_include=False,
msg="Checking value of %s" % v):
return int(conf.env[v_define])
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index 045f858..6d6996a 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -286,7 +286,10 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
os.makedirs(subdir)
Utils.writef(os.path.join(subdir, 'lib1.c'), 'int lib_func(void) { return 42; }\n')
- Utils.writef(os.path.join(dir, 'main.c'), 'int main(void) {return !(lib_func() == 42);}\n')
+ Utils.writef(os.path.join(dir, 'main.c'),
+ """int lib_func(void);
+int main(void) {return !(lib_func() == 42);}
+""")
bld = Build.BuildContext()
bld.log = conf.log
@@ -444,7 +447,7 @@ def CHECK_UNAME(conf):
execute=True,
define_ret=True,
quote=True,
- headers='sys/utsname.h',
+ headers=['sys/utsname.h', 'stdio.h'],
local_include=False,
msg="Checking uname %s type" % v):
ret = False
diff --git a/lib/replace/test/shared_mmap.c b/lib/replace/test/shared_mmap.c
index 50dad8d..a660f88 100644
--- a/lib/replace/test/shared_mmap.c
+++ b/lib/replace/test/shared_mmap.c
@@ -8,6 +8,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <stdlib.h>
#define DATA "conftest.mmap"
@@ -15,7 +16,7 @@
#define MAP_FILE 0
#endif
-main()
+int main()
{
int *buf;
int i;
diff --git a/lib/replace/test/shared_mremap.c b/lib/replace/test/shared_mremap.c
index 05032ad..276fcdb 100644
--- a/lib/replace/test/shared_mremap.c
+++ b/lib/replace/test/shared_mremap.c
@@ -7,6 +7,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <stdlib.h>
#define DATA "conftest.mmap"
@@ -18,7 +19,7 @@
#define MAP_FAILED (int *)-1
#endif
-main()
+int main()
{
int *buf;
int fd;
diff --git a/lib/replace/test/snprintf.c b/lib/replace/test/snprintf.c
index d06630b..153b3ed 100644
--- a/lib/replace/test/snprintf.c
+++ b/lib/replace/test/snprintf.c
@@ -26,4 +26,4 @@ void foo(const char *format, ...)
printf("1");
exit(0);
}
-main() { foo("hello"); }
+int main() { foo("hello"); }
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 1dfd902..ea0d5d0 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -189,7 +189,7 @@ def configure(conf):
''',
define='HAVE_IPV6',
lib='nsl socket',
- headers='sys/socket.h netdb.h netinet/in.h')
+ headers='sys/socket.h netdb.h netinet/in.h net/if.h')
if conf.CONFIG_SET('HAVE_SYS_UCONTEXT_H') and conf.CONFIG_SET('HAVE_SIGNAL_H'):
conf.CHECK_CODE('''
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 760f8b0..740f5fa 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -522,7 +522,7 @@ static int have_syscall(void)
return 0;
}
-main()
+int main()
{
if (getuid() != 0) {
#if (defined(AIX) && defined(USE_SETREUID))
diff --git a/source3/wscript b/source3/wscript
index c6b2421..5d792a0 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -149,7 +149,7 @@ long ret = splice(0,0,1,0,400,SPLICE_F_MOVE);
#ifndef F_NOTIFY
#define F_NOTIFY 1026
#endif
-main() {
+int main() {
exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
}''', 'HAVE_KERNEL_CHANGE_NOTIFY', addmain=False, execute=True,
headers='fcntl.h signal.h',
@@ -163,7 +163,7 @@ main() {
#ifndef F_NOTIFY
#define F_NOTIFY 1026
#endif
-main() {
+int main() {
exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
}''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
msg="Checking for Linux kernel oplocks")
@@ -183,7 +183,7 @@ main() {
#define LOCK_MAND 32
#define LOCK_READ 64
#endif
-main() {
+int main() {
exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
}''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, execute=True,
msg="Checking for kernel share modes")
@@ -1232,7 +1232,7 @@ syscall(SYS_initgroups, 16, NULL, NULL, 0);
if conf.CHECK_CODE('''
#include <time.h>
-main() {
+int main() {
struct tm *tm;
if (sizeof(time_t) == 8) {
time_t max_time = 0x7fffffffffffffffll;
@@ -1260,7 +1260,7 @@ main() {
#include <unistd.h>
#endif
#include <sys/types.h>
-main() { dev_t dev = makedev(1,2); return 0; }
+int main() { dev_t dev = makedev(1,2); return 0; }
''',
'HAVE_MAKEDEV',
addmain=False,
@@ -1275,7 +1275,7 @@ void exit_on_core(int ignored) {
exit(1);
}
-main() {
+int main() {
char *newpath;
signal(SIGSEGV, exit_on_core);
newpath = realpath("/tmp", NULL);
@@ -1427,7 +1427,7 @@ main() {
# Check for getcwd allowing a NULL arg.
conf.CHECK_CODE('''
#include <unistd.h>
-main() {
+int main() {
char *s = getcwd(NULL,0);
exit(s != NULL ? 0 : 1);
}''', 'GETCWD_TAKES_NULL', addmain=False, execute=True,
diff --git a/tests/ftruncate.c b/tests/ftruncate.c
index d3e5de3..e7118e9 100644
--- a/tests/ftruncate.c
+++ b/tests/ftruncate.c
@@ -11,7 +11,7 @@
#define DATA "conftest.trunc"
#define LEN 7663
-main()
+int main()
{
int *buf;
int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666);
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx