5 #if defined(__linux__) && defined(__powerpc__)
9 #if HAVE_SYS_SYSTEMCFG_H
10 #include <sys/systemcfg.h>
12 #define __power_pc() 0
21 #define _MIRE_INTERNAL
34 static const char *
platform =
"/etc/rpm/platform";
97 const char *
const key;
113 {
"buildarch", 0, 1 },
120 #define RPMVAR_OPTFLAGS 3
121 #define RPMVAR_INCLUDE 43
122 #define RPMVAR_MACROFILES 49
124 #define RPMVAR_NUM 55
170 for (i = 0; i < cache->
size; i++)
187 while (*name &&
xisspace(*name)) name++;
190 while (*chptr && *chptr !=
':') chptr++;
194 }
else if (chptr == name) {
200 while (*chptr ==
':' ||
xisspace(*chptr)) chptr--;
203 while (*equivs &&
xisspace(*equivs)) equivs++;
211 for (i = 0; i < entry->
count; i++)
220 (cache->
size + 1) *
sizeof(*cache->
cache));
227 if (delEntry)
return 0;
229 while ((chptr = strtok(equivs,
" ")) != NULL) {
231 if (chptr[0] ==
'\0')
235 * (entry->
count + 1));
252 for (i = 0; i < table->
count; i++)
254 return table->
list + i;
267 for (i = 0; i < table->
count; i++) {
270 equiv = table->
list + i;
278 *
sizeof(*table->
list));
295 if (!entry || entry->
visited)
return;
299 for (i = 0; i < entry->
count; i++) {
303 for (i = 0; i < entry->
count; i++) {
314 const char * key =
name;
317 for (i = 0; i < cache->
size; i++)
320 while (table->
count > 0) {
340 const char * fn,
int lineNum)
347 const char * tshort_name;
352 *table =
xrealloc(*table,
sizeof(**table) * (*tableLen));
355 t = & ((*table)[*tableLen - 2]);
357 tname = strtok(line,
": \t");
358 tshort_name = strtok(NULL,
" \t");
359 s = strtok(NULL,
" \t");
360 if (! (tname && tshort_name && s)) {
365 if (strtok(NULL,
" \t")) {
372 tnum = strtoul(s, &s1, 10);
373 if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
394 const char * fn,
int lineNum)
402 *table =
xrealloc(*table,
sizeof(**table) * (*tableLen));
405 t = & ((*table)[*tableLen - 1]);
408 t->
name = strtok(line,
": \t");
409 t->
defName = strtok(NULL,
" \t");
415 if (strtok(NULL,
" \t")) {
434 if (strcmp(name, table[tableLen].name))
437 return &(table[tableLen]);
451 if (table[tableLen].name && !strcmp(name, table[tableLen].name))
452 return table[tableLen].
defName;
464 if (arch == NULL) arch = current[
ARCH];
469 if (next->
arch && !strcmp(next->
arch, arch))
return next->
value;
475 while (next && next->
arch) next = next->
next;
477 return next ? next->
value : NULL;
492 if (var != orig) var =
_free(var);
512 static void setVarDefault(
int var,
const char * macroname,
const char * val,
539 fn =
alloca(strlen(topdir) + strlen(subdir) + 2);
541 if (fn[strlen(topdir) - 1] !=
'/')
546 topdir =
_free(topdir);
549 if (macroname != NULL) {
550 #define _TOPDIRMACRO "%{_topdir}/"
553 strcat(body, subdir);
561 RPM_SOURCE_DIR=\"%{_sourcedir}\"\n\
562 RPM_BUILD_DIR=\"%{_builddir}\"\n\
563 RPM_OPT_FLAGS=\"%{optflags}\"\n\
564 RPM_ARCH=\"%{_arch}\"\n\
566 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\n\
567 RPM_DOC_DIR=\"%{_docdir}\"\n\
568 export RPM_DOC_DIR\n\
569 RPM_PACKAGE_NAME=\"%{name}\"\n\
570 RPM_PACKAGE_VERSION=\"%{version}\"\n\
571 RPM_PACKAGE_RELEASE=\"%{release}\"\n\
572 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\n\
573 %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\n\
574 export RPM_BUILD_ROOT\n}\
589 "/usr/src/rpm",
"%{_usr}/src/rpm");
591 "/var/tmp",
"%{_var}/tmp");
593 "/var/lib/rpm",
"%{_var}/lib/rpm");
595 "/usr/share/doc",
"%{_usr}/share/doc");
598 "%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm",NULL);
625 if (next->
arch && !strcmp(next->
arch, arch))
break;
630 if (!next->
arch)
break;
636 if (next->
arch && arch && !strcmp(next->
arch, arch)) {
640 }
else if (next->
arch || arch) {
666 { off_t size =
fdSize(fd);
667 size_t nb = (size >= 0 ? size : (8*BUFSIZ - 2));
674 rc =
Fread(next,
sizeof(*next), nb, fd);
675 if (
Ferror(fd) || (size > 0 && rc != nb)) {
688 while (*next !=
'\0') {
694 while (*se && *se !=
'\n') se++;
695 if (*se !=
'\0') *se++ =
'\0';
702 if (*s ==
'#' || *s ==
'\0')
continue;
706 while (*se && !
xisspace(*se) && *se !=
':') se++;
710 while (*se &&
xisspace(*se) && *se !=
':') se++;
715 (
unsigned)(0xff & *se), urlfn, linenum);
722 searchOption.
name = s;
727 const char *arch, *val, *fn;
729 arch = val = fn = NULL;
732 option->
name, urlfn, linenum);
736 switch (option->
var) {
742 if (*se !=
'\0') *se++ =
'\0';
747 if (fn == NULL || *fn ==
'\0') {
749 option->
name, urlfn, linenum, s);
755 fdinc =
Fopen(fn,
"r.fpio");
756 if (fdinc == NULL ||
Ferror(fdinc)) {
769 if (fn == NULL || *fn ==
'\0') {
771 option->
name, urlfn, linenum, fn);
786 _(
"missing architecture for %s at %s:%d\n"),
787 option->
name, urlfn, linenum);
794 _(
"missing argument for %s at %s:%d\n"),
795 option->
name, urlfn, linenum);
804 (arch == NULL || !strcmp(arch, current[
ARCH]))) {
809 strcpy(n, option->
name);
823 if (!strncmp(tables[i].key, s, strlen(tables[i].key)))
827 if (i < RPM_MACHTABLE_COUNT) {
828 const char *rest = s + strlen(tables[i].key);
829 if (*rest ==
'_') rest++;
831 if (!strcmp(rest,
"compat")) {
836 }
else if (tables[i].hasTranslate &&
837 !strcmp(rest,
"translate")) {
839 &tables[i].defaultsLength,
843 }
else if (tables[i].hasCanon &&
844 !strcmp(rest,
"canon")) {
845 if (
addCanon(&tables[i].canons, &tables[i].canonsLength,
888 while (pe-- > p && isspace(*pe))
893 cvog->
os =
"unknown";
895 while (*p && !(*p ==
'-' || isspace(*p)))
897 if (*p !=
'\0') *p++ =
'\0';
900 while (*p && !(*p ==
'-' || isspace(*p)))
904 if (*p !=
'\0') *p++ =
'\0';
908 if (*p !=
'\0') *p++ =
'\0';
911 while (*p && !(*p ==
'-' || isspace(*p)))
917 while (*p && !(*p ==
'-' || isspace(*p)))
920 if (*p !=
'\0') *p++ =
'\0';
946 for (i = 0; i < nre; i++)
947 (
void) mireClean(mire + i);
962 int mireAppend(rpmMireMode mode,
int tag,
const char * pattern,
963 miRE * mi_rep,
int * mi_nrep)
969 mire =
xrealloc(mire, ((*mi_nrep) + 1) *
sizeof(*mire));
973 memset(mire, 0,
sizeof(*mire));
976 return mireRegcomp(mire, pattern);
994 int init_platform = 0;
1003 if (rc || b == NULL || blen <= 0) {
1009 for (pe = p; p && *p; p = pe) {
1010 pe = strchr(p,
'\n');
1016 if (*p ==
'\0' || *p ==
'#')
1019 if (init_platform) {
1020 char * t = p + strlen(p);
1024 xx =
mireAppend(RPMMIRE_REGEX, 0, p, &mi_re, &mi_nre);
1028 if (!
parseCVOG(p, &cvog) && cvog != NULL) {
1031 addMacro(NULL,
"_host_os", NULL, cvog->
os, -1);
1034 p =
rpmExpand(
"%{_host_cpu}-%{_host_vendor}-%{_host_os}",
1035 (cvog && *cvog->
gnu ?
"-" : NULL),
1036 (cvog ? cvog->
gnu : NULL), NULL);
1037 xx =
mireAppend(RPMMIRE_STRCMP, 0, p, &mi_re, &mi_nre);
1042 rc = (init_platform ? 0 : -1);
1066 if (mi_re == NULL) {
1071 if ((mire = mi_re) != NULL)
1072 for (i = 0; i < mi_nre; i++) {
1073 if (!mireRegexec(mire + i, platform))
1079 # if defined(__linux__) && defined(__i386__)
1086 static inline void cpuid(
unsigned int op,
unsigned int *eax,
unsigned int *ebx,
unsigned int *ecx,
unsigned int *edx)
1090 *eax = *ebx = *ecx = *edx = 0;
1095 "movl %%ebx, %%esi \n"
1097 :
"=a" (*eax),
"=S" (*ebx),
"=c" (*ecx),
"=d" (*edx)
1104 static inline unsigned int cpuid_eax(
unsigned int op)
1107 unsigned int tmp, val;
1108 cpuid(op, &val, &tmp, &tmp, &tmp);
1112 static inline unsigned int cpuid_ebx(
unsigned int op)
1115 unsigned int tmp, val;
1116 cpuid(op, &tmp, &val, &tmp, &tmp);
1120 static inline unsigned int cpuid_ecx(
unsigned int op)
1123 unsigned int tmp, val;
1124 cpuid(op, &tmp, &tmp, &val, &tmp);
1128 static inline unsigned int cpuid_edx(
unsigned int op)
1131 unsigned int tmp, val;
1132 cpuid(op, &tmp, &tmp, &tmp, &val);
1137 static sigjmp_buf jenv;
1139 static inline void model3(
int _unused)
1143 siglongjmp(jenv, 1);
1146 static inline int RPMClass(
void)
1151 unsigned int tfms, junk, cap, capamd;
1153 signal(SIGILL, model3);
1155 if (sigsetjmp(jenv, 1))
1158 if (cpuid_eax(0x000000000)==0)
1161 cpuid(0x00000001, &tfms, &junk, &junk, &cap);
1162 cpuid(0x80000001, &junk, &junk, &junk, &capamd);
1169 if (cap & (1<<15)) {
1171 if (capamd & (1<<30))
1180 static int is_athlon(
void)
1183 unsigned int eax, ebx, ecx, edx;
1187 cpuid (0, &eax, &ebx, &ecx, &edx);
1191 memset(vendor, 0,
sizeof(vendor));
1194 vendor[i] = (
unsigned char) (ebx >>(8*i));
1196 vendor[4+i] = (
unsigned char) (edx >>(8*i));
1198 vendor[8+i] = (
unsigned char) (ecx >>(8*i));
1200 if (strncmp(vendor,
"AuthenticAMD", 12) != 0)
1206 static int is_pentium3(
void)
1208 unsigned int eax, ebx, ecx, edx, family, model;
1210 cpuid(0, &eax, &ebx, &ecx, &edx);
1211 memset(vendor, 0,
sizeof(vendor));
1212 *((
unsigned int *)&vendor[0]) = ebx;
1213 *((
unsigned int *)&vendor[4]) = edx;
1214 *((
unsigned int *)&vendor[8]) = ecx;
1215 if (strncmp(vendor,
"GenuineIntel", 12) != 0)
1217 cpuid(1, &eax, &ebx, &ecx, &edx);
1218 family = (eax >> 8) & 0x0f;
1219 model = (eax >> 4) & 0x0f;
1245 static int is_pentium4(
void)
1247 unsigned int eax, ebx, ecx, edx, family, model;
1249 cpuid(0, &eax, &ebx, &ecx, &edx);
1250 memset(vendor, 0,
sizeof(vendor));
1251 *((
unsigned int *)&vendor[0]) = ebx;
1252 *((
unsigned int *)&vendor[4]) = edx;
1253 *((
unsigned int *)&vendor[8]) = ecx;
1254 if (strncmp(vendor,
"GenuineIntel", 12) != 0)
1256 cpuid(1, &eax, &ebx, &ecx, &edx);
1257 family = (eax >> 8) & 0x0f;
1258 model = (eax >> 4) & 0x0f;
1276 #if defined(__linux__) && defined(__powerpc__)
1277 static jmp_buf mfspr_jmpbuf;
1279 static void mfspr_ill(
int notused)
1281 longjmp(mfspr_jmpbuf, -1);
1292 static struct utsname un;
1293 static int gotDefaults = 0;
1298 while (!gotDefaults) {
1307 if (s && *s !=
'\0') {
1308 strncpy(un.machine, s,
sizeof(un.machine));
1309 un.machine[
sizeof(un.machine)-1] =
'\0';
1313 if (s && *s !=
'\0') {
1314 strncpy(un.sysname, s,
sizeof(un.sysname));
1315 un.sysname[
sizeof(un.sysname)-1] =
'\0';
1322 if (cvog->
cpu && cvog->
cpu[0] !=
'\0') {
1323 strncpy(un.machine, cvog->
cpu,
sizeof(un.machine));
1324 un.machine[
sizeof(un.machine)-1] =
'\0';
1326 if (cvog->
os && cvog->
os[0] !=
'\0') {
1327 strncpy(un.sysname, cvog->
os,
sizeof(un.sysname));
1328 un.sysname[
sizeof(un.sysname)-1] =
'\0';
1336 #if !defined(__linux__)
1341 strncpy(un.sysname,
"SINIX",
sizeof(un.sysname));
1344 if (!strcmp(un.sysname,
"AIX")) {
1345 strcpy(un.machine,
__power_pc() ?
"ppc" :
"rs6000");
1346 sprintf(un.sysname,
"aix%s.%s", un.version, un.release);
1348 else if(!strcmp(un.sysname,
"Darwin")) {
1350 strcpy(un.machine,
"ppc");
1351 #else ifdef __i386__
1352 strcpy(un.machine,
"i386");
1355 else if (!strcmp(un.sysname,
"SunOS")) {
1356 if (!strncmp(un.release,
"4", 1)) {
1359 (un.release[fd] != 0 && (fd <
sizeof(un.release)));
1361 if (!
xisdigit(un.release[fd]) && (un.release[fd] !=
'.')) {
1366 sprintf(un.sysname,
"sunos%s",un.release);
1370 sprintf(un.sysname,
"solaris%1d%s", atoi(un.release)-3,
1371 un.release+1+(atoi(un.release)/10));
1376 if (!strcmp(un.machine,
"i86pc"))
1377 sprintf(un.machine,
"i386");
1379 else if (!strcmp(un.sysname,
"HP-UX"))
1381 sprintf(un.sysname,
"hpux%s", strpbrk(un.release,
"123456789"));
1382 else if (!strcmp(un.sysname,
"OSF1"))
1384 sprintf(un.sysname,
"osf%s", strpbrk(un.release,
"123456789"));
1385 else if (!strncmp(un.sysname,
"IP", 2))
1386 un.sysname[2] =
'\0';
1387 else if (!strncmp(un.sysname,
"SINIX", 5)) {
1388 sprintf(un.sysname,
"sinix%s",un.release);
1389 if (!strncmp(un.machine,
"RM", 2))
1390 sprintf(un.machine,
"mips");
1392 else if ((!strncmp(un.machine,
"34", 2) ||
1393 !strncmp(un.machine,
"33", 2)) && \
1394 !strncmp(un.release,
"4.0", 3))
1397 char * prelid = NULL;
1398 FD_t fd =
Fopen(
"/etc/.relid",
"r.fdio");
1401 if (fd != NULL && !
Ferror(fd)) {
1403 {
int irelid =
Fread(chptr,
sizeof(*chptr), 256, fd);
1407 if ((prelid = strstr(chptr,
"RELEASE "))){
1408 prelid += strlen(
"RELEASE ")+1;
1409 sprintf(un.sysname,
"ncr-sysv4.%.*s",1,prelid);
1414 chptr =
_free (chptr);
1418 strcpy(un.sysname,
"ncr-sysv4");
1420 strcpy(un.machine,
"i486");
1426 for (chptr = un.machine; *chptr !=
'\0'; chptr++)
1427 if (*chptr ==
'/') *chptr =
'-';
1429 # if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
1431 strcpy(un.machine,
"mipsel");
1432 # elif defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB)
1434 strcpy(un.machine,
"mips");
1437 # if defined(__hpux) && defined(_SC_CPU_VERSION)
1439 # if !defined(CPU_PA_RISC1_2)
1440 # define CPU_PA_RISC1_2 0x211
1442 # if !defined(CPU_PA_RISC2_0)
1443 # define CPU_PA_RISC2_0 0x214
1445 int cpu_version = sysconf(_SC_CPU_VERSION);
1447 # if defined(CPU_HP_MC68020)
1448 if (cpu_version == CPU_HP_MC68020)
1449 strcpy(un.machine,
"m68k");
1451 # if defined(CPU_HP_MC68030)
1452 if (cpu_version == CPU_HP_MC68030)
1453 strcpy(un.machine,
"m68k");
1455 # if defined(CPU_HP_MC68040)
1456 if (cpu_version == CPU_HP_MC68040)
1457 strcpy(un.machine,
"m68k");
1460 # if defined(CPU_PA_RISC1_0)
1461 if (cpu_version == CPU_PA_RISC1_0)
1462 strcpy(un.machine,
"hppa1.0");
1464 # if defined(CPU_PA_RISC1_1)
1465 if (cpu_version == CPU_PA_RISC1_1)
1466 strcpy(un.machine,
"hppa1.1");
1468 # if defined(CPU_PA_RISC1_2)
1469 if (cpu_version == CPU_PA_RISC1_2)
1470 strcpy(un.machine,
"hppa1.2");
1472 # if defined(CPU_PA_RISC2_0)
1473 if (cpu_version == CPU_PA_RISC2_0)
1474 strcpy(un.machine,
"hppa2.0");
1479 # if defined(__linux__) && defined(__sparc__)
1480 if (!strcmp(un.machine,
"sparc")) {
1481 #define PERS_LINUX 0x00000000
1482 #define PERS_LINUX_32BIT 0x00800000
1483 #define PERS_LINUX32 0x00000008
1485 extern int personality(
unsigned long);
1488 oldpers = personality(PERS_LINUX_32BIT);
1489 if (oldpers != -1) {
1490 if (personality(PERS_LINUX) != -1) {
1492 if (! strcmp(un.machine,
"sparc64")) {
1493 strcpy(un.machine,
"sparcv9");
1494 oldpers = PERS_LINUX32;
1497 personality(oldpers);
1502 # if defined(__GNUC__) && defined(__alpha__)
1504 unsigned long amask, implver;
1505 register long v0 __asm__(
"$0") = -1;
1506 __asm__ (
".long 0x47e00c20" :
"=r"(v0) :
"0"(v0));
1508 __asm__ (
".long 0x47e03d80" :
"=r"(v0));
1513 case 0: strcpy(un.machine,
"alphaev5");
break;
1514 case 1: strcpy(un.machine,
"alphaev56");
break;
1515 case 0x101: strcpy(un.machine,
"alphapca56");
break;
1520 case 0x303: strcpy(un.machine,
"alphaev6");
break;
1521 case 0x307: strcpy(un.machine,
"alphaev67");
break;
1528 # if defined(__linux__) && defined(__i386__)
1530 char class = (char) (RPMClass() | '0');
1532 if ((
class ==
'6' && is_athlon()) ||
class ==
'7')
1533 strcpy(un.machine,
"athlon");
1534 else if (is_pentium4())
1535 strcpy(un.machine,
"pentium4");
1536 else if (is_pentium3())
1537 strcpy(un.machine,
"pentium3");
1538 else if (strchr(
"3456", un.machine[1]) && un.machine[1] !=
class)
1539 un.machine[1] =
class;
1543 # if defined(__linux__) && defined(__powerpc__)
1546 __sighandler_t oldh = signal(SIGILL, mfspr_ill);
1547 if (setjmp(mfspr_jmpbuf) == 0) {
1548 __asm__ __volatile__ (
"mfspr %0, 287" :
"=r" (pvr));
1550 signal(SIGILL, oldh);
1560 strcpy(un.machine,
"ppc");
1564 strcpy(un.machine,
"ppciseries");
1568 strcpy(un.machine,
"ppcpseries");
1570 strcpy(un.machine,
"ppc");
1593 if (arch) *arch = un.machine;
1594 if (os) *os = un.sysname;
1601 const char * arch, * os;
1605 if (currTables[
ARCH] != archTable) {
1606 currTables[
ARCH] = archTable;
1610 if (currTables[
OS] != osTable) {
1611 currTables[
OS] = osTable;
1618 const char * fakeplatform;
1622 fakeplatform =
rpmExpand(name,
"%{_host_vendor}-%{_host_os}%{?_gnu}", NULL);
1625 fakeplatform =
rpmExpand(name,
"%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
1628 fakeplatform =
rpmExpand(
"%{_host_arch}-%{_host_vendor}-", name,
"%{?_gnu}", NULL);
1631 fakeplatform =
rpmExpand(
"%{_target_arch}-%{_target_vendor}-", name,
"%{?_gnu}", NULL);
1635 _free(fakeplatform);
1643 *arch = current[
ARCH];
1656 if (tables[currTables[
ARCH]].hasTranslate)
1658 tables[currTables[
ARCH]].defaults,
1659 tables[currTables[
ARCH]].defaultsLength);
1661 assert(arch != NULL);
1665 if (tables[currTables[
OS]].hasTranslate)
1667 tables[currTables[
OS]].defaults,
1668 tables[currTables[
OS]].defaultsLength);
1673 if (!current[
ARCH] || strcmp(arch, current[
ARCH])) {
1679 if (!current[
OS] || strcmp(os, current[
OS])) {
1681 current[
OS] =
_free(current[OS]);
1682 if (!strcmp(t,
"linux"))
1694 int which = currTables[type];
1697 if (which >= 2) which -= 2;
1700 tables[which].canons,
1701 tables[which].canonsLength);
1704 if (num) *num = canon->
num;
1707 if (num) *num = 255;
1708 if (name) *name = current[type];
1725 char *ca = NULL, *co = NULL, *ct = NULL;
1735 if (target && *target) {
1739 if ((c = strchr(ca,
'-')) != NULL) {
1742 if ((co = strrchr(c,
'-')) == NULL) {
1747 if ((co = strrchr(c,
'-')) == NULL)
1752 if (co != NULL) co =
xstrdup(co);
1755 const char *a = NULL;
1756 const char *o = NULL;
1767 const char *a = NULL;
1772 for (x = 0; ca[x] !=
'\0'; x++)
1776 const char *o = NULL;
1781 for (x = 0; co[x] !=
'\0'; x++)
1786 ct =
xmalloc(strlen(ca) +
sizeof(
"-") + strlen(co));
1787 sprintf(ct,
"%s-%s", ca, co);
1805 if (optflags != NULL) {
1849 for (k = 0; k < e->
count; k++)
1888 defaultsInitialized = 0;
1906 char *myrcfiles = NULL;
1910 if (!defaultsInitialized) {
1912 defaultsInitialized = 1;
1917 if (rcfiles != NULL)
1918 for (r = myrcfiles =
xstrdup(rcfiles); r && *r !=
'\0'; r = re) {
1923 for (re = r; (re = strchr(re,
':')) != NULL; re++) {
1924 if (!(re[1] ==
'/' && re[2] ==
'/'))
1927 if (re && *re ==
':')
1934 if (r[0] ==
'~' && r[1] ==
'/') {
1935 const char * etc_dir =
getenv(
"HOME_ETC");
1936 const char * home =
getenv(
"HOME");
1938 if (strlen(etc_dir) > (
sizeof(fn) - strlen(r))) {
1943 strcpy(fn, etc_dir);
1944 strncat(fn,
"/",
sizeof(fn) - strlen(fn));
1955 if (strlen(home) > (
sizeof(fn) - strlen(r))) {
1967 strncat(fn, r,
sizeof(fn) - (strlen(fn) + 1));
1968 fn[
sizeof(fn)-1] =
'\0';
1971 fd =
Fopen(fn,
"r.fpio");
1972 if (fd == NULL ||
Ferror(fd)) {
1985 myrcfiles =
_free(myrcfiles);
1998 if (mfpath != NULL) {
2000 mfpath =
_free(mfpath);
2029 {
const char *cpu =
rpmExpand(
"%{_target_cpu}", NULL);
2030 const char *os =
rpmExpand(
"%{_target_os}", NULL);
2039 (void)rpmluaGetPrintBuffer(NULL);
2054 fprintf(fp,
"ARCHITECTURE AND OS:\n");
2055 fprintf(fp,
"build arch : %s\n", current[
ARCH]);
2057 fprintf(fp,
"compatible build archs:");
2059 for (i = 0; i < equivTable->
count; i++)
2060 fprintf(fp,
" %s", equivTable->
list[i].
name);
2063 fprintf(fp,
"build os : %s\n", current[
OS]);
2065 fprintf(fp,
"compatible build os's :");
2067 for (i = 0; i < equivTable->
count; i++)
2068 fprintf(fp,
" %s", equivTable->
list[i].
name);
2076 fprintf(fp,
"install arch : %s\n", current[ARCH]);
2077 fprintf(fp,
"install os : %s\n", current[OS]);
2079 fprintf(fp,
"compatible archs :");
2081 for (i = 0; i < equivTable->
count; i++)
2082 fprintf(fp,
" %s", equivTable->
list[i].
name);
2085 fprintf(fp,
"compatible os's :");
2087 for (i = 0; i < equivTable->
count; i++)
2088 fprintf(fp,
" %s", equivTable->
list[i].
name);
2093 fprintf(fp,
"\nRPMRC VALUES:\n");
2094 fprintf(fp,
"%-21s : %s\n",
"rcfiles", ((s && *s) ? s :
"(not set)"));
2100 fprintf(fp,
"%-21s : %s\n", opt->
name, s ? s :
"(not set)");
2103 fprintf(fp,
"\nMACRO DEFINITIONS:\n");
2105 const char * s =
rpmExpand(
"%{?optflags}", NULL);
2106 fprintf(fp,
"%-21s : %s\n",
"optflags", ((s && *s) ? s :
"(not set)"));
2111 fprintf(fp,
"\nMACRO DEFINITIONS:\n");
2112 fprintf(fp,
"%-21s : %s\n",
"macrofiles", ((s && *s) ? s :
"(not set)"));
2121 fprintf(fp,
_(
"Configured system provides (from /etc/rpm/sysinfo):\n"));
2126 fprintf(fp,
" %s\n", DNEVR+2);
2135 fprintf(fp,
_(
"Features provided by rpmlib installer:\n"));
2141 fprintf(fp,
" %s\n", DNEVR+2);
2149 _(
"Features provided by current cpuinfo (from /proc/cpuinfo):\n"));
2154 fprintf(fp,
" %s\n", DNEVR+2);
2165 _(
"Features provided by current getconf:\n"));
2170 fprintf(fp,
" %s\n", DNEVR+2);
2179 _(
"Features provided by current uname:\n"));
2184 fprintf(fp,
" %s\n", DNEVR+2);