From 553d017fd9f51c4f02906e2810e8206b749c67f0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 2 Aug 2006 10:43:26 +0000 Subject: [PATCH] From Daniel Trstenjak, build fixes for Hpux 11.11, Irix 6.5, Solaris 8 and Aix --- Make/makedefs | 48 +++++++++++++++++++ include/osg/GLU | 2 +- include/osg/Math | 8 ++++ include/osg/NodeTrackerCallback | 8 +++- include/osg/Texture | 5 +- include/osgDB/ReaderWriter | 1 + include/osgGA/NodeTrackerManipulator | 8 +++- src/osgPlugins/OpenFlight/ControlRecords.cpp | 2 +- src/osgPlugins/OpenFlight/GeometryRecords.cpp | 2 +- src/osgPlugins/OpenFlight/PaletteRecords.cpp | 2 +- src/osgPlugins/OpenFlight/Pools.cpp | 2 +- src/osgPlugins/OpenFlight/Record.cpp | 4 ++ src/osgPlugins/OpenFlight/Record.h | 2 +- src/osgPlugins/bsp/BSPLoad.cpp | 4 -- src/osgPlugins/bsp/BSPLoad.h | 1 + src/osgPlugins/lwo/ReaderWriterLWO.cpp | 3 +- src/osgPlugins/net/sockstream.cpp | 6 +-- 17 files changed, 90 insertions(+), 18 deletions(-) diff --git a/Make/makedefs b/Make/makedefs index 04806b50b..731341431 100644 --- a/Make/makedefs +++ b/Make/makedefs @@ -233,6 +233,8 @@ endif #### IRIX Specific definitions ifeq ($(OS),IRIX) + INSTBINCMD = cp + INSTDEVCMD = cp CXX = CC ifeq ($(CXX),CC) LINKARGS = -L${TOPDIR}/$(LIBINST) -LANG:std -OPT:Olimit=0 @@ -725,6 +727,52 @@ ifeq ($(OS),HP-UX) GDAL_INCLUDES = `gdal-config --cflags` GDAL_LIBS = `gdal-config --libs` + INSTXCMD = install -c -m 755 + INSTRCMD = install -c -m 644 + + INSTBINCMD = install -c -m 755 + INSTDEVCMD = install -c -m 644 +endif + + +ifeq ($(OS),AIX) + CXX = g++ + C++ = $(CXX) + DEPARG = -M + INC += + DEF += + OPTF = -O + DBGF = -g + SHARED = + ARCH = 32 + LDFLAGS += + LINKARGS = -lpthread + LIB_EXT = sl + PLUGIN_EXT = sl + DYNAMICLIBRARYLIB = -ldld + + + OSG_LIBS = -losgGA -losgDB -losgUtil -losg + GL_LIBS = -lGLU -lGL + X_INC = + X_LIBS = -lXext -lXi -lX11 + SOCKET_LIBS = + OTHER_LIBS = -lm -lOpenThreads + PNG_INCLUDE = -I/usr/local/include/libpng -I/usr/local/include/ + PNG_LIBS = -L/usr/local/lib -lpng -lz + JPEG_INCLUDE = -I/usr/local/include + JPEG_LIBS = -L/usr/local/lib -ljpeg + TIFF_INCLUDE = -I/usr/local/include + TIFF_LIB = -L/usr/local/lib -ltiff + GIF_INCLUDE = -I/opt/libungif/include + GIF_LIBS = -L/opt/libungif/lib -lungif + + FREETYPE_INCLUDE = `freetype-config --cflags` + FREETYPE_LIB = `freetype-config --libs` + + GDAL_INCLUDES = `gdal-config --cflags` + GDAL_LIBS = `gdal-config --libs` + endif diff --git a/include/osg/GLU b/include/osg/GLU index 1c2d84754..0d0ad8354 100644 --- a/include/osg/GLU +++ b/include/osg/GLU @@ -14,7 +14,7 @@ #ifndef OSG_GLU #define OSG_GLU 1 -#ifdef __APPLE__ +#if defined(__APPLE__) || defined (_AIX) #include #define GLU_TESS_CALLBACK GLvoid (CALLBACK*)(...) #else diff --git a/include/osg/Math b/include/osg/Math index e16e351ab..00de39387 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -84,6 +84,10 @@ inline float atan2f(float value1, float value2) { return static_cast(atan2(value1,value2)); } #endif + #ifndef tanf + inline float tanf(float value) { return static_cast(tan(value)); } + #endif + #endif @@ -95,6 +99,10 @@ inline float floorf(float value) { return static_cast(floor(value)); } #endif + #ifndef ceilf + inline float ceilf(float value) { return static_cast(ceil(value)); } + #endif + #endif namespace osg { diff --git a/include/osg/NodeTrackerCallback b/include/osg/NodeTrackerCallback index f5d60a3be..04b2b8c47 100644 --- a/include/osg/NodeTrackerCallback +++ b/include/osg/NodeTrackerCallback @@ -28,7 +28,13 @@ class OSG_EXPORT NodeTrackerCallback : public NodeCallback typedef std::vector< observer_ptr > ObserveredNodePath; - void setTrackNodePath(const osg::NodePath& nodePath) { _trackNodePath.clear(); _trackNodePath.insert(_trackNodePath.begin(), nodePath.begin(),nodePath.end()); } + void setTrackNodePath(const osg::NodePath& nodePath) + { + _trackNodePath.clear(); + _trackNodePath.reserve(nodePath.size()); + std::copy(nodePath.begin(), nodePath.end(), std::back_inserter(_trackNodePath)); + } + void setTrackNodePath(const ObserveredNodePath& nodePath) { _trackNodePath = nodePath; } ObserveredNodePath& getTrackNodePath() { return _trackNodePath; } diff --git a/include/osg/Texture b/include/osg/Texture index fca483562..99a345f47 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -160,8 +160,11 @@ #define GL_TEXTURE_BINDING_3D 0x806A #endif -#ifndef GL_TEXTURE_COMPARE_MODE_ARB +#ifndef GL_DEPTH_TEXTURE_MODE_ARB #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_TEXTURE_COMPARE_MODE_ARB #define GL_TEXTURE_COMPARE_MODE_ARB 0x884C #define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D #define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E diff --git a/include/osgDB/ReaderWriter b/include/osgDB/ReaderWriter index a44ea0756..b3163661e 100644 --- a/include/osgDB/ReaderWriter +++ b/include/osgDB/ReaderWriter @@ -22,6 +22,7 @@ #include #include +#include namespace osgDB { diff --git a/include/osgGA/NodeTrackerManipulator b/include/osgGA/NodeTrackerManipulator index ebe059b19..5b27186e3 100644 --- a/include/osgGA/NodeTrackerManipulator +++ b/include/osgGA/NodeTrackerManipulator @@ -31,7 +31,13 @@ class OSGGA_EXPORT NodeTrackerManipulator : public MatrixManipulator typedef std::vector< osg::observer_ptr > ObserveredNodePath; - void setTrackNodePath(const osg::NodePath& nodePath) { _trackNodePath.clear(); _trackNodePath.insert(_trackNodePath.begin(), nodePath.begin(),nodePath.end()); } + void setTrackNodePath(const osg::NodePath& nodePath) + { + _trackNodePath.clear(); + _trackNodePath.reserve(nodePath.size()); + std::copy(nodePath.begin(), nodePath.end(), std::back_inserter(_trackNodePath)); + } + void setTrackNodePath(const ObserveredNodePath& nodePath) { _trackNodePath = nodePath; } ObserveredNodePath& getTrackNodePath() { return _trackNodePath; } diff --git a/src/osgPlugins/OpenFlight/ControlRecords.cpp b/src/osgPlugins/OpenFlight/ControlRecords.cpp index c89a9033c..eb4a34a37 100644 --- a/src/osgPlugins/OpenFlight/ControlRecords.cpp +++ b/src/osgPlugins/OpenFlight/ControlRecords.cpp @@ -4,7 +4,7 @@ // Copyright (C) 2005-2006 Brede Johansen // -#include +#include #include #include #include "Registry.h" diff --git a/src/osgPlugins/OpenFlight/GeometryRecords.cpp b/src/osgPlugins/OpenFlight/GeometryRecords.cpp index ed68b4d64..9fca524fb 100644 --- a/src/osgPlugins/OpenFlight/GeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/GeometryRecords.cpp @@ -4,7 +4,7 @@ // Copyright (C) 2005-2006 Brede Johansen // -#include +#include #include #include #include diff --git a/src/osgPlugins/OpenFlight/PaletteRecords.cpp b/src/osgPlugins/OpenFlight/PaletteRecords.cpp index 434c1f0d0..773f5b38a 100644 --- a/src/osgPlugins/OpenFlight/PaletteRecords.cpp +++ b/src/osgPlugins/OpenFlight/PaletteRecords.cpp @@ -4,7 +4,7 @@ // Copyright (C) 2005-2006 Brede Johansen // -#include +#include #include #include #include diff --git a/src/osgPlugins/OpenFlight/Pools.cpp b/src/osgPlugins/OpenFlight/Pools.cpp index 8e2c03e0b..b7d348b24 100644 --- a/src/osgPlugins/OpenFlight/Pools.cpp +++ b/src/osgPlugins/OpenFlight/Pools.cpp @@ -4,7 +4,7 @@ // Copyright (C) 2005-2006 Brede Johansen // -#include +#include #include "Pools.h" #include "Document.h" diff --git a/src/osgPlugins/OpenFlight/Record.cpp b/src/osgPlugins/OpenFlight/Record.cpp index 9bb702c00..3a9852a33 100644 --- a/src/osgPlugins/OpenFlight/Record.cpp +++ b/src/osgPlugins/OpenFlight/Record.cpp @@ -17,6 +17,10 @@ Record::Record() { } +Record::~Record() +{ +} + void Record::setParent(PrimaryRecord* parent) { _parent = parent; diff --git a/src/osgPlugins/OpenFlight/Record.h b/src/osgPlugins/OpenFlight/Record.h index ce1152650..a798cf643 100644 --- a/src/osgPlugins/OpenFlight/Record.h +++ b/src/osgPlugins/OpenFlight/Record.h @@ -49,7 +49,7 @@ public: protected: - virtual ~Record() {} + virtual ~Record(); virtual void readRecord(RecordInputStream& in, Document& document); diff --git a/src/osgPlugins/bsp/BSPLoad.cpp b/src/osgPlugins/bsp/BSPLoad.cpp index fe90a7da9..368dcc7bf 100644 --- a/src/osgPlugins/bsp/BSPLoad.cpp +++ b/src/osgPlugins/bsp/BSPLoad.cpp @@ -5,10 +5,6 @@ #include "BSPLoad.h" -#include - - - bool BSPLoad::Load(const std::string& filename, int curveTesselation) diff --git a/src/osgPlugins/bsp/BSPLoad.h b/src/osgPlugins/bsp/BSPLoad.h index ff39a803d..ea4a20602 100644 --- a/src/osgPlugins/bsp/BSPLoad.h +++ b/src/osgPlugins/bsp/BSPLoad.h @@ -10,6 +10,7 @@ #include #include +#include //Directory entry in header class BSP_DIRECTORY_ENTRY diff --git a/src/osgPlugins/lwo/ReaderWriterLWO.cpp b/src/osgPlugins/lwo/ReaderWriterLWO.cpp index 8e9e540fc..2a49de195 100644 --- a/src/osgPlugins/lwo/ReaderWriterLWO.cpp +++ b/src/osgPlugins/lwo/ReaderWriterLWO.cpp @@ -37,6 +37,7 @@ #include #include "Converter.h" +#include "VertexMap.h" #include "old_lw.h" #include "old_Lwo2.h" @@ -104,7 +105,7 @@ lwosg::Converter::Options ReaderWriterLWO::parse_options(const Options *options) int unit; if (iss >> mapname >> unit) { - conv_options.texturemap_bindings.insert(std::make_pair(mapname, unit)); + conv_options.texturemap_bindings.insert(lwosg::VertexMap_binding_map::value_type(mapname, unit)); } } if (opt == "MAX_TEXTURE_UNITS") { diff --git a/src/osgPlugins/net/sockstream.cpp b/src/osgPlugins/net/sockstream.cpp index 250221bd0..0b4f782d1 100644 --- a/src/osgPlugins/net/sockstream.cpp +++ b/src/osgPlugins/net/sockstream.cpp @@ -64,7 +64,7 @@ #include #include -#if (defined(__APPLE__)&&(__GNUC__<4)) || (defined(WIN32)&&!defined(__CYGWIN__)) || defined (__sgi) || defined (__hpux) +#if (defined(__APPLE__)&&(__GNUC__<4)) || (defined(WIN32)&&!defined(__CYGWIN__)) || defined (__sgi) typedef int socklen_t; #endif @@ -246,9 +246,7 @@ bool sockerr::benign () const switch (err) { case EINTR: case EWOULDBLOCK: -// On FreeBSD (and probably on Linux too) -// EAGAIN has the same value as EWOULDBLOCK -#if !defined(__CYGWIN__) && !defined( __sgi) && !defined(__linux__) && !defined(__sun) && !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)) // LN +#if defined(EAGAIN) && (EAGAIN != EWOULDBLOCK) case EAGAIN: #endif return true;