* We do now have a special "_haiku_revision" section in our libroot,
containing the Haiku SVN revision number which is used by uname(). The value is 0 when built, but updated by the build system before copying libroot to the image (new rule CopySetHaikuRevision). * For AboutHaiku we no longer write the SVN revision number into a resource. Instead we use the uname() info. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20082 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -48,5 +48,16 @@ SharedLibrary libroot.so
|
||||
$(librootObjects:G=nogrist)
|
||||
;
|
||||
|
||||
|
||||
# Copy libroot.so and update the copy's revision section. We link everything
|
||||
# against the original, but the copy will end up on the disk image (this way
|
||||
# we avoid unnecessary dependencies). The copy will be located in a subdirectory.
|
||||
if $(TARGET_PLATFORM) = haiku {
|
||||
MakeLocate <revisioned>libroot.so
|
||||
: [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) revisioned ] ;
|
||||
CopySetHaikuRevision <revisioned>libroot.so : libroot.so ;
|
||||
}
|
||||
|
||||
|
||||
SubInclude HAIKU_TOP src system libroot os ;
|
||||
SubInclude HAIKU_TOP src system libroot posix ;
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Haiku SVN revision. Will be set when copying libroot.so to the image.
|
||||
// Lives in a separate section so that it can easily be found.
|
||||
extern uint32 _gHaikuRevision __attribute__((section("_haiku_revision")));
|
||||
uint32 _gHaikuRevision = 0;
|
||||
|
||||
|
||||
int
|
||||
uname(struct utsname *info)
|
||||
{
|
||||
@@ -28,13 +34,15 @@ uname(struct utsname *info)
|
||||
strlcpy(info->sysname, "Haiku", sizeof(info->sysname));
|
||||
|
||||
info->version[0] = '\0';
|
||||
#ifdef HAIKU_REVISION
|
||||
snprintf(info->version, sizeof(info->version), "r%d ", HAIKU_REVISION);
|
||||
#endif
|
||||
if (_gHaikuRevision) {
|
||||
snprintf(info->version, sizeof(info->version), "r%ld ",
|
||||
_gHaikuRevision);
|
||||
}
|
||||
strlcat(info->version, systemInfo.kernel_build_date, sizeof(info->version));
|
||||
strlcat(info->version, " ", sizeof(info->version));
|
||||
strlcat(info->version, systemInfo.kernel_build_time, sizeof(info->version));
|
||||
snprintf(info->release, sizeof(info->release), "%lld", systemInfo.kernel_version);
|
||||
snprintf(info->release, sizeof(info->release), "%lld",
|
||||
systemInfo.kernel_version);
|
||||
|
||||
// TODO: make this better
|
||||
switch (systemInfo.platform_type) {
|
||||
|
||||
Reference in New Issue
Block a user