From Norman Vine (with small tweaks by Robert Osfield), build fixes for Cygwin

This commit is contained in:
Robert Osfield 2004-08-04 08:27:43 +00:00
parent 041b664660
commit 7eb3f2646e
33 changed files with 137 additions and 111 deletions

View File

@ -1,7 +1,7 @@
################################################################
# Dependency library which have been installed on this system
GDAL_INSTALLED = no
GDAL_INSTALLED = yes
JASPER_INSTALLED = no
FREETYPE_INSTALLED = yes

View File

@ -197,17 +197,24 @@ ifeq ($(OS),SunOS)
PNG_LIBS = /usr/local/lib/libpng.a /usr/local/lib/libz.a
FREETYPE_LIB = /usr/local/lib/libfreetype.a
endif
DYNAMICLIBRARYLIB = -ldl
OSG_LIBS = -losgGA -losgDB -losgUtil -losg
GL_LIBS = -lGLU -lGL
X_INC = -I/usr/X11R6/include
X_LIBS = -lXext -lXmu -lXi -lX11
SOCKET_LIBS = -lsocket -lnsl
INSTBINCMD = cp
INSTDEVCMD = cp
INST_LOCATION = /opt/OpenSceneGraph
MAKEDIST = $(TOPDIR)/Make/makepkg
OTHER_LIBS = -lOpenThreads
DYNAMICLIBRARYLIB = -ldl
OSG_LIBS = -losgGA -losgDB -losgUtil -losg
GL_LIBS = -lGLU -lGL
X_INC = -I/usr/X11R6/include
X_LIBS = -lXext -lXmu -lXi -lX11
SOCKET_LIBS = -lsocket -lnsl
INSTBINCMD = cp
INSTDEVCMD = cp
INST_LOCATION = /opt/OpenSceneGraph
MAKEDIST = $(TOPDIR)/Make/makepkg
OTHER_LIBS = -lOpenThreads
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
#### IRIX Specific definitions
@ -290,6 +297,11 @@ ifeq ($(OS),IRIX)
GIF_LIBS = -lungif
MAKEDIST = $(TOPDIR)/Make/makeirixdist
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
#### Linux specific definitions
@ -368,6 +380,10 @@ ifeq ($(OS),Linux)
OTHER_LIBS += -lfnccheck
endif
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
#### FreeBSD specific definitions
@ -395,6 +411,11 @@ ifeq ($(OS),FreeBSD)
JPEG_LIBS = -ljpeg
TIFF_LIB = -ltiff
GIF_LIBS = -lungif
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
#### MacOS X specific definitions
@ -441,6 +462,10 @@ ifeq ($(OS),Darwin)
GIF_LIBS = -lungif
TIFF_LIBS = -ltiff -lz -ljpeg
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
#### Cygwin specific definitions
@ -451,9 +476,9 @@ ifeq ($(OS),CYGWIN)
DEF += -DWIN32 -W -Wall -DNOMINMAX
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared\
-Wl,--out-implib,$(TOPDIR)/lib/$(OS)/lib$(TARGET_BASENAME).dll.a
-Wl,--export-all-symbols
SHARED = -shared \
-Wl,--out-implib,$(TOPDIR)/lib/$(OS)/lib$(TARGET_BASENAME).dll.a \
-Wl,--export-all-symbols
EXE_EXT =.exe
ARCH =
@ -471,7 +496,11 @@ ifeq ($(OS),CYGWIN)
JPEG_LIBS = -ljpeg
GIF_LIBS = -lungif
TIFF_LIB = -ltiff -lz -ljpeg
FREETYPE_LIB = -lfreetype
FREETYPE_LIB = `freetype-config --libs`
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
LIBINST = bin
PLUGININST = bin/$(OS)$(ARCH)
@ -495,12 +524,13 @@ endif
#### Mingw specific definitions
ifeq ($(OS),MINGW)
C++ = c++ -mthreads
C++ = c++ -mthreads
# -fomit-frame-pointer -march=pentium3 -msse -mmmx -mfpmath=sse
DEPARG = -M
INC +=
DEF += -DWIN32 -Wall
# -W
OPTF = -O2
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared -mthreads \
-Wl,--out-implib,$(TOPDIR)/lib/$(OS)/lib$(TARGET_BASENAME).dll.a \
@ -523,6 +553,7 @@ ifeq ($(OS),MINGW)
GIF_LIBS = -lungif
TIFF_LIB = -ltiff -lz -ljpeg
FREETYPE_LIB = -lfreetype
GDAL_LIB = -lgdal -ljpeg -lgeotiff -ltiff -lpng -lz
LIBXML2_INCLUDE = -I/usr/mingw/include/libxml2
@ -592,6 +623,10 @@ endif
GIF_INCLUDE = -I/opt/libungif/include
GIF_LIBS = -L/opt/libungif/lib -lungif
GDAL_INCLUDES = -I`gdal-config --prefix`/include
GDAL_LIBS = `gdal-config --dep-libs`
GDAL_LIBS += `gdal-config --libs`
endif
VPATH=..

