Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/flex/, sys-devel/flex/files/
Date: Fri, 13 Oct 2017 20:19:39
Message-Id: 1507925963.aa6c077d00c3a21b75ae646421aefadcad527f80.whissi@gentoo
1 commit: aa6c077d00c3a21b75ae646421aefadcad527f80
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 13 20:16:10 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 13 20:19:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa6c077d
7
8 sys-devel/flex: Rev bump to fix multiple problems
9
10 Closes: https://bugs.gentoo.org/628744
11 Closes: https://bugs.gentoo.org/625508
12 See: https://bugs.gentoo.org/632523
13 Package-Manager: Portage-2.3.10, Repoman-2.3.3
14
15 .../flex-2.6.4-fix-build-with-glibc2.6+.patch | 767 +++++++++++++++++++++
16 sys-devel/flex/files/flex-2.6.4-libobjdir.patch | 26 +
17 sys-devel/flex/flex-2.6.4-r1.ebuild | 85 +++
18 3 files changed, 878 insertions(+)
19
20 diff --git a/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch b/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch
21 new file mode 100644
22 index 00000000000..328b5752456
23 --- /dev/null
24 +++ b/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch
25 @@ -0,0 +1,767 @@
26 +Backport of https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380
27 +
28 +Bug: https://bugs.gentoo.org/628744
29 +
30 +--- a/configure
31 ++++ b/configure
32 +@@ -3605,13 +3605,142 @@ test -z "$SED" && SED=sed
33 + Xsed="$SED -e 1s/^X//"
34 +
35 +
36 ++ac_ext=c
37 ++ac_cpp='$CPP $CPPFLAGS'
38 ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
39 ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
40 ++ac_compiler_gnu=$ac_cv_c_compiler_gnu
41 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
42 ++$as_echo_n "checking how to run the C preprocessor... " >&6; }
43 ++# On Suns, sometimes $CPP names a directory.
44 ++if test -n "$CPP" && test -d "$CPP"; then
45 ++ CPP=
46 ++fi
47 ++if test -z "$CPP"; then
48 ++ if ${ac_cv_prog_CPP+:} false; then :
49 ++ $as_echo_n "(cached) " >&6
50 ++else
51 ++ # Double quotes because CPP needs to be expanded
52 ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
53 ++ do
54 ++ ac_preproc_ok=false
55 ++for ac_c_preproc_warn_flag in '' yes
56 ++do
57 ++ # Use a header file that comes with gcc, so configuring glibc
58 ++ # with a fresh cross-compiler works.
59 ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
60 ++ # <limits.h> exists even on freestanding compilers.
61 ++ # On the NeXT, cc -E runs the code through the compiler's parser,
62 ++ # not just through cpp. "Syntax error" is here to catch this case.
63 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64 ++/* end confdefs.h. */
65 ++#ifdef __STDC__
66 ++# include <limits.h>
67 ++#else
68 ++# include <assert.h>
69 ++#endif
70 ++ Syntax error
71 ++_ACEOF
72 ++if ac_fn_c_try_cpp "$LINENO"; then :
73 ++
74 ++else
75 ++ # Broken: fails on valid input.
76 ++continue
77 ++fi
78 ++rm -f conftest.err conftest.i conftest.$ac_ext
79 ++
80 ++ # OK, works on sane cases. Now check whether nonexistent headers
81 ++ # can be detected and how.
82 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
83 ++/* end confdefs.h. */
84 ++#include <ac_nonexistent.h>
85 ++_ACEOF
86 ++if ac_fn_c_try_cpp "$LINENO"; then :
87 ++ # Broken: success on invalid input.
88 ++continue
89 ++else
90 ++ # Passes both tests.
91 ++ac_preproc_ok=:
92 ++break
93 ++fi
94 ++rm -f conftest.err conftest.i conftest.$ac_ext
95 ++
96 ++done
97 ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
98 ++rm -f conftest.i conftest.err conftest.$ac_ext
99 ++if $ac_preproc_ok; then :
100 ++ break
101 ++fi
102 +
103 ++ done
104 ++ ac_cv_prog_CPP=$CPP
105 +
106 ++fi
107 ++ CPP=$ac_cv_prog_CPP
108 ++else
109 ++ ac_cv_prog_CPP=$CPP
110 ++fi
111 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
112 ++$as_echo "$CPP" >&6; }
113 ++ac_preproc_ok=false
114 ++for ac_c_preproc_warn_flag in '' yes
115 ++do
116 ++ # Use a header file that comes with gcc, so configuring glibc
117 ++ # with a fresh cross-compiler works.
118 ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
119 ++ # <limits.h> exists even on freestanding compilers.
120 ++ # On the NeXT, cc -E runs the code through the compiler's parser,
121 ++ # not just through cpp. "Syntax error" is here to catch this case.
122 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
123 ++/* end confdefs.h. */
124 ++#ifdef __STDC__
125 ++# include <limits.h>
126 ++#else
127 ++# include <assert.h>
128 ++#endif
129 ++ Syntax error
130 ++_ACEOF
131 ++if ac_fn_c_try_cpp "$LINENO"; then :
132 +
133 ++else
134 ++ # Broken: fails on valid input.
135 ++continue
136 ++fi
137 ++rm -f conftest.err conftest.i conftest.$ac_ext
138 +
139 ++ # OK, works on sane cases. Now check whether nonexistent headers
140 ++ # can be detected and how.
141 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
142 ++/* end confdefs.h. */
143 ++#include <ac_nonexistent.h>
144 ++_ACEOF
145 ++if ac_fn_c_try_cpp "$LINENO"; then :
146 ++ # Broken: success on invalid input.
147 ++continue
148 ++else
149 ++ # Passes both tests.
150 ++ac_preproc_ok=:
151 ++break
152 ++fi
153 ++rm -f conftest.err conftest.i conftest.$ac_ext
154 +
155 ++done
156 ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
157 ++rm -f conftest.i conftest.err conftest.$ac_ext
158 ++if $ac_preproc_ok; then :
159 +
160 ++else
161 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
162 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
163 ++as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
164 ++See \`config.log' for more details" "$LINENO" 5; }
165 ++fi
166 +
167 ++ac_ext=c
168 ++ac_cpp='$CPP $CPPFLAGS'
169 ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
170 ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
171 ++ac_compiler_gnu=$ac_cv_c_compiler_gnu
172 +
173 +
174 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
175 +@@ -3744,91 +3873,208 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
176 + EGREP="$ac_cv_path_EGREP"
177 +
178 +
179 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
180 +-$as_echo_n "checking for fgrep... " >&6; }
181 +-if ${ac_cv_path_FGREP+:} false; then :
182 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
183 ++$as_echo_n "checking for ANSI C header files... " >&6; }
184 ++if ${ac_cv_header_stdc+:} false; then :
185 + $as_echo_n "(cached) " >&6
186 + else
187 +- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
188 +- then ac_cv_path_FGREP="$GREP -F"
189 +- else
190 +- if test -z "$FGREP"; then
191 +- ac_path_FGREP_found=false
192 +- # Loop through the user's path and test for each of PROGNAME-LIST
193 +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
194 +-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
195 +-do
196 +- IFS=$as_save_IFS
197 +- test -z "$as_dir" && as_dir=.
198 +- for ac_prog in fgrep; do
199 +- for ac_exec_ext in '' $ac_executable_extensions; do
200 +- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
201 +- as_fn_executable_p "$ac_path_FGREP" || continue
202 +-# Check for GNU ac_path_FGREP and select it if it is found.
203 +- # Check for GNU $ac_path_FGREP
204 +-case `"$ac_path_FGREP" --version 2>&1` in
205 +-*GNU*)
206 +- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
207 +-*)
208 +- ac_count=0
209 +- $as_echo_n 0123456789 >"conftest.in"
210 +- while :
211 +- do
212 +- cat "conftest.in" "conftest.in" >"conftest.tmp"
213 +- mv "conftest.tmp" "conftest.in"
214 +- cp "conftest.in" "conftest.nl"
215 +- $as_echo 'FGREP' >> "conftest.nl"
216 +- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
217 +- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
218 +- as_fn_arith $ac_count + 1 && ac_count=$as_val
219 +- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
220 +- # Best one so far, save it but keep looking for a better one
221 +- ac_cv_path_FGREP="$ac_path_FGREP"
222 +- ac_path_FGREP_max=$ac_count
223 +- fi
224 +- # 10*(2^10) chars as input seems more than enough
225 +- test $ac_count -gt 10 && break
226 +- done
227 +- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
228 +-esac
229 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
230 ++/* end confdefs.h. */
231 ++#include <stdlib.h>
232 ++#include <stdarg.h>
233 ++#include <string.h>
234 ++#include <float.h>
235 +
236 +- $ac_path_FGREP_found && break 3
237 +- done
238 +- done
239 +- done
240 +-IFS=$as_save_IFS
241 +- if test -z "$ac_cv_path_FGREP"; then
242 +- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
243 +- fi
244 +-else
245 +- ac_cv_path_FGREP=$FGREP
246 +-fi
247 ++int
248 ++main ()
249 ++{
250 +
251 +- fi
252 ++ ;
253 ++ return 0;
254 ++}
255 ++_ACEOF
256 ++if ac_fn_c_try_compile "$LINENO"; then :
257 ++ ac_cv_header_stdc=yes
258 ++else
259 ++ ac_cv_header_stdc=no
260 + fi
261 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
262 +-$as_echo "$ac_cv_path_FGREP" >&6; }
263 +- FGREP="$ac_cv_path_FGREP"
264 +-
265 ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
266 +
267 +-test -z "$GREP" && GREP=grep
268 ++if test $ac_cv_header_stdc = yes; then
269 ++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
270 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
271 ++/* end confdefs.h. */
272 ++#include <string.h>
273 +
274 ++_ACEOF
275 ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
276 ++ $EGREP "memchr" >/dev/null 2>&1; then :
277 +
278 ++else
279 ++ ac_cv_header_stdc=no
280 ++fi
281 ++rm -f conftest*
282 +
283 ++fi
284 +
285 ++if test $ac_cv_header_stdc = yes; then
286 ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
287 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
288 ++/* end confdefs.h. */
289 ++#include <stdlib.h>
290 +
291 ++_ACEOF
292 ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
293 ++ $EGREP "free" >/dev/null 2>&1; then :
294 +
295 ++else
296 ++ ac_cv_header_stdc=no
297 ++fi
298 ++rm -f conftest*
299 +
300 ++fi
301 +
302 ++if test $ac_cv_header_stdc = yes; then
303 ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
304 ++ if test "$cross_compiling" = yes; then :
305 ++ :
306 ++else
307 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
308 ++/* end confdefs.h. */
309 ++#include <ctype.h>
310 ++#include <stdlib.h>
311 ++#if ((' ' & 0x0FF) == 0x020)
312 ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
313 ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
314 ++#else
315 ++# define ISLOWER(c) \
316 ++ (('a' <= (c) && (c) <= 'i') \
317 ++ || ('j' <= (c) && (c) <= 'r') \
318 ++ || ('s' <= (c) && (c) <= 'z'))
319 ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
320 ++#endif
321 +
322 ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
323 ++int
324 ++main ()
325 ++{
326 ++ int i;
327 ++ for (i = 0; i < 256; i++)
328 ++ if (XOR (islower (i), ISLOWER (i))
329 ++ || toupper (i) != TOUPPER (i))
330 ++ return 2;
331 ++ return 0;
332 ++}
333 ++_ACEOF
334 ++if ac_fn_c_try_run "$LINENO"; then :
335 +
336 ++else
337 ++ ac_cv_header_stdc=no
338 ++fi
339 ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
340 ++ conftest.$ac_objext conftest.beam conftest.$ac_ext
341 ++fi
342 +
343 ++fi
344 ++fi
345 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
346 ++$as_echo "$ac_cv_header_stdc" >&6; }
347 ++if test $ac_cv_header_stdc = yes; then
348 +
349 ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h
350 +
351 ++fi
352 +
353 ++# On IRIX 5.3, sys/types and inttypes.h are conflicting.
354 ++for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
355 ++ inttypes.h stdint.h unistd.h
356 ++do :
357 ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
358 ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
359 ++"
360 ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
361 ++ cat >>confdefs.h <<_ACEOF
362 ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
363 ++_ACEOF
364 ++
365 ++fi
366 ++
367 ++done
368 ++
369 ++
370 ++
371 ++ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
372 ++if test "x$ac_cv_header_minix_config_h" = xyes; then :
373 ++ MINIX=yes
374 ++else
375 ++ MINIX=
376 ++fi
377 ++
378 ++
379 ++ if test "$MINIX" = yes; then
380 +
381 ++$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
382 +
383 +
384 ++$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
385 ++
386 ++
387 ++$as_echo "#define _MINIX 1" >>confdefs.h
388 ++
389 ++ fi
390 ++
391 ++
392 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
393 ++$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
394 ++if ${ac_cv_safe_to_define___extensions__+:} false; then :
395 ++ $as_echo_n "(cached) " >&6
396 ++else
397 ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
398 ++/* end confdefs.h. */
399 ++
400 ++# define __EXTENSIONS__ 1
401 ++ $ac_includes_default
402 ++int
403 ++main ()
404 ++{
405 ++
406 ++ ;
407 ++ return 0;
408 ++}
409 ++_ACEOF
410 ++if ac_fn_c_try_compile "$LINENO"; then :
411 ++ ac_cv_safe_to_define___extensions__=yes
412 ++else
413 ++ ac_cv_safe_to_define___extensions__=no
414 ++fi
415 ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
416 ++fi
417 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
418 ++$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
419 ++ test $ac_cv_safe_to_define___extensions__ = yes &&
420 ++ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
421 ++
422 ++ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
423 ++
424 ++ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
425 ++
426 ++ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
427 ++
428 ++ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
429 ++
430 ++
431 ++for ac_header in dlfcn.h
432 ++do :
433 ++ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
434 ++"
435 ++if test "x$ac_cv_header_dlfcn_h" = xyes; then :
436 ++ cat >>confdefs.h <<_ACEOF
437 ++#define HAVE_DLFCN_H 1
438 ++_ACEOF
439 ++
440 ++fi
441 ++
442 ++done
443 +
444 +
445 + # Check whether --with-gnu-ld was given.
446 +@@ -6898,288 +7144,6 @@ func_munge_path_list ()
447 + esac
448 + }
449 +
450 +-ac_ext=c
451 +-ac_cpp='$CPP $CPPFLAGS'
452 +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
453 +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
454 +-ac_compiler_gnu=$ac_cv_c_compiler_gnu
455 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
456 +-$as_echo_n "checking how to run the C preprocessor... " >&6; }
457 +-# On Suns, sometimes $CPP names a directory.
458 +-if test -n "$CPP" && test -d "$CPP"; then
459 +- CPP=
460 +-fi
461 +-if test -z "$CPP"; then
462 +- if ${ac_cv_prog_CPP+:} false; then :
463 +- $as_echo_n "(cached) " >&6
464 +-else
465 +- # Double quotes because CPP needs to be expanded
466 +- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
467 +- do
468 +- ac_preproc_ok=false
469 +-for ac_c_preproc_warn_flag in '' yes
470 +-do
471 +- # Use a header file that comes with gcc, so configuring glibc
472 +- # with a fresh cross-compiler works.
473 +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
474 +- # <limits.h> exists even on freestanding compilers.
475 +- # On the NeXT, cc -E runs the code through the compiler's parser,
476 +- # not just through cpp. "Syntax error" is here to catch this case.
477 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
478 +-/* end confdefs.h. */
479 +-#ifdef __STDC__
480 +-# include <limits.h>
481 +-#else
482 +-# include <assert.h>
483 +-#endif
484 +- Syntax error
485 +-_ACEOF
486 +-if ac_fn_c_try_cpp "$LINENO"; then :
487 +-
488 +-else
489 +- # Broken: fails on valid input.
490 +-continue
491 +-fi
492 +-rm -f conftest.err conftest.i conftest.$ac_ext
493 +-
494 +- # OK, works on sane cases. Now check whether nonexistent headers
495 +- # can be detected and how.
496 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
497 +-/* end confdefs.h. */
498 +-#include <ac_nonexistent.h>
499 +-_ACEOF
500 +-if ac_fn_c_try_cpp "$LINENO"; then :
501 +- # Broken: success on invalid input.
502 +-continue
503 +-else
504 +- # Passes both tests.
505 +-ac_preproc_ok=:
506 +-break
507 +-fi
508 +-rm -f conftest.err conftest.i conftest.$ac_ext
509 +-
510 +-done
511 +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
512 +-rm -f conftest.i conftest.err conftest.$ac_ext
513 +-if $ac_preproc_ok; then :
514 +- break
515 +-fi
516 +-
517 +- done
518 +- ac_cv_prog_CPP=$CPP
519 +-
520 +-fi
521 +- CPP=$ac_cv_prog_CPP
522 +-else
523 +- ac_cv_prog_CPP=$CPP
524 +-fi
525 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
526 +-$as_echo "$CPP" >&6; }
527 +-ac_preproc_ok=false
528 +-for ac_c_preproc_warn_flag in '' yes
529 +-do
530 +- # Use a header file that comes with gcc, so configuring glibc
531 +- # with a fresh cross-compiler works.
532 +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
533 +- # <limits.h> exists even on freestanding compilers.
534 +- # On the NeXT, cc -E runs the code through the compiler's parser,
535 +- # not just through cpp. "Syntax error" is here to catch this case.
536 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
537 +-/* end confdefs.h. */
538 +-#ifdef __STDC__
539 +-# include <limits.h>
540 +-#else
541 +-# include <assert.h>
542 +-#endif
543 +- Syntax error
544 +-_ACEOF
545 +-if ac_fn_c_try_cpp "$LINENO"; then :
546 +-
547 +-else
548 +- # Broken: fails on valid input.
549 +-continue
550 +-fi
551 +-rm -f conftest.err conftest.i conftest.$ac_ext
552 +-
553 +- # OK, works on sane cases. Now check whether nonexistent headers
554 +- # can be detected and how.
555 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
556 +-/* end confdefs.h. */
557 +-#include <ac_nonexistent.h>
558 +-_ACEOF
559 +-if ac_fn_c_try_cpp "$LINENO"; then :
560 +- # Broken: success on invalid input.
561 +-continue
562 +-else
563 +- # Passes both tests.
564 +-ac_preproc_ok=:
565 +-break
566 +-fi
567 +-rm -f conftest.err conftest.i conftest.$ac_ext
568 +-
569 +-done
570 +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
571 +-rm -f conftest.i conftest.err conftest.$ac_ext
572 +-if $ac_preproc_ok; then :
573 +-
574 +-else
575 +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
576 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
577 +-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
578 +-See \`config.log' for more details" "$LINENO" 5; }
579 +-fi
580 +-
581 +-ac_ext=c
582 +-ac_cpp='$CPP $CPPFLAGS'
583 +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
584 +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
585 +-ac_compiler_gnu=$ac_cv_c_compiler_gnu
586 +-
587 +-
588 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
589 +-$as_echo_n "checking for ANSI C header files... " >&6; }
590 +-if ${ac_cv_header_stdc+:} false; then :
591 +- $as_echo_n "(cached) " >&6
592 +-else
593 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
594 +-/* end confdefs.h. */
595 +-#include <stdlib.h>
596 +-#include <stdarg.h>
597 +-#include <string.h>
598 +-#include <float.h>
599 +-
600 +-int
601 +-main ()
602 +-{
603 +-
604 +- ;
605 +- return 0;
606 +-}
607 +-_ACEOF
608 +-if ac_fn_c_try_compile "$LINENO"; then :
609 +- ac_cv_header_stdc=yes
610 +-else
611 +- ac_cv_header_stdc=no
612 +-fi
613 +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
614 +-
615 +-if test $ac_cv_header_stdc = yes; then
616 +- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
617 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
618 +-/* end confdefs.h. */
619 +-#include <string.h>
620 +-
621 +-_ACEOF
622 +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
623 +- $EGREP "memchr" >/dev/null 2>&1; then :
624 +-
625 +-else
626 +- ac_cv_header_stdc=no
627 +-fi
628 +-rm -f conftest*
629 +-
630 +-fi
631 +-
632 +-if test $ac_cv_header_stdc = yes; then
633 +- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
634 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
635 +-/* end confdefs.h. */
636 +-#include <stdlib.h>
637 +-
638 +-_ACEOF
639 +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
640 +- $EGREP "free" >/dev/null 2>&1; then :
641 +-
642 +-else
643 +- ac_cv_header_stdc=no
644 +-fi
645 +-rm -f conftest*
646 +-
647 +-fi
648 +-
649 +-if test $ac_cv_header_stdc = yes; then
650 +- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
651 +- if test "$cross_compiling" = yes; then :
652 +- :
653 +-else
654 +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
655 +-/* end confdefs.h. */
656 +-#include <ctype.h>
657 +-#include <stdlib.h>
658 +-#if ((' ' & 0x0FF) == 0x020)
659 +-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
660 +-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
661 +-#else
662 +-# define ISLOWER(c) \
663 +- (('a' <= (c) && (c) <= 'i') \
664 +- || ('j' <= (c) && (c) <= 'r') \
665 +- || ('s' <= (c) && (c) <= 'z'))
666 +-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
667 +-#endif
668 +-
669 +-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
670 +-int
671 +-main ()
672 +-{
673 +- int i;
674 +- for (i = 0; i < 256; i++)
675 +- if (XOR (islower (i), ISLOWER (i))
676 +- || toupper (i) != TOUPPER (i))
677 +- return 2;
678 +- return 0;
679 +-}
680 +-_ACEOF
681 +-if ac_fn_c_try_run "$LINENO"; then :
682 +-
683 +-else
684 +- ac_cv_header_stdc=no
685 +-fi
686 +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
687 +- conftest.$ac_objext conftest.beam conftest.$ac_ext
688 +-fi
689 +-
690 +-fi
691 +-fi
692 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
693 +-$as_echo "$ac_cv_header_stdc" >&6; }
694 +-if test $ac_cv_header_stdc = yes; then
695 +-
696 +-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
697 +-
698 +-fi
699 +-
700 +-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
701 +-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
702 +- inttypes.h stdint.h unistd.h
703 +-do :
704 +- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
705 +-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
706 +-"
707 +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
708 +- cat >>confdefs.h <<_ACEOF
709 +-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
710 +-_ACEOF
711 +-
712 +-fi
713 +-
714 +-done
715 +-
716 +-
717 +-for ac_header in dlfcn.h
718 +-do :
719 +- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
720 +-"
721 +-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
722 +- cat >>confdefs.h <<_ACEOF
723 +-#define HAVE_DLFCN_H 1
724 +-_ACEOF
725 +-
726 +-fi
727 +-
728 +-done
729 +-
730 +-
731 +-
732 +
733 +
734 + # Set options
735 +--- a/src/config.h.in
736 ++++ b/src/config.h.in
737 +@@ -207,6 +207,9 @@
738 + /* Define to the m4 executable name. */
739 + #undef M4
740 +
741 ++/* Define to 1 if your C compiler doesn't accept -c and -o together. */
742 ++#undef NO_MINUS_C_MINUS_O
743 ++
744 + /* Name of package */
745 + #undef PACKAGE
746 +
747 +@@ -239,6 +242,28 @@
748 + /* Define to 1 if you have the ANSI C header files. */
749 + #undef STDC_HEADERS
750 +
751 ++/* Enable extensions on AIX 3, Interix. */
752 ++#ifndef _ALL_SOURCE
753 ++# undef _ALL_SOURCE
754 ++#endif
755 ++/* Enable GNU extensions on systems that have them. */
756 ++#ifndef _GNU_SOURCE
757 ++# undef _GNU_SOURCE
758 ++#endif
759 ++/* Enable threading extensions on Solaris. */
760 ++#ifndef _POSIX_PTHREAD_SEMANTICS
761 ++# undef _POSIX_PTHREAD_SEMANTICS
762 ++#endif
763 ++/* Enable extensions on HP NonStop. */
764 ++#ifndef _TANDEM_SOURCE
765 ++# undef _TANDEM_SOURCE
766 ++#endif
767 ++/* Enable general extensions on Solaris. */
768 ++#ifndef __EXTENSIONS__
769 ++# undef __EXTENSIONS__
770 ++#endif
771 ++
772 ++
773 + /* Version number of package */
774 + #undef VERSION
775 +
776 +@@ -246,6 +271,16 @@
777 + `char[]'. */
778 + #undef YYTEXT_POINTER
779 +
780 ++/* Define to 1 if on MINIX. */
781 ++#undef _MINIX
782 ++
783 ++/* Define to 2 if the system does not provide POSIX.1 features except with
784 ++ this defined. */
785 ++#undef _POSIX_1_SOURCE
786 ++
787 ++/* Define to 1 if you need to in order for `stat' and other things to work. */
788 ++#undef _POSIX_SOURCE
789 ++
790 + /* Define to empty if `const' does not conform to ANSI C. */
791 + #undef const
792 +
793
794 diff --git a/sys-devel/flex/files/flex-2.6.4-libobjdir.patch b/sys-devel/flex/files/flex-2.6.4-libobjdir.patch
795 new file mode 100644
796 index 00000000000..a652b9236b1
797 --- /dev/null
798 +++ b/sys-devel/flex/files/flex-2.6.4-libobjdir.patch
799 @@ -0,0 +1,26 @@
800 +https://github.com/westes/flex/commit/24e73c4446841eda8d4ea01298e887059e8c1472
801 +
802 +Bug: https://bugs.gentoo.org/625508
803 +
804 +--- a/src/Makefile.am
805 ++++ b/src/Makefile.am
806 +@@ -79,6 +79,8 @@ COMMON_SOURCES = \
807 +
808 + LDADD = $(LIBOBJS) @LIBINTL@
809 +
810 ++$(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)
811 ++
812 + include_HEADERS = \
813 + FlexLexer.h
814 +
815 +--- a/src/Makefile.in
816 ++++ b/src/Makefile.in
817 +@@ -1688,6 +1688,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
818 + @CROSS_TRUE@$(stage1flex_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
819 + @CROSS_TRUE@$(stage1flex_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
820 +
821 ++$(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)
822 ++
823 + skel.c: flex.skl mkskel.sh flexint.h tables_shared.h tables_shared.c
824 + $(SHELL) $(srcdir)/mkskel.sh $(srcdir) $(m4) $(VERSION) > $@.tmp
825 + mv $@.tmp $@
826
827 diff --git a/sys-devel/flex/flex-2.6.4-r1.ebuild b/sys-devel/flex/flex-2.6.4-r1.ebuild
828 new file mode 100644
829 index 00000000000..b221d35914b
830 --- /dev/null
831 +++ b/sys-devel/flex/flex-2.6.4-r1.ebuild
832 @@ -0,0 +1,85 @@
833 +# Copyright 1999-2017 Gentoo Foundation
834 +# Distributed under the terms of the GNU General Public License v2
835 +
836 +EAPI="6"
837 +
838 +inherit eutils flag-o-matic libtool multilib-minimal
839 +
840 +DESCRIPTION="The Fast Lexical Analyzer"
841 +HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
842 +SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
843 +
844 +LICENSE="FLEX"
845 +SLOT="0"
846 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
847 +IUSE="nls static test"
848 +
849 +# We want bison explicitly and not yacc in general #381273
850 +RDEPEND="sys-devel/m4"
851 +DEPEND="${RDEPEND}
852 + app-arch/xz-utils
853 + nls? ( sys-devel/gettext )
854 + test? ( sys-devel/bison )"
855 +
856 +PATCHES=(
857 + "${FILESDIR}"/${PN}-2.6.4-libobjdir.patch
858 + "${FILESDIR}"/${PN}-2.6.4-fix-build-with-glibc2.6+.patch
859 +)
860 +
861 +src_prepare() {
862 + default
863 +
864 + # Disable running in the tests/ subdir as it has a bunch of built sources
865 + # that cannot be made conditional (automake limitation). #568842
866 + if ! use test ; then
867 + sed -i \
868 + -e '/^SUBDIRS =/,/^$/{/tests/d}' \
869 + Makefile.in || die
870 + fi
871 + elibtoolize # Prefix always needs this
872 +}
873 +
874 +src_configure() {
875 + use static && append-ldflags -static
876 +
877 + multilib-minimal_src_configure
878 +}
879 +
880 +multilib_src_configure() {
881 + # Do not install shared libs #503522
882 + ECONF_SOURCE=${S} \
883 + econf \
884 + --disable-shared \
885 + $(use_enable nls) \
886 + --docdir='$(datarootdir)/doc/'${PF}
887 +}
888 +
889 +multilib_src_compile() {
890 + if multilib_is_native_abi; then
891 + default
892 + else
893 + cd src || die
894 + emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
895 + fi
896 +}
897 +
898 +multilib_src_test() {
899 + multilib_is_native_abi && emake check
900 +}
901 +
902 +multilib_src_install() {
903 + if multilib_is_native_abi; then
904 + default
905 + else
906 + cd src || die
907 + emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
908 + fi
909 +}
910 +
911 +multilib_src_install_all() {
912 + einstalldocs
913 + dodoc ONEWS
914 + prune_libtool_files --all
915 + rm "${ED}"/usr/share/doc/${PF}/COPYING || die
916 + dosym flex /usr/bin/lex
917 +}