Add support for non-native ABI on hybrid build,
by following the steps taken by TranslatorRoster and LocaleRoster. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37900 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3426ce1404
commit
39f372d1d7
@ -33,7 +33,8 @@ GLRendererRoster::GLRendererRoster(BGLView *view, ulong options)
|
||||
: fNextID(0),
|
||||
fView(view),
|
||||
fOptions(options),
|
||||
fSafeMode(false)
|
||||
fSafeMode(false),
|
||||
fABISubDirectory(NULL)
|
||||
{
|
||||
char parameter[32];
|
||||
size_t parameterLength = sizeof(parameter);
|
||||
@ -62,6 +63,23 @@ GLRendererRoster::GLRendererRoster(BGLView *view, ulong options)
|
||||
fSafeMode = true;
|
||||
}
|
||||
|
||||
// We might run in compatibility mode on a system with a different ABI. The
|
||||
// renderers matching our ABI can usually be found in respective
|
||||
// subdirectories of the opengl add-ons directories.
|
||||
system_info info;
|
||||
if (get_system_info(&info) == B_OK
|
||||
&& (info.abi & B_HAIKU_ABI_MAJOR)
|
||||
!= (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) {
|
||||
switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) {
|
||||
case B_HAIKU_ABI_GCC_2:
|
||||
fABISubDirectory = "gcc2";
|
||||
break;
|
||||
case B_HAIKU_ABI_GCC_4:
|
||||
fABISubDirectory = "gcc4";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AddDefaultPaths();
|
||||
}
|
||||
|
||||
@ -111,6 +129,16 @@ GLRendererRoster::AddPath(const char* path)
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
// if a subdirectory for our ABI exists, use that instead
|
||||
if (fABISubDirectory != NULL) {
|
||||
BEntry entry(&directory, fABISubDirectory);
|
||||
if (entry.IsDirectory()) {
|
||||
status = directory.SetTo(&entry);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
node_ref nodeRef;
|
||||
status = directory.GetNodeRef(&nodeRef);
|
||||
if (status < B_OK)
|
||||
|
@ -36,6 +36,8 @@ class GLRendererRoster {
|
||||
BGLView *fView;
|
||||
ulong fOptions;
|
||||
bool fSafeMode;
|
||||
const char* fABISubDirectory;
|
||||
|
||||
};
|
||||
|
||||
#endif /* _GLRENDERER_ROSTER_H */
|
||||
|
Loading…
Reference in New Issue
Block a user