Author: jim
Date: 2005-10-24 19:05:09 -0600 (Mon, 24 Oct 2005)
New Revision: 1212

Added:
   trunk/coreutils/coreutils-5.92-suppress_uptime_kill_su-1.patch
   trunk/coreutils/coreutils-5.92-uname-1.patch
Modified:
   trunk/
Log:
 [EMAIL PROTECTED]:  jim | 2005-10-24 18:04:13 -0700
 Added: coreutils-5.92-suppress_uptime_kill_su-1.patch 
coreutils-5.92-uname-1.patch



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - cc2644d5-6cf8-0310-b111-c40428001e49:/patches:1420
   + cc2644d5-6cf8-0310-b111-c40428001e49:/patches:1422

Added: trunk/coreutils/coreutils-5.92-suppress_uptime_kill_su-1.patch
===================================================================
--- trunk/coreutils/coreutils-5.92-suppress_uptime_kill_su-1.patch      
2005-10-24 21:46:22 UTC (rev 1211)
+++ trunk/coreutils/coreutils-5.92-suppress_uptime_kill_su-1.patch      
2005-10-25 01:05:09 UTC (rev 1212)
@@ -0,0 +1,263 @@
+Submitted By: Matthew Burgess <matthew at linuxfromscratch dot org>
+Date: 2005-10-23
+Initial Package Version: 5.92
+Origin: original suppress_hotname_uptame_kill_su patch (Robert Connolly)
+Upstream Status: N/A
+Description: This patch supresses the building of uptime, and kill.  The su 
+command is built so the testsuite can run, use './src/su', but it will not 
+be installed. Also see: 
+           http://www.linuxfromscratch.org/patches/downloads/coreutils/
+           coreutils-5.0-dupes-2.patch
+
+diff -Naur coreutils-5.92.orig/AUTHORS coreutils-5.92/AUTHORS
+--- coreutils-5.92.orig/AUTHORS        2004-11-03 23:10:50.000000000 +0000
++++ coreutils-5.92/AUTHORS     2005-10-23 19:37:35.000000000 +0000
+@@ -34,7 +34,6 @@
+ hostname: Jim Meyering
+ id: Arnold Robbins, David MacKenzie
+ join: Mike Haertel
+-kill: Paul Eggert
+ link: Michael Stone
+ ln: Mike Parker, David MacKenzie
+ logname: FIXME: unknown
+@@ -83,7 +82,6 @@
+ unexpand: David MacKenzie
+ uniq: Richard Stallman, David MacKenzie
+ unlink: Michael Stone
+-uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
+ users: Joseph Arceneaux, David MacKenzie
+ vdir: Richard Stallman, David MacKenzie
+ wc: Paul Rubin, David MacKenzie
+diff -Naur coreutils-5.92.orig/Makefile.in coreutils-5.92/Makefile.in
+--- coreutils-5.92.orig/Makefile.in    2005-10-22 18:13:25.000000000 +0000
++++ coreutils-5.92/Makefile.in 2005-10-23 19:37:24.000000000 +0000
+@@ -148,7 +148,7 @@
+       $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
+       $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
+       $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
+-      $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
++      $(top_srcdir)/m4/unlocked-io.m4 \
+       $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
+       $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
+       $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
+diff -Naur coreutils-5.92.orig/README coreutils-5.92/README
+--- coreutils-5.92.orig/README 2005-09-28 18:34:03.000000000 +0000
++++ coreutils-5.92/README      2005-10-23 19:37:24.000000000 +0000
+@@ -9,11 +9,11 @@
+ 
+   [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
+   df dir dircolors dirname du echo env expand expr factor false fmt fold
+-  ginstall groups head hostid hostname id join kill link ln logname ls
++  ginstall groups head hostid hostname id join link ln logname ls
+   md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
+   printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort
+   split stat stty su sum sync tac tail tee test touch tr true tsort tty
+-  uname unexpand uniq unlink uptime users vdir wc who whoami yes
++  uname unexpand uniq unlink users vdir wc who whoami yes
+ 
+ See the file NEWS for a list of major changes in the current release.
+ 
+diff -Naur coreutils-5.92.orig/configure coreutils-5.92/configure
+--- coreutils-5.92.orig/configure      2005-10-22 18:13:26.000000000 +0000
++++ coreutils-5.92/configure   2005-10-23 19:37:24.000000000 +0000
+@@ -50832,8 +50832,7 @@
+ { echo "$as_me:$LINENO: result: $gnulib_cv_have_boot_time" >&5
+ echo "${ECHO_T}$gnulib_cv_have_boot_time" >&6; }
+   if test $gnulib_cv_have_boot_time = yes; then
+-  OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
+-  MAN="$MAN uptime.1"
++echo "uptime is suppressed"
+ fi
+ 
+ 
+diff -Naur coreutils-5.92.orig/man/Makefile.in coreutils-5.92/man/Makefile.in
+--- coreutils-5.92.orig/man/Makefile.in        2005-10-22 18:13:19.000000000 
+0000
++++ coreutils-5.92/man/Makefile.in     2005-10-23 19:37:24.000000000 +0000
+@@ -142,7 +142,7 @@
+       $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
+       $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
+       $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
+-      $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
++      $(top_srcdir)/m4/unlocked-io.m4 \
+       $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
+       $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
+       $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
+@@ -303,13 +303,13 @@
+   basename.1 cat.1 chgrp.1 chmod.1 chown.1 chroot.1 cksum.1 comm.1 \
+   cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \
+   echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \
+-  head.1 hostid.1 hostname.1 id.1 install.1 join.1 kill.1 \
++  head.1 hostid.1 hostname.1 id.1 install.1 join.1 \
+   link.1 ln.1 logname.1 \
+   ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
+   paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
+   rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \
+   su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
+-  tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \
++  tty.1 uname.1 unexpand.1 uniq.1 unlink.1 users.1 vdir.1 wc.1 \
+   who.1 whoami.1 yes.1
+ 
+ man_aux = $(dist_man_MANS:.1=.x)
+@@ -575,7 +575,6 @@
+ id.1:         $(common_dep)   $(srcdir)/id.x          ../src/id.c
+ install.1:    $(common_dep)   $(srcdir)/install.x     ../src/install.c
+ join.1:               $(common_dep)   $(srcdir)/join.x        ../src/join.c
+-kill.1:               $(common_dep)   $(srcdir)/kill.x        ../src/kill.c
+ link.1:               $(common_dep)   $(srcdir)/link.x        ../src/link.c
+ ln.1:         $(common_dep)   $(srcdir)/ln.x          ../src/ln.c
+ logname.1:    $(common_dep)   $(srcdir)/logname.x     ../src/logname.c
+@@ -624,7 +623,6 @@
+ unexpand.1:   $(common_dep)   $(srcdir)/unexpand.x    ../src/unexpand.c
+ uniq.1:               $(common_dep)   $(srcdir)/uniq.x        ../src/uniq.c
+ unlink.1:     $(common_dep)   $(srcdir)/unlink.x      ../src/unlink.c
+-uptime.1:     $(common_dep)   $(srcdir)/uptime.x      ../src/uptime.c
+ users.1:      $(common_dep)   $(srcdir)/users.x       ../src/users.c
+ vdir.1:               $(common_dep)   $(srcdir)/vdir.x        ../src/ls.c
+ wc.1:         $(common_dep)   $(srcdir)/wc.x          ../src/wc.c
+@@ -656,7 +654,7 @@
+ check-x-vs-1:
+       PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH;                \
+       t=ls-files.$$$$;                                                \
+-      (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
++      (cd $(srcdir) && ls -1 *.x) | grep -v -e 'kill.x' -e 'uptime.x' | sed 
's/\.x$$//' | $(ASSORT) > $$t;\
+       echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//'        \
+         | $(ASSORT) | diff - $$t || { rm $$t; exit 1; };              \
+       rm $$t
+diff -Naur coreutils-5.92.orig/src/Makefile.in coreutils-5.92/src/Makefile.in
+--- coreutils-5.92.orig/src/Makefile.in        2005-10-22 18:15:15.000000000 
+0000
++++ coreutils-5.92/src/Makefile.in     2005-10-23 19:37:24.000000000 +0000
+@@ -39,7 +39,7 @@
+ host_triplet = @host@
+ EXTRA_PROGRAMS = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \
+       nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \
+-      uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT)
++      uname$(EXEEXT) users$(EXEEXT) who$(EXEEXT)
+ bin_PROGRAMS = [$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \
+       cp$(EXEEXT) dd$(EXEEXT) dircolors$(EXEEXT) du$(EXEEXT) \
+       ginstall$(EXEEXT) link$(EXEEXT) ln$(EXEEXT) dir$(EXEEXT) \
+@@ -56,7 +56,7 @@
+       uniq$(EXEEXT) wc$(EXEEXT) basename$(EXEEXT) date$(EXEEXT) \
+       dirname$(EXEEXT) echo$(EXEEXT) env$(EXEEXT) expr$(EXEEXT) \
+       factor$(EXEEXT) false$(EXEEXT) hostname$(EXEEXT) id$(EXEEXT) \
+-      kill$(EXEEXT) logname$(EXEEXT) pathchk$(EXEEXT) \
++      logname$(EXEEXT) pathchk$(EXEEXT) \
+       printenv$(EXEEXT) printf$(EXEEXT) pwd$(EXEEXT) seq$(EXEEXT) \
+       sleep$(EXEEXT) tee$(EXEEXT) test$(EXEEXT) true$(EXEEXT) \
+       tty$(EXEEXT) whoami$(EXEEXT) yes$(EXEEXT) $(am__EXEEXT_1) \
+@@ -169,7 +169,7 @@
+       $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
+       $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
+       $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
+-      $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
++      $(top_srcdir)/m4/unlocked-io.m4 \
+       $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
+       $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
+       $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
+@@ -350,11 +350,6 @@
+ join_LDADD = $(LDADD)
+ join_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
+       ../lib/libcoreutils.a
+-kill_SOURCES = kill.c
+-kill_OBJECTS = kill.$(OBJEXT)
+-kill_LDADD = $(LDADD)
+-kill_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
+-      ../lib/libcoreutils.a
+ link_SOURCES = link.c
+ link_OBJECTS = link.$(OBJEXT)
+ link_LDADD = $(LDADD)
+@@ -577,9 +572,6 @@
+ unlink_LDADD = $(LDADD)
+ unlink_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
+       ../lib/libcoreutils.a
+-uptime_SOURCES = uptime.c
+-uptime_OBJECTS = uptime.$(OBJEXT)
+-uptime_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+ users_SOURCES = users.c
+ users_OBJECTS = users.$(OBJEXT)
+ users_LDADD = $(LDADD)
+@@ -622,28 +614,28 @@
+       csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \
+       dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \
+       fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \
+-      id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \
++      id.c join.c link.c ln.c logname.c $(ls_SOURCES) \
+       $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \
+       nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \
+       printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \
+       rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \
+       sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \
+       tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \
+-      unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \
++      unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \
+       wc.c who.c whoami.c yes.c
+ DIST_SOURCES = $(__SOURCES) basename.c cat.c $(chgrp_SOURCES) chmod.c \
+       $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \
+       csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \
+       dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \
+       fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \
+-      id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \
++      id.c join.c link.c ln.c logname.c $(ls_SOURCES) \
+       $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \
+       nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \
+       printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \
+       rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \
+       sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \
+       tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \
+-      unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \
++      unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \
+       wc.c who.c whoami.c yes.c
+ HEADERS = $(noinst_HEADERS)
+ ETAGS = etags
+@@ -840,7 +832,6 @@
+ nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP)
+ sleep_LDADD = $(nanosec_libs)
+ tail_LDADD = $(nanosec_libs)
+-uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
+ su_LDADD = $(LDADD) $(LIB_CRYPT)
+ SUFFIXES = .sh
+ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
+@@ -1076,9 +1067,6 @@
+ join$(EXEEXT): $(join_OBJECTS) $(join_DEPENDENCIES) 
+       @rm -f join$(EXEEXT)
+       $(LINK) $(join_LDFLAGS) $(join_OBJECTS) $(join_LDADD) $(LIBS)
+-kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) 
+-      @rm -f kill$(EXEEXT)
+-      $(LINK) $(kill_LDFLAGS) $(kill_OBJECTS) $(kill_LDADD) $(LIBS)
+ link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) 
+       @rm -f link$(EXEEXT)
+       $(LINK) $(link_LDFLAGS) $(link_OBJECTS) $(link_LDADD) $(LIBS)
+@@ -1226,9 +1214,6 @@
+ unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) 
+       @rm -f unlink$(EXEEXT)
+       $(LINK) $(unlink_LDFLAGS) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS)
+-uptime$(EXEEXT): $(uptime_OBJECTS) $(uptime_DEPENDENCIES) 
+-      @rm -f uptime$(EXEEXT)
+-      $(LINK) $(uptime_LDFLAGS) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS)
+ users$(EXEEXT): $(users_OBJECTS) $(users_DEPENDENCIES) 
+       @rm -f users$(EXEEXT)
+       $(LINK) $(users_LDFLAGS) $(users_OBJECTS) $(users_LDADD) $(LIBS)
+@@ -1322,7 +1307,6 @@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+@@ -1378,7 +1362,6 @@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+@@ -1606,7 +1589,7 @@
+         && can_create_suid_root_executable=yes; \
+       rm -f $$TMPFILE; \
+       if test $$can_create_suid_root_executable = yes; then \
+-        $(INSTALL_SU); \
++        echo "Installation of su is suppressed"; \
+       else \
+         echo "WARNING: insufficient access; not installing su"; \
+         echo "NOTE: to install su, run 'make install-root' as root"; \

