]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-amd64.patch
- ugly gcc hack not needed.
[packages/rpm.git] / rpm-amd64.patch
1 diff -urN rpm.org/build/parseSpec.c rpm/build/parseSpec.c
2 --- rpm.org/build/parseSpec.c   2004-06-14 14:52:54.433793272 +0200
3 +++ rpm/build/parseSpec.c       2004-06-14 14:55:21.399451096 +0200
4 @@ -227,6 +227,15 @@
5      return 0;
6  }
7  /*@=boundswrite@*/
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 @@ -319,13 +328,15 @@
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.org/lib/rpmrc.c rpm/lib/rpmrc.c
39 --- rpm.org/lib/rpmrc.c 2004-06-14 14:53:19.117040848 +0200
40 +++ rpm/lib/rpmrc.c     2004-06-14 14:55:21.421447752 +0200
41 @@ -1319,6 +1319,13 @@
42         }
43  #      endif
44  
45 +#       if defined(__linux__) && defined(__amd64__)
46 +        {
47 +           /* Defaults to amd64 if compiler supports __amd64__ */
48 +           strcpy(un.machine, "amd64");
49 +        }
50 +#       endif
51 +
52  #      if defined(__linux__) && defined(__powerpc__)
53         {
54             unsigned pvr = 0;
55 diff -urN rpm.org/rpmrc.in rpm/rpmrc.in
56 --- rpm.org/rpmrc.in    2004-06-14 14:53:29.723428432 +0200
57 +++ rpm/rpmrc.in        2004-06-14 14:58:38.156539472 +0200
58 @@ -272,9 +272,9 @@
59  
60  buildarchtranslate: ia64: ia64
61  
62 -buildarchtranslate: x86_64: x86_64
63 -buildarchtranslate: amd64: x86_64
64 -buildarchtranslate: ia32e: x86_64
65 +buildarchtranslate: x86_64: amd64
66 +buildarchtranslate: amd64: amd64
67 +buildarchtranslate: ia32e: amd64
68  
69  #############################################################
70  # Architecture compatibility
71 diff -urN rpm.org/configure.ac rpm/configure.ac
72 --- rpm.org/configure.ac        2004-07-02 23:11:17.214544320 +0200
73 +++ rpm/configure.ac    2004-07-02 23:11:43.369568152 +0200
74 @@ -1110,7 +1110,7 @@
75  *86)           RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
76  ia32e*)                RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
77  amd64*)                RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
78 -x86_64*)       RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
79 +x86_64*)       RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
80  alpha*)                RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
81  sparc64*)      RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;;
82  sparc*)                RPMCANONCOLOR=3; RPMCANONARCH=sparc ;;
This page took 0.046482 seconds and 3 git commands to generate.