Browse Source
* Added definitions for IRIX * Patchset to get dedicated server to compile on IRIX. * Cleaned up debug statements in wscript * Potential bug in IRIX implementation of isnan? For now just use the portable macro. * Include the platform port files in the build * Temporary execution script for setting appropriate library search paths to the right locations in the build directory. This should probably get replaced with a more permanent script at some point which lives in the same directory as the normal xash binary, or be replaced by a solution that sets the rpath during config or modifies rpath during install. * Clean up formatting and remove unneeded debugging statements * Added GPL copyright notice and description * Moved to irix platform folder and edited script * Re-introduced _inline macro * Replace spaces with tabs Co-authored-by: Xav101 <xaviernye@msn.com>pull/2/head
Xav101
2 years ago
committed by
GitHub
15 changed files with 150 additions and 3 deletions
@ -0,0 +1,39 @@ |
|||||||
|
/*
|
||||||
|
dladdr.c - dladdr implementation for SGI IRIX |
||||||
|
Copyright (C) 2022 Xav101 |
||||||
|
This program is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
/*
|
||||||
|
* From SGI IRIX's 'man dladdr' |
||||||
|
* |
||||||
|
* <dlfcn.h> does not contain a prototype for dladdr or definition of |
||||||
|
* Dl_info. The #include <dlfcn.h> in the SYNOPSIS line is traditional, |
||||||
|
* but contains no dladdr prototype and no IRIX library contains an |
||||||
|
* implementation. Write your own declaration based on the code below. |
||||||
|
* |
||||||
|
* The following code is dependent on internal interfaces that are not |
||||||
|
* part of the IRIX compatibility guarantee; however, there is no future |
||||||
|
* intention to change this interface, so on a practical level, the code |
||||||
|
* below is safe to use on IRIX. |
||||||
|
* |
||||||
|
* |
||||||
|
* |
||||||
|
* The following code has been reproduced from the manpage. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "dladdr.h" |
||||||
|
|
||||||
|
int dladdr(void *address, Dl_info* dl) |
||||||
|
{ |
||||||
|
void *v; |
||||||
|
v = _rld_new_interface(_RLD_DLADDR, address, dl); |
||||||
|
return (int)v; |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
/*
|
||||||
|
dladdr.h - dladdr prototypes for SGI IRIX |
||||||
|
Copyright (C) 2022 Xav101 |
||||||
|
This program is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* See engine/platform/irix/dladdr.c for the requirement for this implementation */ |
||||||
|
|
||||||
|
#ifndef DLADDR_IRIX_H |
||||||
|
#define DLADDR_IRIX_H |
||||||
|
|
||||||
|
#include <rld_interface.h> |
||||||
|
#ifndef _RLD_INTERFACE_DLFCN_H_DLADDR |
||||||
|
#define _RLD_INTERFACE_DLFCN_H_DLADDR |
||||||
|
typedef struct Dl_info { |
||||||
|
const char * dli_fname; |
||||||
|
void * dli_fbase; |
||||||
|
const char * dli_saddr; |
||||||
|
int dli_version; |
||||||
|
int dli_reserved1; |
||||||
|
long dli_reserved[4]; |
||||||
|
} Dl_info; |
||||||
|
#endif |
||||||
|
#define _RLD_DLADDR 14 |
||||||
|
|
||||||
|
int dladdr(void *address, Dl_info* dl); |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,9 @@ |
|||||||
|
#!/usr/sgug/bin/bash |
||||||
|
|
||||||
|
# Build path |
||||||
|
export LD_LIBRARYN32_PATH=$PWD/filesystem:$LD_LIBRARYN32_PATH |
||||||
|
|
||||||
|
# Install path |
||||||
|
export LD_LIBRARYN32_PATH=$PWD:$LD_LIBRARYN32_PATH |
||||||
|
|
||||||
|
exec $PWD/build/engine/xash |
Loading…
Reference in new issue