Build Fixes for IRIX.
This commit is contained in:
parent
06046639b5
commit
f8107a39b9
120
Make/makedefs
120
Make/makedefs
@ -205,50 +205,84 @@ endif
|
|||||||
|
|
||||||
#### IRIX Specific definitions
|
#### IRIX Specific definitions
|
||||||
ifeq ($(OS),IRIX)
|
ifeq ($(OS),IRIX)
|
||||||
LINKARGS = -L${TOPDIR}/lib -LANG:std -OPT:Olimit=0
|
CXX = CC
|
||||||
C++ = CC
|
ifeq ($(CXX),CC)
|
||||||
DEPARG = -M
|
LINKARGS = -L${TOPDIR}/lib -LANG:std -OPT:Olimit=0
|
||||||
INC += -I${TOPDIR}/include -I/usr/freeware/include
|
C++ = CC
|
||||||
DEF += -LANG:std -OPT:Olimit=0 \
|
DEPARG = -M
|
||||||
-DEBUG:woff=1681 -DEBUG:woff=1682 -DEBUG:woff=3303\
|
INC += -I${TOPDIR}/include -I/usr/freeware/include
|
||||||
-MDupdate $(MAKEDEPEND)
|
DEF += -LANG:std -OPT:Olimit=0 \
|
||||||
OPTF = -O2
|
-DEBUG:woff=1681 -DEBUG:woff=1682 -DEBUG:woff=3303\
|
||||||
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
|
-MDupdate $(MAKEDEPEND)
|
||||||
SHARED = -shared
|
OPTF = -O2
|
||||||
PFLIBS = \
|
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
|
||||||
-lpf3ds -lpfdem -lpfdted -lpfdwb -lpfdxf -lpfevt \
|
SHARED = -shared
|
||||||
-lpfflt -lpfgds -lpfgfo -lpfim -lpflsa -lpflsb \
|
PFLIBS = \
|
||||||
-lpfnff -lpfobj -lpfpegg -lpfpfb -lpfphd -lpfpts \
|
-lpf3ds -lpfdem -lpfdted -lpfdwb -lpfdxf -lpfevt \
|
||||||
-lpfrot -lpfscale -lpfsgf -lpfsgo -lpfsphere -lpfsv \
|
-lpfflt -lpfgds -lpfgfo -lpfim -lpflsa -lpflsb \
|
||||||
-lpftri -lpfunc -lpfvct -lpfdu -lpfutil -lpf -all -limage
|
-lpfnff -lpfobj -lpfpegg -lpfpfb -lpfphd -lpfpts \
|
||||||
FREETYPE_LIB = -lfreetype
|
-lpfrot -lpfscale -lpfsgf -lpfsgo -lpfsphere -lpfsv \
|
||||||
ARCH = 32
|
-lpftri -lpfunc -lpfvct -lpfdu -lpfutil -lpf -all -limage
|
||||||
ifeq ($(ARCH),64)
|
FREETYPE_LIB = -lfreetype
|
||||||
ARCHARGS = -64 -DARCH64
|
ARCH = 32
|
||||||
ARCHINST = 64
|
ifeq ($(ARCH),64)
|
||||||
LINKARGS += -L/usr/freeware/lib64
|
ARCHARGS = -64 -DARCH64
|
||||||
PF_XTRA_LIBS = -L/usr/lib64/libpfdb -rpath /usr/lib64/libpfdb \
|
ARCHINST = 64
|
||||||
$(PFLIBS)
|
LINKARGS += -L/usr/freeware/lib64
|
||||||
else
|
PF_XTRA_LIBS = -L/usr/lib64/libpfdb -rpath /usr/lib64/libpfdb \
|
||||||
ARCHARGS = -n32
|
$(PFLIBS)
|
||||||
ARCHINST = 32
|
else
|
||||||
LINKARGS += -L/usr/freeware/lib32
|
ARCHARGS = -n32
|
||||||
PF_XTRA_LIBS = -L/usr/lib32/libpfdb -rpath /usr/lib32/libpfdb \
|
ARCHINST = 32
|
||||||
$(PFLIBS)
|
LINKARGS += -L/usr/freeware/lib32
|
||||||
endif
|
PF_XTRA_LIBS = -L/usr/lib32/libpfdb -rpath /usr/lib32/libpfdb \
|
||||||
|
$(PFLIBS)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
LIBS = -lstdc++
|
||||||
|
LINKARGS = -L${TOPDIR}/lib
|
||||||
|
C++ = g++
|
||||||
|
INC += -I${TOPDIR}/include -I/usr/freeware/include
|
||||||
|
DEF += -fPIC -W -Wno-unused
|
||||||
|
OPTF = -O2
|
||||||
|
DBGF = -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS
|
||||||
|
SHARED = -shared
|
||||||
|
PFLIBS = \
|
||||||
|
-lpf3ds -lpfdem -lpfdted -lpfdwb -lpfdxf -lpfevt \
|
||||||
|
-lpfflt -lpfgds -lpfgfo -lpfim -lpflsa -lpflsb \
|
||||||
|
-lpfnff -lpfobj -lpfpegg -lpfpfb -lpfphd -lpfpts \
|
||||||
|
-lpfrot -lpfscale -lpfsgf -lpfsgo -lpfsphere -lpfsv \
|
||||||
|
-lpftri -lpfunc -lpfvct -lpfdu -lpfutil -lpf -all -limage
|
||||||
|
FREETYPE_LIB = -lfreetype
|
||||||
|
ARCH = 32
|
||||||
|
ifeq ($(ARCH),64)
|
||||||
|
ARCHARGS = -mabi=64 -mips4 -DARCH64
|
||||||
|
ARCHINST = 64
|
||||||
|
LINKARGS += -L/usr/freeware/lib64
|
||||||
|
PF_XTRA_LIBS = -L/usr/lib64/libpfdb -rpath /usr/lib64/libpfdb \
|
||||||
|
$(PFLIBS)
|
||||||
|
else
|
||||||
|
ARCHARGS = -mabi=n32 -mips4
|
||||||
|
ARCHINST = 32
|
||||||
|
LINKARGS += -L/usr/freeware/lib32
|
||||||
|
PF_XTRA_LIBS = -L/usr/lib32/libpfdb -rpath /usr/lib32/libpfdb \
|
||||||
|
$(PFLIBS)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
DYNAMICLIBRARYLIB =
|
||||||
|
OSG_LIBS = -losgGA -losgDB -losgUtil -losg
|
||||||
|
GL_LIBS = -lGLU -lGL
|
||||||
|
X_INC = -I/usr/X11R6/include
|
||||||
|
X_LIBS = -lXext -lXi -lXmu -lX11
|
||||||
|
SOCKET_LIBS =
|
||||||
|
OTHER_LIBS = -lm -lOpenThreads
|
||||||
|
PNG_LIBS = -lpng
|
||||||
|
JPEG_LIBS = -ljpeg
|
||||||
|
TIFF_LIB = -ltiff
|
||||||
|
GIF_LIBS = -lungif
|
||||||
|
MAKEDIST = $(TOPDIR)/Make/makeirixdist
|
||||||
|
|
||||||
DYNAMICLIBRARYLIB =
|
|
||||||
OSG_LIBS = -losgGA -losgDB -losgUtil -losg
|
|
||||||
GL_LIBS = -lGLU -lGL
|
|
||||||
X_INC = -I/usr/X11R6/include
|
|
||||||
X_LIBS = -lXext -lXi -lXmu -lX11
|
|
||||||
SOCKET_LIBS =
|
|
||||||
OTHER_LIBS = -lm -lOpenThreads
|
|
||||||
PNG_LIBS = -lpng
|
|
||||||
JPEG_LIBS = -ljpeg
|
|
||||||
TIFF_LIB = -ltiff
|
|
||||||
GIF_LIBS = -lungif
|
|
||||||
MAKEDIST = $(TOPDIR)/Make/makeirixdist
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#### Linux specific definitions
|
#### Linux specific definitions
|
||||||
|
@ -12,7 +12,6 @@ INSTFILES = \
|
|||||||
|
|
||||||
EXEC = osgscalarbar
|
EXEC = osgscalarbar
|
||||||
|
|
||||||
INC += $(PRODUCER_INCLUDE_DIR) -I/usr/X11R6/include
|
INC += $(X_INC)
|
||||||
LDFLAGS += $(PRODUCER_LIB_DIR)
|
|
||||||
|
|
||||||
include $(TOPDIR)/Make/makerules
|
include $(TOPDIR)/Make/makerules
|
||||||
|
@ -8,7 +8,6 @@ LIBS += -losgText -losgProducer -lProducer -losgDB -losgText -losgUtil -losg
|
|||||||
|
|
||||||
EXEC = osgscalarbar
|
EXEC = osgscalarbar
|
||||||
|
|
||||||
INC += $(PRODUCER_INCLUDE_DIR) -I/usr/X11R6/include
|
INC += $(X_INC)
|
||||||
LDFLAGS += $(PRODUCER_LIB_DIR)
|
|
||||||
|
|
||||||
include $(TOPDIR)/Make/makerules
|
include $(TOPDIR)/Make/makerules
|
||||||
|
@ -12,7 +12,6 @@ INSTFILES = \
|
|||||||
|
|
||||||
EXEC = osgspheresegment
|
EXEC = osgspheresegment
|
||||||
|
|
||||||
INC += $(PRODUCER_INCLUDE_DIR) -I/usr/X11R6/include
|
INC += $(X_INC)
|
||||||
LDFLAGS += $(PRODUCER_LIB_DIR)
|
|
||||||
|
|
||||||
include $(TOPDIR)/Make/makerules
|
include $(TOPDIR)/Make/makerules
|
||||||
|
@ -8,7 +8,6 @@ LIBS += -losgText -losgProducer -lProducer -losgDB -losgText -losgUtil -losg
|
|||||||
|
|
||||||
EXEC = osgspheresegment
|
EXEC = osgspheresegment
|
||||||
|
|
||||||
INC += $(PRODUCER_INCLUDE_DIR) -I/usr/X11R6/include
|
INC += $(X_INC)
|
||||||
LDFLAGS += $(PRODUCER_LIB_DIR)
|
|
||||||
|
|
||||||
include $(TOPDIR)/Make/makerules
|
include $(TOPDIR)/Make/makerules
|
||||||
|
@ -8,7 +8,6 @@ LIBS += -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS
|
|||||||
|
|
||||||
EXEC = osgviewer
|
EXEC = osgviewer
|
||||||
|
|
||||||
INC += $(PRODUCER_INCLUDE_DIR) $(X_INC)
|
INC += $(X_INC)
|
||||||
LDFLAGS += $(PRODUCER_LIB_DIR)
|
|
||||||
|
|
||||||
include $(TOPDIR)/Make/makerules
|
include $(TOPDIR)/Make/makerules
|
||||||
|
@ -18,30 +18,30 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef __int64 Timer_t;
|
typedef __int64 Timer_t;
|
||||||
}
|
}
|
||||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)|| defined(__MINGW32__)
|
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)|| defined(__MINGW32__)
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef unsigned long long Timer_t;
|
typedef unsigned long long Timer_t;
|
||||||
}
|
}
|
||||||
#elif defined(__sgi)
|
#elif defined(__sgi)
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef unsigned long long Timer_t;
|
typedef unsigned long long Timer_t;
|
||||||
}
|
}
|
||||||
#elif defined(unix)
|
#elif defined(unix)
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef unsigned long long Timer_t;
|
typedef unsigned long long Timer_t;
|
||||||
}
|
}
|
||||||
#elif defined __APPLE__ || defined macintosh
|
#elif defined __APPLE__ || defined macintosh
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef double Timer_t;
|
typedef double Timer_t;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
namespace osg {
|
namespace osg {
|
||||||
typedef std::clock_t Timer_t;
|
typedef std::clock_t Timer_t;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
@ -57,14 +57,14 @@ class SG_EXPORT Timer {
|
|||||||
static const Timer* instance();
|
static const Timer* instance();
|
||||||
|
|
||||||
|
|
||||||
#if defined __DARWIN_OSX__ || defined macintosh
|
#if defined __DARWIN_OSX__ || defined macintosh
|
||||||
// PJA MAC OSX - inline Tick() pollutes namespace so badly
|
// PJA MAC OSX - inline Tick() pollutes namespace so badly
|
||||||
// we cant compile, due to Carbon.h ...
|
// we cant compile, due to Carbon.h ...
|
||||||
Timer_t tick() const;
|
Timer_t tick() const;
|
||||||
#else
|
#else
|
||||||
inline Timer_t tick() const;
|
inline Timer_t tick() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline double delta_s( Timer_t t1, Timer_t t2 ) const { return (double)(t2 - t1)*_secsPerTick; }
|
inline double delta_s( Timer_t t1, Timer_t t2 ) const { return (double)(t2 - t1)*_secsPerTick; }
|
||||||
inline double delta_m( Timer_t t1, Timer_t t2 ) const { return delta_s(t1,t2)*1e3; }
|
inline double delta_m( Timer_t t1, Timer_t t2 ) const { return delta_s(t1,t2)*1e3; }
|
||||||
inline double delta_u( Timer_t t1, Timer_t t2 ) const { return delta_s(t1,t2)*1e6; }
|
inline double delta_u( Timer_t t1, Timer_t t2 ) const { return delta_s(t1,t2)*1e6; }
|
||||||
@ -81,7 +81,7 @@ class SG_EXPORT Timer {
|
|||||||
unsigned long* _clockAddress_32;
|
unsigned long* _clockAddress_32;
|
||||||
unsigned long long* _clockAddress_64;
|
unsigned long long* _clockAddress_64;
|
||||||
int _cycleCntrSize;
|
int _cycleCntrSize;
|
||||||
// for SGI machines with 32 bit clocks.
|
// for SGI machines with 32 bit clocks.
|
||||||
mutable unsigned long _lastClockValue;
|
mutable unsigned long _lastClockValue;
|
||||||
mutable unsigned long long _rollOver;
|
mutable unsigned long long _rollOver;
|
||||||
# endif
|
# endif
|
||||||
@ -129,15 +129,15 @@ class SG_EXPORT Timer {
|
|||||||
#define CLK(x) __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x))
|
#define CLK(x) __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x))
|
||||||
namespace osg{
|
namespace osg{
|
||||||
|
|
||||||
inline Timer_t Timer::tick() const
|
inline Timer_t Timer::tick() const
|
||||||
{
|
{
|
||||||
if (_useStandardClock)
|
if (_useStandardClock)
|
||||||
return clock();
|
return clock();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Timer_t x;CLK(x);return x;
|
Timer_t x;CLK(x);return x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ class SG_EXPORT Timer {
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#ifdef __ia64
|
#ifdef __ia64
|
||||||
#define CLK(x) ((x)=0)
|
#define CLK(x) ((x)=0)
|
||||||
#else
|
#else
|
||||||
#define CLK(x) __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x))
|
#define CLK(x) __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x))
|
||||||
#endif
|
#endif
|
||||||
@ -189,14 +189,18 @@ class SG_EXPORT Timer {
|
|||||||
if ( _clockAddress_64 )
|
if ( _clockAddress_64 )
|
||||||
return *_clockAddress_64;
|
return *_clockAddress_64;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned long clockValue = *_clockAddress_32;
|
unsigned long clockValue = *_clockAddress_32;
|
||||||
if( _lastClockValue > clockValue )
|
if( _lastClockValue > clockValue )
|
||||||
{
|
{
|
||||||
_rollOver += 0x100000000L;
|
# ifdef __GNUC__
|
||||||
}
|
_rollOver += 0x100000000LL;
|
||||||
_lastClockValue = clockValue;
|
#else
|
||||||
return _rollOver + clockValue;
|
_rollOver += 0x100000000L;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
_lastClockValue = clockValue;
|
||||||
|
return _rollOver + clockValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#ifndef OSGFX_VALIDATOR_
|
#ifndef OSGFX_VALIDATOR_
|
||||||
#define OSGFX_VALIDATOR_
|
#define OSGFX_VALIDATOR_
|
||||||
|
|
||||||
#include <osgFX/Export>
|
#include <osgFX/Effect>
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
#include <osg/StateAttribute>
|
#include <osg/StateAttribute>
|
||||||
@ -25,9 +25,6 @@
|
|||||||
namespace osgFX
|
namespace osgFX
|
||||||
{
|
{
|
||||||
|
|
||||||
// forward declaration
|
|
||||||
class Effect;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class is used internally by osgFX::Effect to choose between different
|
This class is used internally by osgFX::Effect to choose between different
|
||||||
techniques dynamically. The apply() method will call each technique's
|
techniques dynamically. The apply() method will call each technique's
|
||||||
|
@ -88,7 +88,7 @@ const Timer* Timer::instance()
|
|||||||
if (sysctlbyname("machdep.tsc_freq", &cpuspeed, &len, NULL, NULL) == -1)
|
if (sysctlbyname("machdep.tsc_freq", &cpuspeed, &len, NULL, NULL) == -1)
|
||||||
{
|
{
|
||||||
_useStandardClock = true;
|
_useStandardClock = true;
|
||||||
perror("sysctlbyname(machdep.tsc_freq)");
|
perror("sysctlbyname(machdep.tsc_freq)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ const Timer* Timer::instance()
|
|||||||
Timer::Timer()
|
Timer::Timer()
|
||||||
{
|
{
|
||||||
#ifdef __ia64
|
#ifdef __ia64
|
||||||
_useStandardClock = true;
|
_useStandardClock = true;
|
||||||
#else
|
#else
|
||||||
_useStandardClock = false;
|
_useStandardClock = false;
|
||||||
#endif
|
#endif
|
||||||
@ -125,17 +125,17 @@ const Timer* Timer::instance()
|
|||||||
while( fgets( buff, sizeof( buff ), fp ) > 0 )
|
while( fgets( buff, sizeof( buff ), fp ) > 0 )
|
||||||
{
|
{
|
||||||
if( !strncmp( buff, "cpu MHz", strlen( "cpu MHz" )))
|
if( !strncmp( buff, "cpu MHz", strlen( "cpu MHz" )))
|
||||||
{
|
{
|
||||||
char *ptr = buff;
|
char *ptr = buff;
|
||||||
|
|
||||||
while( ptr && *ptr != ':' ) ptr++;
|
while( ptr && *ptr != ':' ) ptr++;
|
||||||
if( ptr )
|
if( ptr )
|
||||||
{
|
{
|
||||||
ptr++;
|
ptr++;
|
||||||
sscanf( ptr, "%lf", &cpu_mhz );
|
sscanf( ptr, "%lf", &cpu_mhz );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose( fp );
|
fclose( fp );
|
||||||
|
|
||||||
@ -160,7 +160,6 @@ const Timer* Timer::instance()
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/syssgi.h>
|
#include <sys/syssgi.h>
|
||||||
#include <sys/immu.h>
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
Timer::Timer( void )
|
Timer::Timer( void )
|
||||||
@ -232,26 +231,26 @@ const Timer* Timer::instance()
|
|||||||
#elif defined (__DARWIN_OSX__) || defined (macintosh)
|
#elif defined (__DARWIN_OSX__) || defined (macintosh)
|
||||||
|
|
||||||
#if defined (__DARWIN_OSX__)
|
#if defined (__DARWIN_OSX__)
|
||||||
#include <Carbon/Carbon.h> // do I really have to link against the Carbon framework just for this?
|
#include <Carbon/Carbon.h> // do I really have to link against the Carbon framework just for this?
|
||||||
#else
|
#else
|
||||||
#include <MacTypes.h>
|
#include <MacTypes.h>
|
||||||
#include <Timer.h>
|
#include <Timer.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Timer::Timer( void )
|
Timer::Timer( void )
|
||||||
{
|
{
|
||||||
_useStandardClock = false;
|
_useStandardClock = false;
|
||||||
_secsPerTick = 1e-6; // Carbon timer's precision.
|
_secsPerTick = 1e-6; // Carbon timer's precision.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer_t Timer::tick(void) const
|
Timer_t Timer::tick(void) const
|
||||||
{
|
{
|
||||||
UnsignedWide usecs;
|
UnsignedWide usecs;
|
||||||
Microseconds(&usecs);
|
Microseconds(&usecs);
|
||||||
|
|
||||||
return (usecs.hi * 4294967296.0) + usecs.lo;
|
return (usecs.hi * 4294967296.0) + usecs.lo;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(unix)
|
#elif defined(unix)
|
||||||
|
Loading…
Reference in New Issue
Block a user