View File

@ -11,6 +11,8 @@ OSG News (most significant items from ChangeLog)
DatabasePager
Double Vec & Matrix classes
osgUtil - tristipper, simplifier, GLObjectVisitor.
Examples - osgdem, osgphotoalbum, osgbluemarble, osgtesselate, osgsimulation

View File

@ -2,7 +2,7 @@
#include <fcntl.h>
#include <sys/types.h>
#if !defined (WIN32)
#if !defined (WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@ -26,7 +26,7 @@
#include <unistd.h>
#include <net/soioctl.h>
#elif defined(__CYGWIN__)
// nothing needed
#include <unistd.h>
#elif defined(__sun)
#include <unistd.h>
#include <sys/sockio.h>
@ -56,7 +56,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void )
{
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@ -65,7 +65,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void )
{
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@ -83,13 +83,13 @@ bool Broadcaster::init( void )
perror( "Socket" );
return false;
}
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE;
#else
int on = 1;
#endif
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
@ -99,16 +99,16 @@ bool Broadcaster::init( void )
saddr.sin_port = htons( _port );
if( _address == 0 )
{
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif
#if !defined (WIN32)
#if !defined (WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
#endif
#if defined (__linux)
#if defined (__linux) || defined(__CYGWIN__)
strcpy( ifr.ifr_name, "eth0" );
#elif defined(__sun)
strcpy( ifr.ifr_name, "hme0" );
@ -174,7 +174,7 @@ void Broadcaster::sync( void )
return;
}
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
int err = WSAGetLastError ();

View File

@ -7,7 +7,7 @@
// Class definition for broadcasting a buffer to a LAN
//
#ifndef WIN32
#if !defined(WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#endif
@ -36,7 +36,7 @@ class Broadcaster
bool init( void );
private :
#if defined (WIN32)
#if defined(WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
@ -45,7 +45,7 @@ class Broadcaster
short _port;
void *_buffer;
unsigned int _buffer_size;
#if defined (WIN32)
#if defined(WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr;
#else
struct sockaddr_in saddr;

View File

@ -12,7 +12,7 @@
#include <osg/Quat>
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#endif

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@ -26,7 +26,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void )
{
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@ -35,7 +35,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void )
{
#ifdef WIN32
#if defined(WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@ -53,7 +53,7 @@ bool Receiver::init( void )
perror( "Socket" );
return false;
}
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else
@ -64,7 +64,7 @@ bool Receiver::init( void )
// struct sockaddr_in saddr;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else
saddr.sin_addr.s_addr = 0;
@ -117,7 +117,7 @@ void Receiver::sync( void )
tv.tv_sec = 0;
tv.tv_usec = 0;
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port );
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)

View File

@ -8,7 +8,7 @@
// Class definition for the recipient of a broadcasted message
//
#ifndef WIN32
#if !defined(WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#endif
@ -33,14 +33,11 @@ class Receiver
bool init( void );
private :
#if defined (WIN32)
#if defined (WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
#endif
#if defined (WIN32)
SOCKADDR_IN saddr;
#else
int _so;
struct sockaddr_in saddr;
#endif
bool _initialized;

View File

@ -4,15 +4,13 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgdem.cpp\
ifneq ("$(GDAL_INCLUDES)","")
INC += $(GDAL_INCLUDES)
endif
ifneq ("$(GDAL_LIB_DIR)","")
LDFLAGS += -L$(GDAL_LIB_DIR)
endif
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgText -losgGA -losgDB -losgUtil -losg -lgdal $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
ifeq ($(OS),MINGW)
LIBS += -ljpeg -lpng -lgeotiff -ltiff -lz -L/usr/mingw/lib/malloc.o
endif
INSTFILES = \
$(CXXFILES)\

