diff options
author | jbj <devnull@localhost> | 1998-10-06 19:18:47 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1998-10-06 19:18:47 +0000 |
commit | 7ad030f18f118f164a088852aa01ffc2784d006b (patch) | |
tree | 97a8d08e1de30298871fcf02b18f1283e96b2f6b | |
parent | 76b407a906cffa58e7d8986b11de92b3da1d032a (diff) | |
download | rpm-7ad030f18f118f164a088852aa01ffc2784d006b.tar.gz |
non-linux arch/os identification (Eugene Kanter).
CVS patchset: 2410
CVS date: 1998/10/06 19:18:47
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | lib-rpmrc.in | 25 | ||||
-rw-r--r-- | lib/rpmrc.c | 84 |
3 files changed, 103 insertions, 9 deletions
@@ -1,4 +1,4 @@ -2.5.5 -> 2.9 +2.5.5 -> 2.90 - add generalized expression handler (Tom Dyas<tdyas@remus.rutgers.edu>) - use /usr/lib/rpm/mkinstalldirs if mkdir -p fails. - more portable dirent handling (Hermann Lauer). @@ -20,6 +20,7 @@ - add new fully recursive macro.c 2.5.4 -> 2.5.5: + - non-linux arch/os identification (Eugene Kanter). - portable mode_t/pid_t typedefs. - fix check for trailing / in Prefix: - remove 2 character language name assumption. diff --git a/lib-rpmrc.in b/lib-rpmrc.in index c166a5945..9baf4cdce 100644 --- a/lib-rpmrc.in +++ b/lib-rpmrc.in @@ -28,6 +28,10 @@ optflags: sparc -O2 optflags: m68k -O2 -fomit-frame-pointer optflags: ppc -O2 -fsigned-char optflags: parisc -O2 -mpa-risc-1-0 +optflags: hppa1.0 -O2 -mpa-risc-1-0 +optflags: hppa1.1 -O2 -mpa-risc-1-0 +optflags: hppa1.2 -O2 -mpa-risc-1-0 +optflags: hppa2.0 -O2 -mpa-risc-1-0 optflags: mipseb -O2 optflags: mipsel -O2 optflags: arm3 -O2 @@ -89,6 +93,7 @@ os_canon: BSD/OS: BSD_OS 12 os_canon: machten: machten 13 os_canon: CYGWIN32_NT: cygwin32 14 os_canon: CYGWIN32_95: cygwin32 15 +os_canon: UNIX_SV: MP_RAS: 16 ############################################################# # For a given uname().machine, the default build arch @@ -146,12 +151,32 @@ arch_compat: rs6000: noarch arch_compat: mipseb: noarch arch_compat: mipsel: noarch +arch_compat: hppa2.0: hppa1.2 +arch_compat: hppa1.2: hppa1.1 +arch_compat: hppa1.1: hppa1.0 +arch_compat: hppa1.0: parisc arch_compat: parisc: noarch arch_compat: arm4: arm3 arch_compat: arm3: noarch os_compat: IRIX64: IRIX +os_compat: solaris2.6: solaris2.3 solaris2.4 solaris2.5 +os_compat: solaris2.5: solaris2.3 solaris2.4 +os_compat: solaris2.4: solaris2.3 + +os_compat: hpux11.00: hpux10.30 +os_compat: hpux10.30: hpux10.20 +os_compat: hpux10.20: hpux10.10 +os_compat: hpux10.10: hpux10.01 +os_compat: hpux10.01: hpux10.00 +os_compat: hpux10.00: hpux9.07 +os_compat: hpux9.07: hpux9.05 +os_compat: hpux9.05: hpux9.04 + +os_compat: osf4.0: osf3.2 + +os_compat: ncr-sysv4.3: ncr-sysv4.2 buildarch_compat: i986: i886 buildarch_compat: i886: i786 diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 6b25ec351..55da66b90 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -804,12 +804,74 @@ static void defaultMachine(char ** arch, char ** os) { if (!gotDefaults) { uname(&un); + +#if !defined(__linux__) +#ifdef SNI + /* USUALLY un.sysname on sinix does start with the word "SINIX" + * let's be absolutely sure + */ + sprintf(un.sysname,"SINIX"); +#endif if (!strcmp(un.sysname, "AIX")) { strcpy(un.machine, __power_pc() ? "ppc" : "rs6000"); - } else if (!strncmp(un.sysname, "IP", 2)) { - un.sysname[2] = '\0'; + sprintf(un.sysname,"aix%s.%s",un.version,un.release); } - + else if (!strcmp(un.sysname, "SunOS")) { + if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ { + int fd; + for (fd=0;(un.release[fd] != 0 && (fd < sizeof(un.release)));fd++) + if (!isdigit(un.release[fd]) && (un.release[fd] != '.')) { + un.release[fd] = 0; + break; + } + sprintf(un.sysname,"sunos%s",un.release); + } + + else /* Solaris 2.x: n.x.x becomes n-3.x.x */ + sprintf(un.sysname,"solaris%1d%s",atoi(un.release)-3,un.release+1+(atoi(un.release)/10)); + } + else if (!strcmp(un.sysname, "HP-UX")) + /*make un.sysname look like hpux9.05 for example*/ + sprintf(un.sysname,"hpux%s",strpbrk(un.release,"123456789")); + else if (!strcmp(un.sysname, "OSF1")) + /*make un.sysname look like osf3.2 for example*/ + sprintf(un.sysname,"osf%s",strpbrk(un.release,"123456789")); + else if (!strncmp(un.sysname, "IP", 2)) + un.sysname[2] = '\0'; + else if (!strncmp(un.sysname, "SINIX", 5)) { + sprintf(un.sysname, "sinix%s",un.release); + if (!strncmp(un.machine, "RM", 2)) + sprintf(un.machine, "mips"); + } + else if ((!strncmp(un.machine, "34", 2) || \ + !strncmp(un.machine, "33", 2)) && \ + !strncmp(un.release, "4.0", 3)) { + /* we are on ncr-sysv4 */ + int fd = open("/etc/.relid", O_RDONLY, 0700); + if (fd >0) { + chptr = (char *) calloc(256,1); + if (chptr != NULL) { + int irelid = read(fd, (void *)chptr, 256); + close(fd); + /* example: "112393 RELEASE 020200 Version 01 OS" */ + if (irelid > 0) { + char *prelid; + if ((prelid=strstr(chptr, "RELEASE "))){ + prelid += strlen("RELEASE ")+1; + sprintf(un.sysname,"ncr-sysv4.%.*s",1,prelid); + } + } + free (chptr); + } + } + if (!prelid) + /* parsing /etc/.relid file failed */ + strcpy(un.sysname,"ncr-sysv4"); + /* wrong, just for now, find out how to look for i586 later*/ + strcpy(un.machine,"i486"); + } +#endif + /* get rid of the hyphens in the sysname */ chptr = un.machine; while (*chptr++) @@ -823,8 +885,14 @@ static void defaultMachine(char ** arch, char ** os) { strcpy(un.machine, "mipseb"); # endif - #if defined(__hpux) && defined(_SC_CPU_VERSION) +# if defined(__hpux) && defined(_SC_CPU_VERSION) { +# if !defined(CPU_PA_RISC1_2) +# define CPU_PA_RISC1_2 0x211 /* HP PA-RISC1.2 */ +# endif +# if !defined(CPU_PA_RISC2_0) +# define CPU_PA_RISC2_0 0x214 /* HP PA-RISC2.0 */ +# endif int cpu_version = sysconf(_SC_CPU_VERSION); # if defined(CPU_HP_MC68020) @@ -842,19 +910,19 @@ static void defaultMachine(char ** arch, char ** os) { # if defined(CPU_PA_RISC1_0) if (cpu_version == CPU_PA_RISC1_0) - strcpy(un.machine, "parisc"); + strcpy(un.machine, "hppa1.0"); # endif # if defined(CPU_PA_RISC1_1) if (cpu_version == CPU_PA_RISC1_1) - strcpy(un.machine, "parisc"); + strcpy(un.machine, "hppa1.1"); # endif # if defined(CPU_PA_RISC1_2) if (cpu_version == CPU_PA_RISC1_2) - strcpy(un.machine, "parisc"); + strcpy(un.machine, "hppa1.2"); # endif # if defined(CPU_PA_RISC2_0) if (cpu_version == CPU_PA_RISC2_0) - strcpy(un.machine, "parisc"); + strcpy(un.machine, "hppa2.0"); # endif } # endif |