installplatform clean up, add athlon (PLD).
authorjbj <devnull@localhost>
Tue, 30 Jul 2002 17:07:39 +0000 (17:07 +0000)
committerjbj <devnull@localhost>
Tue, 30 Jul 2002 17:07:39 +0000 (17:07 +0000)
CVS patchset: 5582
CVS date: 2002/07/30 17:07:39

installplatform
lib/rpmrc.c

index 894e81f..ead6f15 100755 (executable)
@@ -21,21 +21,21 @@ E_O_F
 
 RPM="./rpm --rcfile $TEMPRC"
 
-arch="`$RPM --eval '%{_arch}'`"
+canonarch_sed='s_i.86_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_\(powerpc\|ppc\)[^-]*_ppc_'
+arch="`$RPM --eval '%{_arch}'|sed -e "$canonarch_sed"`"
 VENDOR="`$RPM --eval '%{_vendor}'`"
 OS="`$RPM --eval '%{_os}'`"
 RPMRC_GNU="`$RPM --eval '%{_gnu}'`"
-target_platform="`$RPM --eval '%{?_gnu:%undefine _gnu}%{_target_platform}'`"
-target="`$RPM --eval '%{_target}'`"
+target_platform="`$RPM --eval '%{?_gnu:%undefine _gnu}%{_target_platform}'|sed -e "$canonarch_sed"`"
+target="`$RPM --eval '%{_target}'|sed -e "$canonarch_sed"`"
 
 case "$arch" in
-  i[3456]86) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_athlon_' ;;
+  i[3456]86|athlon) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_athlon_' ;;
   alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
   sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
   powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6]\|$\)_ppc64\1_' ;;
   *) SUBSTS=y___ ;;
 esac
-base_arch=`echo $arch | sed -e 's_i?86_i386_;s_sparc.*_sparc_;s_alpha.*_alpha_;s_\(powerpc\|ppc\).*_ppc_'`
 
 for SUBST in $SUBSTS ; do
   ARCH=`echo $arch | sed -e $SUBST`
@@ -74,6 +74,7 @@ for SUBST in $SUBSTS ; do
     ;;
   pld)
     VENDORSED='-e s,^@pld@,,'
+    RPMRC_OPTFLAGS="`echo $RPMRC_OPTFLAGS | sed -e "s/ -g/ /"`"
     ;;
   mandrake)
     VENDORSED='-e s,^@mandrake@,,'
@@ -89,12 +90,12 @@ for SUBST in $SUBSTS ; do
 
   cat $PLATFORM \
   | sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
-       -e "s,@RPMRC_ARCH@,$base_arch," \
+       -e "s,@RPMRC_ARCH@,$ARCH," \
        -e "s,@RPMRC_GNU@,$RPMRC_GNU," \
        -e "s,@LIB@,$LIB," \
        -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
        -e "s,@DEFAULTDOCDIR@,$DEFAULTDOCDIR," \
-       -e '/FLAGS:-/!s,\${,%{_,' \
+       -e '/\${\w*:-/!s,\${,%{_,' \
        $MULTILIBSED \
        $VENDORSED \
   | grep -v '^@' \
index d5c3646..fe763af 100644 (file)
@@ -894,7 +894,7 @@ exit:
 /*
  * Generic CPUID function
  */
-static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
+static inline void cpuid(unsigned int op, int *eax, int *ebx, int *ecx, int *edx)
        /*@modifies *eax, *ebx, *ecx, *edx @*/
 {
 #ifdef __LCLINT__
@@ -1000,8 +1000,8 @@ static inline int RPMClass(void)
        if (cpuid_eax(0x000000000)==0)
                return 4;
 
-       cpuid(0x000000001, &tfms, &junk, &junk, &cap);
-       cpuid(0x800000001, &junk, &junk, &junk, &capamd);
+       cpuid(0x00000001, &tfms, &junk, &junk, &cap);
+       cpuid(0x80000001, &junk, &junk, &junk, &capamd);
        
        cpu = (tfms>>8)&15;