64 #define CPU_TYPE_STRING "PPC-32"
65 #elif defined (__ppc64__)
66 #define CPU_TYPE_STRING "PPC-64"
67 #elif defined (__i386__)
68 #define CPU_TYPE_STRING "x86-32"
69 #elif defined (__x86_64__)
70 #define CPU_TYPE_STRING "x86-64"
73 #define CPU_TYPE_STRING "<unknown big-endian architecture>"
74 #elif OOLITE_LITTLE_ENDIAN
75 #define CPU_TYPE_STRING "<unknown little-endian architecture>"
77 #define CPU_TYPE_STRING "<unknown architecture with unknown byte order>"
82 #define OS_TYPE_STRING "Mac OS X"
84 #define OS_TYPE_STRING "Windows"
86 #define OS_TYPE_STRING "Linux"
88 #define OS_TYPE_STRING "unknown SDL system"
90 #define OS_TYPE_STRING "unknown system"
94 #define RELEASE_VARIANT_STRING " debug"
95 #elif !defined (NDEBUG)
96 #define RELEASE_VARIANT_STRING " test release"
98 #define RELEASE_VARIANT_STRING ""
101 NSArray *featureStrings = [NSArray arrayWithObjects:
116 #if OO_CHECK_GL_HEAVY
117 @"heavy OpenGL error checking",
120 #ifndef OO_EXCLUDE_DEBUG_SUPPORT
121 @"JavaScript console support",
124 @"Debug plug-in support",
128 #if OO_OXP_VERIFIER_ENABLED
132 #if OO_LOCALIZATION_TOOLS
133 @"localization tools",
137 @"debug GraphViz support",
141 #ifdef MOZ_TRACE_JSCALLS
142 @"JavaScript profiling",
144 @"JavaScript native callback profiling",
148 #if OO_FOV_INFLIGHT_CONTROL_ENABLED
149 @"FOV in-flight control",
155 #if (OOLITE_MAC_OS_X || (OOLITE_GNUSTEP_1_20 && !OOLITE_WINDOWS))
156 NSString *systemString = [NSString stringWithFormat:@OS_TYPE_STRING " %@", [[NSProcessInfo processInfo] operatingSystemVersionString]];
158 NSString *systemString = [NSString stringWithFormat:@OS_TYPE_STRING " %@ %@-bit", operatingSystemFullVersion(), is64BitSystem() ? @"64":@"32"];
160 #define systemString @OS_TYPE_STRING
163 NSString *versionString =
nil;
164 #if (defined (SNAPSHOT_BUILD) && defined (OOLITE_SNAPSHOT_VERSION))
165 versionString =
@"development version " OOLITE_SNAPSHOT_VERSION;
167 versionString = [NSString stringWithFormat:@"version %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]];
169 if (versionString ==
nil) versionString =
@"<unknown version>";
171 NSMutableString *miscString = [NSMutableString stringWithFormat:@"Opening log for Oolite %@ (" CPU_TYPE_STRING RELEASE_VARIANT_STRING ") under %@ at %@.\n", versionString, systemString, [NSDate date]];
173 [miscString appendString:AdditionalLogHeaderInfo()];
175 NSString *featureDesc = [featureStrings componentsJoinedByString:@", "];
176 if ([featureDesc length] == 0) featureDesc =
@"none";
177 [miscString appendFormat:@"\nBuild options: %@.\n", featureDesc];
179 [miscString appendString:@"\nNote that the contents of the log file can be adjusted by editing logcontrol.plist."];
181 OOLog(
@"log.header",
@"%@\n", miscString);
236 NSString *typeStr =
nil, *subTypeStr =
nil;
238 unsigned long long sysCPUType =
GetSysCtlInt(
"hw.cputype");
239 unsigned long long sysCPUFamily =
GetSysCtlInt(
"hw.cpufamily");
240 unsigned long long sysCPUFrequency =
GetSysCtlInt(
"hw.cpufrequency");
241 unsigned long long sysCPUCount =
GetSysCtlInt(
"hw.physicalcpu");
242 unsigned long long sysLogicalCPUCount =
GetSysCtlInt(
"hw.logicalcpu");
251 case CPU_TYPE_POWERPC:
252 typeStr =
@"PowerPC";
257 switch (sysCPUFamily)
260 subTypeStr =
@" (Core 2/Merom)";
263 case CPUFAMILY_INTEL_PENRYN:
264 subTypeStr =
@" (Penryn)";
267 case CPUFAMILY_INTEL_NEHALEM:
268 subTypeStr =
@" (Nehalem)";
271 case CPUFAMILY_INTEL_WESTMERE:
272 subTypeStr =
@" (Westmere)";
275 case CPUFAMILY_INTEL_SANDYBRIDGE:
276 subTypeStr =
@" (Sandy Bridge)";
279 case CPUFAMILY_INTEL_IVYBRIDGE:
280 subTypeStr =
@" (Ivy Bridge)";
284 subTypeStr =
@" (Haswell)";
288 subTypeStr =
@" (Broadwell)";
292 subTypeStr =
@" (Skylake)";
296 subTypeStr = [NSString stringWithFormat:@" (family 0x%llx)", sysCPUFamily];
304 if (typeStr ==
nil) typeStr = [NSString stringWithFormat:@"CPU type %llu", sysCPUType];
306 NSString *countStr =
nil;
307 if (sysCPUCount == sysLogicalCPUCount) countStr = [NSString stringWithFormat:@"%llu", sysCPUCount];
308 else countStr = [NSString stringWithFormat:@"%llu (%llu logical)", sysCPUCount, sysLogicalCPUCount];
310 return [NSString stringWithFormat:@"%@ x %@%@ @ %llu MHz", countStr, typeStr, subTypeStr, (sysCPUFrequency + 500000) / 1000000];
353 return [NSString stringWithFormat:@"%@ %u processor%@ detected. System RAM: %llu MB (free: %llu MB).", cpuDescription, cpuCount, cpuCount != 1 ? @"s" : @"", systemMemoryStatus.ooPhysicalMemory, systemMemoryStatus.ooAvailableMemory];