aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteAuthenticationData.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteFramework.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteInventoryStore.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs3
-rw-r--r--OpenSim/Framework/Util.cs30
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs15
9 files changed, 51 insertions, 14 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index bb23fc1..d0e24c3 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
81 /// <param name="dbconnect">connect string</param> 81 /// <param name="dbconnect">connect string</param>
82 override public void Initialise(string dbconnect) 82 override public void Initialise(string dbconnect)
83 { 83 {
84 if (Util.IsWindows())
85 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
86
84 if (dbconnect == string.Empty) 87 if (dbconnect == string.Empty)
85 { 88 {
86 dbconnect = "URI=file:Asset.db,version=3"; 89 dbconnect = "URI=file:Asset.db,version=3";
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
index f51aa28..5120453 100644
--- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
@@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
65 65
66 if (!m_initialized) 66 if (!m_initialized)
67 { 67 {
68 if (Util.IsWindows())
69 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
70
68 m_Connection = new SqliteConnection(connectionString); 71 m_Connection = new SqliteConnection(connectionString);
69 m_Connection.Open(); 72 m_Connection.Open();
70 73
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index 8db9262..c042ba2 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
69 69
70 public void Initialise(string connectionString) 70 public void Initialise(string connectionString)
71 { 71 {
72 if (Util.IsWindows())
73 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
74
72 m_connectionString = connectionString; 75 m_connectionString = connectionString;
73 76
74 m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); 77 m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
diff --git a/OpenSim/Data/SQLite/SQLiteFramework.cs b/OpenSim/Data/SQLite/SQLiteFramework.cs
index 4992bcc..1594717 100644
--- a/OpenSim/Data/SQLite/SQLiteFramework.cs
+++ b/OpenSim/Data/SQLite/SQLiteFramework.cs
@@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
48 48
49 protected SQLiteFramework(string connectionString) 49 protected SQLiteFramework(string connectionString)
50 { 50 {
51 if (Util.IsWindows())
52 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
51 } 53 }
52 54
53 ////////////////////////////////////////////////////////////// 55 //////////////////////////////////////////////////////////////
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index 7dc07ec..ccbd154 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
77 { 77 {
78 m_Initialized = true; 78 m_Initialized = true;
79 79
80 if (Util.IsWindows())
81 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
82
80 if (dbconnect == string.Empty) 83 if (dbconnect == string.Empty)
81 { 84 {
82 dbconnect = "URI=file:inventoryStore.db,version=3"; 85 dbconnect = "URI=file:inventoryStore.db,version=3";
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 6295113..186a586 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -110,6 +110,9 @@ namespace OpenSim.Data.SQLite
110 { 110 {
111 try 111 try
112 { 112 {
113 if (Util.IsWindows())
114 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
115
113 m_connectionString = connectionString; 116 m_connectionString = connectionString;
114 117
115 ds = new DataSet("Region"); 118 ds = new DataSet("Region");
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 16f9046..1f36986 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
52 52
53 public SQLiteXInventoryData(string conn, string realm) 53 public SQLiteXInventoryData(string conn, string realm)
54 { 54 {
55 if (Util.IsWindows())
56 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
57
55 m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>( 58 m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
56 conn, "inventoryfolders", "XInventoryStore"); 59 conn, "inventoryfolders", "XInventoryStore");
57 m_Items = new SqliteItemHandler( 60 m_Items = new SqliteItemHandler(
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index b3ec5c2..efa4a7b 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -392,6 +392,36 @@ namespace OpenSim.Framework
392 || platformId == PlatformID.WinCE); 392 || platformId == PlatformID.WinCE);
393 } 393 }
394 394
395 public static bool LoadArchSpecificWindowsDll(string libraryName)
396 {
397 // We do this so that OpenSimulator on Windows loads the correct native library depending on whether
398 // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
399 // will find it already loaded later on.
400 //
401 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
402 // controlled in config files.
403 string nativeLibraryPath;
404
405 if (Util.Is64BitProcess())
406 nativeLibraryPath = "lib64/" + libraryName;
407 else
408 nativeLibraryPath = "lib32/" + libraryName;
409
410 m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
411
412 if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
413 {
414 m_log.ErrorFormat(
415 "[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
416
417 return false;
418 }
419 else
420 {
421 return true;
422 }
423 }
424
395 public static bool IsEnvironmentSupported(ref string reason) 425 public static bool IsEnvironmentSupported(ref string reason)
396 { 426 {
397 // Must have .NET 2.0 (Generics / libsl) 427 // Must have .NET 2.0 (Generics / libsl)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index e8bb476..478dd95 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -66,20 +66,7 @@ namespace OpenSim.Region.Physics.OdePlugin
66 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be 66 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
67 // controlled in Ode.NET.dll.config 67 // controlled in Ode.NET.dll.config
68 if (Util.IsWindows()) 68 if (Util.IsWindows())
69 { 69 Util.LoadArchSpecificWindowsDll("ode.dll");
70 string nativeLibraryPath;
71
72 if (Util.Is64BitProcess())
73 nativeLibraryPath = "lib64/ode.dll";
74 else
75 nativeLibraryPath = "lib32/ode.dll";
76
77 m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
78
79 if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
80 m_log.ErrorFormat(
81 "[ODE PLUGIN]: Couldn't find native Windows ODE library at {0}", nativeLibraryPath);
82 }
83 70
84 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to 71 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
85 // http://opensimulator.org/mantis/view.php?id=2750). 72 // http://opensimulator.org/mantis/view.php?id=2750).