Add missing ${C,LD}FLAGS to various package builds
[qi-bootmenu-system.git] / sources / patches / linux-2.6.28-perl3.patch
blob59d28bdfd7eb7462d9f5ecbc014c2a9235129e00
1 From: Rob Landley <rob@landley.net>
3 Convert kernel/cpu/mkcapflags.pl to kernel/cpu/mkcapflags.sh.
5 This script generates kernel/cpu/capflags.c from include/asm/cpufeature.h.
7 Signed-off-by: Rob Landley <rob@landley.net>
8 ---
10 Changes from previous version (http://lkml.org/lkml/2009/1/2/24):
12 None, just a rediff.
14 arch/x86/kernel/cpu/Makefile | 4 +--
15 arch/x86/kernel/cpu/mkcapflags.pl | 32 ----------------------------
16 arch/x86/kernel/cpu/mkcapflags.sh | 28 ++++++++++++++++++++++++
17 3 files changed, 30 insertions(+), 34 deletions(-)
19 diff -ruN linux-2.6.30.old/arch/x86/kernel/cpu/Makefile linux-2.6.30/arch/x86/kernel/cpu/Makefile
20 --- linux-2.6.30.old/arch/x86/kernel/cpu/Makefile 2009-06-09 22:05:27.000000000 -0500
21 +++ linux-2.6.30/arch/x86/kernel/cpu/Makefile 2009-06-22 16:39:06.000000000 -0500
22 @@ -30,10 +30,10 @@
23 obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
25 quiet_cmd_mkcapflags = MKCAP $@
26 - cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@
27 + cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $< $@
29 cpufeature = $(src)/../../include/asm/cpufeature.h
31 targets += capflags.c
32 -$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.pl FORCE
33 +$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
34 $(call if_changed,mkcapflags)
35 diff -ruN linux-2.6.30.old/arch/x86/kernel/cpu/mkcapflags.pl linux-2.6.30/arch/x86/kernel/cpu/mkcapflags.pl
36 --- linux-2.6.30.old/arch/x86/kernel/cpu/mkcapflags.pl 2009-06-09 22:05:27.000000000 -0500
37 +++ linux-2.6.30/arch/x86/kernel/cpu/mkcapflags.pl 1969-12-31 18:00:00.000000000 -0600
38 @@ -1,32 +0,0 @@
39 -#!/usr/bin/perl
41 -# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h
44 -($in, $out) = @ARGV;
46 -open(IN, "< $in\0") or die "$0: cannot open: $in: $!\n";
47 -open(OUT, "> $out\0") or die "$0: cannot create: $out: $!\n";
49 -print OUT "#include <asm/cpufeature.h>\n\n";
50 -print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";
52 -while (defined($line = <IN>)) {
53 - if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
54 - $macro = $1;
55 - $feature = $2;
56 - $tail = $3;
57 - if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) {
58 - $feature = $1;
59 - }
61 - if ($feature ne '') {
62 - printf OUT "\t%-32s = \"%s\",\n",
63 - "[$macro]", "\L$feature";
64 - }
65 - }
67 -print OUT "};\n";
69 -close(IN);
70 -close(OUT);
71 diff -ruN linux-2.6.30.old/arch/x86/kernel/cpu/mkcapflags.sh linux-2.6.30/arch/x86/kernel/cpu/mkcapflags.sh
72 --- linux-2.6.30.old/arch/x86/kernel/cpu/mkcapflags.sh 1969-12-31 18:00:00.000000000 -0600
73 +++ linux-2.6.30/arch/x86/kernel/cpu/mkcapflags.sh 2009-06-22 16:39:06.000000000 -0500
74 @@ -0,0 +1,28 @@
75 +#!/bin/sh
77 +# Generate the x86_cap_flags[] array from include/asm/cpufeature.h
80 +IN=$1
81 +OUT=$2
84 + echo "#include <asm/cpufeature.h>"
85 + echo ""
86 + echo "const char * const x86_cap_flags[NCAPINTS*32] = {"
88 + # Iterate through any input lines starting with #define X86_FEATURE_
89 + sed -n -e 's/\t/ /g' -e 's/^ *# *define *X86_FEATURE_//p' $IN |
90 + while read i
91 + do
92 + # Name is everything up to the first whitespace
93 + NAME="$(echo "$i" | sed 's/ .*//')"
95 + # If the /* comment */ starts with a quote string, grab that.
96 + VALUE="$(echo "$i" | sed -n 's@.*/\* *\("[^"]*"\).*\*/@\1@p')"
97 + [ -z "$VALUE" ] && VALUE="\"$(echo "$NAME" | tr A-Z a-z)\""
99 + [ "$VALUE" != '""' ] && echo " [X86_FEATURE_$NAME] = $VALUE,"
100 + done
101 + echo "};"
102 +) > $OUT