diff --git a/.cvsignore b/.cvsignore index 179e430..0728a68 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -SimGear-1.9.0.tar.gz +SimGear-1.9.1.tar.gz diff --git a/SimGear-1.9.0-shared.patch b/SimGear-1.9.0-shared.patch deleted file mode 100644 index 985b7f8..0000000 --- a/SimGear-1.9.0-shared.patch +++ /dev/null @@ -1,992 +0,0 @@ -diff -uNrp SimGear-1.9.0.orig/configure.ac SimGear-1.9.0/configure.ac ---- SimGear-1.9.0.orig/configure.ac 2008-12-20 07:39:46.000000000 +0100 -+++ SimGear-1.9.0/configure.ac 2009-01-06 09:48:09.000000000 +0100 -@@ -3,6 +3,7 @@ dnl script. - - AC_INIT - AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx]) -+AC_PROG_LIBTOOL - - dnl Require at least automake 2.52 - AC_PREREQ(2.52) -diff -uNrp SimGear-1.9.0.orig/simgear/bucket/Makefile.am SimGear-1.9.0/simgear/bucket/Makefile.am ---- SimGear-1.9.0.orig/simgear/bucket/Makefile.am 2007-07-23 00:37:26.000000000 +0200 -+++ SimGear-1.9.0/simgear/bucket/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,10 +1,11 @@ - includedir = @includedir@/bucket - --lib_LIBRARIES = libsgbucket.a -+lib_LTLIBRARIES = libsgbucket.la - - include_HEADERS = newbucket.hxx - --libsgbucket_a_SOURCES = newbucket.cxx -+libsgbucket_la_SOURCES = newbucket.cxx -+libsgbucket_la_LDFLAGS = -release @VERSION@ -module - - # noinst_PROGRAMS = testbucket - -diff -uNrp SimGear-1.9.0.orig/simgear/debug/Makefile.am SimGear-1.9.0/simgear/debug/Makefile.am ---- SimGear-1.9.0.orig/simgear/debug/Makefile.am 2002-09-07 04:58:19.000000000 +0200 -+++ SimGear-1.9.0/simgear/debug/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -2,10 +2,11 @@ includedir = @includedir@/debug - - EXTRA_DIST = logtest.cxx - --lib_LIBRARIES = libsgdebug.a -+lib_LTLIBRARIES = libsgdebug.la - - include_HEADERS = debug_types.h logstream.hxx - --libsgdebug_a_SOURCES = logstream.cxx -+libsgdebug_la_SOURCES = logstream.cxx -+libsgdebug_la_LDFLAGS = -release @VERSION@ -module - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/environment/Makefile.am SimGear-1.9.0/simgear/environment/Makefile.am ---- SimGear-1.9.0.orig/simgear/environment/Makefile.am 2008-03-04 09:54:00.000000000 +0100 -+++ SimGear-1.9.0/simgear/environment/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,9 +1,17 @@ - includedir = @includedir@/environment - --lib_LIBRARIES = libsgenvironment.a -+lib_LTLIBRARIES = libsgenvironment.la - - include_HEADERS = metar.hxx visual_enviro.hxx precipitation.hxx - --libsgenvironment_a_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx -+libsgenvironment_la_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx -+libsgenvironment_la_LDFLAGS = -release @VERSION@ -module -lGL -lplibssg -+libsgenvironment_la_LIBADD = \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/sound/libsgsound.la \ -+ $(top_builddir)/simgear/scene/sky/libsgsky.la -+ $(top_builddir)/simgear/math/libsgmath.la - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/ephemeris/Makefile.am SimGear-1.9.0/simgear/ephemeris/Makefile.am ---- SimGear-1.9.0.orig/simgear/ephemeris/Makefile.am 2003-08-29 09:35:55.000000000 +0200 -+++ SimGear-1.9.0/simgear/ephemeris/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/ephemeris - --lib_LIBRARIES = libsgephem.a -+lib_LTLIBRARIES = libsgephem.la - - include_HEADERS = \ - celestialBody.hxx \ -@@ -16,7 +16,7 @@ include_HEADERS = \ - uranus.hxx \ - venus.hxx - --libsgephem_a_SOURCES = \ -+libsgephem_la_SOURCES = \ - celestialBody.cxx \ - ephemeris.cxx \ - jupiter.cxx \ -@@ -31,4 +31,10 @@ libsgephem_a_SOURCES = \ - uranus.cxx \ - venus.cxx - -+libsgephem_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgephem_la_LIBADD = \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/io/Makefile.am SimGear-1.9.0/simgear/io/Makefile.am ---- SimGear-1.9.0.orig/simgear/io/Makefile.am 2007-07-23 00:37:26.000000000 +0200 -+++ SimGear-1.9.0/simgear/io/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/io - --lib_LIBRARIES = libsgio.a -+lib_LTLIBRARIES = libsgio.la - - include_HEADERS = \ - iochannel.hxx \ -@@ -11,7 +11,7 @@ include_HEADERS = \ - sg_socket.hxx \ - sg_socket_udp.hxx - --libsgio_a_SOURCES = \ -+libsgio_la_SOURCES = \ - iochannel.cxx \ - lowlevel.cxx \ - sg_binobj.cxx \ -@@ -22,55 +22,82 @@ libsgio_a_SOURCES = \ - - INCLUDES = -I$(top_srcdir) - -+libsgio_la_LDFLAGS = -release @VERSION@ -module -lplibnet -lz -+ -+libsgio_la_LIBADD = \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la -+ - noinst_PROGRAMS = decode_binobj socktest lowtest tcp_server tcp_client - - tcp_server_SOURCES = tcp_server.cxx - --tcp_server_LDADD = \ -- libsgio.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/bucket/libsgbucket.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -+tcp_server_LDFLAGS = \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ - -lplibnet -lplibul -lz \ - $(network_LIBS) \ - $(base_LIBS) - - tcp_client_SOURCES = tcp_client.cxx - --tcp_client_LDADD = \ -- libsgio.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/bucket/libsgbucket.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -+tcp_client_LDFLAGS = \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ - -lplibnet -lplibul -lz \ - $(network_LIBS) \ - $(base_LIBS) - - socktest_SOURCES = socktest.cxx - --socktest_LDADD = \ -- libsgio.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/bucket/libsgbucket.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- -lplibnet -lplibul -lz \ -+socktest_LDFLAGS = \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ -lplibnet -lz \ - $(network_LIBS) \ - $(base_LIBS) - - lowtest_SOURCES = lowtest.cxx - --lowtest_LDADD = \ -- libsgio.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/bucket/libsgbucket.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- $(base_LIBS) -lz -+lowtest_LDFLAGS = \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(base_LIBS) -lz -lplibnet -lplibul - - decode_binobj_SOURCES = decode_binobj.cxx - --decode_binobj_LDADD = \ -- libsgio.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/bucket/libsgbucket.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- $(base_LIBS) -lz -+decode_binobj_LDFLAGS = \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(base_LIBS) -lz -lplibnet -lplibul -diff -uNrp SimGear-1.9.0.orig/simgear/magvar/Makefile.am SimGear-1.9.0/simgear/magvar/Makefile.am ---- SimGear-1.9.0.orig/simgear/magvar/Makefile.am 2007-07-23 00:37:26.000000000 +0200 -+++ SimGear-1.9.0/simgear/magvar/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,19 +1,21 @@ - includedir = @includedir@/magvar - --lib_LIBRARIES = libsgmagvar.a -+lib_LTLIBRARIES = libsgmagvar.la - - include_HEADERS = magvar.hxx - --libsgmagvar_a_SOURCES = \ -+libsgmagvar_la_SOURCES = \ - coremag.hxx coremag.cxx \ - magvar.cxx - -+libsgmagvar_la_LDFLAGS = -release @VERSION@ -module -+ - noinst_PROGRAMS = testmagvar - - testmagvar_SOURCES = testmagvar.cxx - --testmagvar_LDADD = \ -- libsgmagvar.a \ -+testmagvar_LDFLAGS = \ -+ $(top_builddir)/simgear/magvar/libsgmagvar.la \ - $(base_LIBS) - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/Makefile.am SimGear-1.9.0/simgear/Makefile.am ---- SimGear-1.9.0.orig/simgear/Makefile.am 2008-07-25 20:35:40.000000000 +0200 -+++ SimGear-1.9.0/simgear/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -14,23 +14,25 @@ include_HEADERS = \ - - SUBDIRS = \ - $(compatibility_DIR) \ -- xml \ - debug \ -- misc \ - structure \ -+ xml \ -+ props \ -+ misc \ - bucket \ - ephemeris \ -+ serial \ - io \ - magvar \ - math \ -+ sound \ -+ screen \ -+ scene/util \ -+ scene/sky \ - $(METAR_DIRS) \ - nasal \ -- props \ - route \ - scene \ -- screen \ -- serial \ -- sound \ - $(SGTHREAD_DIR) \ - timing - -diff -uNrp SimGear-1.9.0.orig/simgear/math/Makefile.am SimGear-1.9.0/simgear/math/Makefile.am ---- SimGear-1.9.0.orig/simgear/math/Makefile.am 2008-04-14 23:44:21.000000000 +0200 -+++ SimGear-1.9.0/simgear/math/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -4,12 +4,20 @@ check_PROGRAMS = SGMathTest SGGeometryT - TESTS = $(check_PROGRAMS) - - SGMathTest_SOURCES = SGMathTest.cxx --SGMathTest_LDADD = libsgmath.a $(base_LIBS) -+SGMathTest_LDFLAGS = $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ libsgmath.la $(base_LIBS) -lz -lplibnet -lplibul - - SGGeometryTest_SOURCES = SGGeometryTest.cxx --SGGeometryTest_LDADD = libsgmath.a $(base_LIBS) -+SGGeometryTest_LDFLAGS = libsgmath.la $(base_LIBS) - --lib_LIBRARIES = libsgmath.a -+lib_LTLIBRARIES = libsgmath.la - - include_HEADERS = \ - interpolater.hxx \ -@@ -44,7 +52,7 @@ include_HEADERS = \ - SGVec3.hxx \ - SGVec4.hxx - --libsgmath_a_SOURCES = \ -+libsgmath_la_SOURCES = \ - interpolater.cxx \ - leastsqs.cxx \ - sg_random.c \ -@@ -52,4 +60,11 @@ libsgmath_a_SOURCES = \ - SGGeod.cxx \ - SGGeodesy.cxx - -+libsgmath_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgmath_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/props/libsgprops.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/misc/Makefile.am SimGear-1.9.0/simgear/misc/Makefile.am ---- SimGear-1.9.0.orig/simgear/misc/Makefile.am 2007-12-04 23:38:41.000000000 +0100 -+++ SimGear-1.9.0/simgear/misc/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/misc - --lib_LIBRARIES = libsgmisc.a -+lib_LTLIBRARIES = libsgmisc.la - - include_HEADERS = \ - sg_path.hxx \ -@@ -14,7 +14,7 @@ include_HEADERS = \ - stdint.hxx \ - PathOptions.hxx - --libsgmisc_a_SOURCES = \ -+libsgmisc_la_SOURCES = \ - sg_path.cxx \ - sgstream.cxx \ - strutils.cxx \ -@@ -24,19 +24,23 @@ libsgmisc_a_SOURCES = \ - interpolator.cxx \ - PathOptions.cxx - --noinst_PROGRAMS = tabbed_value_test swap_test -+libsgmisc_la_LDFLAGS = -release @VERSION@ -module -lz - --tabbed_value_test_SOURCES = tabbed_values_test.cxx --tabbed_value_test_LDADD = \ -- libsgmisc.a \ -- $(top_builddir)/simgear/xml/libsgxml.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a -+libsgmisc_la_LIBADD = \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ -losg -losgDB - --$(top_builddir)/simgear/xml/libsgxml.a: -- cd $(top_builddir)/simgear/xml && $(MAKE) $(AM_MAKEFLAGS) libsgxml.a -+noinst_PROGRAMS = tabbed_value_test swap_test - --$(top_builddir)/simgear/debug/libsgdebug.a: -- cd $(top_builddir)/simgear/debug && $(MAKE) $(AM_MAKEFLAGS) libsgdebug.a -+tabbed_value_test_SOURCES = tabbed_values_test.cxx -+tabbed_value_test_LDFLAGS = \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ -lz - - swap_test_SOURCES = swap_test.cpp - -diff -uNrp SimGear-1.9.0.orig/simgear/nasal/Makefile.am SimGear-1.9.0/simgear/nasal/Makefile.am ---- SimGear-1.9.0.orig/simgear/nasal/Makefile.am 2007-03-29 20:50:12.000000000 +0200 -+++ SimGear-1.9.0/simgear/nasal/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,13 +1,15 @@ - includedir = @includedir@/nasal - --lib_LIBRARIES = libsgnasal.a -+lib_LTLIBRARIES = libsgnasal.la - - include_HEADERS = nasal.h naref.h - --libsgnasal_a_SOURCES = bitslib.c code.c code.h codegen.c data.h gc.c \ -- hash.c iolib.c iolib.h lex.c lib.c mathlib.c \ -- misc.c naref.h nasal.h parse.c parse.h string.c \ -- thread-posix.c thread-win32.c threadlib.c \ -- utf8lib.c vector.c -+libsgnasal_la_SOURCES = bitslib.c code.c code.h codegen.c data.h gc.c \ -+ hash.c iolib.c iolib.h lex.c lib.c mathlib.c \ -+ misc.c naref.h nasal.h parse.c parse.h string.c \ -+ thread-posix.c thread-win32.c threadlib.c \ -+ utf8lib.c vector.c -+ -+libsgnasal_la_LDFLAGS = -release @VERSION@ -module -lm -lpthread - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/props/Makefile.am SimGear-1.9.0/simgear/props/Makefile.am ---- SimGear-1.9.0.orig/simgear/props/Makefile.am 2007-07-23 00:37:27.000000000 +0200 -+++ SimGear-1.9.0/simgear/props/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,25 +1,32 @@ - includedir = @includedir@/props - --lib_LIBRARIES = libsgprops.a -+lib_LTLIBRARIES = libsgprops.la - - include_HEADERS = \ - condition.hxx \ - props.hxx \ - props_io.hxx - --libsgprops_a_SOURCES = \ -+libsgprops_la_SOURCES = \ - condition.cxx \ - props.cxx \ - props_io.cxx - -+libsgprops_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgprops_la_LIBADD = \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la -+ - noinst_PROGRAMS = props_test - - props_test_SOURCES = props_test.cxx --props_test_LDADD = \ -- libsgprops.a \ -- $(top_builddir)/simgear/xml/libsgxml.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/structure/libsgstructure.a -+props_test_LDFLAGS = \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ -lz - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/route/Makefile.am SimGear-1.9.0/simgear/route/Makefile.am ---- SimGear-1.9.0.orig/simgear/route/Makefile.am 2007-07-23 00:37:27.000000000 +0200 -+++ SimGear-1.9.0/simgear/route/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,34 +1,43 @@ - includedir = @includedir@/route - --lib_LIBRARIES = libsgroute.a -+lib_LTLIBRARIES = libsgroute.la - - include_HEADERS = route.hxx waypoint.hxx - --libsgroute_a_SOURCES = \ -+libsgroute_la_SOURCES = \ - route.cxx \ - waypoint.cxx - -+libsgroute_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgroute_la_LIBADD = \ -+ $(top_builddir)/simgear/math/libsgmath.la -+ - INCLUDES = -I$(top_srcdir) - - noinst_PROGRAMS = waytest routetest - - waytest_SOURCES = waytest.cxx - --waytest_LDADD = \ -- libsgroute.a \ -- $(top_builddir)/simgear/math/libsgmath.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- $(top_builddir)/simgear/props/libsgprops.a \ -- $(top_builddir)/simgear/structure/libsgstructure.a \ -- $(top_builddir)/simgear/xml/libsgxml.a \ -+waytest_LDFLAGS = \ -+ $(top_builddir)/simgear/route/libsgroute.la \ -+ $(top_builddir)/simgear/math/libsgmath.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ - $(base_LIBS) \ - -lz - - routetest_SOURCES = routetest.cxx - --routetest_LDADD = \ -- libsgroute.a \ -- $(top_builddir)/simgear/math/libsgmath.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(base_LIBS) -+routetest_LDFLAGS = \ -+ $(top_builddir)/simgear/route/libsgroute.la \ -+ $(top_builddir)/simgear/math/libsgmath.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ -+ $(base_LIBS) -lz -diff -uNrp SimGear-1.9.0.orig/simgear/scene/material/Makefile.am SimGear-1.9.0/simgear/scene/material/Makefile.am ---- SimGear-1.9.0.orig/simgear/scene/material/Makefile.am 2003-05-15 18:19:56.000000000 +0200 -+++ SimGear-1.9.0/simgear/scene/material/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/scene/material - --lib_LIBRARIES = libsgmaterial.a -+lib_LTLIBRARIES = libsgmaterial.la - - noinst_HEADERS = - -@@ -9,9 +9,17 @@ include_HEADERS = \ - matlib.hxx \ - matmodel.hxx - --libsgmaterial_a_SOURCES = \ -+libsgmaterial_la_SOURCES = \ - mat.cxx \ - matlib.cxx \ - matmodel.cxx - -+libsgmaterial_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lGL -+ -+libsgmaterial_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/math/libsgmath.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/scene/model/Makefile.am SimGear-1.9.0/simgear/scene/model/Makefile.am ---- SimGear-1.9.0.orig/simgear/scene/model/Makefile.am 2008-03-22 10:30:26.000000000 +0100 -+++ SimGear-1.9.0/simgear/scene/model/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/scene/model - --lib_LIBRARIES = libsgmodel.a -+lib_LTLIBRARIES = libsgmodel.la - - noinst_HEADERS = - -@@ -25,7 +25,7 @@ include_HEADERS = \ - SGScaleTransform.hxx \ - SGTranslateTransform.hxx - --libsgmodel_a_SOURCES = \ -+libsgmodel_la_SOURCES = \ - animation.cxx \ - particles.cxx \ - location.cxx \ -@@ -46,4 +46,14 @@ libsgmodel_a_SOURCES = \ - SGScaleTransform.cxx \ - SGTranslateTransform.cxx - -+libsgmodel_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibsg -lGL -+ -+libsgmodel_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/screen/libsgscreen.la \ -+ $(top_builddir)/simgear/environment/libsgenvironment.la \ -+ $(top_builddir)/simgear/math/libsgmath.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/scene/sky/Makefile.am SimGear-1.9.0/simgear/scene/sky/Makefile.am ---- SimGear-1.9.0.orig/simgear/scene/sky/Makefile.am 2008-10-26 10:37:18.000000000 +0100 -+++ SimGear-1.9.0/simgear/scene/sky/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/scene/sky - --lib_LIBRARIES = libsgsky.a -+lib_LTLIBRARIES = libsgsky.la - - include_HEADERS = \ - cloud.hxx \ -@@ -15,7 +15,7 @@ include_HEADERS = \ - newcloud.hxx \ - CloudShaderGeometry.hxx - --libsgsky_a_SOURCES = \ -+libsgsky_la_SOURCES = \ - cloud.cxx \ - dome.cxx \ - moon.cxx \ -@@ -28,4 +28,15 @@ libsgsky_a_SOURCES = \ - newcloud.cxx \ - CloudShaderGeometry.cxx - -+libsgsky_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibul -lplibsg \ -+ -lGL -lGLU -+ -+libsgsky_la_LIBADD = \ -+ $(top_builddir)/simgear/screen/libsgscreen.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/math/libsgmath.la \ -+ $(top_builddir)/simgear/scene/util/libsgutil.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/scene/tgdb/Makefile.am SimGear-1.9.0/simgear/scene/tgdb/Makefile.am ---- SimGear-1.9.0.orig/simgear/scene/tgdb/Makefile.am 2008-08-28 19:52:44.000000000 +0200 -+++ SimGear-1.9.0/simgear/scene/tgdb/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/scene/tgdb - --lib_LIBRARIES = libsgtgdb.a -+lib_LTLIBRARIES = libsgtgdb.la - - noinst_HEADERS = - -@@ -24,7 +24,7 @@ include_HEADERS = \ - TileCache.hxx \ - TileEntry.hxx - --libsgtgdb_a_SOURCES = \ -+libsgtgdb_la_SOURCES = \ - apt_signs.cxx \ - obj.cxx \ - pt_lights.cxx \ -@@ -40,4 +40,14 @@ libsgtgdb_a_SOURCES = \ - TileEntry.cxx \ - TreeBin.cxx TreeBin.hxx - -+libsgtgdb_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibul -lGL -+ -+libsgtgdb_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/bucket/libsgbucket.la \ -+ $(top_builddir)/simgear/io/libsgio.la \ -+ $(top_builddir)/simgear/scene/material/libsgmaterial.la \ -+ $(top_builddir)/simgear/screen/libsgscreen.la \ -+ $(top_builddir)/simgear/math/libsgmath.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/scene/util/Makefile.am SimGear-1.9.0/simgear/scene/util/Makefile.am ---- SimGear-1.9.0.orig/simgear/scene/util/Makefile.am 2008-04-23 20:13:51.000000000 +0200 -+++ SimGear-1.9.0/simgear/scene/util/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/scene/util - --lib_LIBRARIES = libsgutil.a -+lib_LTLIBRARIES = libsgutil.la - - noinst_HEADERS = - -@@ -21,7 +21,7 @@ include_HEADERS = \ - VectorArrayAdapter.hxx - - --libsgutil_a_SOURCES = \ -+libsgutil_la_SOURCES = \ - SGEnlargeBoundingBox.cxx \ - SGSceneFeatures.cxx \ - SGSceneUserData.cxx \ -@@ -31,4 +31,6 @@ libsgutil_a_SOURCES = \ - StateAttributeFactory.cxx \ - QuadTreeBuilder.cxx - -+libsgutil_la_LDFLAGS = -release @VERSION@ -module -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/screen/Makefile.am SimGear-1.9.0/simgear/screen/Makefile.am ---- SimGear-1.9.0.orig/simgear/screen/Makefile.am 2007-07-23 00:37:27.000000000 +0200 -+++ SimGear-1.9.0/simgear/screen/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/screen - --lib_LIBRARIES = libsgscreen.a -+lib_LTLIBRARIES = libsgscreen.la - - EXTRA_DIST = jpgfactory.cxx jpgfactory.hxx - -@@ -24,7 +24,7 @@ include_HEADERS = \ - shader.h \ - tr.h - --libsgscreen_a_SOURCES = \ -+libsgscreen_la_SOURCES = \ - texture.cxx \ - GLBitmaps.cxx \ - $(IMAGE_SERVER_SRCS) \ -@@ -35,15 +35,21 @@ libsgscreen_a_SOURCES = \ - shader.cpp \ - win32-printer.h - -+libsgscreen_la_LDFLAGS = -release @VERSION@ -module -lGL -lGLU -lX11 -lz \ -+ -ldl -ljpeg -lplibssg -+ -+libsgscreen_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la -+ - if HAVE_GLUT - noinst_PROGRAMS = TestRenderTexture - - TestRenderTexture_SOURCES = TestRenderTexture.cpp - --TestRenderTexture_LDADD = \ -- libsgscreen.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(opengl_LIBS) -+TestRenderTexture_LDFLAGS = \ -+ $(top_builddir)/simgear/screen/libsgscreen.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(opengl_LIBS) -lz -lplibssg -ljpeg - endif - - INCLUDES = -I$(top_srcdir) -I$(top_builddir) -DGLX_GLXEXT_PROTOTYPES -diff -uNrp SimGear-1.9.0.orig/simgear/serial/Makefile.am SimGear-1.9.0/simgear/serial/Makefile.am ---- SimGear-1.9.0.orig/simgear/serial/Makefile.am 2007-07-23 00:37:27.000000000 +0200 -+++ SimGear-1.9.0/simgear/serial/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,17 +1,21 @@ - includedir = @includedir@/serial - --lib_LIBRARIES = libsgserial.a -+lib_LTLIBRARIES = libsgserial.la - - include_HEADERS = serial.hxx - --libsgserial_a_SOURCES = serial.cxx -+libsgserial_la_SOURCES = serial.cxx -+ -+libsgserial_la_LDFLAGS = -release @VERSION@ -module -+libsgserial_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la - - noinst_PROGRAMS = testserial - - testserial_SOURCES = testserial.cxx - --testserial_LDADD = \ -- libsgserial.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a -+testserial_LDFLAGS = \ -+ $(top_builddir)/simgear/serial/libsgserial.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la - - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/sound/Makefile.am SimGear-1.9.0/simgear/sound/Makefile.am ---- SimGear-1.9.0.orig/simgear/sound/Makefile.am 2007-07-23 00:37:27.000000000 +0200 -+++ SimGear-1.9.0/simgear/sound/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -2,7 +2,7 @@ includedir = @includedir@/sound - - EXTRA_DIST = jet.wav - --lib_LIBRARIES = libsgsound.a -+lib_LTLIBRARIES = libsgsound.la - - noinst_HEADERS = - -@@ -11,25 +11,33 @@ include_HEADERS = \ - soundmgr_openal.hxx \ - xmlsound.hxx - --libsgsound_a_SOURCES = \ -+libsgsound_la_SOURCES = \ - sample_openal.cxx \ - soundmgr_openal.cxx \ - xmlsound.cxx - -+libsgsound_la_LDFLAGS = -release @VERSION@ -module $(openal_LIBS) -+libsgsound_la_LIBADD = \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/props/libsgprops.la -+ - noinst_PROGRAMS = openal_test1 openal_test2 - - openal_test1_SOURCES = openal_test1.cxx - openal_test2_SOURCES = openal_test2.cxx - --openal_test1_LDADD = \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -+openal_test1_LDFLAGS = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ - $(openal_LIBS) - --openal_test2_LDADD = \ -- libsgsound.a \ -- $(top_builddir)/simgear/debug/libsgdebug.a \ -- $(top_builddir)/simgear/misc/libsgmisc.a \ -- $(top_builddir)/simgear/structure/libsgstructure.a \ -+openal_test2_LDFLAGS = \ -+ $(top_builddir)/simgear/sound/libsgsound.la \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la \ -+ $(top_builddir)/simgear/structure/libsgstructure.la \ -+ $(top_builddir)/simgear/props/libsgprops.la \ -+ $(top_builddir)/simgear/xml/libsgxml.la \ - $(openal_LIBS) - - INCLUDES = -I$(top_srcdir) -DSRC_DIR=\"$(top_srcdir)/simgear/sound\" -diff -uNrp SimGear-1.9.0.orig/simgear/structure/Makefile.am SimGear-1.9.0/simgear/structure/Makefile.am ---- SimGear-1.9.0.orig/simgear/structure/Makefile.am 2008-12-11 18:35:14.000000000 +0100 -+++ SimGear-1.9.0/simgear/structure/Makefile.am 2009-01-06 09:50:22.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/structure - --lib_LIBRARIES = libsgstructure.a -+lib_LTLIBRARIES = libsgstructure.la - - include_HEADERS = \ - callback.hxx \ -@@ -19,7 +19,7 @@ include_HEADERS = \ - SGSmplstat.hxx \ - Singleton.hxx - --libsgstructure_a_SOURCES = \ -+libsgstructure_la_SOURCES = \ - commands.cxx \ - exception.cxx \ - event_mgr.cxx\ -@@ -30,5 +30,10 @@ libsgstructure_a_SOURCES = \ - SGSmplhist.cxx \ - SGSmplstat.cxx - -+libsgstructure_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgstructure_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la -+ - INCLUDES = -I$(top_srcdir) - -diff -uNrp SimGear-1.9.0.orig/simgear/structure/Makefile.am.orig SimGear-1.9.0/simgear/structure/Makefile.am.orig ---- SimGear-1.9.0.orig/simgear/structure/Makefile.am.orig 1970-01-01 01:00:00.000000000 +0100 -+++ SimGear-1.9.0/simgear/structure/Makefile.am.orig 2008-12-11 18:35:14.000000000 +0100 -@@ -0,0 +1,34 @@ -+includedir = @includedir@/structure -+ -+lib_LIBRARIES = libsgstructure.a -+ -+include_HEADERS = \ -+ callback.hxx \ -+ commands.hxx \ -+ exception.hxx \ -+ event_mgr.hxx \ -+ subsystem_mgr.hxx \ -+ OSGUtils.hxx \ -+ OSGVersion.hxx \ -+ SGAtomic.hxx \ -+ SGBinding.hxx \ -+ SGExpression.hxx \ -+ SGReferenced.hxx \ -+ SGSharedPtr.hxx \ -+ SGSmplhist.hxx \ -+ SGSmplstat.hxx \ -+ Singleton.hxx -+ -+libsgstructure_a_SOURCES = \ -+ commands.cxx \ -+ exception.cxx \ -+ event_mgr.cxx\ -+ subsystem_mgr.cxx \ -+ SGAtomic.cxx \ -+ SGBinding.cxx \ -+ SGExpression.cxx \ -+ SGSmplhist.cxx \ -+ SGSmplstat.cxx -+ -+INCLUDES = -I$(top_srcdir) -+ -diff -uNrp SimGear-1.9.0.orig/simgear/structure/Makefile.am.rej SimGear-1.9.0/simgear/structure/Makefile.am.rej ---- SimGear-1.9.0.orig/simgear/structure/Makefile.am.rej 1970-01-01 01:00:00.000000000 +0100 -+++ SimGear-1.9.0/simgear/structure/Makefile.am.rej 2009-01-06 09:48:09.000000000 +0100 -@@ -0,0 +1,17 @@ -+*************** -+*** 17,23 **** -+ SGSmplhist.hxx \ -+ SGSmplstat.hxx -+ -+- libsgstructure_a_SOURCES = \ -+ commands.cxx \ -+ exception.cxx \ -+ event_mgr.cxx\ -+--- 17,23 ---- -+ SGSmplhist.hxx \ -+ SGSmplstat.hxx -+ -++ libsgstructure_la_SOURCES = \ -+ commands.cxx \ -+ exception.cxx \ -+ event_mgr.cxx\ -Binary files SimGear-1.9.0.orig/simgear/structure/.Makefile.am.rej.swp and SimGear-1.9.0/simgear/structure/.Makefile.am.rej.swp differ -diff -uNrp SimGear-1.9.0.orig/simgear/threads/Makefile.am SimGear-1.9.0/simgear/threads/Makefile.am ---- SimGear-1.9.0.orig/simgear/threads/Makefile.am 2002-09-07 04:58:20.000000000 +0200 -+++ SimGear-1.9.0/simgear/threads/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,13 +1,15 @@ - includedir = @includedir@/threads - --lib_LIBRARIES = libsgthreads.a -+lib_LTLIBRARIES = libsgthreads.la - - include_HEADERS = \ - SGGuard.hxx \ - SGQueue.hxx \ - SGThread.hxx - --libsgthreads_a_SOURCES = \ -+libsgthreads_la_SOURCES = \ - SGThread.cxx - -+libsgthreads_la_LDFLAGS = -release @VERSION@ -module -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/timing/Makefile.am SimGear-1.9.0/simgear/timing/Makefile.am ---- SimGear-1.9.0.orig/simgear/timing/Makefile.am 2002-09-07 04:58:19.000000000 +0200 -+++ SimGear-1.9.0/simgear/timing/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/timing - --lib_LIBRARIES = libsgtiming.a -+lib_LTLIBRARIES = libsgtiming.la - - include_HEADERS = \ - geocoord.h \ -@@ -9,11 +9,17 @@ include_HEADERS = \ - timestamp.hxx \ - timezone.h - --libsgtiming_a_SOURCES = \ -+libsgtiming_la_SOURCES = \ - geocoord.cxx \ - lowleveltime.cxx \ - sg_time.cxx \ - timestamp.cxx \ - timezone.cxx - -+libsgtiming_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgtiming_la_LIBADD = \ -+ $(top_builddir)/simgear/debug/libsgdebug.la \ -+ $(top_builddir)/simgear/misc/libsgmisc.la -+ - INCLUDES = -I$(top_srcdir) -diff -uNrp SimGear-1.9.0.orig/simgear/xml/Makefile.am SimGear-1.9.0/simgear/xml/Makefile.am ---- SimGear-1.9.0.orig/simgear/xml/Makefile.am 2003-08-29 09:35:57.000000000 +0200 -+++ SimGear-1.9.0/simgear/xml/Makefile.am 2009-01-06 09:48:09.000000000 +0100 -@@ -1,6 +1,6 @@ - includedir = @includedir@/xml - --lib_LIBRARIES = libsgxml.a -+lib_LTLIBRARIES = libsgxml.la - - include_HEADERS = \ - easyxml.hxx -@@ -8,7 +8,7 @@ include_HEADERS = \ - noinst_HEADERS = \ - xmltok_impl.c xmltok_ns.c - --libsgxml_a_SOURCES = \ -+libsgxml_la_SOURCES = \ - asciitab.h \ - easyxml.cxx \ - hashtable.h hashtable.c \ -@@ -18,4 +18,9 @@ libsgxml_a_SOURCES = \ - xmltok.h xmltok.c \ - xmltok_impl.h - -+libsgxml_la_LDFLAGS = -release @VERSION@ -module -+ -+libsgxml_la_LIBADD = \ -+ $(top_builddir)/simgear/structure/libsgstructure.la -+ - INCLUDES = -I$(top_srcdir) diff --git a/SimGear-1.9.0-untangle.patch b/SimGear-1.9.0-untangle.patch deleted file mode 100644 index ff47f19..0000000 --- a/SimGear-1.9.0-untangle.patch +++ /dev/null @@ -1,951 +0,0 @@ -diff -uNrp SimGear-1.9.0.orig/simgear/misc/sg_path.cxx SimGear-1.9.0/simgear/misc/sg_path.cxx ---- SimGear-1.9.0.orig/simgear/misc/sg_path.cxx 2008-08-05 03:12:20.000000000 +0200 -+++ SimGear-1.9.0/simgear/misc/sg_path.cxx 2008-11-23 23:27:54.000000000 +0100 -@@ -35,42 +35,6 @@ - #include "sg_path.hxx" - - --/** -- * define directory path separators -- */ -- --static const char sgDirPathSep = '/'; --static const char sgDirPathSepBad = '\\'; -- --#if defined( WIN32 ) && !defined(__CYGWIN__) --static const char sgSearchPathSep = ';'; --#else --static const char sgSearchPathSep = ':'; --#endif -- -- --// If Unix, replace all ":" with "/". If MacOS, replace all "/" with --// ":" it should go without saying that neither of these characters --// should be used in file or directory names. In windoze, allow the --// second character to be a ":" for things like c:\foo\bar -- --void --SGPath::fix() --{ -- for ( string::size_type i = 0; i < path.size(); ++i ) { --#if defined( WIN32 ) -- // for windoze, don't replace the ":" for the second character -- if ( i == 1 ) { -- continue; -- } --#endif -- if ( path[i] == sgDirPathSepBad ) { -- path[i] = sgDirPathSep; -- } -- } --} -- -- - // default constructor - SGPath::SGPath() - : path("") -@@ -78,19 +42,6 @@ SGPath::SGPath() - } - - --// create a path based on "path" --SGPath::SGPath( const std::string& p ) -- : path(p) --{ -- fix(); --} -- -- --// destructor --SGPath::~SGPath() { --} -- -- - // set path - void SGPath::set( const string& p ) { - path = p; -@@ -98,40 +49,15 @@ void SGPath::set( const string& p ) { - } - - --// append another piece to the existing path --void SGPath::append( const string& p ) { -- if ( path.size() == 0 ) { -- path = p; -- } else { -- if ( p[0] != sgDirPathSep ) { -- path += sgDirPathSep; -- } -- path += p; -- } -- fix(); --} -- - //add a new path component to the existing path string - void SGPath::add( const string& p ) { -- append( sgSearchPathSep+p ); --} -- -- --// concatenate a string to the end of the path without inserting a --// path separator --void SGPath::concat( const string& p ) { -- if ( path.size() == 0 ) { -- path = p; -- } else { -- path += p; -- } -- fix(); -+ append( SGPATH_sgSearchPathSep+p ); - } - - - // Get the file part of the path (everything after the last path sep) - string SGPath::file() const { -- int index = path.rfind(sgDirPathSep); -+ int index = path.rfind(SGPATH_sgDirPathSep); - if (index >= 0) { - return path.substr(index + 1); - } else { -@@ -140,16 +66,6 @@ string SGPath::file() const { - } - - --// get the directory part of the path. --string SGPath::dir() const { -- int index = path.rfind(sgDirPathSep); -- if (index >= 0) { -- return path.substr(0, index); -- } else { -- return ""; -- } --} -- - // get the base part of the path (everything but the extension.) - string SGPath::base() const { - int index = path.rfind("."); -@@ -180,91 +96,3 @@ bool SGPath::exists() const { - fclose(fp); - return true; - } -- --#if defined( _MSC_VER) || defined(__MINGW32__) --# define sgMkDir(d,m) _mkdir(d) --#else --# define sgMkDir(d,m) mkdir(d,m) --#endif -- -- --int SGPath::create_dir( mode_t mode ) { -- string_list dirlist = sgPathSplit(dir()); -- if ( dirlist.empty() ) -- return -1; -- string path = dirlist[0]; -- string_list path_elements = sgPathBranchSplit(path); -- bool absolute = !path.empty() && path[0] == sgDirPathSep; -- -- unsigned int i = 1; -- SGPath dir = absolute ? string( 1, sgDirPathSep ) : ""; -- dir.concat( path_elements[0] ); --#if defined( _MSC_VER) || defined(__MINGW32__) -- if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) { -- dir.append( path_elements[1] ); -- i = 2; -- } --#endif -- struct stat info; -- int r; -- for(; ( r = stat( dir.c_str(), &info ) ) == 0 && i < path_elements.size(); i++) { -- dir.append(path_elements[i]); -- } -- if ( r == 0 ) { -- return 0; // Directory already exists -- } -- if ( sgMkDir( dir.c_str(), mode) ) { -- SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); -- return -2; -- } -- for(; i < path_elements.size(); i++) { -- dir.append(path_elements[i]); -- if ( sgMkDir( dir.c_str(), mode) ) { -- SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); -- return -2; -- } -- } -- -- return 0; --} -- --string_list sgPathBranchSplit( const string &dirpath ) { -- string_list path_elements; -- string element, path = dirpath; -- while ( path.size() ) { -- size_t p = path.find( sgDirPathSep ); -- if ( p != string::npos ) { -- element = path.substr( 0, p ); -- path.erase( 0, p + 1 ); -- } else { -- element = path; -- path = ""; -- } -- if ( element.size() ) -- path_elements.push_back( element ); -- } -- return path_elements; --} -- -- --string_list sgPathSplit( const string &search_path ) { -- string tmp = search_path; -- string_list result; -- result.clear(); -- -- bool done = false; -- -- while ( !done ) { -- int index = tmp.find(sgSearchPathSep); -- if (index >= 0) { -- result.push_back( tmp.substr(0, index) ); -- tmp = tmp.substr( index + 1 ); -- } else { -- if ( !tmp.empty() ) -- result.push_back( tmp ); -- done = true; -- } -- } -- -- return result; --} -diff -uNrp SimGear-1.9.0.orig/simgear/misc/sg_path.hxx SimGear-1.9.0/simgear/misc/sg_path.hxx ---- SimGear-1.9.0.orig/simgear/misc/sg_path.hxx 2008-08-05 03:12:20.000000000 +0200 -+++ SimGear-1.9.0/simgear/misc/sg_path.hxx 2008-11-23 23:27:54.000000000 +0100 -@@ -34,6 +34,7 @@ - #include - - #include -+#include - - using std::string; - -@@ -42,6 +43,67 @@ using std::string; - #endif - - /** -+ * define directory path separators -+ */ -+ -+static const char SGPATH_sgDirPathSep = '/'; -+static const char SGPATH_sgDirPathSepBad = '\\'; -+ -+#if defined( WIN32 ) && !defined(__CYGWIN__) -+static const char SGPATH_sgSearchPathSep = ';'; -+#else -+static const char SGPATH_sgSearchPathSep = ':'; -+#endif -+ -+/** -+ * Split a directory string into a list of it's parent directories. -+ */ -+static inline string_list sgPathBranchSplit( const string &dirpath ) { -+ string_list path_elements; -+ string element, path = dirpath; -+ while ( path.size() ) { -+ size_t p = path.find( SGPATH_sgDirPathSep ); -+ if ( p != string::npos ) { -+ element = path.substr( 0, p ); -+ path.erase( 0, p + 1 ); -+ } else { -+ element = path; -+ path = ""; -+ } -+ if ( element.size() ) -+ path_elements.push_back( element ); -+ } -+ return path_elements; -+} -+ -+ -+/** -+ * Split a directory search path into a vector of individual paths -+ */ -+static inline string_list sgPathSplit( const string &search_path ) { -+ string tmp = search_path; -+ string_list result; -+ result.clear(); -+ -+ bool done = false; -+ -+ while ( !done ) { -+ int index = tmp.find(SGPATH_sgSearchPathSep); -+ if (index >= 0) { -+ result.push_back( tmp.substr(0, index) ); -+ tmp = tmp.substr( index + 1 ); -+ } else { -+ if ( !tmp.empty() ) -+ result.push_back( tmp ); -+ done = true; -+ } -+ } -+ -+ return result; -+} -+ -+ -+/** - * A class to hide path separator difference across platforms and assist - * in managing file system path names. - * -@@ -64,10 +126,13 @@ public: - * Construct a path based on the starting path provided. - * @param p initial path - */ -- SGPath( const string& p ); -+ SGPath( const string& p ) : path(p) -+ { -+ fix(); -+ } - - /** Destructor */ -- ~SGPath(); -+ ~SGPath() {} - - /** - * Set path to a new value -@@ -80,7 +145,17 @@ public: - * Append another piece to the existing path. Inserts a path - * separator between the existing component and the new component. - * @param p additional path component */ -- void append( const string& p ); -+ void append( const string& p ) { -+ if ( path.size() == 0 ) { -+ path = p; -+ } else { -+ if ( p[0] != SGPATH_sgDirPathSep ) { -+ path += SGPATH_sgDirPathSep; -+ } -+ path += p; -+ } -+ fix(); -+ } - - /** - * Append a new piece to the existing path. Inserts a search path -@@ -93,7 +168,14 @@ public: - * path separator. - * @param p additional path suffix - */ -- void concat( const string& p ); -+ void concat( const string& p ) { -+ if ( path.size() == 0 ) { -+ path = p; -+ } else { -+ path += p; -+ } -+ fix(); -+ } - - /** - * Get the file part of the path (everything after the last path sep) -@@ -105,7 +187,14 @@ public: - * Get the directory part of the path. - * @return directory string - */ -- string dir() const; -+ string dir() const { -+ int index = path.rfind(SGPATH_sgDirPathSep); -+ if (index >= 0) { -+ return path.substr(0, index); -+ } else { -+ return ""; -+ } -+ } - - /** - * Get the base part of the path (everything but the extension.) -@@ -141,26 +230,77 @@ public: - * Create the designated directory. - * @return 0 on success, or <0 on failure. - */ -- int create_dir(mode_t mode); -+ int create_dir(mode_t mode) { -+ string_list dirlist = sgPathSplit(dir()); -+ if ( dirlist.empty() ) -+ return -1; -+ string path = dirlist[0]; -+ string_list path_elements = sgPathBranchSplit(path); -+ bool absolute = !path.empty() && path[0] == SGPATH_sgDirPathSep; -+ -+ unsigned int i = 1; -+ SGPath dir = absolute ? string( 1, SGPATH_sgDirPathSep ) : ""; -+ dir.concat( path_elements[0] ); -+#if defined( _MSC_VER) || defined(__MINGW32__) -+ if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) { -+ dir.append( path_elements[1] ); -+ i = 2; -+ } -+#endif -+ struct stat info; -+ int r; -+ for(; ( r = stat( dir.c_str(), &info ) ) == 0 && i < path_elements.size(); i++) { -+ dir.append(path_elements[i]); -+ } -+ if ( r == 0 ) { -+ return 0; // Directory already exists -+ } -+#if defined( _MSC_VER) || defined(__MINGW32__) -+# define sgMkDir(d,m) _mkdir(d) -+#else -+# define sgMkDir(d,m) mkdir(d,m) -+#endif -+ if ( sgMkDir( dir.c_str(), mode) ) { -+ SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); -+ return -2; -+ } -+ for(; i < path_elements.size(); i++) { -+ dir.append(path_elements[i]); -+ if ( sgMkDir( dir.c_str(), mode) ) { -+ SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); -+ return -2; -+ } -+ } -+#undef sgMkDir -+ -+ return 0; -+ } - - private: - -- void fix(); -+ // If Unix, replace all ":" with "/". If MacOS, replace all "/" with -+ // ":" it should go without saying that neither of these characters -+ // should be used in file or directory names. In windoze, allow the -+ // second character to be a ":" for things like c:\foo\bar -+ -+ void fix() -+ { -+ for ( string::size_type i = 0; i < path.size(); ++i ) { -+#if defined( WIN32 ) -+ // for windoze, don't replace the ":" for the second character -+ if ( i == 1 ) { -+ continue; -+ } -+#endif -+ if ( path[i] == SGPATH_sgDirPathSepBad ) { -+ path[i] = SGPATH_sgDirPathSep; -+ } -+ } -+ } - - }; - - --/** -- * Split a directory string into a list of it's parent directories. -- */ --string_list sgPathBranchSplit( const string &path ); -- --/** -- * Split a directory search path into a vector of individual paths -- */ --string_list sgPathSplit( const string &search_path ); -- -- - #endif // _SG_PATH_HXX - - -diff -uNrp SimGear-1.9.0.orig/simgear/props/props.cxx SimGear-1.9.0/simgear/props/props.cxx ---- SimGear-1.9.0.orig/simgear/props/props.cxx 2008-08-05 03:12:20.000000000 +0200 -+++ SimGear-1.9.0/simgear/props/props.cxx 2008-11-23 23:27:54.000000000 +0100 -@@ -314,60 +314,6 @@ find_node (SGPropertyNode * current, - //////////////////////////////////////////////////////////////////////// - - inline bool --SGPropertyNode::get_bool () const --{ -- if (_tied) -- return _value.bool_val->getValue(); -- else -- return _local_val.bool_val; --} -- --inline int --SGPropertyNode::get_int () const --{ -- if (_tied) -- return _value.int_val->getValue(); -- else -- return _local_val.int_val; --} -- --inline long --SGPropertyNode::get_long () const --{ -- if (_tied) -- return _value.long_val->getValue(); -- else -- return _local_val.long_val; --} -- --inline float --SGPropertyNode::get_float () const --{ -- if (_tied) -- return _value.float_val->getValue(); -- else -- return _local_val.float_val; --} -- --inline double --SGPropertyNode::get_double () const --{ -- if (_tied) -- return _value.double_val->getValue(); -- else -- return _local_val.double_val; --} -- --inline const char * --SGPropertyNode::get_string () const --{ -- if (_tied) -- return _value.string_val->getValue(); -- else -- return _local_val.string_val; --} -- --inline bool - SGPropertyNode::set_bool (bool val) - { - if (_tied) { -@@ -1170,40 +1116,6 @@ SGPropertyNode::getFloatValue () const - } - } - --double --SGPropertyNode::getDoubleValue () const --{ -- // Shortcut for common case -- if (_attr == (READ|WRITE) && _type == DOUBLE) -- return get_double(); -- -- if (getAttribute(TRACE_READ)) -- trace_read(); -- if (!getAttribute(READ)) -- return SGRawValue::DefaultValue; -- -- switch (_type) { -- case ALIAS: -- return _value.alias->getDoubleValue(); -- case BOOL: -- return double(get_bool()); -- case INT: -- return double(get_int()); -- case LONG: -- return double(get_long()); -- case FLOAT: -- return double(get_float()); -- case DOUBLE: -- return get_double(); -- case STRING: -- case UNSPECIFIED: -- return strtod(get_string(), 0); -- case NONE: -- default: -- return SGRawValue::DefaultValue; -- } --} -- - const char * - SGPropertyNode::getStringValue () const - { -diff -uNrp SimGear-1.9.0.orig/simgear/props/props.hxx SimGear-1.9.0/simgear/props/props.hxx ---- SimGear-1.9.0.orig/simgear/props/props.hxx 2008-06-03 02:21:38.000000000 +0200 -+++ SimGear-1.9.0/simgear/props/props.hxx 2008-11-23 23:27:54.000000000 +0100 -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - #if PROPS_STANDALONE - #else -@@ -900,7 +901,38 @@ public: - /** - * Get a double value for this node. - */ -- double getDoubleValue () const; -+ double getDoubleValue () const -+ { -+ // Shortcut for common case -+ if (_attr == (READ|WRITE) && _type == DOUBLE) -+ return get_double(); -+ -+ if (getAttribute(TRACE_READ)) -+ trace_read(); -+ if (!getAttribute(READ)) -+ return SGRawValue::DefaultValue; -+ -+ switch (_type) { -+ case ALIAS: -+ return _value.alias->getDoubleValue(); -+ case BOOL: -+ return double(get_bool()); -+ case INT: -+ return double(get_int()); -+ case LONG: -+ return double(get_long()); -+ case FLOAT: -+ return double(get_float()); -+ case DOUBLE: -+ return get_double(); -+ case STRING: -+ case UNSPECIFIED: -+ return strtod(get_string(), 0); -+ case NONE: -+ default: -+ return SGRawValue::DefaultValue; -+ } -+ } - - - /** -@@ -1365,12 +1397,54 @@ protected: - private: - - // Get the raw value -- bool get_bool () const; -- int get_int () const; -- long get_long () const; -- float get_float () const; -- double get_double () const; -- const char * get_string () const; -+ inline bool get_bool () const -+ { -+ if (_tied) -+ return _value.bool_val->getValue(); -+ else -+ return _local_val.bool_val; -+ } -+ -+ inline int get_int () const -+ { -+ if (_tied) -+ return _value.int_val->getValue(); -+ else -+ return _local_val.int_val; -+ } -+ -+ inline long get_long () const -+ { -+ if (_tied) -+ return _value.long_val->getValue(); -+ else -+ return _local_val.long_val; -+ } -+ -+ inline float get_float () const -+ { -+ if (_tied) -+ return _value.float_val->getValue(); -+ else -+ return _local_val.float_val; -+ } -+ -+ inline double get_double () const -+ { -+ if (_tied) -+ return _value.double_val->getValue(); -+ else -+ return _local_val.double_val; -+ } -+ -+ inline const char * get_string () const -+ { -+ if (_tied) -+ return _value.string_val->getValue(); -+ else -+ return _local_val.string_val; -+ } -+ - - // Set the raw value - bool set_bool (bool value); -diff -uNrp SimGear-1.9.0.orig/simgear/scene/model/model.cxx SimGear-1.9.0/simgear/scene/model/model.cxx ---- SimGear-1.9.0.orig/simgear/scene/model/model.cxx 2008-08-29 23:16:43.000000000 +0200 -+++ SimGear-1.9.0/simgear/scene/model/model.cxx 2008-11-23 23:19:45.000000000 +0100 -@@ -20,43 +20,6 @@ - - #include "model.hxx" - --using std::vector; -- --osg::Texture2D* --SGLoadTexture2D(bool staticTexture, const std::string& path, -- const osgDB::ReaderWriter::Options* options, -- bool wrapu, bool wrapv, int) --{ -- osg::Image* image; -- if (options) -- image = osgDB::readImageFile(path, options); -- else -- image = osgDB::readImageFile(path); -- osg::ref_ptr texture = new osg::Texture2D; -- texture->setImage(image); -- if (staticTexture) -- texture->setDataVariance(osg::Object::STATIC); -- if (wrapu) -- texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); -- else -- texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); -- if (wrapv) -- texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); -- else -- texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); -- -- if (image) { -- int s = image->s(); -- int t = image->t(); -- -- if (s <= t && 32 <= s) { -- SGSceneFeatures::instance()->setTextureCompression(texture.get()); -- } else if (t < s && 32 <= t) { -- SGSceneFeatures::instance()->setTextureCompression(texture.get()); -- } -- } -- -- return texture.release(); --} -+// empty, all inline class now. - - // end of model.cxx -diff -uNrp SimGear-1.9.0.orig/simgear/scene/model/model.hxx SimGear-1.9.0/simgear/scene/model/model.hxx ---- SimGear-1.9.0.orig/simgear/scene/model/model.hxx 2008-08-05 03:12:21.000000000 +0200 -+++ SimGear-1.9.0/simgear/scene/model/model.hxx 2008-11-23 23:23:19.000000000 +0100 -@@ -24,10 +24,53 @@ using std::set; - - #include - --osg::Texture2D* -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+inline osg::Texture2D* - SGLoadTexture2D(bool staticTexture, const std::string& path, - const osgDB::ReaderWriter::Options* options = 0, -- bool wrapu = true, bool wrapv = true, int mipmaplevels = -1); -+ bool wrapu = true, bool wrapv = true, int mipmaplevels = -1) -+{ -+ osg::Image* image; -+ if (options) -+ image = osgDB::readImageFile(path, options); -+ else -+ image = osgDB::readImageFile(path); -+ osg::ref_ptr texture = new osg::Texture2D; -+ texture->setImage(image); -+ if (staticTexture) -+ texture->setDataVariance(osg::Object::STATIC); -+ if (wrapu) -+ texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); -+ else -+ texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); -+ if (wrapv) -+ texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); -+ else -+ texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); -+ -+ if (image) { -+ int s = image->s(); -+ int t = image->t(); -+ -+ if (s <= t && 32 <= s) { -+ SGSceneFeatures::instance()->setTextureCompression(texture.get()); -+ } else if (t < s && 32 <= t) { -+ SGSceneFeatures::instance()->setTextureCompression(texture.get()); -+ } -+ } -+ -+ return texture.release(); -+} - - inline osg::Texture2D* - SGLoadTexture2D(const std::string& path, -diff -uNrp SimGear-1.9.0.orig/simgear/timing/timestamp.cxx SimGear-1.9.0/simgear/timing/timestamp.cxx ---- SimGear-1.9.0.orig/simgear/timing/timestamp.cxx 2008-08-05 03:12:21.000000000 +0200 -+++ SimGear-1.9.0/simgear/timing/timestamp.cxx 2008-11-23 23:27:54.000000000 +0100 -@@ -24,72 +24,8 @@ - // $Id: timestamp.cxx,v 1.9 2008/07/27 15:15:34 fredb Exp $ - - --#ifdef HAVE_CONFIG_H --# include --#endif -- --#include -- --#include -- --#ifdef HAVE_SYS_TIMEB_H --# include // for ftime() and struct timeb --#endif --#ifdef HAVE_UNISTD_H --# include // for gettimeofday() --#endif --#ifdef HAVE_SYS_TIME_H --# include // for get/setitimer, gettimeofday, struct timeval --#endif -- --#ifdef WIN32 --# include --# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) --# define NEAR /* */ --# define FAR /* */ --# endif --# include --#endif -+// empty, all inline class now. - - #include "timestamp.hxx" - - --void SGTimeStamp::stamp() { --#if defined( WIN32 ) && !defined(__CYGWIN__) -- unsigned int t; -- t = timeGetTime(); -- seconds = t / 1000; -- usec = ( t - ( seconds * 1000 ) ) * 1000; --#elif defined( HAVE_GETTIMEOFDAY ) -- struct timeval current; -- struct timezone tz; -- // sg_timestamp currtime; -- gettimeofday(¤t, &tz); -- seconds = current.tv_sec; -- usec = current.tv_usec; --#elif defined( HAVE_GETLOCALTIME ) -- SYSTEMTIME current; -- GetLocalTime(¤t); -- seconds = current.wSecond; -- usec = current.wMilliseconds * 1000; --#elif defined( HAVE_FTIME ) -- struct timeb current; -- ftime(¤t); -- seconds = current.time; -- usec = current.millitm * 1000; --#else --# error Port me --#endif --} -- --// increment the time stamp by the number of microseconds (usec) --SGTimeStamp operator + (const SGTimeStamp& t, const long& m) { -- return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000, -- ( t.usec + m ) % 1000000 ); --} -- --// difference between time stamps in microseconds (usec) --long operator - (const SGTimeStamp& a, const SGTimeStamp& b) --{ -- return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec); --} -diff -uNrp SimGear-1.9.0.orig/simgear/timing/timestamp.hxx SimGear-1.9.0/simgear/timing/timestamp.hxx ---- SimGear-1.9.0.orig/simgear/timing/timestamp.hxx 2006-10-31 06:41:32.000000000 +0100 -+++ SimGear-1.9.0/simgear/timing/timestamp.hxx 2008-11-23 23:27:54.000000000 +0100 -@@ -32,9 +32,33 @@ - # error This library requires C++ - #endif - -+#ifdef HAVE_CONFIG_H -+# include -+#endif - - #include - -+#include -+ -+#ifdef HAVE_SYS_TIMEB_H -+# include // for ftime() and struct timeb -+#endif -+#ifdef HAVE_UNISTD_H -+# include // for gettimeofday() -+#endif -+#ifdef HAVE_SYS_TIME_H -+# include // for get/setitimer, gettimeofday, struct timeval -+#endif -+ -+#ifdef WIN32 -+# include -+# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) -+# define NEAR /* */ -+# define FAR /* */ -+# endif -+# include -+#endif -+ - - // MSVC++ 6.0 kuldge - Need forward declaration of friends. - class SGTimeStamp; -@@ -73,7 +97,33 @@ public: - SGTimeStamp( const long s, const long m ); - - /** Update stored time to current time (seconds and microseconds) */ -- void stamp(); -+ inline void stamp() { -+#if defined( WIN32 ) && !defined(__CYGWIN__) -+ unsigned int t; -+ t = timeGetTime(); -+ seconds = t / 1000; -+ usec = ( t - ( seconds * 1000 ) ) * 1000; -+#elif defined( HAVE_GETTIMEOFDAY ) -+ struct timeval current; -+ struct timezone tz; -+ // sg_timestamp currtime; -+ gettimeofday(¤t, &tz); -+ seconds = current.tv_sec; -+ usec = current.tv_usec; -+#elif defined( HAVE_GETLOCALTIME ) -+ SYSTEMTIME current; -+ GetLocalTime(¤t); -+ seconds = current.wSecond; -+ usec = current.wMilliseconds * 1000; -+#elif defined( HAVE_FTIME ) -+ struct timeb current; -+ ftime(¤t); -+ seconds = current.time; -+ usec = current.millitm * 1000; -+#else -+# error Port me -+#endif -+ } - - /** - * Increment the saved time by the specified number of microseconds -@@ -81,7 +131,10 @@ public: - * @param m microseconds increment - * @return new time stamp - */ -- friend SGTimeStamp operator + (const SGTimeStamp& t, const long& m); -+ friend SGTimeStamp operator + (const SGTimeStamp& t, const long& m) { -+ return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000, -+ ( t.usec + m ) % 1000000 ); -+ } - - /** - * Subtract two time stamps returning the difference in microseconds. -@@ -89,7 +142,9 @@ public: - * @param b timestame 2 - * @return difference in microseconds - */ -- friend long operator - (const SGTimeStamp& a, const SGTimeStamp& b); -+ friend long operator - (const SGTimeStamp& a, const SGTimeStamp& b) { -+ return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec); -+ } - - /** @return the saved seconds of this time stamp */ - inline long get_seconds() const { return seconds; } diff --git a/SimGear-1.9.1-shared.patch b/SimGear-1.9.1-shared.patch new file mode 100644 index 0000000..aff63c2 --- /dev/null +++ b/SimGear-1.9.1-shared.patch @@ -0,0 +1,994 @@ +diff -uNrp SimGear-1.9.1.orig/configure.ac SimGear-1.9.1/configure.ac +--- SimGear-1.9.1.orig/configure.ac 2009-01-25 13:03:56.000000000 +0100 ++++ SimGear-1.9.1/configure.ac 2009-02-03 22:37:33.000000000 +0100 +@@ -3,6 +3,7 @@ dnl script. + + AC_INIT + AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx]) ++AC_PROG_LIBTOOL + + dnl Require at least automake 2.52 + AC_PREREQ(2.52) +diff -uNrp SimGear-1.9.1.orig/simgear/bucket/Makefile.am SimGear-1.9.1/simgear/bucket/Makefile.am +--- SimGear-1.9.1.orig/simgear/bucket/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/bucket/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,10 +1,11 @@ + includedir = @includedir@/bucket + +-lib_LIBRARIES = libsgbucket.a ++lib_LTLIBRARIES = libsgbucket.la + + include_HEADERS = newbucket.hxx + +-libsgbucket_a_SOURCES = newbucket.cxx ++libsgbucket_la_SOURCES = newbucket.cxx ++libsgbucket_la_LDFLAGS = -release @VERSION@ -module + + # noinst_PROGRAMS = testbucket + +diff -uNrp SimGear-1.9.1.orig/simgear/debug/Makefile.am SimGear-1.9.1/simgear/debug/Makefile.am +--- SimGear-1.9.1.orig/simgear/debug/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/debug/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -2,10 +2,11 @@ includedir = @includedir@/debug + + EXTRA_DIST = logtest.cxx + +-lib_LIBRARIES = libsgdebug.a ++lib_LTLIBRARIES = libsgdebug.la + + include_HEADERS = debug_types.h logstream.hxx + +-libsgdebug_a_SOURCES = logstream.cxx ++libsgdebug_la_SOURCES = logstream.cxx ++libsgdebug_la_LDFLAGS = -release @VERSION@ -module + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/environment/Makefile.am SimGear-1.9.1/simgear/environment/Makefile.am +--- SimGear-1.9.1.orig/simgear/environment/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/environment/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,9 +1,17 @@ + includedir = @includedir@/environment + +-lib_LIBRARIES = libsgenvironment.a ++lib_LTLIBRARIES = libsgenvironment.la + + include_HEADERS = metar.hxx visual_enviro.hxx precipitation.hxx + +-libsgenvironment_a_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx ++libsgenvironment_la_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx ++libsgenvironment_la_LDFLAGS = -release @VERSION@ -module -lGL -lplibssg ++libsgenvironment_la_LIBADD = \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/sound/libsgsound.la \ ++ $(top_builddir)/simgear/scene/sky/libsgsky.la ++ $(top_builddir)/simgear/math/libsgmath.la + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/ephemeris/Makefile.am SimGear-1.9.1/simgear/ephemeris/Makefile.am +--- SimGear-1.9.1.orig/simgear/ephemeris/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/ephemeris/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/ephemeris + +-lib_LIBRARIES = libsgephem.a ++lib_LTLIBRARIES = libsgephem.la + + include_HEADERS = \ + celestialBody.hxx \ +@@ -16,7 +16,7 @@ include_HEADERS = \ + uranus.hxx \ + venus.hxx + +-libsgephem_a_SOURCES = \ ++libsgephem_la_SOURCES = \ + celestialBody.cxx \ + ephemeris.cxx \ + jupiter.cxx \ +@@ -31,4 +31,10 @@ libsgephem_a_SOURCES = \ + uranus.cxx \ + venus.cxx + ++libsgephem_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgephem_la_LIBADD = \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/io/Makefile.am SimGear-1.9.1/simgear/io/Makefile.am +--- SimGear-1.9.1.orig/simgear/io/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/io/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/io + +-lib_LIBRARIES = libsgio.a ++lib_LTLIBRARIES = libsgio.la + + include_HEADERS = \ + iochannel.hxx \ +@@ -11,7 +11,7 @@ include_HEADERS = \ + sg_socket.hxx \ + sg_socket_udp.hxx + +-libsgio_a_SOURCES = \ ++libsgio_la_SOURCES = \ + iochannel.cxx \ + lowlevel.cxx \ + sg_binobj.cxx \ +@@ -22,55 +22,82 @@ libsgio_a_SOURCES = \ + + INCLUDES = -I$(top_srcdir) + ++libsgio_la_LDFLAGS = -release @VERSION@ -module -lplibnet -lz ++ ++libsgio_la_LIBADD = \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la ++ + noinst_PROGRAMS = decode_binobj socktest lowtest tcp_server tcp_client + + tcp_server_SOURCES = tcp_server.cxx + +-tcp_server_LDADD = \ +- libsgio.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/bucket/libsgbucket.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ ++tcp_server_LDFLAGS = \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ + -lplibnet -lplibul -lz \ + $(network_LIBS) \ + $(base_LIBS) + + tcp_client_SOURCES = tcp_client.cxx + +-tcp_client_LDADD = \ +- libsgio.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/bucket/libsgbucket.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ ++tcp_client_LDFLAGS = \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ + -lplibnet -lplibul -lz \ + $(network_LIBS) \ + $(base_LIBS) + + socktest_SOURCES = socktest.cxx + +-socktest_LDADD = \ +- libsgio.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/bucket/libsgbucket.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- -lplibnet -lplibul -lz \ ++socktest_LDFLAGS = \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ -lplibnet -lz \ + $(network_LIBS) \ + $(base_LIBS) + + lowtest_SOURCES = lowtest.cxx + +-lowtest_LDADD = \ +- libsgio.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/bucket/libsgbucket.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- $(base_LIBS) -lz ++lowtest_LDFLAGS = \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(base_LIBS) -lz -lplibnet -lplibul + + decode_binobj_SOURCES = decode_binobj.cxx + +-decode_binobj_LDADD = \ +- libsgio.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/bucket/libsgbucket.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- $(base_LIBS) -lz ++decode_binobj_LDFLAGS = \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(base_LIBS) -lz -lplibnet -lplibul +diff -uNrp SimGear-1.9.1.orig/simgear/magvar/Makefile.am SimGear-1.9.1/simgear/magvar/Makefile.am +--- SimGear-1.9.1.orig/simgear/magvar/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/magvar/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,19 +1,21 @@ + includedir = @includedir@/magvar + +-lib_LIBRARIES = libsgmagvar.a ++lib_LTLIBRARIES = libsgmagvar.la + + include_HEADERS = magvar.hxx + +-libsgmagvar_a_SOURCES = \ ++libsgmagvar_la_SOURCES = \ + coremag.hxx coremag.cxx \ + magvar.cxx + ++libsgmagvar_la_LDFLAGS = -release @VERSION@ -module ++ + noinst_PROGRAMS = testmagvar + + testmagvar_SOURCES = testmagvar.cxx + +-testmagvar_LDADD = \ +- libsgmagvar.a \ ++testmagvar_LDFLAGS = \ ++ $(top_builddir)/simgear/magvar/libsgmagvar.la \ + $(base_LIBS) + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/Makefile.am SimGear-1.9.1/simgear/Makefile.am +--- SimGear-1.9.1.orig/simgear/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -14,23 +14,25 @@ include_HEADERS = \ + + SUBDIRS = \ + $(compatibility_DIR) \ +- xml \ + debug \ +- misc \ + structure \ ++ xml \ ++ props \ ++ misc \ + bucket \ + ephemeris \ ++ serial \ + io \ + magvar \ + math \ ++ sound \ ++ screen \ ++ scene/util \ ++ scene/sky \ + $(METAR_DIRS) \ + nasal \ +- props \ + route \ + scene \ +- screen \ +- serial \ +- sound \ + $(SGTHREAD_DIR) \ + timing + +diff -uNrp SimGear-1.9.1.orig/simgear/math/Makefile.am SimGear-1.9.1/simgear/math/Makefile.am +--- SimGear-1.9.1.orig/simgear/math/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/math/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -4,12 +4,20 @@ check_PROGRAMS = SGMathTest SGGeometryT + TESTS = $(check_PROGRAMS) + + SGMathTest_SOURCES = SGMathTest.cxx +-SGMathTest_LDADD = libsgmath.a $(base_LIBS) ++SGMathTest_LDFLAGS = $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ libsgmath.la $(base_LIBS) -lz -lplibnet -lplibul + + SGGeometryTest_SOURCES = SGGeometryTest.cxx +-SGGeometryTest_LDADD = libsgmath.a $(base_LIBS) ++SGGeometryTest_LDFLAGS = libsgmath.la $(base_LIBS) + +-lib_LIBRARIES = libsgmath.a ++lib_LTLIBRARIES = libsgmath.la + + include_HEADERS = \ + interpolater.hxx \ +@@ -44,7 +52,7 @@ include_HEADERS = \ + SGVec3.hxx \ + SGVec4.hxx + +-libsgmath_a_SOURCES = \ ++libsgmath_la_SOURCES = \ + interpolater.cxx \ + leastsqs.cxx \ + sg_random.c \ +@@ -52,4 +60,11 @@ libsgmath_a_SOURCES = \ + SGGeod.cxx \ + SGGeodesy.cxx + ++libsgmath_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgmath_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/props/libsgprops.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/misc/Makefile.am SimGear-1.9.1/simgear/misc/Makefile.am +--- SimGear-1.9.1.orig/simgear/misc/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/misc/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/misc + +-lib_LIBRARIES = libsgmisc.a ++lib_LTLIBRARIES = libsgmisc.la + + include_HEADERS = \ + sg_path.hxx \ +@@ -14,7 +14,7 @@ include_HEADERS = \ + stdint.hxx \ + PathOptions.hxx + +-libsgmisc_a_SOURCES = \ ++libsgmisc_la_SOURCES = \ + sg_path.cxx \ + sgstream.cxx \ + strutils.cxx \ +@@ -24,19 +24,23 @@ libsgmisc_a_SOURCES = \ + interpolator.cxx \ + PathOptions.cxx + +-noinst_PROGRAMS = tabbed_value_test swap_test ++libsgmisc_la_LDFLAGS = -release @VERSION@ -module -lz + +-tabbed_value_test_SOURCES = tabbed_values_test.cxx +-tabbed_value_test_LDADD = \ +- libsgmisc.a \ +- $(top_builddir)/simgear/xml/libsgxml.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a ++libsgmisc_la_LIBADD = \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ -losg -losgDB + +-$(top_builddir)/simgear/xml/libsgxml.a: +- cd $(top_builddir)/simgear/xml && $(MAKE) $(AM_MAKEFLAGS) libsgxml.a ++noinst_PROGRAMS = tabbed_value_test swap_test + +-$(top_builddir)/simgear/debug/libsgdebug.a: +- cd $(top_builddir)/simgear/debug && $(MAKE) $(AM_MAKEFLAGS) libsgdebug.a ++tabbed_value_test_SOURCES = tabbed_values_test.cxx ++tabbed_value_test_LDFLAGS = \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ -lz + + swap_test_SOURCES = swap_test.cpp + +diff -uNrp SimGear-1.9.1.orig/simgear/nasal/Makefile.am SimGear-1.9.1/simgear/nasal/Makefile.am +--- SimGear-1.9.1.orig/simgear/nasal/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/nasal/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,13 +1,15 @@ + includedir = @includedir@/nasal + +-lib_LIBRARIES = libsgnasal.a ++lib_LTLIBRARIES = libsgnasal.la + + include_HEADERS = nasal.h naref.h + +-libsgnasal_a_SOURCES = bitslib.c code.c code.h codegen.c data.h gc.c \ +- hash.c iolib.c iolib.h lex.c lib.c mathlib.c \ +- misc.c naref.h nasal.h parse.c parse.h string.c \ +- thread-posix.c thread-win32.c threadlib.c \ +- utf8lib.c vector.c ++libsgnasal_la_SOURCES = bitslib.c code.c code.h codegen.c data.h gc.c \ ++ hash.c iolib.c iolib.h lex.c lib.c mathlib.c \ ++ misc.c naref.h nasal.h parse.c parse.h string.c \ ++ thread-posix.c thread-win32.c threadlib.c \ ++ utf8lib.c vector.c ++ ++libsgnasal_la_LDFLAGS = -release @VERSION@ -module -lm -lpthread + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/props/Makefile.am SimGear-1.9.1/simgear/props/Makefile.am +--- SimGear-1.9.1.orig/simgear/props/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/props/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,25 +1,32 @@ + includedir = @includedir@/props + +-lib_LIBRARIES = libsgprops.a ++lib_LTLIBRARIES = libsgprops.la + + include_HEADERS = \ + condition.hxx \ + props.hxx \ + props_io.hxx + +-libsgprops_a_SOURCES = \ ++libsgprops_la_SOURCES = \ + condition.cxx \ + props.cxx \ + props_io.cxx + ++libsgprops_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgprops_la_LIBADD = \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la ++ + noinst_PROGRAMS = props_test + + props_test_SOURCES = props_test.cxx +-props_test_LDADD = \ +- libsgprops.a \ +- $(top_builddir)/simgear/xml/libsgxml.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/structure/libsgstructure.a ++props_test_LDFLAGS = \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ -lz + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/route/Makefile.am SimGear-1.9.1/simgear/route/Makefile.am +--- SimGear-1.9.1.orig/simgear/route/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/route/Makefile.am 2009-02-03 22:44:50.000000000 +0100 +@@ -1,35 +1,43 @@ + includedir = @includedir@/route + +-lib_LIBRARIES = libsgroute.a ++lib_LTLIBRARIES = libsgroute.la + + include_HEADERS = route.hxx waypoint.hxx + +-libsgroute_a_SOURCES = \ ++libsgroute_la_SOURCES = \ + route.cxx \ + waypoint.cxx + ++libsgroute_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgroute_la_LIBADD = \ ++ $(top_builddir)/simgear/math/libsgmath.la ++ + INCLUDES = -I$(top_srcdir) + + noinst_PROGRAMS = waytest routetest + + waytest_SOURCES = waytest.cxx + +-waytest_LDADD = \ +- libsgroute.a \ +- $(top_builddir)/simgear/math/libsgmath.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- $(top_builddir)/simgear/props/libsgprops.a \ +- $(top_builddir)/simgear/structure/libsgstructure.a \ +- $(top_builddir)/simgear/xml/libsgxml.a \ ++waytest_LDFLAGS = \ ++ $(top_builddir)/simgear/route/libsgroute.la \ ++ $(top_builddir)/simgear/math/libsgmath.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ + $(base_LIBS) \ + -lz + + routetest_SOURCES = routetest.cxx + +-routetest_LDADD = \ +- libsgroute.a \ +- $(top_builddir)/simgear/math/libsgmath.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/structure/libsgstructure.a \ +- $(base_LIBS) ++routetest_LDFLAGS = \ ++ $(top_builddir)/simgear/route/libsgroute.la \ ++ $(top_builddir)/simgear/math/libsgmath.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ ++ $(base_LIBS) -lz +Binary files SimGear-1.9.1.orig/simgear/route/.Makefile.am.orig.swp and SimGear-1.9.1/simgear/route/.Makefile.am.orig.swp differ +Binary files SimGear-1.9.1.orig/simgear/route/.Makefile.am.rej.swp and SimGear-1.9.1/simgear/route/.Makefile.am.rej.swp differ +diff -uNrp SimGear-1.9.1.orig/simgear/scene/material/Makefile.am SimGear-1.9.1/simgear/scene/material/Makefile.am +--- SimGear-1.9.1.orig/simgear/scene/material/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/material/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/scene/material + +-lib_LIBRARIES = libsgmaterial.a ++lib_LTLIBRARIES = libsgmaterial.la + + noinst_HEADERS = + +@@ -9,9 +9,17 @@ include_HEADERS = \ + matlib.hxx \ + matmodel.hxx + +-libsgmaterial_a_SOURCES = \ ++libsgmaterial_la_SOURCES = \ + mat.cxx \ + matlib.cxx \ + matmodel.cxx + ++libsgmaterial_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lGL ++ ++libsgmaterial_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/math/libsgmath.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/scene/model/Makefile.am SimGear-1.9.1/simgear/scene/model/Makefile.am +--- SimGear-1.9.1.orig/simgear/scene/model/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/model/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/scene/model + +-lib_LIBRARIES = libsgmodel.a ++lib_LTLIBRARIES = libsgmodel.la + + noinst_HEADERS = + +@@ -25,7 +25,7 @@ include_HEADERS = \ + SGScaleTransform.hxx \ + SGTranslateTransform.hxx + +-libsgmodel_a_SOURCES = \ ++libsgmodel_la_SOURCES = \ + animation.cxx \ + particles.cxx \ + location.cxx \ +@@ -46,4 +46,14 @@ libsgmodel_a_SOURCES = \ + SGScaleTransform.cxx \ + SGTranslateTransform.cxx + ++libsgmodel_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibsg -lGL ++ ++libsgmodel_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/screen/libsgscreen.la \ ++ $(top_builddir)/simgear/environment/libsgenvironment.la \ ++ $(top_builddir)/simgear/math/libsgmath.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/scene/sky/Makefile.am SimGear-1.9.1/simgear/scene/sky/Makefile.am +--- SimGear-1.9.1.orig/simgear/scene/sky/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/sky/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/scene/sky + +-lib_LIBRARIES = libsgsky.a ++lib_LTLIBRARIES = libsgsky.la + + include_HEADERS = \ + cloud.hxx \ +@@ -15,7 +15,7 @@ include_HEADERS = \ + newcloud.hxx \ + CloudShaderGeometry.hxx + +-libsgsky_a_SOURCES = \ ++libsgsky_la_SOURCES = \ + cloud.cxx \ + dome.cxx \ + moon.cxx \ +@@ -28,4 +28,15 @@ libsgsky_a_SOURCES = \ + newcloud.cxx \ + CloudShaderGeometry.cxx + ++libsgsky_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibul -lplibsg \ ++ -lGL -lGLU ++ ++libsgsky_la_LIBADD = \ ++ $(top_builddir)/simgear/screen/libsgscreen.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/math/libsgmath.la \ ++ $(top_builddir)/simgear/scene/util/libsgutil.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/scene/tgdb/Makefile.am SimGear-1.9.1/simgear/scene/tgdb/Makefile.am +--- SimGear-1.9.1.orig/simgear/scene/tgdb/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/tgdb/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/scene/tgdb + +-lib_LIBRARIES = libsgtgdb.a ++lib_LTLIBRARIES = libsgtgdb.la + + noinst_HEADERS = + +@@ -24,7 +24,7 @@ include_HEADERS = \ + TileCache.hxx \ + TileEntry.hxx + +-libsgtgdb_a_SOURCES = \ ++libsgtgdb_la_SOURCES = \ + apt_signs.cxx \ + obj.cxx \ + pt_lights.cxx \ +@@ -40,4 +40,14 @@ libsgtgdb_a_SOURCES = \ + TileEntry.cxx \ + TreeBin.cxx TreeBin.hxx + ++libsgtgdb_la_LDFLAGS = -release @VERSION@ -module -lplibssg -lplibul -lGL ++ ++libsgtgdb_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/bucket/libsgbucket.la \ ++ $(top_builddir)/simgear/io/libsgio.la \ ++ $(top_builddir)/simgear/scene/material/libsgmaterial.la \ ++ $(top_builddir)/simgear/screen/libsgscreen.la \ ++ $(top_builddir)/simgear/math/libsgmath.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/scene/util/Makefile.am SimGear-1.9.1/simgear/scene/util/Makefile.am +--- SimGear-1.9.1.orig/simgear/scene/util/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/util/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/scene/util + +-lib_LIBRARIES = libsgutil.a ++lib_LTLIBRARIES = libsgutil.la + + noinst_HEADERS = + +@@ -21,7 +21,7 @@ include_HEADERS = \ + VectorArrayAdapter.hxx + + +-libsgutil_a_SOURCES = \ ++libsgutil_la_SOURCES = \ + SGEnlargeBoundingBox.cxx \ + SGSceneFeatures.cxx \ + SGSceneUserData.cxx \ +@@ -31,4 +31,6 @@ libsgutil_a_SOURCES = \ + StateAttributeFactory.cxx \ + QuadTreeBuilder.cxx + ++libsgutil_la_LDFLAGS = -release @VERSION@ -module ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/screen/Makefile.am SimGear-1.9.1/simgear/screen/Makefile.am +--- SimGear-1.9.1.orig/simgear/screen/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/screen/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/screen + +-lib_LIBRARIES = libsgscreen.a ++lib_LTLIBRARIES = libsgscreen.la + + EXTRA_DIST = jpgfactory.cxx jpgfactory.hxx + +@@ -24,7 +24,7 @@ include_HEADERS = \ + shader.h \ + tr.h + +-libsgscreen_a_SOURCES = \ ++libsgscreen_la_SOURCES = \ + texture.cxx \ + GLBitmaps.cxx \ + $(IMAGE_SERVER_SRCS) \ +@@ -35,15 +35,21 @@ libsgscreen_a_SOURCES = \ + shader.cpp \ + win32-printer.h + ++libsgscreen_la_LDFLAGS = -release @VERSION@ -module -lGL -lGLU -lX11 -lz \ ++ -ldl -ljpeg -lplibssg ++ ++libsgscreen_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la ++ + if HAVE_GLUT + noinst_PROGRAMS = TestRenderTexture + + TestRenderTexture_SOURCES = TestRenderTexture.cpp + +-TestRenderTexture_LDADD = \ +- libsgscreen.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(opengl_LIBS) ++TestRenderTexture_LDFLAGS = \ ++ $(top_builddir)/simgear/screen/libsgscreen.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(opengl_LIBS) -lz -lplibssg -ljpeg + endif + + INCLUDES = -I$(top_srcdir) -I$(top_builddir) -DGLX_GLXEXT_PROTOTYPES +diff -uNrp SimGear-1.9.1.orig/simgear/serial/Makefile.am SimGear-1.9.1/simgear/serial/Makefile.am +--- SimGear-1.9.1.orig/simgear/serial/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/serial/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,17 +1,21 @@ + includedir = @includedir@/serial + +-lib_LIBRARIES = libsgserial.a ++lib_LTLIBRARIES = libsgserial.la + + include_HEADERS = serial.hxx + +-libsgserial_a_SOURCES = serial.cxx ++libsgserial_la_SOURCES = serial.cxx ++ ++libsgserial_la_LDFLAGS = -release @VERSION@ -module ++libsgserial_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la + + noinst_PROGRAMS = testserial + + testserial_SOURCES = testserial.cxx + +-testserial_LDADD = \ +- libsgserial.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a ++testserial_LDFLAGS = \ ++ $(top_builddir)/simgear/serial/libsgserial.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la + + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/sound/Makefile.am SimGear-1.9.1/simgear/sound/Makefile.am +--- SimGear-1.9.1.orig/simgear/sound/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/sound/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -2,7 +2,7 @@ includedir = @includedir@/sound + + EXTRA_DIST = jet.wav + +-lib_LIBRARIES = libsgsound.a ++lib_LTLIBRARIES = libsgsound.la + + noinst_HEADERS = + +@@ -11,25 +11,33 @@ include_HEADERS = \ + soundmgr_openal.hxx \ + xmlsound.hxx + +-libsgsound_a_SOURCES = \ ++libsgsound_la_SOURCES = \ + sample_openal.cxx \ + soundmgr_openal.cxx \ + xmlsound.cxx + ++libsgsound_la_LDFLAGS = -release @VERSION@ -module $(openal_LIBS) ++libsgsound_la_LIBADD = \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/props/libsgprops.la ++ + noinst_PROGRAMS = openal_test1 openal_test2 + + openal_test1_SOURCES = openal_test1.cxx + openal_test2_SOURCES = openal_test2.cxx + +-openal_test1_LDADD = \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ ++openal_test1_LDFLAGS = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ + $(openal_LIBS) + +-openal_test2_LDADD = \ +- libsgsound.a \ +- $(top_builddir)/simgear/debug/libsgdebug.a \ +- $(top_builddir)/simgear/misc/libsgmisc.a \ +- $(top_builddir)/simgear/structure/libsgstructure.a \ ++openal_test2_LDFLAGS = \ ++ $(top_builddir)/simgear/sound/libsgsound.la \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la \ ++ $(top_builddir)/simgear/structure/libsgstructure.la \ ++ $(top_builddir)/simgear/props/libsgprops.la \ ++ $(top_builddir)/simgear/xml/libsgxml.la \ + $(openal_LIBS) + + INCLUDES = -I$(top_srcdir) -DSRC_DIR=\"$(top_srcdir)/simgear/sound\" +diff -uNrp SimGear-1.9.1.orig/simgear/structure/Makefile.am SimGear-1.9.1/simgear/structure/Makefile.am +--- SimGear-1.9.1.orig/simgear/structure/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/structure/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/structure + +-lib_LIBRARIES = libsgstructure.a ++lib_LTLIBRARIES = libsgstructure.la + + include_HEADERS = \ + callback.hxx \ +@@ -19,7 +19,7 @@ include_HEADERS = \ + SGSmplstat.hxx \ + Singleton.hxx + +-libsgstructure_a_SOURCES = \ ++libsgstructure_la_SOURCES = \ + commands.cxx \ + exception.cxx \ + event_mgr.cxx\ +@@ -30,5 +30,10 @@ libsgstructure_a_SOURCES = \ + SGSmplhist.cxx \ + SGSmplstat.cxx + ++libsgstructure_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgstructure_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la ++ + INCLUDES = -I$(top_srcdir) + +diff -uNrp SimGear-1.9.1.orig/simgear/structure/Makefile.am.orig SimGear-1.9.1/simgear/structure/Makefile.am.orig +--- SimGear-1.9.1.orig/simgear/structure/Makefile.am.orig 1970-01-01 01:00:00.000000000 +0100 ++++ SimGear-1.9.1/simgear/structure/Makefile.am.orig 2009-02-03 22:37:33.000000000 +0100 +@@ -0,0 +1,34 @@ ++includedir = @includedir@/structure ++ ++lib_LIBRARIES = libsgstructure.a ++ ++include_HEADERS = \ ++ callback.hxx \ ++ commands.hxx \ ++ exception.hxx \ ++ event_mgr.hxx \ ++ subsystem_mgr.hxx \ ++ OSGUtils.hxx \ ++ OSGVersion.hxx \ ++ SGAtomic.hxx \ ++ SGBinding.hxx \ ++ SGExpression.hxx \ ++ SGReferenced.hxx \ ++ SGSharedPtr.hxx \ ++ SGSmplhist.hxx \ ++ SGSmplstat.hxx \ ++ Singleton.hxx ++ ++libsgstructure_a_SOURCES = \ ++ commands.cxx \ ++ exception.cxx \ ++ event_mgr.cxx\ ++ subsystem_mgr.cxx \ ++ SGAtomic.cxx \ ++ SGBinding.cxx \ ++ SGExpression.cxx \ ++ SGSmplhist.cxx \ ++ SGSmplstat.cxx ++ ++INCLUDES = -I$(top_srcdir) ++ +diff -uNrp SimGear-1.9.1.orig/simgear/structure/Makefile.am.rej SimGear-1.9.1/simgear/structure/Makefile.am.rej +--- SimGear-1.9.1.orig/simgear/structure/Makefile.am.rej 1970-01-01 01:00:00.000000000 +0100 ++++ SimGear-1.9.1/simgear/structure/Makefile.am.rej 2009-02-03 22:37:33.000000000 +0100 +@@ -0,0 +1,17 @@ ++*************** ++*** 17,23 **** ++ SGSmplhist.hxx \ ++ SGSmplstat.hxx ++ ++- libsgstructure_a_SOURCES = \ ++ commands.cxx \ ++ exception.cxx \ ++ event_mgr.cxx\ ++--- 17,23 ---- ++ SGSmplhist.hxx \ ++ SGSmplstat.hxx ++ +++ libsgstructure_la_SOURCES = \ ++ commands.cxx \ ++ exception.cxx \ ++ event_mgr.cxx\ +diff -uNrp SimGear-1.9.1.orig/simgear/threads/Makefile.am SimGear-1.9.1/simgear/threads/Makefile.am +--- SimGear-1.9.1.orig/simgear/threads/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/threads/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,13 +1,15 @@ + includedir = @includedir@/threads + +-lib_LIBRARIES = libsgthreads.a ++lib_LTLIBRARIES = libsgthreads.la + + include_HEADERS = \ + SGGuard.hxx \ + SGQueue.hxx \ + SGThread.hxx + +-libsgthreads_a_SOURCES = \ ++libsgthreads_la_SOURCES = \ + SGThread.cxx + ++libsgthreads_la_LDFLAGS = -release @VERSION@ -module ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/timing/Makefile.am SimGear-1.9.1/simgear/timing/Makefile.am +--- SimGear-1.9.1.orig/simgear/timing/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/timing/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/timing + +-lib_LIBRARIES = libsgtiming.a ++lib_LTLIBRARIES = libsgtiming.la + + include_HEADERS = \ + geocoord.h \ +@@ -9,11 +9,17 @@ include_HEADERS = \ + timestamp.hxx \ + timezone.h + +-libsgtiming_a_SOURCES = \ ++libsgtiming_la_SOURCES = \ + geocoord.cxx \ + lowleveltime.cxx \ + sg_time.cxx \ + timestamp.cxx \ + timezone.cxx + ++libsgtiming_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgtiming_la_LIBADD = \ ++ $(top_builddir)/simgear/debug/libsgdebug.la \ ++ $(top_builddir)/simgear/misc/libsgmisc.la ++ + INCLUDES = -I$(top_srcdir) +diff -uNrp SimGear-1.9.1.orig/simgear/xml/Makefile.am SimGear-1.9.1/simgear/xml/Makefile.am +--- SimGear-1.9.1.orig/simgear/xml/Makefile.am 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/xml/Makefile.am 2009-02-03 22:37:33.000000000 +0100 +@@ -1,6 +1,6 @@ + includedir = @includedir@/xml + +-lib_LIBRARIES = libsgxml.a ++lib_LTLIBRARIES = libsgxml.la + + include_HEADERS = \ + easyxml.hxx +@@ -8,7 +8,7 @@ include_HEADERS = \ + noinst_HEADERS = \ + xmltok_impl.c xmltok_ns.c + +-libsgxml_a_SOURCES = \ ++libsgxml_la_SOURCES = \ + asciitab.h \ + easyxml.cxx \ + hashtable.h hashtable.c \ +@@ -18,4 +18,9 @@ libsgxml_a_SOURCES = \ + xmltok.h xmltok.c \ + xmltok_impl.h + ++libsgxml_la_LDFLAGS = -release @VERSION@ -module ++ ++libsgxml_la_LIBADD = \ ++ $(top_builddir)/simgear/structure/libsgstructure.la ++ + INCLUDES = -I$(top_srcdir) diff --git a/SimGear-1.9.1-untangle.patch b/SimGear-1.9.1-untangle.patch new file mode 100644 index 0000000..0fdb64f --- /dev/null +++ b/SimGear-1.9.1-untangle.patch @@ -0,0 +1,3432 @@ +diff -uNrp SimGear-1.9.1.orig/simgear/misc/sg_path.cxx SimGear-1.9.1/simgear/misc/sg_path.cxx +--- SimGear-1.9.1.orig/simgear/misc/sg_path.cxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/misc/sg_path.cxx 2009-02-03 22:50:13.000000000 +0100 +@@ -35,42 +35,6 @@ + #include "sg_path.hxx" + + +-/** +- * define directory path separators +- */ +- +-static const char sgDirPathSep = '/'; +-static const char sgDirPathSepBad = '\\'; +- +-#if defined( WIN32 ) && !defined(__CYGWIN__) +-static const char sgSearchPathSep = ';'; +-#else +-static const char sgSearchPathSep = ':'; +-#endif +- +- +-// If Unix, replace all ":" with "/". If MacOS, replace all "/" with +-// ":" it should go without saying that neither of these characters +-// should be used in file or directory names. In windoze, allow the +-// second character to be a ":" for things like c:\foo\bar +- +-void +-SGPath::fix() +-{ +- for ( string::size_type i = 0; i < path.size(); ++i ) { +-#if defined( WIN32 ) +- // for windoze, don't replace the ":" for the second character +- if ( i == 1 ) { +- continue; +- } +-#endif +- if ( path[i] == sgDirPathSepBad ) { +- path[i] = sgDirPathSep; +- } +- } +-} +- +- + // default constructor + SGPath::SGPath() + : path("") +@@ -78,19 +42,6 @@ SGPath::SGPath() + } + + +-// create a path based on "path" +-SGPath::SGPath( const std::string& p ) +- : path(p) +-{ +- fix(); +-} +- +- +-// destructor +-SGPath::~SGPath() { +-} +- +- + // set path + void SGPath::set( const string& p ) { + path = p; +@@ -98,40 +49,15 @@ void SGPath::set( const string& p ) { + } + + +-// append another piece to the existing path +-void SGPath::append( const string& p ) { +- if ( path.size() == 0 ) { +- path = p; +- } else { +- if ( p[0] != sgDirPathSep ) { +- path += sgDirPathSep; +- } +- path += p; +- } +- fix(); +-} +- + //add a new path component to the existing path string + void SGPath::add( const string& p ) { +- append( sgSearchPathSep+p ); +-} +- +- +-// concatenate a string to the end of the path without inserting a +-// path separator +-void SGPath::concat( const string& p ) { +- if ( path.size() == 0 ) { +- path = p; +- } else { +- path += p; +- } +- fix(); ++ append( SGPATH_sgSearchPathSep+p ); + } + + + // Get the file part of the path (everything after the last path sep) + string SGPath::file() const { +- int index = path.rfind(sgDirPathSep); ++ int index = path.rfind(SGPATH_sgDirPathSep); + if (index >= 0) { + return path.substr(index + 1); + } else { +@@ -140,16 +66,6 @@ string SGPath::file() const { + } + + +-// get the directory part of the path. +-string SGPath::dir() const { +- int index = path.rfind(sgDirPathSep); +- if (index >= 0) { +- return path.substr(0, index); +- } else { +- return ""; +- } +-} +- + // get the base part of the path (everything but the extension.) + string SGPath::base() const { + int index = path.rfind("."); +@@ -180,91 +96,3 @@ bool SGPath::exists() const { + fclose(fp); + return true; + } +- +-#if defined( _MSC_VER) || defined(__MINGW32__) +-# define sgMkDir(d,m) _mkdir(d) +-#else +-# define sgMkDir(d,m) mkdir(d,m) +-#endif +- +- +-int SGPath::create_dir( mode_t mode ) { +- string_list dirlist = sgPathSplit(dir()); +- if ( dirlist.empty() ) +- return -1; +- string path = dirlist[0]; +- string_list path_elements = sgPathBranchSplit(path); +- bool absolute = !path.empty() && path[0] == sgDirPathSep; +- +- unsigned int i = 1; +- SGPath dir = absolute ? string( 1, sgDirPathSep ) : ""; +- dir.concat( path_elements[0] ); +-#if defined( _MSC_VER) || defined(__MINGW32__) +- if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) { +- dir.append( path_elements[1] ); +- i = 2; +- } +-#endif +- struct stat info; +- int r; +- for(; ( r = stat( dir.c_str(), &info ) ) == 0 && i < path_elements.size(); i++) { +- dir.append(path_elements[i]); +- } +- if ( r == 0 ) { +- return 0; // Directory already exists +- } +- if ( sgMkDir( dir.c_str(), mode) ) { +- SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); +- return -2; +- } +- for(; i < path_elements.size(); i++) { +- dir.append(path_elements[i]); +- if ( sgMkDir( dir.c_str(), mode) ) { +- SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); +- return -2; +- } +- } +- +- return 0; +-} +- +-string_list sgPathBranchSplit( const string &dirpath ) { +- string_list path_elements; +- string element, path = dirpath; +- while ( path.size() ) { +- size_t p = path.find( sgDirPathSep ); +- if ( p != string::npos ) { +- element = path.substr( 0, p ); +- path.erase( 0, p + 1 ); +- } else { +- element = path; +- path = ""; +- } +- if ( element.size() ) +- path_elements.push_back( element ); +- } +- return path_elements; +-} +- +- +-string_list sgPathSplit( const string &search_path ) { +- string tmp = search_path; +- string_list result; +- result.clear(); +- +- bool done = false; +- +- while ( !done ) { +- int index = tmp.find(sgSearchPathSep); +- if (index >= 0) { +- result.push_back( tmp.substr(0, index) ); +- tmp = tmp.substr( index + 1 ); +- } else { +- if ( !tmp.empty() ) +- result.push_back( tmp ); +- done = true; +- } +- } +- +- return result; +-} +diff -uNrp SimGear-1.9.1.orig/simgear/misc/sg_path.hxx SimGear-1.9.1/simgear/misc/sg_path.hxx +--- SimGear-1.9.1.orig/simgear/misc/sg_path.hxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/misc/sg_path.hxx 2009-02-03 22:50:13.000000000 +0100 +@@ -34,6 +34,7 @@ + #include + + #include ++#include + + using std::string; + +@@ -42,6 +43,67 @@ using std::string; + #endif + + /** ++ * define directory path separators ++ */ ++ ++static const char SGPATH_sgDirPathSep = '/'; ++static const char SGPATH_sgDirPathSepBad = '\\'; ++ ++#if defined( WIN32 ) && !defined(__CYGWIN__) ++static const char SGPATH_sgSearchPathSep = ';'; ++#else ++static const char SGPATH_sgSearchPathSep = ':'; ++#endif ++ ++/** ++ * Split a directory string into a list of it's parent directories. ++ */ ++static inline string_list sgPathBranchSplit( const string &dirpath ) { ++ string_list path_elements; ++ string element, path = dirpath; ++ while ( path.size() ) { ++ size_t p = path.find( SGPATH_sgDirPathSep ); ++ if ( p != string::npos ) { ++ element = path.substr( 0, p ); ++ path.erase( 0, p + 1 ); ++ } else { ++ element = path; ++ path = ""; ++ } ++ if ( element.size() ) ++ path_elements.push_back( element ); ++ } ++ return path_elements; ++} ++ ++ ++/** ++ * Split a directory search path into a vector of individual paths ++ */ ++static inline string_list sgPathSplit( const string &search_path ) { ++ string tmp = search_path; ++ string_list result; ++ result.clear(); ++ ++ bool done = false; ++ ++ while ( !done ) { ++ int index = tmp.find(SGPATH_sgSearchPathSep); ++ if (index >= 0) { ++ result.push_back( tmp.substr(0, index) ); ++ tmp = tmp.substr( index + 1 ); ++ } else { ++ if ( !tmp.empty() ) ++ result.push_back( tmp ); ++ done = true; ++ } ++ } ++ ++ return result; ++} ++ ++ ++/** + * A class to hide path separator difference across platforms and assist + * in managing file system path names. + * +@@ -64,10 +126,13 @@ public: + * Construct a path based on the starting path provided. + * @param p initial path + */ +- SGPath( const string& p ); ++ SGPath( const string& p ) : path(p) ++ { ++ fix(); ++ } + + /** Destructor */ +- ~SGPath(); ++ ~SGPath() {} + + /** + * Set path to a new value +@@ -80,7 +145,17 @@ public: + * Append another piece to the existing path. Inserts a path + * separator between the existing component and the new component. + * @param p additional path component */ +- void append( const string& p ); ++ void append( const string& p ) { ++ if ( path.size() == 0 ) { ++ path = p; ++ } else { ++ if ( p[0] != SGPATH_sgDirPathSep ) { ++ path += SGPATH_sgDirPathSep; ++ } ++ path += p; ++ } ++ fix(); ++ } + + /** + * Append a new piece to the existing path. Inserts a search path +@@ -93,7 +168,14 @@ public: + * path separator. + * @param p additional path suffix + */ +- void concat( const string& p ); ++ void concat( const string& p ) { ++ if ( path.size() == 0 ) { ++ path = p; ++ } else { ++ path += p; ++ } ++ fix(); ++ } + + /** + * Get the file part of the path (everything after the last path sep) +@@ -105,7 +187,14 @@ public: + * Get the directory part of the path. + * @return directory string + */ +- string dir() const; ++ string dir() const { ++ int index = path.rfind(SGPATH_sgDirPathSep); ++ if (index >= 0) { ++ return path.substr(0, index); ++ } else { ++ return ""; ++ } ++ } + + /** + * Get the base part of the path (everything but the extension.) +@@ -141,26 +230,77 @@ public: + * Create the designated directory. + * @return 0 on success, or <0 on failure. + */ +- int create_dir(mode_t mode); ++ int create_dir(mode_t mode) { ++ string_list dirlist = sgPathSplit(dir()); ++ if ( dirlist.empty() ) ++ return -1; ++ string path = dirlist[0]; ++ string_list path_elements = sgPathBranchSplit(path); ++ bool absolute = !path.empty() && path[0] == SGPATH_sgDirPathSep; ++ ++ unsigned int i = 1; ++ SGPath dir = absolute ? string( 1, SGPATH_sgDirPathSep ) : ""; ++ dir.concat( path_elements[0] ); ++#if defined( _MSC_VER) || defined(__MINGW32__) ++ if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) { ++ dir.append( path_elements[1] ); ++ i = 2; ++ } ++#endif ++ struct stat info; ++ int r; ++ for(; ( r = stat( dir.c_str(), &info ) ) == 0 && i < path_elements.size(); i++) { ++ dir.append(path_elements[i]); ++ } ++ if ( r == 0 ) { ++ return 0; // Directory already exists ++ } ++#if defined( _MSC_VER) || defined(__MINGW32__) ++# define sgMkDir(d,m) _mkdir(d) ++#else ++# define sgMkDir(d,m) mkdir(d,m) ++#endif ++ if ( sgMkDir( dir.c_str(), mode) ) { ++ SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); ++ return -2; ++ } ++ for(; i < path_elements.size(); i++) { ++ dir.append(path_elements[i]); ++ if ( sgMkDir( dir.c_str(), mode) ) { ++ SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() ); ++ return -2; ++ } ++ } ++#undef sgMkDir ++ ++ return 0; ++ } + + private: + +- void fix(); ++ // If Unix, replace all ":" with "/". If MacOS, replace all "/" with ++ // ":" it should go without saying that neither of these characters ++ // should be used in file or directory names. In windoze, allow the ++ // second character to be a ":" for things like c:\foo\bar ++ ++ void fix() ++ { ++ for ( string::size_type i = 0; i < path.size(); ++i ) { ++#if defined( WIN32 ) ++ // for windoze, don't replace the ":" for the second character ++ if ( i == 1 ) { ++ continue; ++ } ++#endif ++ if ( path[i] == SGPATH_sgDirPathSepBad ) { ++ path[i] = SGPATH_sgDirPathSep; ++ } ++ } ++ } + + }; + + +-/** +- * Split a directory string into a list of it's parent directories. +- */ +-string_list sgPathBranchSplit( const string &path ); +- +-/** +- * Split a directory search path into a vector of individual paths +- */ +-string_list sgPathSplit( const string &search_path ); +- +- + #endif // _SG_PATH_HXX + + +diff -uNrp SimGear-1.9.1.orig/simgear/props/props.cxx SimGear-1.9.1/simgear/props/props.cxx +--- SimGear-1.9.1.orig/simgear/props/props.cxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/props/props.cxx 2009-02-03 22:50:13.000000000 +0100 +@@ -314,60 +314,6 @@ find_node (SGPropertyNode * current, + //////////////////////////////////////////////////////////////////////// + + inline bool +-SGPropertyNode::get_bool () const +-{ +- if (_tied) +- return _value.bool_val->getValue(); +- else +- return _local_val.bool_val; +-} +- +-inline int +-SGPropertyNode::get_int () const +-{ +- if (_tied) +- return _value.int_val->getValue(); +- else +- return _local_val.int_val; +-} +- +-inline long +-SGPropertyNode::get_long () const +-{ +- if (_tied) +- return _value.long_val->getValue(); +- else +- return _local_val.long_val; +-} +- +-inline float +-SGPropertyNode::get_float () const +-{ +- if (_tied) +- return _value.float_val->getValue(); +- else +- return _local_val.float_val; +-} +- +-inline double +-SGPropertyNode::get_double () const +-{ +- if (_tied) +- return _value.double_val->getValue(); +- else +- return _local_val.double_val; +-} +- +-inline const char * +-SGPropertyNode::get_string () const +-{ +- if (_tied) +- return _value.string_val->getValue(); +- else +- return _local_val.string_val; +-} +- +-inline bool + SGPropertyNode::set_bool (bool val) + { + if (_tied) { +@@ -1172,40 +1118,6 @@ SGPropertyNode::getFloatValue () const + } + } + +-double +-SGPropertyNode::getDoubleValue () const +-{ +- // Shortcut for common case +- if (_attr == (READ|WRITE) && _type == DOUBLE) +- return get_double(); +- +- if (getAttribute(TRACE_READ)) +- trace_read(); +- if (!getAttribute(READ)) +- return SGRawValue::DefaultValue; +- +- switch (_type) { +- case ALIAS: +- return _value.alias->getDoubleValue(); +- case BOOL: +- return double(get_bool()); +- case INT: +- return double(get_int()); +- case LONG: +- return double(get_long()); +- case FLOAT: +- return double(get_float()); +- case DOUBLE: +- return get_double(); +- case STRING: +- case UNSPECIFIED: +- return strtod(get_string(), 0); +- case NONE: +- default: +- return SGRawValue::DefaultValue; +- } +-} +- + const char * + SGPropertyNode::getStringValue () const + { +diff -uNrp SimGear-1.9.1.orig/simgear/props/props.cxx.orig SimGear-1.9.1/simgear/props/props.cxx.orig +--- SimGear-1.9.1.orig/simgear/props/props.cxx.orig 1970-01-01 01:00:00.000000000 +0100 ++++ SimGear-1.9.1/simgear/props/props.cxx.orig 2009-01-25 13:00:32.000000000 +0100 +@@ -0,0 +1,2378 @@ ++// props.cxx - implementation of a property list. ++// Started Fall 2000 by David Megginson, david@megginson.com ++// This code is released into the Public Domain. ++// ++// See props.html for documentation [replace with URL when available]. ++// ++// $Id$ ++ ++#include "props.hxx" ++ ++#include ++ ++#include ++#include ++#include ++ ++#if PROPS_STANDALONE ++#include ++#else ++ ++#include ++#include ++ ++#if ( _MSC_VER == 1200 ) ++// MSVC 6 is buggy, and needs something strange here ++using std::vector; ++using std::vector; ++using std::vector; ++#endif ++#endif ++ ++#if PROPS_STANDALONE ++using std::cerr; ++#endif ++using std::endl; ++using std::find; ++using std::sort; ++using std::string; ++using std::vector; ++using std::stringstream; ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Local classes. ++//////////////////////////////////////////////////////////////////////// ++ ++/** ++ * Comparator class for sorting by index. ++ */ ++class CompareIndices ++{ ++public: ++ int operator() (const SGPropertyNode_ptr n1, const SGPropertyNode_ptr n2) const { ++ return (n1->getIndex() < n2->getIndex()); ++ } ++}; ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Convenience macros for value access. ++//////////////////////////////////////////////////////////////////////// ++ ++#define TEST_READ(dflt) if (!getAttribute(READ)) return dflt ++#define TEST_WRITE if (!getAttribute(WRITE)) return false ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Default values for every type. ++//////////////////////////////////////////////////////////////////////// ++ ++template<> const bool SGRawValue::DefaultValue = false; ++template<> const int SGRawValue::DefaultValue = 0; ++template<> const long SGRawValue::DefaultValue = 0L; ++template<> const float SGRawValue::DefaultValue = 0.0; ++template<> const double SGRawValue::DefaultValue = 0.0L; ++template<> const char * const SGRawValue::DefaultValue = ""; ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Local path normalization code. ++//////////////////////////////////////////////////////////////////////// ++ ++/** ++ * A component in a path. ++ */ ++struct PathComponent ++{ ++ string name; ++ int index; ++}; ++ ++/** ++ * Parse the name for a path component. ++ * ++ * Name: [_a-zA-Z][-._a-zA-Z0-9]* ++ */ ++static inline const string ++parse_name (const string &path, int &i) ++{ ++ string name = ""; ++ int max = path.size(); ++ ++ if (path[i] == '.') { ++ i++; ++ if (i < max && path[i] == '.') { ++ i++; ++ name = ".."; ++ } else { ++ name = "."; ++ } ++ if (i < max && path[i] != '/') ++ throw string("illegal character after " + name); ++ } ++ ++ else if (isalpha(path[i]) || path[i] == '_') { ++ name += path[i]; ++ i++; ++ ++ // The rules inside a name are a little ++ // less restrictive. ++ while (i < max) { ++ if (isalpha(path[i]) || isdigit(path[i]) || path[i] == '_' || ++ path[i] == '-' || path[i] == '.') { ++ name += path[i]; ++ } else if (path[i] == '[' || path[i] == '/') { ++ break; ++ } else { ++ throw string("name may contain only ._- and alphanumeric characters"); ++ } ++ i++; ++ } ++ } ++ ++ else { ++ if (name.size() == 0) ++ throw string("name must begin with alpha or '_'"); ++ } ++ ++ return name; ++} ++ ++ ++/** ++ * Parse the optional integer index for a path component. ++ * ++ * Index: "[" [0-9]+ "]" ++ */ ++static inline int ++parse_index (const string &path, int &i) ++{ ++ int index = 0; ++ ++ if (path[i] != '[') ++ return 0; ++ else ++ i++; ++ ++ for (int max = path.size(); i < max; i++) { ++ if (isdigit(path[i])) { ++ index = (index * 10) + (path[i] - '0'); ++ } else if (path[i] == ']') { ++ i++; ++ return index; ++ } else { ++ break; ++ } ++ } ++ ++ throw string("unterminated index (looking for ']')"); ++} ++ ++ ++/** ++ * Parse a single path component. ++ * ++ * Component: Name Index? ++ */ ++static inline PathComponent ++parse_component (const string &path, int &i) ++{ ++ PathComponent component; ++ component.name = parse_name(path, i); ++ if (component.name[0] != '.') ++ component.index = parse_index(path, i); ++ else ++ component.index = -1; ++ return component; ++} ++ ++ ++/** ++ * Parse a path into its components. ++ */ ++static void ++parse_path (const string &path, vector &components) ++{ ++ int pos = 0; ++ int max = path.size(); ++ ++ // Check for initial '/' ++ if (path[pos] == '/') { ++ PathComponent root; ++ root.name = ""; ++ root.index = -1; ++ components.push_back(root); ++ pos++; ++ while (pos < max && path[pos] == '/') ++ pos++; ++ } ++ ++ while (pos < max) { ++ components.push_back(parse_component(path, pos)); ++ while (pos < max && path[pos] == '/') ++ pos++; ++ } ++} ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Other static utility functions. ++//////////////////////////////////////////////////////////////////////// ++ ++ ++static char * ++copy_string (const char * s) ++{ ++ // FIXME: potential buffer overflow. ++ // For some reason, strnlen and ++ // strncpy cause all kinds of crashes. ++ char * copy = new char[strlen(s) + 1]; ++ strcpy(copy, s); ++ return copy; ++} ++ ++static bool ++compare_strings (const char * s1, const char * s2) ++{ ++ return !strncmp(s1, s2, SGPropertyNode::MAX_STRING_LEN); ++} ++ ++/** ++ * Locate a child node by name and index. ++ */ ++static int ++find_child (const char * name, int index, const vector& nodes) ++{ ++ int nNodes = nodes.size(); ++ for (int i = 0; i < nNodes; i++) { ++ SGPropertyNode * node = nodes[i]; ++ if (compare_strings(node->getName(), name) && node->getIndex() == index) ++ return i; ++ } ++ return -1; ++} ++ ++ ++/** ++ * Locate another node, given a relative path. ++ */ ++static SGPropertyNode * ++find_node (SGPropertyNode * current, ++ const vector &components, ++ int position, ++ bool create) ++{ ++ // Run off the end of the list ++ if (current == 0) { ++ return 0; ++ } ++ ++ // Success! This is the one we want. ++ else if (position >= (int)components.size()) { ++ return (current->getAttribute(SGPropertyNode::REMOVED) ? 0 : current); ++ } ++ ++ // Empty component means root. ++ else if (components[position].name == "") { ++ return find_node(current->getRootNode(), components, position + 1, create); ++ } ++ ++ // . means current directory ++ else if (components[position].name == ".") { ++ return find_node(current, components, position + 1, create); ++ } ++ ++ // .. means parent directory ++ else if (components[position].name == "..") { ++ SGPropertyNode * parent = current->getParent(); ++ if (parent == 0) ++ throw string("attempt to move past root with '..'"); ++ else ++ return find_node(parent, components, position + 1, create); ++ } ++ ++ // Otherwise, a child name ++ else { ++ SGPropertyNode * child = ++ current->getChild(components[position].name.c_str(), ++ components[position].index, ++ create); ++ return find_node(child, components, position + 1, create); ++ } ++} ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Private methods from SGPropertyNode (may be inlined for speed). ++//////////////////////////////////////////////////////////////////////// ++ ++inline bool ++SGPropertyNode::get_bool () const ++{ ++ if (_tied) ++ return _value.bool_val->getValue(); ++ else ++ return _local_val.bool_val; ++} ++ ++inline int ++SGPropertyNode::get_int () const ++{ ++ if (_tied) ++ return _value.int_val->getValue(); ++ else ++ return _local_val.int_val; ++} ++ ++inline long ++SGPropertyNode::get_long () const ++{ ++ if (_tied) ++ return _value.long_val->getValue(); ++ else ++ return _local_val.long_val; ++} ++ ++inline float ++SGPropertyNode::get_float () const ++{ ++ if (_tied) ++ return _value.float_val->getValue(); ++ else ++ return _local_val.float_val; ++} ++ ++inline double ++SGPropertyNode::get_double () const ++{ ++ if (_tied) ++ return _value.double_val->getValue(); ++ else ++ return _local_val.double_val; ++} ++ ++inline const char * ++SGPropertyNode::get_string () const ++{ ++ if (_tied) ++ return _value.string_val->getValue(); ++ else ++ return _local_val.string_val; ++} ++ ++inline bool ++SGPropertyNode::set_bool (bool val) ++{ ++ if (_tied) { ++ if (_value.bool_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ _local_val.bool_val = val; ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++inline bool ++SGPropertyNode::set_int (int val) ++{ ++ if (_tied) { ++ if (_value.int_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ _local_val.int_val = val; ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++inline bool ++SGPropertyNode::set_long (long val) ++{ ++ if (_tied) { ++ if (_value.long_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ _local_val.long_val = val; ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++inline bool ++SGPropertyNode::set_float (float val) ++{ ++ if (_tied) { ++ if (_value.float_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ _local_val.float_val = val; ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++inline bool ++SGPropertyNode::set_double (double val) ++{ ++ if (_tied) { ++ if (_value.double_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ _local_val.double_val = val; ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++inline bool ++SGPropertyNode::set_string (const char * val) ++{ ++ if (_tied) { ++ if (_value.string_val->setValue(val)) { ++ fireValueChanged(); ++ return true; ++ } else { ++ return false; ++ } ++ } else { ++ delete [] _local_val.string_val; ++ _local_val.string_val = copy_string(val); ++ fireValueChanged(); ++ return true; ++ } ++} ++ ++void ++SGPropertyNode::clearValue () ++{ ++ switch (_type) { ++ case NONE: ++ break; ++ case ALIAS: ++ put(_value.alias); ++ _value.alias = 0; ++ break; ++ case BOOL: ++ if (_tied) { ++ delete _value.bool_val; ++ _value.bool_val = 0; ++ } ++ _local_val.bool_val = SGRawValue::DefaultValue; ++ break; ++ case INT: ++ if (_tied) { ++ delete _value.int_val; ++ _value.int_val = 0; ++ } ++ _local_val.int_val = SGRawValue::DefaultValue; ++ break; ++ case LONG: ++ if (_tied) { ++ delete _value.long_val; ++ _value.long_val = 0L; ++ } ++ _local_val.long_val = SGRawValue::DefaultValue; ++ break; ++ case FLOAT: ++ if (_tied) { ++ delete _value.float_val; ++ _value.float_val = 0; ++ } ++ _local_val.float_val = SGRawValue::DefaultValue; ++ break; ++ case DOUBLE: ++ if (_tied) { ++ delete _value.double_val; ++ _value.double_val = 0; ++ } ++ _local_val.double_val = SGRawValue::DefaultValue; ++ break; ++ case STRING: ++ case UNSPECIFIED: ++ if (_tied) { ++ delete _value.string_val; ++ _value.string_val = 0; ++ } else { ++ delete [] _local_val.string_val; ++ } ++ _local_val.string_val = 0; ++ break; ++ } ++ _tied = false; ++ _type = NONE; ++} ++ ++ ++/** ++ * Get the value as a string. ++ */ ++const char * ++SGPropertyNode::make_string () const ++{ ++ if (!getAttribute(READ)) ++ return ""; ++ ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getStringValue(); ++ case BOOL: ++ if (get_bool()) ++ return "true"; ++ else ++ return "false"; ++ case INT: ++ { ++ stringstream sstr; ++ sstr << get_int(); ++ _buffer = sstr.str(); ++ return _buffer.c_str(); ++ } ++ case LONG: ++ { ++ stringstream sstr; ++ sstr << get_long(); ++ _buffer = sstr.str(); ++ return _buffer.c_str(); ++ } ++ case FLOAT: ++ { ++ stringstream sstr; ++ sstr << get_float(); ++ _buffer = sstr.str(); ++ return _buffer.c_str(); ++ } ++ case DOUBLE: ++ { ++ stringstream sstr; ++ sstr.precision( 10 ); ++ sstr << get_double(); ++ _buffer = sstr.str(); ++ return _buffer.c_str(); ++ } ++ case STRING: ++ case UNSPECIFIED: ++ return get_string(); ++ case NONE: ++ default: ++ return ""; ++ } ++} ++ ++/** ++ * Trace a write access for a property. ++ */ ++void ++SGPropertyNode::trace_write () const ++{ ++#if PROPS_STANDALONE ++ cerr << "TRACE: Write node " << getPath () << ", value \"" ++ << make_string() << '"' << endl; ++#else ++ SG_LOG(SG_GENERAL, SG_ALERT, "TRACE: Write node " << getPath() ++ << ", value \"" << make_string() << '"'); ++#endif ++} ++ ++/** ++ * Trace a read access for a property. ++ */ ++void ++SGPropertyNode::trace_read () const ++{ ++#if PROPS_STANDALONE ++ cerr << "TRACE: Write node " << getPath () << ", value \"" ++ << make_string() << '"' << endl; ++#else ++ SG_LOG(SG_GENERAL, SG_ALERT, "TRACE: Read node " << getPath() ++ << ", value \"" << make_string() << '"'); ++#endif ++} ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Public methods from SGPropertyNode. ++//////////////////////////////////////////////////////////////////////// ++ ++/** ++ * Last used attribute ++ * Update as needed when enum Attribute is changed ++ */ ++const int SGPropertyNode::LAST_USED_ATTRIBUTE = USERARCHIVE; ++ ++/** ++ * Default constructor: always creates a root node. ++ */ ++SGPropertyNode::SGPropertyNode () ++ : _index(0), ++ _parent(0), ++ _path_cache(0), ++ _type(NONE), ++ _tied(false), ++ _attr(READ|WRITE), ++ _listeners(0) ++{ ++ _local_val.string_val = 0; ++} ++ ++ ++/** ++ * Copy constructor. ++ */ ++SGPropertyNode::SGPropertyNode (const SGPropertyNode &node) ++ : _index(node._index), ++ _name(node._name), ++ _parent(0), // don't copy the parent ++ _path_cache(0), ++ _type(node._type), ++ _tied(node._tied), ++ _attr(node._attr), ++ _listeners(0) // CHECK!! ++{ ++ _local_val.string_val = 0; ++ switch (_type) { ++ case NONE: ++ break; ++ case ALIAS: ++ _value.alias = node._value.alias; ++ get(_value.alias); ++ _tied = false; ++ break; ++ case BOOL: ++ if (_tied) { ++ _tied = true; ++ _value.bool_val = node._value.bool_val->clone(); ++ } else { ++ _tied = false; ++ set_bool(node.get_bool()); ++ } ++ break; ++ case INT: ++ if (_tied) { ++ _tied = true; ++ _value.int_val = node._value.int_val->clone(); ++ } else { ++ _tied = false; ++ set_int(node.get_int()); ++ } ++ break; ++ case LONG: ++ if (_tied) { ++ _tied = true; ++ _value.long_val = node._value.long_val->clone(); ++ } else { ++ _tied = false; ++ set_long(node.get_long()); ++ } ++ break; ++ case FLOAT: ++ if (_tied) { ++ _tied = true; ++ _value.float_val = node._value.float_val->clone(); ++ } else { ++ _tied = false; ++ set_float(node.get_float()); ++ } ++ break; ++ case DOUBLE: ++ if (_tied) { ++ _tied = true; ++ _value.double_val = node._value.double_val->clone(); ++ } else { ++ _tied = false; ++ set_double(node.get_double()); ++ } ++ break; ++ case STRING: ++ case UNSPECIFIED: ++ if (_tied) { ++ _tied = true; ++ _value.string_val = node._value.string_val->clone(); ++ } else { ++ _tied = false; ++ set_string(node.get_string()); ++ } ++ break; ++ } ++} ++ ++ ++/** ++ * Convenience constructor. ++ */ ++SGPropertyNode::SGPropertyNode (const char * name, ++ int index, ++ SGPropertyNode * parent) ++ : _index(index), ++ _parent(parent), ++ _path_cache(0), ++ _type(NONE), ++ _tied(false), ++ _attr(READ|WRITE), ++ _listeners(0) ++{ ++ int i = 0; ++ _name = parse_name(name, i); ++ if (i != int(strlen(name)) || name[0] == '.') ++ throw string("plain name expected instead of '") + name + '\''; ++ ++ _local_val.string_val = 0; ++} ++ ++ ++/** ++ * Destructor. ++ */ ++SGPropertyNode::~SGPropertyNode () ++{ ++ // zero out all parent pointers, else they might be dangling ++ for (unsigned i = 0; i < _children.size(); ++i) ++ _children[i]->_parent = 0; ++ for (unsigned i = 0; i < _removedChildren.size(); ++i) ++ _removedChildren[i]->_parent = 0; ++ delete _path_cache; ++ clearValue(); ++ ++ if (_listeners) { ++ vector::iterator it; ++ for (it = _listeners->begin(); it != _listeners->end(); ++it) ++ (*it)->unregister_property(this); ++ delete _listeners; ++ } ++} ++ ++ ++/** ++ * Alias to another node. ++ */ ++bool ++SGPropertyNode::alias (SGPropertyNode * target) ++{ ++ if (target == 0 || _type == ALIAS || _tied) ++ return false; ++ clearValue(); ++ get(target); ++ _value.alias = target; ++ _type = ALIAS; ++ return true; ++} ++ ++ ++/** ++ * Alias to another node by path. ++ */ ++bool ++SGPropertyNode::alias (const char * path) ++{ ++ return alias(getNode(path, true)); ++} ++ ++ ++/** ++ * Remove an alias. ++ */ ++bool ++SGPropertyNode::unalias () ++{ ++ if (_type != ALIAS) ++ return false; ++ clearValue(); ++ return true; ++} ++ ++ ++/** ++ * Get the target of an alias. ++ */ ++SGPropertyNode * ++SGPropertyNode::getAliasTarget () ++{ ++ return (_type == ALIAS ? _value.alias : 0); ++} ++ ++ ++const SGPropertyNode * ++SGPropertyNode::getAliasTarget () const ++{ ++ return (_type == ALIAS ? _value.alias : 0); ++} ++ ++ ++/** ++ * Get a non-const child by index. ++ */ ++SGPropertyNode * ++SGPropertyNode::getChild (int position) ++{ ++ if (position >= 0 && position < nChildren()) ++ return _children[position]; ++ else ++ return 0; ++} ++ ++ ++/** ++ * Get a const child by index. ++ */ ++const SGPropertyNode * ++SGPropertyNode::getChild (int position) const ++{ ++ if (position >= 0 && position < nChildren()) ++ return _children[position]; ++ else ++ return 0; ++} ++ ++ ++/** ++ * Get a non-const child by name and index, creating if necessary. ++ */ ++SGPropertyNode * ++SGPropertyNode::getChild (const char * name, int index, bool create) ++{ ++ int pos = find_child(name, index, _children); ++ if (pos >= 0) { ++ return _children[pos]; ++ } else if (create) { ++ SGPropertyNode_ptr node; ++ pos = find_child(name, index, _removedChildren); ++ if (pos >= 0) { ++ vector::iterator it = _removedChildren.begin(); ++ it += pos; ++ node = _removedChildren[pos]; ++ _removedChildren.erase(it); ++ node->setAttribute(REMOVED, false); ++ } else { ++ node = new SGPropertyNode(name, index, this); ++ } ++ _children.push_back(node); ++ fireChildAdded(node); ++ return node; ++ } else { ++ return 0; ++ } ++} ++ ++ ++/** ++ * Get a const child by name and index. ++ */ ++const SGPropertyNode * ++SGPropertyNode::getChild (const char * name, int index) const ++{ ++ int pos = find_child(name, index, _children); ++ if (pos >= 0) ++ return _children[pos]; ++ else ++ return 0; ++} ++ ++ ++/** ++ * Get all children with the same name (but different indices). ++ */ ++vector ++SGPropertyNode::getChildren (const char * name) const ++{ ++ vector children; ++ int max = _children.size(); ++ ++ for (int i = 0; i < max; i++) ++ if (compare_strings(_children[i]->getName(), name)) ++ children.push_back(_children[i]); ++ ++ sort(children.begin(), children.end(), CompareIndices()); ++ return children; ++} ++ ++ ++/** ++ * Remove this node and all children from nodes that link to them ++ * in their path cache. ++ */ ++void ++SGPropertyNode::remove_from_path_caches () ++{ ++ for (unsigned int i = 0; i < _children.size(); ++i) ++ _children[i]->remove_from_path_caches(); ++ ++ for (unsigned int i = 0; i < _linkedNodes.size(); i++) ++ _linkedNodes[i]->erase(this); ++ _linkedNodes.clear(); ++} ++ ++ ++/** ++ * Remove child by position. ++ */ ++SGPropertyNode_ptr ++SGPropertyNode::removeChild (int pos, bool keep) ++{ ++ SGPropertyNode_ptr node; ++ if (pos < 0 || pos >= (int)_children.size()) ++ return node; ++ ++ vector::iterator it = _children.begin(); ++ it += pos; ++ node = _children[pos]; ++ _children.erase(it); ++ if (keep) { ++ _removedChildren.push_back(node); ++ } ++ ++ node->remove_from_path_caches(); ++ node->setAttribute(REMOVED, true); ++ node->clearValue(); ++ fireChildRemoved(node); ++ return node; ++} ++ ++ ++/** ++ * Remove a child node ++ */ ++SGPropertyNode_ptr ++SGPropertyNode::removeChild (const char * name, int index, bool keep) ++{ ++ SGPropertyNode_ptr ret; ++ int pos = find_child(name, index, _children); ++ if (pos >= 0) ++ ret = removeChild(pos, keep); ++ return ret; ++} ++ ++ ++/** ++ * Remove all children with the specified name. ++ */ ++vector ++SGPropertyNode::removeChildren (const char * name, bool keep) ++{ ++ vector children; ++ ++ for (int pos = _children.size() - 1; pos >= 0; pos--) ++ if (compare_strings(_children[pos]->getName(), name)) ++ children.push_back(removeChild(pos, keep)); ++ ++ sort(children.begin(), children.end(), CompareIndices()); ++ return children; ++} ++ ++ ++/** ++ * Remove a linked node. ++ */ ++bool ++SGPropertyNode::remove_linked_node (hash_table * node) ++{ ++ for (unsigned int i = 0; i < _linkedNodes.size(); i++) { ++ if (_linkedNodes[i] == node) { ++ vector::iterator it = _linkedNodes.begin(); ++ it += i; ++ _linkedNodes.erase(it); ++ return true; ++ } ++ } ++ return false; ++} ++ ++ ++const char * ++SGPropertyNode::getDisplayName (bool simplify) const ++{ ++ _display_name = _name; ++ if (_index != 0 || !simplify) { ++ stringstream sstr; ++ sstr << '[' << _index << ']'; ++ _display_name += sstr.str(); ++ } ++ return _display_name.c_str(); ++} ++ ++ ++const char * ++SGPropertyNode::getPath (bool simplify) const ++{ ++ // Calculate the complete path only once. ++ if (_parent != 0 && _path.empty()) { ++ _path = _parent->getPath(simplify); ++ _path += '/'; ++ _path += getDisplayName(simplify); ++ } ++ ++ return _path.c_str(); ++} ++ ++SGPropertyNode::Type ++SGPropertyNode::getType () const ++{ ++ if (_type == ALIAS) ++ return _value.alias->getType(); ++ else ++ return _type; ++} ++ ++ ++bool ++SGPropertyNode::getBoolValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == BOOL) ++ return get_bool(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getBoolValue(); ++ case BOOL: ++ return get_bool(); ++ case INT: ++ return get_int() == 0 ? false : true; ++ case LONG: ++ return get_long() == 0L ? false : true; ++ case FLOAT: ++ return get_float() == 0.0 ? false : true; ++ case DOUBLE: ++ return get_double() == 0.0L ? false : true; ++ case STRING: ++ case UNSPECIFIED: ++ return (compare_strings(get_string(), "true") || getDoubleValue() != 0.0L); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++} ++ ++int ++SGPropertyNode::getIntValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == INT) ++ return get_int(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getIntValue(); ++ case BOOL: ++ return int(get_bool()); ++ case INT: ++ return get_int(); ++ case LONG: ++ return int(get_long()); ++ case FLOAT: ++ return int(get_float()); ++ case DOUBLE: ++ return int(get_double()); ++ case STRING: ++ case UNSPECIFIED: ++ return atoi(get_string()); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++} ++ ++long ++SGPropertyNode::getLongValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == LONG) ++ return get_long(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getLongValue(); ++ case BOOL: ++ return long(get_bool()); ++ case INT: ++ return long(get_int()); ++ case LONG: ++ return get_long(); ++ case FLOAT: ++ return long(get_float()); ++ case DOUBLE: ++ return long(get_double()); ++ case STRING: ++ case UNSPECIFIED: ++ return strtol(get_string(), 0, 0); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++} ++ ++float ++SGPropertyNode::getFloatValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == FLOAT) ++ return get_float(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getFloatValue(); ++ case BOOL: ++ return float(get_bool()); ++ case INT: ++ return float(get_int()); ++ case LONG: ++ return float(get_long()); ++ case FLOAT: ++ return get_float(); ++ case DOUBLE: ++ return float(get_double()); ++ case STRING: ++ case UNSPECIFIED: ++ return atof(get_string()); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++} ++ ++double ++SGPropertyNode::getDoubleValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == DOUBLE) ++ return get_double(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getDoubleValue(); ++ case BOOL: ++ return double(get_bool()); ++ case INT: ++ return double(get_int()); ++ case LONG: ++ return double(get_long()); ++ case FLOAT: ++ return double(get_float()); ++ case DOUBLE: ++ return get_double(); ++ case STRING: ++ case UNSPECIFIED: ++ return strtod(get_string(), 0); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++} ++ ++const char * ++SGPropertyNode::getStringValue () const ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == STRING) ++ return get_string(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ return make_string(); ++} ++ ++bool ++SGPropertyNode::setBoolValue (bool value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == BOOL) ++ return set_bool(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _tied = false; ++ _type = BOOL; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setBoolValue(value); ++ break; ++ case BOOL: ++ result = set_bool(value); ++ break; ++ case INT: ++ result = set_int(int(value)); ++ break; ++ case LONG: ++ result = set_long(long(value)); ++ break; ++ case FLOAT: ++ result = set_float(float(value)); ++ break; ++ case DOUBLE: ++ result = set_double(double(value)); ++ break; ++ case STRING: ++ case UNSPECIFIED: ++ result = set_string(value ? "true" : "false"); ++ break; ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setIntValue (int value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == INT) ++ return set_int(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _type = INT; ++ _local_val.int_val = 0; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setIntValue(value); ++ break; ++ case BOOL: ++ result = set_bool(value == 0 ? false : true); ++ break; ++ case INT: ++ result = set_int(value); ++ break; ++ case LONG: ++ result = set_long(long(value)); ++ break; ++ case FLOAT: ++ result = set_float(float(value)); ++ break; ++ case DOUBLE: ++ result = set_double(double(value)); ++ break; ++ case STRING: ++ case UNSPECIFIED: { ++ char buf[128]; ++ sprintf(buf, "%d", value); ++ result = set_string(buf); ++ break; ++ } ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setLongValue (long value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == LONG) ++ return set_long(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _type = LONG; ++ _local_val.long_val = 0L; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setLongValue(value); ++ break; ++ case BOOL: ++ result = set_bool(value == 0L ? false : true); ++ break; ++ case INT: ++ result = set_int(int(value)); ++ break; ++ case LONG: ++ result = set_long(value); ++ break; ++ case FLOAT: ++ result = set_float(float(value)); ++ break; ++ case DOUBLE: ++ result = set_double(double(value)); ++ break; ++ case STRING: ++ case UNSPECIFIED: { ++ char buf[128]; ++ sprintf(buf, "%ld", value); ++ result = set_string(buf); ++ break; ++ } ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setFloatValue (float value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == FLOAT) ++ return set_float(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _type = FLOAT; ++ _local_val.float_val = 0; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setFloatValue(value); ++ break; ++ case BOOL: ++ result = set_bool(value == 0.0 ? false : true); ++ break; ++ case INT: ++ result = set_int(int(value)); ++ break; ++ case LONG: ++ result = set_long(long(value)); ++ break; ++ case FLOAT: ++ result = set_float(value); ++ break; ++ case DOUBLE: ++ result = set_double(double(value)); ++ break; ++ case STRING: ++ case UNSPECIFIED: { ++ char buf[128]; ++ sprintf(buf, "%f", value); ++ result = set_string(buf); ++ break; ++ } ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setDoubleValue (double value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == DOUBLE) ++ return set_double(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _local_val.double_val = value; ++ _type = DOUBLE; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setDoubleValue(value); ++ break; ++ case BOOL: ++ result = set_bool(value == 0.0L ? false : true); ++ break; ++ case INT: ++ result = set_int(int(value)); ++ break; ++ case LONG: ++ result = set_long(long(value)); ++ break; ++ case FLOAT: ++ result = set_float(float(value)); ++ break; ++ case DOUBLE: ++ result = set_double(value); ++ break; ++ case STRING: ++ case UNSPECIFIED: { ++ char buf[128]; ++ sprintf(buf, "%f", value); ++ result = set_string(buf); ++ break; ++ } ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setStringValue (const char * value) ++{ ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == STRING) ++ return set_string(value); ++ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE || _type == UNSPECIFIED) { ++ clearValue(); ++ _type = STRING; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setStringValue(value); ++ break; ++ case BOOL: ++ result = set_bool((compare_strings(value, "true") ++ || atoi(value)) ? true : false); ++ break; ++ case INT: ++ result = set_int(atoi(value)); ++ break; ++ case LONG: ++ result = set_long(strtol(value, 0, 0)); ++ break; ++ case FLOAT: ++ result = set_float(atof(value)); ++ break; ++ case DOUBLE: ++ result = set_double(strtod(value, 0)); ++ break; ++ case STRING: ++ case UNSPECIFIED: ++ result = set_string(value); ++ break; ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::setUnspecifiedValue (const char * value) ++{ ++ bool result = false; ++ TEST_WRITE; ++ if (_type == NONE) { ++ clearValue(); ++ _type = UNSPECIFIED; ++ } ++ ++ switch (_type) { ++ case ALIAS: ++ result = _value.alias->setUnspecifiedValue(value); ++ break; ++ case BOOL: ++ result = set_bool((compare_strings(value, "true") ++ || atoi(value)) ? true : false); ++ break; ++ case INT: ++ result = set_int(atoi(value)); ++ break; ++ case LONG: ++ result = set_long(strtol(value, 0, 0)); ++ break; ++ case FLOAT: ++ result = set_float(atof(value)); ++ break; ++ case DOUBLE: ++ result = set_double(strtod(value, 0)); ++ break; ++ case STRING: ++ case UNSPECIFIED: ++ result = set_string(value); ++ break; ++ case NONE: ++ default: ++ break; ++ } ++ ++ if (getAttribute(TRACE_WRITE)) ++ trace_write(); ++ return result; ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ bool old_val = false; ++ if (useDefault) ++ old_val = getBoolValue(); ++ ++ clearValue(); ++ _type = BOOL; ++ _tied = true; ++ _value.bool_val = rawValue.clone(); ++ ++ if (useDefault) ++ setBoolValue(old_val); ++ ++ return true; ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ int old_val = 0; ++ if (useDefault) ++ old_val = getIntValue(); ++ ++ clearValue(); ++ _type = INT; ++ _tied = true; ++ _value.int_val = rawValue.clone(); ++ ++ if (useDefault) ++ setIntValue(old_val); ++ ++ return true; ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ long old_val = 0; ++ if (useDefault) ++ old_val = getLongValue(); ++ ++ clearValue(); ++ _type = LONG; ++ _tied = true; ++ _value.long_val = rawValue.clone(); ++ ++ if (useDefault) ++ setLongValue(old_val); ++ ++ return true; ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ float old_val = 0.0; ++ if (useDefault) ++ old_val = getFloatValue(); ++ ++ clearValue(); ++ _type = FLOAT; ++ _tied = true; ++ _value.float_val = rawValue.clone(); ++ ++ if (useDefault) ++ setFloatValue(old_val); ++ ++ return true; ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ double old_val = 0.0; ++ if (useDefault) ++ old_val = getDoubleValue(); ++ ++ clearValue(); ++ _type = DOUBLE; ++ _tied = true; ++ _value.double_val = rawValue.clone(); ++ ++ if (useDefault) ++ setDoubleValue(old_val); ++ ++ return true; ++ ++} ++ ++bool ++SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) ++{ ++ if (_type == ALIAS || _tied) ++ return false; ++ ++ useDefault = useDefault && hasValue(); ++ string old_val; ++ if (useDefault) ++ old_val = getStringValue(); ++ ++ clearValue(); ++ _type = STRING; ++ _tied = true; ++ _value.string_val = rawValue.clone(); ++ ++ if (useDefault) ++ setStringValue(old_val.c_str()); ++ ++ return true; ++} ++ ++bool ++SGPropertyNode::untie () ++{ ++ if (!_tied) ++ return false; ++ ++ switch (_type) { ++ case BOOL: { ++ bool val = getBoolValue(); ++ clearValue(); ++ _type = BOOL; ++ _local_val.bool_val = val; ++ break; ++ } ++ case INT: { ++ int val = getIntValue(); ++ clearValue(); ++ _type = INT; ++ _local_val.int_val = val; ++ break; ++ } ++ case LONG: { ++ long val = getLongValue(); ++ clearValue(); ++ _type = LONG; ++ _local_val.long_val = val; ++ break; ++ } ++ case FLOAT: { ++ float val = getFloatValue(); ++ clearValue(); ++ _type = FLOAT; ++ _local_val.float_val = val; ++ break; ++ } ++ case DOUBLE: { ++ double val = getDoubleValue(); ++ clearValue(); ++ _type = DOUBLE; ++ _local_val.double_val = val; ++ break; ++ } ++ case STRING: ++ case UNSPECIFIED: { ++ string val = getStringValue(); ++ clearValue(); ++ _type = STRING; ++ _local_val.string_val = copy_string(val.c_str()); ++ break; ++ } ++ case NONE: ++ default: ++ break; ++ } ++ ++ _tied = false; ++ return true; ++} ++ ++SGPropertyNode * ++SGPropertyNode::getRootNode () ++{ ++ if (_parent == 0) ++ return this; ++ else ++ return _parent->getRootNode(); ++} ++ ++const SGPropertyNode * ++SGPropertyNode::getRootNode () const ++{ ++ if (_parent == 0) ++ return this; ++ else ++ return _parent->getRootNode(); ++} ++ ++SGPropertyNode * ++SGPropertyNode::getNode (const char * relative_path, bool create) ++{ ++ if (_path_cache == 0) ++ _path_cache = new hash_table; ++ ++ SGPropertyNode * result = _path_cache->get(relative_path); ++ if (result == 0) { ++ vector components; ++ parse_path(relative_path, components); ++ result = find_node(this, components, 0, create); ++ if (result != 0) ++ _path_cache->put(relative_path, result); ++ } ++ ++ return result; ++} ++ ++SGPropertyNode * ++SGPropertyNode::getNode (const char * relative_path, int index, bool create) ++{ ++ vector components; ++ parse_path(relative_path, components); ++ if (components.size() > 0) ++ components.back().index = index; ++ return find_node(this, components, 0, create); ++} ++ ++const SGPropertyNode * ++SGPropertyNode::getNode (const char * relative_path) const ++{ ++ return ((SGPropertyNode *)this)->getNode(relative_path, false); ++} ++ ++const SGPropertyNode * ++SGPropertyNode::getNode (const char * relative_path, int index) const ++{ ++ return ((SGPropertyNode *)this)->getNode(relative_path, index, false); ++} ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Convenience methods using relative paths. ++//////////////////////////////////////////////////////////////////////// ++ ++ ++/** ++ * Test whether another node has a value attached. ++ */ ++bool ++SGPropertyNode::hasValue (const char * relative_path) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? false : node->hasValue()); ++} ++ ++ ++/** ++ * Get the value type for another node. ++ */ ++SGPropertyNode::Type ++SGPropertyNode::getType (const char * relative_path) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? UNSPECIFIED : (Type)(node->getType())); ++} ++ ++ ++/** ++ * Get a bool value for another node. ++ */ ++bool ++SGPropertyNode::getBoolValue (const char * relative_path, ++ bool defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getBoolValue()); ++} ++ ++ ++/** ++ * Get an int value for another node. ++ */ ++int ++SGPropertyNode::getIntValue (const char * relative_path, ++ int defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getIntValue()); ++} ++ ++ ++/** ++ * Get a long value for another node. ++ */ ++long ++SGPropertyNode::getLongValue (const char * relative_path, ++ long defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getLongValue()); ++} ++ ++ ++/** ++ * Get a float value for another node. ++ */ ++float ++SGPropertyNode::getFloatValue (const char * relative_path, ++ float defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getFloatValue()); ++} ++ ++ ++/** ++ * Get a double value for another node. ++ */ ++double ++SGPropertyNode::getDoubleValue (const char * relative_path, ++ double defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getDoubleValue()); ++} ++ ++ ++/** ++ * Get a string value for another node. ++ */ ++const char * ++SGPropertyNode::getStringValue (const char * relative_path, ++ const char * defaultValue) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? defaultValue : node->getStringValue()); ++} ++ ++ ++/** ++ * Set a bool value for another node. ++ */ ++bool ++SGPropertyNode::setBoolValue (const char * relative_path, bool value) ++{ ++ return getNode(relative_path, true)->setBoolValue(value); ++} ++ ++ ++/** ++ * Set an int value for another node. ++ */ ++bool ++SGPropertyNode::setIntValue (const char * relative_path, int value) ++{ ++ return getNode(relative_path, true)->setIntValue(value); ++} ++ ++ ++/** ++ * Set a long value for another node. ++ */ ++bool ++SGPropertyNode::setLongValue (const char * relative_path, long value) ++{ ++ return getNode(relative_path, true)->setLongValue(value); ++} ++ ++ ++/** ++ * Set a float value for another node. ++ */ ++bool ++SGPropertyNode::setFloatValue (const char * relative_path, float value) ++{ ++ return getNode(relative_path, true)->setFloatValue(value); ++} ++ ++ ++/** ++ * Set a double value for another node. ++ */ ++bool ++SGPropertyNode::setDoubleValue (const char * relative_path, double value) ++{ ++ return getNode(relative_path, true)->setDoubleValue(value); ++} ++ ++ ++/** ++ * Set a string value for another node. ++ */ ++bool ++SGPropertyNode::setStringValue (const char * relative_path, const char * value) ++{ ++ return getNode(relative_path, true)->setStringValue(value); ++} ++ ++ ++/** ++ * Set an unknown value for another node. ++ */ ++bool ++SGPropertyNode::setUnspecifiedValue (const char * relative_path, ++ const char * value) ++{ ++ return getNode(relative_path, true)->setUnspecifiedValue(value); ++} ++ ++ ++/** ++ * Test whether another node is tied. ++ */ ++bool ++SGPropertyNode::isTied (const char * relative_path) const ++{ ++ const SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? false : node->isTied()); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Tie a node reached by a relative path, creating it if necessary. ++ */ ++bool ++SGPropertyNode::tie (const char * relative_path, ++ const SGRawValue &rawValue, ++ bool useDefault) ++{ ++ return getNode(relative_path, true)->tie(rawValue, useDefault); ++} ++ ++ ++/** ++ * Attempt to untie another node reached by a relative path. ++ */ ++bool ++SGPropertyNode::untie (const char * relative_path) ++{ ++ SGPropertyNode * node = getNode(relative_path); ++ return (node == 0 ? false : node->untie()); ++} ++ ++void ++SGPropertyNode::addChangeListener (SGPropertyChangeListener * listener, ++ bool initial) ++{ ++ if (_listeners == 0) ++ _listeners = new vector; ++ _listeners->push_back(listener); ++ listener->register_property(this); ++ if (initial) ++ listener->valueChanged(this); ++} ++ ++void ++SGPropertyNode::removeChangeListener (SGPropertyChangeListener * listener) ++{ ++ vector::iterator it = ++ find(_listeners->begin(), _listeners->end(), listener); ++ if (it != _listeners->end()) { ++ _listeners->erase(it); ++ listener->unregister_property(this); ++ if (_listeners->empty()) { ++ vector* tmp = _listeners; ++ _listeners = 0; ++ delete tmp; ++ } ++ } ++} ++ ++void ++SGPropertyNode::fireValueChanged () ++{ ++ fireValueChanged(this); ++} ++ ++void ++SGPropertyNode::fireChildAdded (SGPropertyNode * child) ++{ ++ fireChildAdded(this, child); ++} ++ ++void ++SGPropertyNode::fireChildRemoved (SGPropertyNode * child) ++{ ++ fireChildRemoved(this, child); ++} ++ ++void ++SGPropertyNode::fireValueChanged (SGPropertyNode * node) ++{ ++ if (_listeners != 0) { ++ for (unsigned int i = 0; i < _listeners->size(); i++) { ++ (*_listeners)[i]->valueChanged(node); ++ } ++ } ++ if (_parent != 0) ++ _parent->fireValueChanged(node); ++} ++ ++void ++SGPropertyNode::fireChildAdded (SGPropertyNode * parent, ++ SGPropertyNode * child) ++{ ++ if (_listeners != 0) { ++ for (unsigned int i = 0; i < _listeners->size(); i++) { ++ (*_listeners)[i]->childAdded(parent, child); ++ } ++ } ++ if (_parent != 0) ++ _parent->fireChildAdded(parent, child); ++} ++ ++void ++SGPropertyNode::fireChildRemoved (SGPropertyNode * parent, ++ SGPropertyNode * child) ++{ ++ if (_listeners != 0) { ++ for (unsigned int i = 0; i < _listeners->size(); i++) { ++ (*_listeners)[i]->childRemoved(parent, child); ++ } ++ } ++ if (_parent != 0) ++ _parent->fireChildRemoved(parent, child); ++} ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Simplified hash table for caching paths. ++//////////////////////////////////////////////////////////////////////// ++ ++#define HASH_TABLE_SIZE 199 ++ ++SGPropertyNode::hash_table::entry::entry () ++ : _value(0) ++{ ++} ++ ++SGPropertyNode::hash_table::entry::~entry () ++{ ++ // Don't delete the value; we don't own ++ // the pointer. ++} ++ ++void ++SGPropertyNode::hash_table::entry::set_key (const char * key) ++{ ++ _key = key; ++} ++ ++void ++SGPropertyNode::hash_table::entry::set_value (SGPropertyNode * value) ++{ ++ _value = value; ++} ++ ++SGPropertyNode::hash_table::bucket::bucket () ++ : _length(0), ++ _entries(0) ++{ ++} ++ ++SGPropertyNode::hash_table::bucket::~bucket () ++{ ++ for (int i = 0; i < _length; i++) ++ delete _entries[i]; ++ delete [] _entries; ++} ++ ++SGPropertyNode::hash_table::entry * ++SGPropertyNode::hash_table::bucket::get_entry (const char * key, bool create) ++{ ++ int i; ++ for (i = 0; i < _length; i++) { ++ if (!strcmp(_entries[i]->get_key(), key)) ++ return _entries[i]; ++ } ++ if (create) { ++ entry ** new_entries = new entry*[_length+1]; ++ for (i = 0; i < _length; i++) { ++ new_entries[i] = _entries[i]; ++ } ++ delete [] _entries; ++ _entries = new_entries; ++ _entries[_length] = new entry; ++ _entries[_length]->set_key(key); ++ _length++; ++ return _entries[_length - 1]; ++ } else { ++ return 0; ++ } ++} ++ ++bool ++SGPropertyNode::hash_table::bucket::erase (SGPropertyNode * node) ++{ ++ for (int i = 0; i < _length; i++) { ++ if (_entries[i]->get_value() == node) { ++ delete _entries[i]; ++ for (++i; i < _length; i++) { ++ _entries[i-1] = _entries[i]; ++ } ++ _length--; ++ return true; ++ } ++ } ++ return false; ++} ++ ++void ++SGPropertyNode::hash_table::bucket::clear (SGPropertyNode::hash_table * owner) ++{ ++ for (int i = 0; i < _length; i++) { ++ SGPropertyNode * node = _entries[i]->get_value(); ++ if (node) ++ node->remove_linked_node(owner); ++ } ++} ++ ++SGPropertyNode::hash_table::hash_table () ++ : _data_length(0), ++ _data(0) ++{ ++} ++ ++SGPropertyNode::hash_table::~hash_table () ++{ ++ for (unsigned int i = 0; i < _data_length; i++) { ++ if (_data[i]) { ++ _data[i]->clear(this); ++ delete _data[i]; ++ } ++ } ++ delete [] _data; ++} ++ ++SGPropertyNode * ++SGPropertyNode::hash_table::get (const char * key) ++{ ++ if (_data_length == 0) ++ return 0; ++ unsigned int index = hashcode(key) % _data_length; ++ if (_data[index] == 0) ++ return 0; ++ entry * e = _data[index]->get_entry(key); ++ if (e == 0) ++ return 0; ++ else ++ return e->get_value(); ++} ++ ++void ++SGPropertyNode::hash_table::put (const char * key, SGPropertyNode * value) ++{ ++ if (_data_length == 0) { ++ _data = new bucket*[HASH_TABLE_SIZE]; ++ _data_length = HASH_TABLE_SIZE; ++ for (unsigned int i = 0; i < HASH_TABLE_SIZE; i++) ++ _data[i] = 0; ++ } ++ unsigned int index = hashcode(key) % _data_length; ++ if (_data[index] == 0) { ++ _data[index] = new bucket; ++ } ++ entry * e = _data[index]->get_entry(key, true); ++ e->set_value(value); ++ value->add_linked_node(this); ++} ++ ++bool ++SGPropertyNode::hash_table::erase (SGPropertyNode * node) ++{ ++ for (unsigned int i = 0; i < _data_length; i++) ++ if (_data[i] && _data[i]->erase(node)) ++ return true; ++ ++ return false; ++} ++ ++unsigned int ++SGPropertyNode::hash_table::hashcode (const char * key) ++{ ++ unsigned int hash = 0; ++ while (*key != 0) { ++ hash = 31 * hash + *key; ++ key++; ++ } ++ return hash; ++} ++ ++ ++ ++//////////////////////////////////////////////////////////////////////// ++// Implementation of SGPropertyChangeListener. ++//////////////////////////////////////////////////////////////////////// ++ ++SGPropertyChangeListener::~SGPropertyChangeListener () ++{ ++ for (int i = _properties.size() - 1; i >= 0; i--) ++ _properties[i]->removeChangeListener(this); ++} ++ ++void ++SGPropertyChangeListener::valueChanged (SGPropertyNode * node) ++{ ++ // NO-OP ++} ++ ++void ++SGPropertyChangeListener::childAdded (SGPropertyNode * node, ++ SGPropertyNode * child) ++{ ++ // NO-OP ++} ++ ++void ++SGPropertyChangeListener::childRemoved (SGPropertyNode * parent, ++ SGPropertyNode * child) ++{ ++ // NO-OP ++} ++ ++void ++SGPropertyChangeListener::register_property (SGPropertyNode * node) ++{ ++ _properties.push_back(node); ++} ++ ++void ++SGPropertyChangeListener::unregister_property (SGPropertyNode * node) ++{ ++ vector::iterator it = ++ find(_properties.begin(), _properties.end(), node); ++ if (it != _properties.end()) ++ _properties.erase(it); ++} ++ ++ ++// end of props.cxx +diff -uNrp SimGear-1.9.1.orig/simgear/props/props.hxx SimGear-1.9.1/simgear/props/props.hxx +--- SimGear-1.9.1.orig/simgear/props/props.hxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/props/props.hxx 2009-02-03 22:50:13.000000000 +0100 +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + #if PROPS_STANDALONE + #else +@@ -900,7 +901,38 @@ public: + /** + * Get a double value for this node. + */ +- double getDoubleValue () const; ++ double getDoubleValue () const ++ { ++ // Shortcut for common case ++ if (_attr == (READ|WRITE) && _type == DOUBLE) ++ return get_double(); ++ ++ if (getAttribute(TRACE_READ)) ++ trace_read(); ++ if (!getAttribute(READ)) ++ return SGRawValue::DefaultValue; ++ ++ switch (_type) { ++ case ALIAS: ++ return _value.alias->getDoubleValue(); ++ case BOOL: ++ return double(get_bool()); ++ case INT: ++ return double(get_int()); ++ case LONG: ++ return double(get_long()); ++ case FLOAT: ++ return double(get_float()); ++ case DOUBLE: ++ return get_double(); ++ case STRING: ++ case UNSPECIFIED: ++ return strtod(get_string(), 0); ++ case NONE: ++ default: ++ return SGRawValue::DefaultValue; ++ } ++ } + + + /** +@@ -1365,12 +1397,54 @@ protected: + private: + + // Get the raw value +- bool get_bool () const; +- int get_int () const; +- long get_long () const; +- float get_float () const; +- double get_double () const; +- const char * get_string () const; ++ inline bool get_bool () const ++ { ++ if (_tied) ++ return _value.bool_val->getValue(); ++ else ++ return _local_val.bool_val; ++ } ++ ++ inline int get_int () const ++ { ++ if (_tied) ++ return _value.int_val->getValue(); ++ else ++ return _local_val.int_val; ++ } ++ ++ inline long get_long () const ++ { ++ if (_tied) ++ return _value.long_val->getValue(); ++ else ++ return _local_val.long_val; ++ } ++ ++ inline float get_float () const ++ { ++ if (_tied) ++ return _value.float_val->getValue(); ++ else ++ return _local_val.float_val; ++ } ++ ++ inline double get_double () const ++ { ++ if (_tied) ++ return _value.double_val->getValue(); ++ else ++ return _local_val.double_val; ++ } ++ ++ inline const char * get_string () const ++ { ++ if (_tied) ++ return _value.string_val->getValue(); ++ else ++ return _local_val.string_val; ++ } ++ + + // Set the raw value + bool set_bool (bool value); +diff -uNrp SimGear-1.9.1.orig/simgear/scene/model/model.cxx SimGear-1.9.1/simgear/scene/model/model.cxx +--- SimGear-1.9.1.orig/simgear/scene/model/model.cxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/model/model.cxx 2009-02-03 22:50:13.000000000 +0100 +@@ -20,43 +20,6 @@ + + #include "model.hxx" + +-using std::vector; +- +-osg::Texture2D* +-SGLoadTexture2D(bool staticTexture, const std::string& path, +- const osgDB::ReaderWriter::Options* options, +- bool wrapu, bool wrapv, int) +-{ +- osg::Image* image; +- if (options) +- image = osgDB::readImageFile(path, options); +- else +- image = osgDB::readImageFile(path); +- osg::ref_ptr texture = new osg::Texture2D; +- texture->setImage(image); +- if (staticTexture) +- texture->setDataVariance(osg::Object::STATIC); +- if (wrapu) +- texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); +- else +- texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); +- if (wrapv) +- texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); +- else +- texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); +- +- if (image) { +- int s = image->s(); +- int t = image->t(); +- +- if (s <= t && 32 <= s) { +- SGSceneFeatures::instance()->setTextureCompression(texture.get()); +- } else if (t < s && 32 <= t) { +- SGSceneFeatures::instance()->setTextureCompression(texture.get()); +- } +- } +- +- return texture.release(); +-} ++// empty, all inline class now. + + // end of model.cxx +diff -uNrp SimGear-1.9.1.orig/simgear/scene/model/model.hxx SimGear-1.9.1/simgear/scene/model/model.hxx +--- SimGear-1.9.1.orig/simgear/scene/model/model.hxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/scene/model/model.hxx 2009-02-03 22:50:13.000000000 +0100 +@@ -24,10 +24,53 @@ using std::set; + + #include + +-osg::Texture2D* ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++inline osg::Texture2D* + SGLoadTexture2D(bool staticTexture, const std::string& path, + const osgDB::ReaderWriter::Options* options = 0, +- bool wrapu = true, bool wrapv = true, int mipmaplevels = -1); ++ bool wrapu = true, bool wrapv = true, int mipmaplevels = -1) ++{ ++ osg::Image* image; ++ if (options) ++ image = osgDB::readImageFile(path, options); ++ else ++ image = osgDB::readImageFile(path); ++ osg::ref_ptr texture = new osg::Texture2D; ++ texture->setImage(image); ++ if (staticTexture) ++ texture->setDataVariance(osg::Object::STATIC); ++ if (wrapu) ++ texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); ++ else ++ texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); ++ if (wrapv) ++ texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); ++ else ++ texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); ++ ++ if (image) { ++ int s = image->s(); ++ int t = image->t(); ++ ++ if (s <= t && 32 <= s) { ++ SGSceneFeatures::instance()->setTextureCompression(texture.get()); ++ } else if (t < s && 32 <= t) { ++ SGSceneFeatures::instance()->setTextureCompression(texture.get()); ++ } ++ } ++ ++ return texture.release(); ++} + + inline osg::Texture2D* + SGLoadTexture2D(const std::string& path, +diff -uNrp SimGear-1.9.1.orig/simgear/timing/timestamp.cxx SimGear-1.9.1/simgear/timing/timestamp.cxx +--- SimGear-1.9.1.orig/simgear/timing/timestamp.cxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/timing/timestamp.cxx 2009-02-03 22:50:13.000000000 +0100 +@@ -24,72 +24,8 @@ + // $Id$ + + +-#ifdef HAVE_CONFIG_H +-# include +-#endif +- +-#include +- +-#include +- +-#ifdef HAVE_SYS_TIMEB_H +-# include // for ftime() and struct timeb +-#endif +-#ifdef HAVE_UNISTD_H +-# include // for gettimeofday() +-#endif +-#ifdef HAVE_SYS_TIME_H +-# include // for get/setitimer, gettimeofday, struct timeval +-#endif +- +-#ifdef WIN32 +-# include +-# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) +-# define NEAR /* */ +-# define FAR /* */ +-# endif +-# include +-#endif ++// empty, all inline class now. + + #include "timestamp.hxx" + + +-void SGTimeStamp::stamp() { +-#if defined( WIN32 ) && !defined(__CYGWIN__) +- unsigned int t; +- t = timeGetTime(); +- seconds = t / 1000; +- usec = ( t - ( seconds * 1000 ) ) * 1000; +-#elif defined( HAVE_GETTIMEOFDAY ) +- struct timeval current; +- struct timezone tz; +- // sg_timestamp currtime; +- gettimeofday(¤t, &tz); +- seconds = current.tv_sec; +- usec = current.tv_usec; +-#elif defined( HAVE_GETLOCALTIME ) +- SYSTEMTIME current; +- GetLocalTime(¤t); +- seconds = current.wSecond; +- usec = current.wMilliseconds * 1000; +-#elif defined( HAVE_FTIME ) +- struct timeb current; +- ftime(¤t); +- seconds = current.time; +- usec = current.millitm * 1000; +-#else +-# error Port me +-#endif +-} +- +-// increment the time stamp by the number of microseconds (usec) +-SGTimeStamp operator + (const SGTimeStamp& t, const long& m) { +- return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000, +- ( t.usec + m ) % 1000000 ); +-} +- +-// difference between time stamps in microseconds (usec) +-long operator - (const SGTimeStamp& a, const SGTimeStamp& b) +-{ +- return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec); +-} +diff -uNrp SimGear-1.9.1.orig/simgear/timing/timestamp.cxx.orig SimGear-1.9.1/simgear/timing/timestamp.cxx.orig +--- SimGear-1.9.1.orig/simgear/timing/timestamp.cxx.orig 1970-01-01 01:00:00.000000000 +0100 ++++ SimGear-1.9.1/simgear/timing/timestamp.cxx.orig 2009-01-25 13:00:32.000000000 +0100 +@@ -0,0 +1,95 @@ ++/** ++ * \file timestamp.cxx ++ * Provides a class for managing a timestamp (seconds & milliseconds.) ++ */ ++ ++// Written by Curtis Olson, started December 1998. ++// ++// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 2 of the ++// License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, but ++// WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License ++// along with this program; if not, write to the Free Software ++// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++// ++// $Id$ ++ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++ ++#include ++ ++#ifdef HAVE_SYS_TIMEB_H ++# include // for ftime() and struct timeb ++#endif ++#ifdef HAVE_UNISTD_H ++# include // for gettimeofday() ++#endif ++#ifdef HAVE_SYS_TIME_H ++# include // for get/setitimer, gettimeofday, struct timeval ++#endif ++ ++#ifdef WIN32 ++# include ++# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) ++# define NEAR /* */ ++# define FAR /* */ ++# endif ++# include ++#endif ++ ++#include "timestamp.hxx" ++ ++ ++void SGTimeStamp::stamp() { ++#if defined( WIN32 ) && !defined(__CYGWIN__) ++ unsigned int t; ++ t = timeGetTime(); ++ seconds = t / 1000; ++ usec = ( t - ( seconds * 1000 ) ) * 1000; ++#elif defined( HAVE_GETTIMEOFDAY ) ++ struct timeval current; ++ struct timezone tz; ++ // sg_timestamp currtime; ++ gettimeofday(¤t, &tz); ++ seconds = current.tv_sec; ++ usec = current.tv_usec; ++#elif defined( HAVE_GETLOCALTIME ) ++ SYSTEMTIME current; ++ GetLocalTime(¤t); ++ seconds = current.wSecond; ++ usec = current.wMilliseconds * 1000; ++#elif defined( HAVE_FTIME ) ++ struct timeb current; ++ ftime(¤t); ++ seconds = current.time; ++ usec = current.millitm * 1000; ++#else ++# error Port me ++#endif ++} ++ ++// increment the time stamp by the number of microseconds (usec) ++SGTimeStamp operator + (const SGTimeStamp& t, const long& m) { ++ return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000, ++ ( t.usec + m ) % 1000000 ); ++} ++ ++// difference between time stamps in microseconds (usec) ++long operator - (const SGTimeStamp& a, const SGTimeStamp& b) ++{ ++ return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec); ++} +diff -uNrp SimGear-1.9.1.orig/simgear/timing/timestamp.hxx SimGear-1.9.1/simgear/timing/timestamp.hxx +--- SimGear-1.9.1.orig/simgear/timing/timestamp.hxx 2009-01-25 13:00:32.000000000 +0100 ++++ SimGear-1.9.1/simgear/timing/timestamp.hxx 2009-02-03 22:50:13.000000000 +0100 +@@ -32,9 +32,33 @@ + # error This library requires C++ + #endif + ++#ifdef HAVE_CONFIG_H ++# include ++#endif + + #include + ++#include ++ ++#ifdef HAVE_SYS_TIMEB_H ++# include // for ftime() and struct timeb ++#endif ++#ifdef HAVE_UNISTD_H ++# include // for gettimeofday() ++#endif ++#ifdef HAVE_SYS_TIME_H ++# include // for get/setitimer, gettimeofday, struct timeval ++#endif ++ ++#ifdef WIN32 ++# include ++# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) ++# define NEAR /* */ ++# define FAR /* */ ++# endif ++# include ++#endif ++ + + // MSVC++ 6.0 kuldge - Need forward declaration of friends. + class SGTimeStamp; +@@ -73,7 +97,33 @@ public: + SGTimeStamp( const long s, const long m ); + + /** Update stored time to current time (seconds and microseconds) */ +- void stamp(); ++ inline void stamp() { ++#if defined( WIN32 ) && !defined(__CYGWIN__) ++ unsigned int t; ++ t = timeGetTime(); ++ seconds = t / 1000; ++ usec = ( t - ( seconds * 1000 ) ) * 1000; ++#elif defined( HAVE_GETTIMEOFDAY ) ++ struct timeval current; ++ struct timezone tz; ++ // sg_timestamp currtime; ++ gettimeofday(¤t, &tz); ++ seconds = current.tv_sec; ++ usec = current.tv_usec; ++#elif defined( HAVE_GETLOCALTIME ) ++ SYSTEMTIME current; ++ GetLocalTime(¤t); ++ seconds = current.wSecond; ++ usec = current.wMilliseconds * 1000; ++#elif defined( HAVE_FTIME ) ++ struct timeb current; ++ ftime(¤t); ++ seconds = current.time; ++ usec = current.millitm * 1000; ++#else ++# error Port me ++#endif ++ } + + /** + * Increment the saved time by the specified number of microseconds +@@ -81,7 +131,10 @@ public: + * @param m microseconds increment + * @return new time stamp + */ +- friend SGTimeStamp operator + (const SGTimeStamp& t, const long& m); ++ friend SGTimeStamp operator + (const SGTimeStamp& t, const long& m) { ++ return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000, ++ ( t.usec + m ) % 1000000 ); ++ } + + /** + * Subtract two time stamps returning the difference in microseconds. +@@ -89,7 +142,9 @@ public: + * @param b timestame 2 + * @return difference in microseconds + */ +- friend long operator - (const SGTimeStamp& a, const SGTimeStamp& b); ++ friend long operator - (const SGTimeStamp& a, const SGTimeStamp& b) { ++ return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec); ++ } + + /** @return the saved seconds of this time stamp */ + inline long get_seconds() const { return seconds; } diff --git a/SimGear.spec b/SimGear.spec index 8ce2ee0..8ac3ae2 100644 --- a/SimGear.spec +++ b/SimGear.spec @@ -1,5 +1,5 @@ Name: SimGear -Version: 1.9.0 +Version: 1.9.1 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries @@ -7,10 +7,10 @@ Summary: Simulation library components URL: http://www.simgear.org Source0: ftp://ftp.simgear.org/pub/simgear/Source/SimGear-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch0: SimGear-1.9.0-shared.patch +Patch0: SimGear-1.9.1-shared.patch Patch1: SimGear-1.9.0-notabbed_value_test.patch Patch2: SimGear-1.9.0-headers.patch -Patch5: SimGear-1.9.0-untangle.patch +Patch5: SimGear-1.9.1-untangle.patch Patch7: SimGear-1.9.0-more-archs.patch BuildRequires: openal-devel, plib-devel >= 1.8.5 BuildRequires: OpenSceneGraph-devel >= 2.6.0 @@ -112,6 +112,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libsgxml.so %changelog +* Tue Feb 03 2009 Fabrice Bellet 1.9.1-1 +- New upstream release + * Tue Jan 06 2009 Fabrice Bellet 1.9.0-1 - New upstream release diff --git a/sources b/sources index 9bdb8d8..1d90da2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c9e532dc8e80025bbd90c6be4a72aad1 SimGear-1.9.0.tar.gz +edfdaa60518a06699a409d0eb9f1b157 SimGear-1.9.1.tar.gz