summaryrefslogtreecommitdiffstats
path: root/debian/patches/cross.patch
blob: 89155f46064c3f7b806850de922c69f5bb5e415d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Helmut Grohne <helmut@subdivi.de>
Date: Fri, 06 Sep 2019 21:41:32 +0200
Subject: [PATCH] cross build fixes

- waf performs sizeof checks by running programs.

--- tevent.orig/buildtools/wafsamba/samba_conftests.py
+++ tevent/buildtools/wafsamba/samba_conftests.py
@@ -86,9 +86,9 @@ def CHECK_LARGEFILE(conf, define='HAVE_L
     '''see what we need for largefile support'''
     getconf_cflags = conf.CHECK_COMMAND(['getconf', 'LFS_CFLAGS'])
     if getconf_cflags is not False:
-        if (conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
+        if (conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
                             define='WORKING_GETCONF_LFS_CFLAGS',
-                            execute=True,
+                            execute=False,
                             cflags=getconf_cflags,
                             msg='Checking getconf large file support flags work')):
             conf.ADD_CFLAGS(getconf_cflags)
@@ -101,23 +101,23 @@ def CHECK_LARGEFILE(conf, define='HAVE_L
                     else:
                         conf.DEFINE(flag_split[0], flag_split[1])
 
-    if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
+    if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
                        define,
-                       execute=True,
+                       execute=False,
                        msg='Checking for large file support without additional flags'):
         return True
 
-    if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
+    if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
                        define,
-                       execute=True,
+                       execute=False,
                        cflags='-D_FILE_OFFSET_BITS=64',
                        msg='Checking for -D_FILE_OFFSET_BITS=64'):
         conf.DEFINE('_FILE_OFFSET_BITS', 64)
         return True
 
-    if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
+    if conf.CHECK_CODE('char dummy[(sizeof(off_t) < 8) ? -1 : 1]',
                        define,
-                       execute=True,
+                       execute=False,
                        cflags='-D_LARGE_FILES',
                        msg='Checking for -D_LARGE_FILES'):
         conf.DEFINE('_LARGE_FILES', 1)