View File

@ -14,15 +14,15 @@
#ifndef OSG_ANIMATIONPATH
#define OSG_ANIMATIONPATH 1
#include <map>
#include <istream>
#include <float.h>
#include <osg/Matrixf>
#include <osg/Matrixd>
#include <osg/Quat>
#include <osg/NodeCallback>
#include <map>
#include <istream>
#include <float.h>
namespace osg {
/** AnimationPath for specify the time varying transformation pathway to use when update camera and model objects.

View File

@ -14,14 +14,15 @@
#ifndef OSG_ARRAY
#define OSG_ARRAY 1
#include <osg/Object>
#include <osg/GL>
#include <vector>
#include <osg/Vec2>
#include <osg/Vec3>
#include <osg/Vec4>
#include <osg/UByte4>
#include <vector>
#include <osg/Object>
#include <osg/GL>
namespace osg {

View File

@ -14,9 +14,9 @@
#ifndef OSG_AUTOTRANSFORM
#define OSG_AUTOTRANSFORM 1
#include <osg/AnimationPath>
#include <osg/Group>
#include <osg/Transform>
#include <osg/AnimationPath>
#include <osg/Quat>
namespace osg {

View File

@ -147,7 +147,7 @@ inline void EllipsoidModel::convertLatLongHeightToXYZ(double latitude, double lo
double N = _radiusEquator / sqrt( 1.0 - _eccentricitySquared*sin_latitude*sin_latitude);
X = (N+height)*cos_latitude*cos(longitude);
Y = (N+height)*cos_latitude*sin(longitude);
Z = (N*(1-_eccentricitySquared)+height)*sin(latitude);
Z = (N*(1-_eccentricitySquared)+height)*sin_latitude;
}

View File

@ -16,8 +16,6 @@
#include <osg/Vec2f>
#include <ostream>
namespace osg {
/** General purpose double pair, uses include representation of

View File

@ -14,10 +14,10 @@
#ifndef OSG_VEC2F
#define OSG_VEC2F 1
#include <osg/Math>
#include <ostream>
#include <osg/Math>
namespace osg {
/** General purpose float pair, uses include representation of

View File

@ -16,8 +16,6 @@
#include <osg/Vec3f>
#include <ostream>
namespace osg {
/** General purpose double triple for use as vertices, vectors and normals.

View File

@ -14,10 +14,10 @@
#ifndef OSG_VEC3F
#define OSG_VEC3F 1
#include <osg/Math>
#include <ostream>
#include <osg/Math>
namespace osg {
/** General purpose float triple for use as vertices, vectors and normals.

View File

@ -16,8 +16,6 @@
#include <osg/Vec3f>
#include <ostream>
namespace osg {
/** General purpose float quad, uses include representation

View File

@ -14,6 +14,8 @@
#ifndef OSGDB_READFILE
#define OSGDB_READFILE 1
#include <string>
#include <osg/Node>
#include <osg/Image>
#include <osg/ArgumentParser>
@ -21,8 +23,6 @@
#include <osgDB/Export>
#include <osgDB/Registry>
#include <string>
namespace osgDB {

View File

@ -14,6 +14,8 @@
#ifndef OSGTEXT_FONT
#define OSGTEXT_FONT 1
#include <string>
#include <osg/Vec2>
#include <osg/Image>
#include <osg/Texture2D>
@ -23,8 +25,6 @@
#include <osgText/Export>
#include <string>
namespace osgText {
class Font;

View File

@ -14,13 +14,13 @@
#ifndef OSGTEXT_STRING
#define OSGTEXT_STRING 1
#include <osg/Referenced>
#include <osgText/Export>
#include <vector>
#include <set>
#include <string>
#include <osg/Referenced>
#include <osgText/Export>
namespace osgText {
class Text;

View File

@ -14,6 +14,9 @@
#ifndef OSGUTIL_CULLVISITOR
#define OSGUTIL_CULLVISITOR 1
#include <map>
#include <vector>
#include <osg/NodeVisitor>
#include <osg/BoundingSphere>
#include <osg/BoundingBox>
@ -24,16 +27,12 @@
#include <osg/Impostor>
#include <osg/ClearNode>
#include <osg/Notify>
#include <osg/Notify>
#include <osg/CullStack>
#include <osgUtil/RenderGraph>
#include <osgUtil/RenderStage>
#include <map>
#include <vector>
#include <osg/Vec3>
namespace osgUtil {

View File

@ -30,11 +30,9 @@ class OSGUTIL_EXPORT SmoothingVisitor : public osg::NodeVisitor
public:
/// default to traversing all children.
SmoothingVisitor()
{
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
}
SmoothingVisitor();
virtual ~SmoothingVisitor();
/// smooth geoset by creating per vertex normals.
static void smooth(osg::Geometry& geoset);

View File

@ -24,12 +24,12 @@
#ifndef _DIRECTX_H_
#define _DIRECTX_H_
#include <osg/Math>
#include <string>
#include <vector>
#include <fstream>
#include <osg/Math>
namespace DX {
/*

View File

@ -4,15 +4,10 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
ReaderWriterGDAL.cpp\
ifneq ("$(GDAL_INCLUDES)","")
INC += $(GDAL_INCLUDES)
endif
ifneq ("$(GDAL_LIB_DIR)","")
LDFLAGS += -L$(GDAL_LIB_DIR)
endif
LIBS += $(OSG_LIBS) -lgdal $(OTHER_LIBS)
LIBS += $(OSG_LIBS) $(GDAL_LIBS) $(OTHER_LIBS)
TARGET_BASENAME = gdal

View File

@ -8,13 +8,13 @@
/* includes */
#include "glm.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <osg/Math>
#include <stdlib.h>
#include "glm.h"
#include <osg/Math>

View File

@ -37,10 +37,12 @@
#include <windows.h>
#ifdef __MSC_VER
// Microsoft Developer warnings that annoy me
#pragma warning ( disable : 4251)
#pragma warning ( disable : 4275)
#pragma warning ( disable : 4786)
#endif
// Somewhat system independent file deletion macro
#define TRPGDELETEFILE(file) DeleteFile((file))

View File

@ -1,8 +1,8 @@
#include <osgProducer/KeyboardMouseCallback>
#include <osg/Math>
#include <osg/Notify>
#include <osgProducer/KeyboardMouseCallback>
#include <float.h>
using namespace osgProducer;

View File

@ -8,17 +8,11 @@ CXXFILES = \
HeightFieldRenderer.cpp\
Version.cpp\
ifneq ("$(GDAL_INCLUDES)","")
INC += $(GDAL_INCLUDES)
endif
ifneq ("$(GDAL_LIB_DIR)","")
LDFLAGS += -L$(GDAL_LIB_DIR)
endif
DEF += -DOSGTERRAIN_LIBRARY
LIBS += -losgDB -losgUtil -losg -lgdal $(GL_LIBS) $(OTHER_LIBS)
INC += $(GDAL_INCLUDES)
LIBS += -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(OTHER_LIBS)
TARGET_BASENAME = osgTerrain
LIB = $(LIB_PREFIX)$(TARGET_BASENAME).$(LIB_EXT)

View File

@ -14,12 +14,12 @@
#ifndef NEWTEXT_DEFAULTFONT_H
#define NEWTEXT_DEFAULTFONT_H 1
#include <map>
#include <osg/ref_ptr>
#include <osgText/Font>
#include <map>
namespace osgText {
class DefaultFont : public Font

View File

@ -1,7 +1,7 @@
#include <osgText/String>
#include <osg/Math>
#include <osg/Notify>
#include <osg/Math>
using namespace osgText;

View File

@ -12,11 +12,13 @@
*/
#include <osg/GL>
#include <vector>
#include <osgText/Text>
#include <osg/Math>
#include <osg/GL>
#include <osgUtil/CullVisitor>
#include <osgDB/ReadFile>
#include <osgText/Text>
#include "DefaultFont.h"

View File

@ -86,6 +86,15 @@ struct SmoothTriangleFunctor
}
};
SmoothingVisitor::SmoothingVisitor()
{
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
}
SmoothingVisitor::~SmoothingVisitor()
{
}
void SmoothingVisitor::smooth(osg::Geometry& geom)
{
Geometry::PrimitiveSetList& primitives = geom.getPrimitiveSetList();