Changeset 8eb1087


Ignore:
Timestamp:
May 27, 2011 3:02:03 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2c3be29
Parents:
d5fd682
Message:
  • CPUID:
    • Recognize amd64 as x86
    • Only check for one file name in library path
    • Log tweaks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    rd5fd682 r8eb1087  
    4646                                    I2PAppContext.getGlobalContext().isRouterContext();
    4747
    48     private static final boolean isX86 = System.getProperty("os.arch").contains("86");
     48    private static final boolean isX86 = System.getProperty("os.arch").contains("86") ||
     49                                         System.getProperty("os.arch").equals("amd64");
    4950    private static final String libPrefix = (System.getProperty("os.name").startsWith("Win") ? "" : "lib");
    5051    private static final String libSuffix = (System.getProperty("os.name").startsWith("Win") ? ".dll" : ".so");
     
    500501        System.out.println("CPU Model: " + getCPUModel());
    501502        System.out.println("CPU Stepping: " + getCPUStepping());
    502         System.out.println("CPU Flags: " + getEDXCPUFlags());
     503        System.out.println("CPU Flags: 0x" + Integer.toHexString(getEDXCPUFlags()));
    503504       
    504505        CPUInfo c = getInfo();
     
    541542                _nativeOk = true;
    542543                if (_doLog)
    543                     System.err.println("INFO: Native CPUID library '"+getLibraryMiddlePart()+"' loaded from somewhere in the path");
     544                    System.err.println("INFO: Native CPUID library " + getLibraryMiddlePart() + " loaded from file");
    544545            } else {
    545546                loaded = loadFromResource();
     
    547548                    _nativeOk = true;
    548549                    if (_doLog)
    549                         System.err.println("INFO: Native CPUID library '"+getResourceName()+"' loaded from resource");
     550                        System.err.println("INFO: Native CPUID library " + getResourceName() + " loaded from resource");
    550551                } else {
    551552                    _nativeOk = false;
     
    582583        // Don't bother trying a 64 bit filename variant.
    583584
     585        // 32 bit variant:
    584586        // Note this is unlikely to succeed on a standard installation, since when we extract the library
    585587        // in loadResource() below, we save it as jcpuid.dll / libcupid.so.
    586588        // However, a distribution may put the file in, e.g., /usr/lib/jni/
    587589        // with the libjcpuid-x86-linux.so name.
    588         try {
    589             System.loadLibrary(getLibraryMiddlePart());
    590             return true;
    591         } catch (UnsatisfiedLinkError ule) {
     590        // Ubuntu packages now use libjcpuid.so
     591        //try {
     592        //    System.loadLibrary(getLibraryMiddlePart());
     593        //    return true;
     594        //} catch (UnsatisfiedLinkError ule) {
    592595            return false;
    593         }
     596        //}
    594597    }
    595598   
Note: See TracChangeset for help on using the changeset viewer.