]>
Commit | Line | Data |
---|---|---|
e1e03444 | 1 | diff -urN rpm-4.3.org/build/parseSpec.c rpm-4.3/build/parseSpec.c |
012a8819 AM |
2 | --- rpm-4.3.org/build/parseSpec.c 2003-12-27 23:56:47.451095576 +0100 |
3 | +++ rpm-4.3/build/parseSpec.c 2003-12-28 00:32:48.447574176 +0100 | |
4 | @@ -189,6 +189,15 @@ | |
5 | return 0; | |
e1e03444 AM |
6 | } |
7 | /*@=boundswrite@*/ | |
e1e03444 AM |
8 | +static const char *getAlternateArch(const char *arch) |
9 | +{ | |
10 | + const char *alternate_arch = NULL; | |
11 | + if (! strncmp("x86_64", arch, sizeof("x86_64")-1)) | |
12 | + alternate_arch = "amd64"; | |
13 | + else if (! strncmp("amd64", arch, sizeof("amd64")-1)) | |
14 | + alternate_arch = "x86_64"; | |
15 | + return alternate_arch; | |
16 | +} | |
012a8819 | 17 | |
e1e03444 AM |
18 | /*@-boundswrite@*/ |
19 | int readLine(Spec spec, int strip) | |
012a8819 | 20 | @@ -277,13 +286,15 @@ |
e1e03444 AM |
21 | match = 0; |
22 | } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) { | |
23 | const char *arch = rpmExpand("%{_target_cpu}", NULL); | |
24 | + const char *alternate_arch = getAlternateArch(arch); | |
25 | s += 7; | |
26 | - match = matchTok(arch, s); | |
27 | + match = matchTok(arch, s) || (alternate_arch && matchTok(alternate_arch, s)); | |
28 | arch = _free(arch); | |
29 | } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) { | |
30 | const char *arch = rpmExpand("%{_target_cpu}", NULL); | |
31 | + const char *alternate_arch = getAlternateArch(arch); | |
32 | s += 8; | |
33 | - match = !matchTok(arch, s); | |
34 | + match = !matchTok(arch, s) && (!alternate_arch || !matchTok(alternate_arch, s)); | |
35 | arch = _free(arch); | |
36 | } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) { | |
37 | const char *os = rpmExpand("%{_target_os}", NULL); | |
38 | diff -urN rpm-4.3.org/installplatform rpm-4.3/installplatform | |
012a8819 AM |
39 | --- rpm-4.3.org/installplatform 2003-12-27 23:56:26.892221000 +0100 |
40 | +++ rpm-4.3/installplatform 2003-12-28 00:37:53.285231808 +0100 | |
41 | @@ -31,6 +31,7 @@ | |
42 | ||
43 | case "$arch" in | |
44 | i[3456]86|athlon) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_athlon_' ;; | |
45 | + x86_64*|amd64*) SUBSTS="s/${arch}/x86_64/ s/${arch}/amd64/" ;; | |
e1e03444 AM |
46 | alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;; |
47 | sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;; | |
012a8819 | 48 | powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;; |
e1e03444 AM |
49 | @@ -66,7 +67,7 @@ |
50 | ppc-linux) MULTILIBNO=1 ;; | |
51 | ppc64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
52 | i?86-linux|athlon-linux) MULTILIBNO=1 ;; | |
53 | - x86_64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
54 | + x86_64-linux|amd64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
55 | esac | |
56 | ||
57 | if [ -n "$MULTILIBNO" ]; then | |
58 | diff -urN rpm-4.3.org/lib/rpmrc.c rpm-4.3/lib/rpmrc.c | |
012a8819 AM |
59 | --- rpm-4.3.org/lib/rpmrc.c 2003-12-27 23:56:25.717399600 +0100 |
60 | +++ rpm-4.3/lib/rpmrc.c 2003-12-28 00:38:48.681810248 +0100 | |
e1e03444 AM |
61 | @@ -1278,6 +1278,13 @@ |
62 | } | |
63 | # endif | |
64 | ||
012a8819 AM |
65 | +# if defined(__linux__) && defined(__amd64__) |
66 | + { | |
e1e03444 | 67 | + /* Defaults to amd64 if compiler supports __amd64__ */ |
012a8819 AM |
68 | + strcpy(un.machine, "amd64"); |
69 | + } | |
70 | +# endif | |
71 | + | |
e1e03444 AM |
72 | # if defined(__linux__) && defined(__powerpc__) |
73 | { | |
74 | unsigned pvr = 0; | |
75 | diff -urN rpm-4.3.org/rpmrc.in rpm-4.3/rpmrc.in | |
012a8819 AM |
76 | --- rpm-4.3.org/rpmrc.in 2003-12-28 00:27:30.039979488 +0100 |
77 | +++ rpm-4.3/rpmrc.in 2003-12-28 00:40:25.817043448 +0100 | |
78 | @@ -203,8 +203,8 @@ | |
e1e03444 AM |
79 | |
80 | buildarchtranslate: ia64: ia64 | |
81 | ||
82 | -buildarchtranslate: x86_64: x86_64 | |
012a8819 | 83 | -buildarchtranslate: amd64: x86_64 |
e1e03444 | 84 | +buildarchtranslate: x86_64: amd64 |
012a8819 | 85 | +buildarchtranslate: amd64: amd64 |
e1e03444 AM |
86 | |
87 | ############################################################# | |
88 | # Architecture compatibility |