summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/index.html33
-rw-r--r--src/openscenegraph-1-pkg-config.patch4
-rw-r--r--src/openscenegraph-2-static.patch19
-rw-r--r--src/openscenegraph-4-disable-png.patch16
-rw-r--r--src/openscenegraph-4-png.patch19
5 files changed, 42 insertions, 49 deletions
diff --git a/doc/index.html b/doc/index.html
index ae70dd6..7b12275 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -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(&lt;plugin&gt;)</code>
- to explicitly reference any plugin you might want to use
- </li>
- </ul>
+ <pre>#ifdef OSG_LIBRARY_STATIC
+USE_GRAPHICSWINDOW()
+USE_OSGPLUGIN(&lt;plugin1&gt;)
+USE_OSGPLUGIN(&lt;plugin2&gt;)
+...
+#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>
diff --git a/src/openscenegraph-1-pkg-config.patch b/src/openscenegraph-1-pkg-config.patch
index 2860524..0b4d740 100644
--- a/src/openscenegraph-1-pkg-config.patch
+++ b/src/openscenegraph-1-pkg-config.patch
@@ -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
diff --git a/src/openscenegraph-2-static.patch b/src/openscenegraph-2-static.patch
index 73405fa..cf90126 100644
--- a/src/openscenegraph-2-static.patch
+++ b/src/openscenegraph-2-static.patch
@@ -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
diff --git a/src/openscenegraph-4-disable-png.patch b/src/openscenegraph-4-disable-png.patch
deleted file mode 100644
index 7a03a46..0000000
--- a/src/openscenegraph-4-disable-png.patch
+++ /dev/null
@@ -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)
diff --git a/src/openscenegraph-4-png.patch b/src/openscenegraph-4-png.patch
new file mode 100644
index 0000000..1aa6f65
--- /dev/null
+++ b/src/openscenegraph-4-png.patch
@@ -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);