Blame view

buildroot/buildroot-2016.08.1/package/rpm/0008-short-circuit-c99.patch 5.79 KB
6b13f685e   김민수   BSP 최초 추가
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
  Buildroot specific
  diff -ru rpm-5.1.9_vanilla/xz/configure rpm-5.1.9_short-circuit-c99/xz/configure
  --- rpm-5.1.9_vanilla/xz/configure	2009-04-18 16:47:23.000000000 +0000
  +++ rpm-5.1.9_short-circuit-c99/xz/configure	2009-08-04 08:25:59.000000000 +0000
  @@ -4970,214 +4970,7 @@
     am__fastdepCC_FALSE=
   fi
   
  -
  -   { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
  -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
  -if test "${ac_cv_prog_cc_c99+set}" = set; then
  -  $as_echo_n "(cached) " >&6
  -else
  -  ac_cv_prog_cc_c99=no
  -ac_save_CC=$CC
  -cat >conftest.$ac_ext <<_ACEOF
  -/* confdefs.h.  */
  -_ACEOF
  -cat confdefs.h >>conftest.$ac_ext
  -cat >>conftest.$ac_ext <<_ACEOF
  -/* end confdefs.h.  */
  -#include <stdarg.h>
  -#include <stdbool.h>
  -#include <stdlib.h>
  -#include <wchar.h>
  -#include <stdio.h>
  -
  -// Check varargs macros.  These examples are taken from C99 6.10.3.5.
  -#define debug(...) fprintf (stderr, __VA_ARGS__)
  -#define showlist(...) puts (#__VA_ARGS__)
  -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
  -static void
  -test_varargs_macros (void)
  -{
  -  int x = 1234;
  -  int y = 5678;
  -  debug ("Flag");
  -  debug ("X = %d
  ", x);
  -  showlist (The first, second, and third items.);
  -  report (x>y, "x is %d but y is %d", x, y);
  -}
  -
  -// Check long long types.
  -#define BIG64 18446744073709551615ull
  -#define BIG32 4294967295ul
  -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
  -#if !BIG_OK
  -  your preprocessor is broken;
  -#endif
  -#if BIG_OK
  -#else
  -  your preprocessor is broken;
  -#endif
  -static long long int bignum = -9223372036854775807LL;
  -static unsigned long long int ubignum = BIG64;
  -
  -struct incomplete_array
  -{
  -  int datasize;
  -  double data[];
  -};
  -
  -struct named_init {
  -  int number;
  -  const wchar_t *name;
  -  double average;
  -};
  -
  -typedef const char *ccp;
  -
  -static inline int
  -test_restrict (ccp restrict text)
  -{
  -  // See if C++-style comments work.
  -  // Iterate through items via the restricted pointer.
  -  // Also check for declarations in for loops.
  -  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
  -    continue;
  -  return 0;
  -}
  -
  -// Check varargs and va_copy.
  -static void
  -test_varargs (const char *format, ...)
  -{
  -  va_list args;
  -  va_start (args, format);
  -  va_list args_copy;
  -  va_copy (args_copy, args);
  -
  -  const char *str;
  -  int number;
  -  float fnumber;
  -
  -  while (*format)
  -    {
  -      switch (*format++)
  -	{
  -	case 's': // string
  -	  str = va_arg (args_copy, const char *);
  -	  break;
  -	case 'd': // int
  -	  number = va_arg (args_copy, int);
  -	  break;
  -	case 'f': // float
  -	  fnumber = va_arg (args_copy, double);
  -	  break;
  -	default:
  -	  break;
  -	}
  -    }
  -  va_end (args_copy);
  -  va_end (args);
  -}
  -
  -int
  -main ()
  -{
  -
  -  // Check bool.
  -  _Bool success = false;
  -
  -  // Check restrict.
  -  if (test_restrict ("String literal") == 0)
  -    success = true;
  -  char *restrict newvar = "Another string";
  -
  -  // Check varargs.
  -  test_varargs ("s, d' f .", "string", 65, 34.234);
  -  test_varargs_macros ();
  -
  -  // Check flexible array members.
  -  struct incomplete_array *ia =
  -    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
  -  ia->datasize = 10;
  -  for (int i = 0; i < ia->datasize; ++i)
  -    ia->data[i] = i * 1.234;
  -
  -  // Check named initializers.
  -  struct named_init ni = {
  -    .number = 34,
  -    .name = L"Test wide string",
  -    .average = 543.34343,
  -  };
  -
  -  ni.number = 58;
  -
  -  int dynamic_array[ni.number];
  -  dynamic_array[ni.number - 1] = 543;
  -
  -  // work around unused variable warnings
  -  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
  -	  || dynamic_array[ni.number - 1] != 543);
  -
  -  ;
  -  return 0;
  -}
  -_ACEOF
  -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
  -do
  -  CC="$ac_save_CC $ac_arg"
  -  rm -f conftest.$ac_objext
  -if { (ac_try="$ac_compile"
  -case "(($ac_try" in
  -  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  -  *) ac_try_echo=$ac_try;;
  -esac
  -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
  -$as_echo "$ac_try_echo") >&5
  -  (eval "$ac_compile") 2>conftest.er1
  -  ac_status=$?
  -  grep -v '^ *+' conftest.er1 >conftest.err
  -  rm -f conftest.er1
  -  cat conftest.err >&5
  -  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
  -  (exit $ac_status); } && {
  -	 test -z "$ac_c_werror_flag" ||
  -	 test ! -s conftest.err
  -       } && test -s conftest.$ac_objext; then
  -  ac_cv_prog_cc_c99=$ac_arg
  -else
  -  $as_echo "$as_me: failed program was:" >&5
  -sed 's/^/| /' conftest.$ac_ext >&5
  -
  -
  -fi
  -
  -rm -f core conftest.err conftest.$ac_objext
  -  test "x$ac_cv_prog_cc_c99" != "xno" && break
  -done
  -rm -f conftest.$ac_ext
  -CC=$ac_save_CC
  -
  -fi
  -# AC_CACHE_VAL
  -case "x$ac_cv_prog_cc_c99" in
  -  x)
  -    { $as_echo "$as_me:$LINENO: result: none needed" >&5
  -$as_echo "none needed" >&6; } ;;
  -  xno)
  -    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
  -$as_echo "unsupported" >&6; } ;;
  -  *)
  -    CC="$CC $ac_cv_prog_cc_c99"
  -    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
  -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
  -esac
  -
  -
  -
  -if test x$ac_cv_prog_cc_c99 = xno ; then
  -	{ { $as_echo "$as_me:$LINENO: error: No C99 compiler was found." >&5
  -$as_echo "$as_me: error: No C99 compiler was found." >&2;}
  -   { (exit 1); exit 1; }; }
  -fi
  +CC="$CC -std=c99"
   
   if test "x$CC" != xcc; then
     { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
  diff -ru rpm-5.1.9_vanilla/xz/configure.ac rpm-5.1.9_short-circuit-c99/xz/configure.ac
  --- rpm-5.1.9_vanilla/xz/configure.ac	2009-02-16 17:07:46.000000000 +0000
  +++ rpm-5.1.9_short-circuit-c99/xz/configure.ac	2009-08-04 08:25:28.000000000 +0000
  @@ -402,10 +402,7 @@
   AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
   AC_PROG_LN_S
   
  -AC_PROG_CC_C99
  -if test x$ac_cv_prog_cc_c99 = xno ; then
  -	AC_MSG_ERROR([No C99 compiler was found.])
  -fi
  +CC="$CC -std=c99"
   
   AM_PROG_CC_C_O
   AM_PROG_AS