Next Previous Contents

7. Optimization for Pentiums

The standard Debian binary packages are built for i386 processors, not Pentiums. They are also often built without any optimization.

This is a Good Thing for a distribution, since it will work on the most hardware. But if you're responsible a site with nothing older than a Pentium-II, you might prefer binary packages built for Pentiums.

7.1 binary-i586

To minimize confusion, we will want to specify a new architecture for our packages: i586. We can force this by making changes to the usrbin/dpkg-architecture/ file:


--- dpkg-architecture~  Sun May 20 11:46:22 2001
+++ dpkg-architecture   Sun May 20 14:57:17 2001
@@ -48,6 +48,8 @@
 require 'controllib.pl';
 
 %archtable=('i386',      'i386-linux',
+               'i586',      'i586-linux',
+               'i686',      'i686-linux',
            'sparc',     'sparc-linux',
            'sparc64',   'sparc64-linux',
            'alpha',     'alpha-linux',
@@ -90,7 +92,7 @@
 sub rewrite_gnu_cpu {
        local ($_) = @_;
 
-       s/(?:i386|i486|i586|i686|pentium)(.*linux)/i386$1/;
+       s/(?:i386|i486|i586|i686|pentium)(.*linux)/i586$1/;
        s/ppc/powerpc/;
        return $_;
 }

The rest of the upload process should run as expected, ultimately resulting in the packages being stored under binary-i586 instead of binary-i386.

7.2 CFLAGS

Many packages can be optimized for a pentium by adding CFLAGS='-O2 -mpentium' to your environment before building the packages.

Unfortunately, many packages specify the CFLAGS internally. To find them, it is usually enough to grep for "CFLAGS" in the debian/rules file. You must then set up a CVS archive as discussed above, then add -O2 -mpentium to the CFLAGS assignment.


Next Previous Contents