]>
Commit | Line | Data |
---|---|---|
e1e03444 AM |
1 | diff -urN rpm-4.3.org/build/parseSpec.c rpm-4.3/build/parseSpec.c |
2 | --- rpm-4.3.org/build/parseSpec.c 2003-11-16 11:30:21.000000000 +0100 | |
3 | +++ rpm-4.3/build/parseSpec.c 2003-11-16 13:53:07.000000000 +0100 | |
4 | @@ -194,6 +194,16 @@ | |
5 | } | |
6 | /*@=boundswrite@*/ | |
7 | ||
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 | +} | |
17 | + | |
18 | /*@-boundswrite@*/ | |
19 | int readLine(Spec spec, int strip) | |
20 | { | |
21 | @@ -282,13 +292,15 @@ | |
22 | match = 0; | |
23 | } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) { | |
24 | const char *arch = rpmExpand("%{_target_cpu}", NULL); | |
25 | + const char *alternate_arch = getAlternateArch(arch); | |
26 | s += 7; | |
27 | - match = matchTok(arch, s); | |
28 | + match = matchTok(arch, s) || (alternate_arch && matchTok(alternate_arch, s)); | |
29 | arch = _free(arch); | |
30 | } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) { | |
31 | const char *arch = rpmExpand("%{_target_cpu}", NULL); | |
32 | + const char *alternate_arch = getAlternateArch(arch); | |
33 | s += 8; | |
34 | - match = !matchTok(arch, s); | |
35 | + match = !matchTok(arch, s) && (!alternate_arch || !matchTok(alternate_arch, s)); | |
36 | arch = _free(arch); | |
37 | } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) { | |
38 | const char *os = rpmExpand("%{_target_os}", NULL); | |
39 | diff -urN rpm-4.3.org/installplatform rpm-4.3/installplatform | |
40 | --- rpm-4.3.org/installplatform 2003-01-10 17:18:55.000000000 +0100 | |
41 | +++ rpm-4.3/installplatform 2003-11-16 13:59:30.000000000 +0100 | |
42 | @@ -34,6 +34,7 @@ | |
43 | alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;; | |
44 | sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;; | |
45 | powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6]\|$\)_ppc64\1_' ;; | |
46 | + x86_64*|amd64*) SUBSTS="s/${arch}/x86_64/ s/${arch}/amd64/" ;; | |
47 | s390*) SUBSTS='s_s390x_s390_ s_s390\([^x]\|$\)_s390x\1_' ;; | |
48 | *) SUBSTS=y___ ;; | |
49 | esac | |
50 | @@ -66,7 +67,7 @@ | |
51 | ppc-linux) MULTILIBNO=1 ;; | |
52 | ppc64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
53 | i?86-linux|athlon-linux) MULTILIBNO=1 ;; | |
54 | - x86_64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
55 | + x86_64-linux|amd64-linux) LIB=lib64; MULTILIBNO=2 ;; | |
56 | esac | |
57 | ||
58 | if [ -n "$MULTILIBNO" ]; then | |
59 | diff -urN rpm-4.3.org/lib/rpmrc.c rpm-4.3/lib/rpmrc.c | |
60 | --- rpm-4.3.org/lib/rpmrc.c 2003-11-16 11:30:21.000000000 +0100 | |
61 | +++ rpm-4.3/lib/rpmrc.c 2003-11-16 13:50:56.000000000 +0100 | |
62 | @@ -1278,6 +1278,13 @@ | |
63 | } | |
64 | # endif | |
65 | ||
66 | +# if defined(__linux__) && defined(__amd64__) | |
67 | + { | |
68 | + /* Defaults to amd64 if compiler supports __amd64__ */ | |
69 | + strcpy(un.machine, "amd64"); | |
70 | + } | |
71 | +# endif | |
72 | + | |
73 | # if defined(__linux__) && defined(__powerpc__) | |
74 | { | |
75 | unsigned pvr = 0; | |
76 | diff -urN rpm-4.3.org/rpmrc.in rpm-4.3/rpmrc.in | |
77 | --- rpm-4.3.org/rpmrc.in 2003-11-16 11:30:21.000000000 +0100 | |
78 | +++ rpm-4.3/rpmrc.in 2003-11-16 13:56:25.000000000 +0100 | |
79 | @@ -18,7 +18,8 @@ | |
80 | optflags: i686 -O2 -march=i686%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_i686: %{specflags_i686}}} | |
81 | optflags: athlon -O2 -march=athlon%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_athlon: %{specflags_athlon}}} | |
82 | optflags: ia64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia64: %{specflags_ia64}}} | |
83 | -optflags: x86_64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_x86_64: %{specflags_x86_64}}} | |
3aa13715 JB |
84 | +optflags: x86_64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_amd64: %{specflags_amd64}} |
85 | +optflags: amd64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_amd64: %{specflags_amd64}} | |
e1e03444 AM |
86 | |
87 | optflags: alpha -O2 -mieee%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_alpha: %{specflags_alpha}}} | |
88 | optflags: alphaev5 -O2 -mieee -mcpu=ev5%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_alpha: %{specflags_alpha}}%{?specflags_alphaev5: %{specflags_alphaev5}}} | |
89 | @@ -71,6 +72,7 @@ | |
90 | arch_canon: i486: i486 1 | |
91 | arch_canon: i386: i386 1 | |
92 | arch_canon: x86_64: x86_64 1 | |
93 | +arch_canon: amd64: amd64 1 | |
94 | ||
95 | arch_canon: alpha: alpha 2 | |
96 | arch_canon: alphaev5: alphaev5 2 | |
97 | @@ -201,7 +203,8 @@ | |
98 | ||
99 | buildarchtranslate: ia64: ia64 | |
100 | ||
101 | -buildarchtranslate: x86_64: x86_64 | |
102 | +buildarchtranslate: amd64: amd64 | |
103 | +buildarchtranslate: x86_64: amd64 | |
104 | ||
105 | ############################################################# | |
106 | # Architecture compatibility | |
107 | @@ -270,6 +273,7 @@ | |
108 | ||
109 | arch_compat: ia64: i686 noarch | |
110 | ||
111 | +arch_compat: amd64: x86_64 | |
112 | arch_compat: x86_64: athlon noarch | |
113 | ||
114 | os_compat: IRIX64: IRIX | |
115 | @@ -299,6 +303,7 @@ | |
116 | os_compat: BSD_OS: bsdi | |
117 | os_compat: bsdi4.0: bsdi | |
118 | ||
119 | +buildarch_compat: amd64: noarch | |
120 | buildarch_compat: ia64: noarch | |
121 | ||
122 | buildarch_compat: athlon: i686 |