61{
62
63 #if defined (__ppc__)
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"
71 #else
72 #if OOLITE_BIG_ENDIAN
73 #define CPU_TYPE_STRING "<unknown big-endian architecture>"
74 #elif OOLITE_LITTLE_ENDIAN
75 #define CPU_TYPE_STRING "<unknown little-endian architecture>"
76 #else
77 #define CPU_TYPE_STRING "<unknown architecture with unknown byte order>"
78 #endif
79 #endif
80
81 #if OOLITE_MAC_OS_X
82 #define OS_TYPE_STRING "Mac OS X"
83 #elif OOLITE_WINDOWS
84 #define OS_TYPE_STRING "Windows"
85 #elif OOLITE_LINUX
86 #define OS_TYPE_STRING "Linux"
87 #elif OOLITE_SDL
88 #define OS_TYPE_STRING "unknown SDL system"
89 #else
90 #define OS_TYPE_STRING "unknown system"
91 #endif
92
93 #if OO_DEBUG
94 #define RELEASE_VARIANT_STRING " debug"
95 #elif !defined (NDEBUG)
96 #define RELEASE_VARIANT_STRING " test release"
97 #else
98 #define RELEASE_VARIANT_STRING ""
99 #endif
100
101 NSArray *featureStrings = [NSArray arrayWithObjects:
102
103 #if OOLITE_OPENAL
104 @"OpenAL",
105 #endif
106
107 #if OO_SHADERS
108 @"GLSL shaders",
109 #endif
110
111 #if NEW_PLANETS
112 @"new planets",
113 #endif
114
115
116 #if OO_CHECK_GL_HEAVY
117 @"heavy OpenGL error checking",
118 #endif
119
120 #ifndef OO_EXCLUDE_DEBUG_SUPPORT
121 @"JavaScript console support",
122 #if OOLITE_MAC_OS_X
123
124 @"Debug plug-in support",
125 #endif
126 #endif
127
128 #if OO_OXP_VERIFIER_ENABLED
129 @"OXP verifier",
130 #endif
131
132 #if OO_LOCALIZATION_TOOLS
133 @"localization tools",
134 #endif
135
136 #if DEBUG_GRAPHVIZ
137 @"debug GraphViz support",
138 #endif
139
140 #if OOJS_PROFILE
141 #ifdef MOZ_TRACE_JSCALLS
142 @"JavaScript profiling",
143 #else
144 @"JavaScript native callback profiling",
145 #endif
146 #endif
147
148 #if OO_FOV_INFLIGHT_CONTROL_ENABLED
149 @"FOV in-flight control",
150 #endif
151
153
154
155 #if (OOLITE_MAC_OS_X || (OOLITE_GNUSTEP_1_20 && !OOLITE_WINDOWS))
156 NSString *systemString = [NSString stringWithFormat:@
OS_TYPE_STRING " %@", [[NSProcessInfo processInfo] operatingSystemVersionString]];
157 #elif OOLITE_WINDOWS
158 NSString *systemString = [NSString stringWithFormat:@
OS_TYPE_STRING " %@ %@-bit", operatingSystemFullVersion(), is64BitSystem() ?
@"64":
@"32"];
159 #else
160 #define systemString @OS_TYPE_STRING
161 #endif
162
163 NSString *versionString =
nil;
164 #if (defined (SNAPSHOT_BUILD) && defined (OOLITE_SNAPSHOT_VERSION))
165 versionString = @"development version " OOLITE_SNAPSHOT_VERSION;
166 #else
167 versionString = [NSString stringWithFormat:@"version %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]];
168 #endif
169 if (versionString ==
nil) versionString =
@"<unknown version>";
170
171 NSMutableString *miscString = [NSMutableString stringWithFormat:
@"Opening log for Oolite %@ (" CPU_TYPE_STRING RELEASE_VARIANT_STRING ") under %@ at %@.\n", versionString, systemString, [NSDate date]];
172
174
175 NSString *featureDesc = [featureStrings componentsJoinedByString:@", "];
176 if ([featureDesc length] == 0) featureDesc = @"none";
177 [miscString appendFormat:@"\nBuild options: %@.\n", featureDesc];
178
179 [miscString appendString:@"\nNote that the contents of the log file can be adjusted by editing logcontrol.plist."];
180
181 OOLog(
@"log.header",
@"%@\n", miscString);
182}
#define OOLog(class, format,...)