Added: trunk/coreutils/coreutils-5.92-uname-1.patch
===================================================================
--- trunk/coreutils/coreutils-5.92-uname-1.patch        2005-10-24 21:46:22 UTC 
(rev 1211)
+++ trunk/coreutils/coreutils-5.92-uname-1.patch        2005-10-25 01:05:09 UTC 
(rev 1212)
@@ -0,0 +1,182 @@
+Submitted By: Matthew Burgess <matthew at linuxfromscratch dot org>
+Date: 2005-10-23
+Initial Package Version: 5.92
+Upstream Status: pending
+Origin: Scot McPherson
+Description: Fix the output of uname once and for all.
+
+       $ uname -m      # This always worked.
+       i686
+       $ uname -i      # Used to report 'unknown'.
+       i386
+       $ uname -p      # Likewise.
+       athlon-4
+
+diff -Naur coreutils-5.92.orig/src/uname.c coreutils-5.92/src/uname.c
+--- coreutils-5.92.orig/src/uname.c    2005-09-15 20:34:42.000000000 +0000
++++ coreutils-5.92/src/uname.c 2005-10-23 10:14:06.000000000 +0000
+@@ -29,6 +29,12 @@
+ # include <sys/systeminfo.h>
+ #endif
+ 
++#ifdef linux
++#define cpuid(in,a,b,c,d)\
++  asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
++int has_sse( void );
++#endif
++
+ #if HAVE_SYS_SYSCTL_H
+ # if HAVE_SYS_PARAM_H
+ #  include <sys/param.h> /* needed for OpenBSD 3.0 */
+@@ -256,6 +262,96 @@
+       if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+         element = processor;
+       }
++#else
++      {
++      struct utsname u;
++      uname (&u);
++      element = u.machine;
++#ifdef linux
++/******************************************************************************
++ *
++ * Hello, major hack.  I shouldn't have to do this.  struct utsname should
++ * have another element with this info in it.  There's probably a struct
++ * somewhere that has this info, I just don't know where it is.
++ *
++ 
*****************************************************************************/
++
++      if( !strcmp( element, "i586" ) || !strcmp( element, "i686" ) ) {
++        int eax, ebx, ecx, edx, unused;
++        int model, family, sse;
++     
++        cpuid(0,unused,ebx,ecx,edx);
++        cpuid(1,eax,unused,unused,unused);
++        model = (eax >> 4) & 0xf;
++        family = (eax >> 8) & 0xf;
++
++        switch(ebx) {
++        case 0x756e6547: // Intel
++          switch( family ) {
++          case 5: // Pentium
++            if( model <= 3 )
++              element="pentium";
++            if( model > 3 )
++              element="pentium-mmx";
++            break;
++          case 6: // PentiumPro - Pentium III
++            if( model == 1 ) // Pentium Pro
++              element="pentiumpro";
++            if( ( model == 3 ) || ( model == 5 ) ||
++                ( model == 6 ) ) // Pentium II
++              element="pentium2";
++            if( ( model == 7 ) || ( model == 8 ) ||
++                ( model == 10 ) || ( model == 11 ) ) // These are all Pentium 
III
++              element="pentium3";
++            break;
++          case 15: // Pentium4
++            element="pentium4";
++            break;
++          default:
++            break;
++          } // end switch( family )
++          break;
++        case 0x68747541: // AMD
++          switch(family) {
++          case 5:
++            if( ( model == 0 ) || ( model == 1 ) || 
++                ( model == 2 ) || ( model == 3 ) ) // K5
++              element="i586";
++            if( ( model == 6 ) || ( model == 7 ) ) // K6
++              element="k6";
++            if( model == 8 ) // K6-2
++              element="k6-2";
++            if( model == 9 ) // K6-3
++              element="k6-3";
++            break;
++          case 6:
++            if( model <= 4 )
++              element="athlon";
++            if( model > 4 ) {
++              sse = has_sse();
++              if( sse == 0 )
++                element="athlon";
++              if( sse == 1 )
++                element="athlon-4";
++            }
++            break;
++          case 15:
++            element="athlon-4";
++            break;
++          default:
++            break;
++          } // end switch( family )
++          break;
++        case 0x69727943: // Cyrix
++          element="i386"; // who knows what cyrix supports, lets be safe
++          break;
++        default:
++          break;
++        } // end switch(ebx)
++      }
++
++#endif
++      }
+ #endif
+ #ifdef UNAME_PROCESSOR
+       if (element == unknown)
+@@ -293,7 +389,7 @@
+ 
+   if (toprint & PRINT_HARDWARE_PLATFORM)
+     {
+-      char const *element = unknown;
++      char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_PLATFORM
+       {
+       static char hardware_platform[257];
+@@ -301,6 +397,15 @@
+                         hardware_platform, sizeof hardware_platform))
+         element = hardware_platform;
+       }
++#else
++      {
++      struct utsname u;
++      uname (&u);
++      element = u.machine;
++      if (strlen (element) == 4 && element[0] == 'i' && element[2] == '8'
++          && element[3] == '6')
++        element[1] = '3';
++      }
+ #endif
+ #ifdef UNAME_HARDWARE_PLATFORM
+       if (element == unknown)
+@@ -323,3 +428,29 @@
+ 
+   exit (EXIT_SUCCESS);
+ }
++
++#ifdef linux
++
++/******************************************************************************
++ *
++ * int has_sse( void )
++ * Checks Athlon CPU's to see if they support SSE.
++ *
++ 
*****************************************************************************/
++
++int has_sse( void )
++{
++  unsigned long edx, unused;
++  int sse;
++  cpuid(1,unused,unused,unused,edx);
++  // I think, I need this tested on a Duron with SSE
++  // and one without it.
++  sse = edx & 0x2000000;
++  if( sse == 0 ) {
++    return 0;
++  } else {
++    return 1;
++  }
++
++}
++#endif

-- 
http://linuxfromscratch.org/mailman/listinfo/patches
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to