RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
Server: rpm5.org Name: Per Ãyvind Karlsen
Root: /v/rpm/cvs Email: pkarl...@rpm5.org
Module: rpm Date: 19-Mar-2009 18:46:24
Branch: HEAD Handle: 2009031917462300
Modified files:
rpm/lib rpmds.c rpmrc.c
Log:
add cpuinfo(endianness)
Summary:
RevisionChanges Path
2.133 +11 -0 rpm/lib/rpmds.c
2.270 +28 -28 rpm/lib/rpmrc.c
patch -p0 <<'@@ .'
Index: rpm/lib/rpmds.c
$ cvs diff -u -r2.132 -r2.133 rpmds.c
--- rpm/lib/rpmds.c 18 Mar 2009 22:11:21 - 2.132
+++ rpm/lib/rpmds.c 19 Mar 2009 17:46:23 - 2.133
@@ -5,6 +5,7 @@
#if defined(SUPPORT_LIBCPUINFO)
#include
+#include
#endif
#if defined(HAVE_GELF_H) && !defined(__FreeBSD__)
@@ -1217,6 +1218,16 @@
rpmdsNSAdd(dsp, NS, "cpu_cores", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
snprintf(tmp, 19, "%d", cpuinfo_get_threads(cip));
rpmdsNSAdd(dsp, NS, "cpu_threads", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
+#ifdef __BYTE_ORDER
+#if __BYTE_ORDER == LITTLE_ENDIAN
+#define endian "little"
+#elif __BYTE_ORDER == BIG_ENDIAN
+#define endian "big"
+#elif __BYTE_ORDER == PDP_ENDIAN
+#define endian "pdp"
+#endif
+rpmdsNSAdd(dsp, NS, "endianness", endian, RPMSENSE_PROBE|RPMSENSE_EQUAL);
+#endif
for (feature = cpuinfo_feature_common; feature !=
cpuinfo_feature_architecture_max; feature++) {
if(feature == cpuinfo_feature_common_max)
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmrc.c
$ cvs diff -u -r2.269 -r2.270 rpmrc.c
--- rpm/lib/rpmrc.c 19 Mar 2009 00:20:18 - 2.269
+++ rpm/lib/rpmrc.c 19 Mar 2009 17:46:23 - 2.270
@@ -503,9 +503,9 @@
/*...@=onlytrans@*/
#if defined(SUPPORT_LIBCPUINFO)
-static inline int rpmCpuinfoMatch(const char * feature, rpmds cpuinfo)
+static inline int rpmCpuinfoMatch(const char * feature, const char * EVR,
rpmds cpuinfo)
{
-rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, "",
RPMSENSE_PROBE);
+rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR,
RPMSENSE_PROBE);
int ret = rpmdsMatch(cpufeature, cpuinfo);
cpufeature = rpmdsFree(cpufeature);
return ret;
@@ -523,59 +523,59 @@
xx = rpmdsCpuinfo(&cpuinfo, NULL);
-if(rpmCpuinfoMatch("cpuinfo([x86])", cpuinfo)) {
- if(rpmCpuinfoMatch("cpuinfo(64bit)", cpuinfo))
+if(rpmCpuinfoMatch("cpuinfo([x86])", "", cpuinfo)) {
+ if(rpmCpuinfoMatch("cpuinfo(64bit)", "", cpuinfo))
{
xx = mireAppend(RPMMIRE_REGEX, 0, "x86_64", NULL, &mi_re, &mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, "amd64", NULL, &mi_re, &mi_nre);
}
- if(rpmCpuinfoMatch("cpuinfo(cmov)", cpuinfo)) {
- if(rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo)) {
- if(rpmCpuinfoMatch("cpuinfo(sse)", cpuinfo)) {
- if(rpmCpuinfoMatch("cpuinfo(sse2)", cpuinfo))
+ if(rpmCpuinfoMatch("cpuinfo(cmov)", "", cpuinfo)) {
+ if(rpmCpuinfoMatch("cpuinfo(mmx)", "", cpuinfo)) {
+ if(rpmCpuinfoMatch("cpuinfo(sse)", "", cpuinfo)) {
+ if(rpmCpuinfoMatch("cpuinfo(sse2)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "pentium4", NULL,
&mi_re, &mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, "pentium3", NULL, &mi_re,
&mi_nre);
}
- if(rpmCpuinfoMatch("cpuinfo(3dnowext)", cpuinfo))
+ if(rpmCpuinfoMatch("cpuinfo(3dnowext)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "athlon", NULL, &mi_re,
&mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, "pentium2", NULL, &mi_re,
&mi_nre);
}
xx = mireAppend(RPMMIRE_REGEX, 0, "i686", NULL, &mi_re, &mi_nre);
}
- if(rpmCpuinfoMatch("cpuinfo(3dnow)", cpuinfo) &&
rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo))
+ if(rpmCpuinfoMatch("cpuinfo(3dnow)", "", cpuinfo) &&
rpmCpuinfoMatch("cpuinfo(mmx)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "geode", NULL, &mi_re, &mi_nre);
- if(rpmCpuinfoMatch("cpuinfo(tsc)", cpuinfo))
+ if(rpmCpuinfoMatch("cpuinfo(tsc)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "i586", NULL, &mi_re, &mi_nre);
- if(rpmCpuinfoMatch("cpuinfo(ac)", cpuinfo))
+ if(rpmCpuinfoMatch("cpuinfo(ac)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "i486", NULL, &mi_re, &mi_nre);
xx =