mirror of https://git.wownero.com/dsc/mxe.git
improvements for package openscenegraph (by Martin Lambers)
* Add -DOSG_LIBRARY_STATIC to openscenegraph-osg.pc Cflags * Update the documentation * Update the openscenegraph-2-static.patch to a more general version that is now submitted to upstream * Add openscenegraph-4-png.patch from upstream SVN which fixes compilation with libpng-1.4. Remove openscenegraph-4-disable-png.patch and reenable the PNG plugin.
This commit is contained in:
parent
b652f30f1f
commit
e3ada8de49
|
@ -364,32 +364,29 @@ AR=$(CROSS)ar</pre>
|
|||
<h3>Step 5d: Cross compile your Project (OSG)</h3>
|
||||
|
||||
<p>
|
||||
Using static OpenSceneGraph libraries requires a few changes to your source:
|
||||
Using static OpenSceneGraph libraries requires a few changes to your source.
|
||||
The graphics subsystem and all plugins required by your application must be
|
||||
referenced explicitly. Use a code block like the following:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Define <code>OSG_LIBRARY_STATIC</code>
|
||||
</li>
|
||||
<li>
|
||||
Use the macro
|
||||
<code>USE_GRAPHICSWINDOW()</code>
|
||||
to explicitly reference your graphics system
|
||||
</li>
|
||||
<li>
|
||||
Use the macro
|
||||
<code>USE_OSGPLUGIN(<plugin>)</code>
|
||||
to explicitly reference any plugin you might want to use
|
||||
</li>
|
||||
</ul>
|
||||
<pre>#ifdef OSG_LIBRARY_STATIC
|
||||
USE_GRAPHICSWINDOW()
|
||||
USE_OSGPLUGIN(<plugin1>)
|
||||
USE_OSGPLUGIN(<plugin2>)
|
||||
...
|
||||
#endif</pre>
|
||||
<p>
|
||||
Look at <code>examples/osgstaticviewer/osgstaticviewer.cpp</code> in the
|
||||
OpenSceneGraph source distribution for an example. This example can be
|
||||
compiled with
|
||||
compiled with the following command:
|
||||
</p>
|
||||
<pre>i686-pc-mingw32-g++ -DOSG_LIBRARY_STATIC \
|
||||
<pre>i686-pc-mingw32-g++ \
|
||||
-o osgstaticviewer.exe examples/osgstaticviewer/osgstaticviewer.cpp \
|
||||
`i686-pc-mingw32-pkg-config --cflags openscenegraph-osgViewer openscenegraph-osgPlugins` \
|
||||
`i686-pc-mingw32-pkg-config --static --libs openscenegraph-osgViewer openscenegraph-osgPlugins`</pre>
|
||||
<p>
|
||||
The <code>i686-pc-mingw32-pkg-config</code> command from mingw-cross-env will
|
||||
automatically add <code>-DOSG_LIBRARY_STATIC</code> to your compiler flags.
|
||||
</p>
|
||||
|
||||
<h3>Further Steps</h3>
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ diff -uNr OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osg.pc.in
|
|||
+Conflicts:
|
||||
+Libs: -L${libdir} -losg
|
||||
+Libs.private: -lglu32 -lopengl32
|
||||
+Cflags: -I${includedir}
|
||||
+Cflags: -I${includedir} -DOSG_LIBRARY_STATIC
|
||||
diff -uNr OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osgPlugins.pc.in OpenSceneGraph-2.8.2/packaging/pkgconfig/openscenegraph-osgPlugins.pc.in
|
||||
--- OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osgPlugins.pc.in 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ OpenSceneGraph-2.8.2/packaging/pkgconfig/openscenegraph-osgPlugins.pc.in 2010-01-17 18:59:13.000000000 +0100
|
||||
|
@ -213,7 +213,7 @@ diff -uNr OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osgPlugin
|
|||
+Requires: openscenegraph-osgParticle openscenegraph-osgWidget openscenegraph-osgVolume openscenegraph-osgShadow openscenegraph-osgTerrain openscenegraph-osgFX openscenegraph-osgSim openscenegraph-osgText openscenegraph-osgAnimation openscenegraph-osgViewer openscenegraph-osgDB openscenegraph-osgUtil openscenegraph-osg openthreads
|
||||
+Conflicts:
|
||||
+Libs:
|
||||
+Libs.private: -L${libdir}/osgPlugins-@OPENSCENEGRAPH_VERSION@ -losgdb_3dc -losgdb_3ds -losgdb_ac -losgdb_bmp -losgdb_bsp -losgdb_bvh -losgdb_cfg -losgdb_curl -losgdb_dds -losgdb_dot -losgdb_dw -losgdb_dxf -losgdb_exr -losgdb_freetype -losgdb_gdal -losgdb_geo -losgdb_gif -losgdb_glsl -losgdb_gz -losgdb_hdr -losgdb_ive -losgdb_jp2 -losgdb_jpeg -losgdb_logo -losgdb_lwo -losgdb_lws -losgdb_md2 -losgdb_mdl -losgdb_normals -losgdb_obj -losgdb_ogr -losgdb_openflight -losgdb_osg -losgdb_osga -losgdb_osganimation -losgdb_osgfx -losgdb_osgparticle -losgdb_osgshadow -losgdb_osgsim -losgdb_osgterrain -losgdb_osgtext -losgdb_osgtgz -losgdb_osgviewer -losgdb_osgvolume -losgdb_osgwidget -losgdb_pic -losgdb_pnm -losgdb_rgb -losgdb_rot -losgdb_scale -losgdb_shp -losgdb_stl -losgdb_tga -losgdb_tgz -losgdb_tiff -losgdb_trans -losgdb_txf -losgdb_txp -losgdb_vtf -losgdb_x -losgdb_zip -lcurl -lgnutls -lgcrypt -lgpg-error -lidn -lIlmImf -lHalf -lImath -lIlmThread -lIex -lfreetype -lgdal -ltiff -lgif -ljasper -ljpeg -liconv -lz -lws2_32 -lwinmm -lwldap32
|
||||
+Libs.private: -L${libdir}/osgPlugins-@OPENSCENEGRAPH_VERSION@ -losgdb_3dc -losgdb_3ds -losgdb_ac -losgdb_bmp -losgdb_bsp -losgdb_bvh -losgdb_cfg -losgdb_curl -losgdb_dds -losgdb_dot -losgdb_dw -losgdb_dxf -losgdb_exr -losgdb_freetype -losgdb_gdal -losgdb_geo -losgdb_gif -losgdb_glsl -losgdb_gz -losgdb_hdr -losgdb_ive -losgdb_jp2 -losgdb_jpeg -losgdb_logo -losgdb_lwo -losgdb_lws -losgdb_md2 -losgdb_mdl -losgdb_normals -losgdb_obj -losgdb_ogr -losgdb_openflight -losgdb_osg -losgdb_osga -losgdb_osganimation -losgdb_osgfx -losgdb_osgparticle -losgdb_osgshadow -losgdb_osgsim -losgdb_osgterrain -losgdb_osgtext -losgdb_osgtgz -losgdb_osgviewer -losgdb_osgvolume -losgdb_osgwidget -losgdb_pic -losgdb_png -losgdb_pnm -losgdb_rgb -losgdb_rot -losgdb_scale -losgdb_shp -losgdb_stl -losgdb_tga -losgdb_tgz -losgdb_tiff -losgdb_trans -losgdb_txf -losgdb_txp -losgdb_vtf -losgdb_x -losgdb_zip -lcurl -lgnutls -lgcrypt -lgpg-error -lidn -lIlmImf -lHalf -lImath -lIlmThread -lIex -lfreetype -lgdal -ltiff -lgif -ljasper -ljpeg -lpng -liconv -lz -lws2_32 -lwinmm -lwldap32
|
||||
+Cflags: -I${includedir}
|
||||
diff -uNr OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osgShadow.pc.in OpenSceneGraph-2.8.2/packaging/pkgconfig/openscenegraph-osgShadow.pc.in
|
||||
--- OpenSceneGraph-2.8.2.orig/packaging/pkgconfig/openscenegraph-osgShadow.pc.in 1970-01-01 01:00:00.000000000 +0100
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
This file is part of mingw-cross-env.
|
||||
See doc/index.html or doc/README for further information.
|
||||
|
||||
diff -uNr OpenSceneGraph-2.8.2.orig/src/osgPlugins/exr/ReaderWriterEXR.cpp OpenSceneGraph-2.8.2/src/osgPlugins/exr/ReaderWriterEXR.cpp
|
||||
--- OpenSceneGraph-2.8.2.orig/src/osgPlugins/exr/ReaderWriterEXR.cpp 2008-11-27 10:36:18.000000000 +0100
|
||||
+++ OpenSceneGraph-2.8.2/src/osgPlugins/exr/ReaderWriterEXR.cpp 2010-01-14 17:55:32.000000000 +0100
|
||||
@@ -4,11 +4,6 @@
|
||||
+++ OpenSceneGraph-2.8.2/src/osgPlugins/exr/ReaderWriterEXR.cpp 2010-01-26 21:36:31.000000000 +0100
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <osg/Image>
|
||||
#include <osg/GL>
|
||||
|
||||
-#ifdef _WIN32
|
||||
-//Make the half format work against openEXR libs
|
||||
-#define OPENEXR_DLL
|
||||
-#endif
|
||||
-
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
+#if defined _WIN32 && !defined OSG_LIBRARY_STATIC
|
||||
//Make the half format work against openEXR libs
|
||||
#define OPENEXR_DLL
|
||||
#endif
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
This file is part of mingw-cross-env.
|
||||
See doc/index.html or doc/README for further information.
|
||||
|
||||
diff -uNr OpenSceneGraph-2.8.2.orig/src/osgPlugins/CMakeLists.txt OpenSceneGraph-2.8.2/src/osgPlugins/CMakeLists.txt
|
||||
--- OpenSceneGraph-2.8.2.orig/src/osgPlugins/CMakeLists.txt 2009-01-14 21:32:06.000000000 +0100
|
||||
+++ OpenSceneGraph-2.8.2/src/osgPlugins/CMakeLists.txt 2010-01-15 06:54:16.000000000 +0100
|
||||
@@ -96,9 +96,6 @@
|
||||
IF(GIFLIB_FOUND)
|
||||
ADD_SUBDIRECTORY(gif)
|
||||
ENDIF(GIFLIB_FOUND)
|
||||
-IF(PNG_FOUND)
|
||||
- ADD_SUBDIRECTORY(png)
|
||||
-ENDIF(PNG_FOUND)
|
||||
IF(TIFF_FOUND)
|
||||
ADD_SUBDIRECTORY(tiff)
|
||||
ENDIF(TIFF_FOUND)
|
|
@ -0,0 +1,19 @@
|
|||
This file is part of mingw-cross-env.
|
||||
See doc/index.html or doc/README for further information.
|
||||
|
||||
--- OpenSceneGraph-2.8.2.orig/src/osgPlugins/png/ReaderWriterPNG.cpp
|
||||
+++ OpenSceneGraph-2.8.2/src/osgPlugins/png/ReaderWriterPNG.cpp
|
||||
@@ -179,5 +179,5 @@
|
||||
|
||||
fin.read((char*)header,8);
|
||||
- if (fin.gcount() == 8 && png_check_sig(header, 8))
|
||||
+ if (fin.gcount() == 8 && png_sig_cmp(header, 0, 8) == 0)
|
||||
png_set_read_fn(png,&fin,png_read_istream); //Use custom read function that will get data from istream
|
||||
else
|
||||
@@ -230,5 +230,5 @@
|
||||
png_set_palette_to_rgb(png);
|
||||
if (color == PNG_COLOR_TYPE_GRAY && depth < 8)
|
||||
- png_set_gray_1_2_4_to_8(png);
|
||||
+ png_set_expand_gray_1_2_4_to_8(png);
|
||||
if (png_get_valid(png, info, PNG_INFO_tRNS))
|
||||
png_set_tRNS_to_alpha(png);
|
Loading…
Reference in New Issue