sysklogd: fix build on musl
[buildroot-gz.git] / package / zip / 0005-unix-configure-remove-GID-UID-size-check.patch
blob38d8d730e1ab6b06d82b0171e041b1a7891fc230
1 From d8da4e5f0ebed000f880e60b6cca7c575f7ed1c7 Mon Sep 17 00:00:00 2001
2 From: Romain Naour <romain.naour@openwide.fr>
3 Date: Fri, 23 Jan 2015 22:13:14 +0100
4 Subject: [PATCH 5/6] unix/configure: remove GID/UID size check
6 This check can't work for cross-compilation since it
7 try to run a target's binary on the host system.
9 Reported-by: Richard Genoud <richard.genoud@gmail.com>
10 Signed-off-by: Romain Naour <romain.naour@openwide.fr>
11 ---
12 unix/configure | 57 ---------------------------------------------------------
13 1 file changed, 57 deletions(-)
15 diff --git a/unix/configure b/unix/configure
16 index de9fd68..7bfc9eb 100644
17 --- a/unix/configure
18 +++ b/unix/configure
19 @@ -237,63 +237,6 @@ _EOF_
20 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
21 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
24 -echo Check size of UIDs and GIDs
25 -echo "(Now zip stores variable size UIDs/GIDs using a new extra field. This"
26 -echo " tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage"
27 -echo " should also be used for backward compatibility.)"
28 -# Added 2008-04-15 CS
29 -cat > conftest.c << _EOF_
30 -# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
31 -# define _LARGEFILE64_SOURCE
32 -# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
33 -# define _LARGE_FILES /* some OSes need this for 64-bit off_t */
34 -#include <sys/types.h>
35 -#include <sys/stat.h>
36 -#include <unistd.h>
37 -#include <stdio.h>
38 -int main()
40 - struct stat s;
42 - printf(" s.st_uid is %u bytes\n", sizeof(s.st_uid));
43 - printf(" s.st_gid is %u bytes\n", sizeof(s.st_gid));
45 - /* see if have 16-bit UID */
46 - if (sizeof(s.st_uid) != 2) {
47 - return 1;
48 - }
49 - /* see if have 16-bit GID */
50 - if (sizeof(s.st_gid) != 2) {
51 - return 2;
52 - }
53 - return 3;
55 -_EOF_
56 -# compile it
57 -$CC -o conftest conftest.c >/dev/null 2>/dev/null
58 -if [ $? -ne 0 ]; then
59 - echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support
60 - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
61 -else
62 -# run it
63 - ./conftest
64 - r=$?
65 - if [ $r -eq 1 ]; then
66 - echo -- UID not 2 bytes - disabling old 16-bit UID/GID support
67 - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
68 - elif [ $r -eq 2 ]; then
69 - echo -- GID not 2 bytes - disabling old 16-bit UID/GID support
70 - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
71 - elif [ $r -eq 3 ]; then
72 - echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support
73 - else
74 - echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support
75 - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
76 - fi
77 -fi
80 # Now we set the 64-bit file environment and check the size of off_t
81 # Added 11/4/2003 EG
82 # Revised 8/12/2004 EG
83 --
84 1.9.3