From 0a2aac8dcaf9a53ef3abbede35e45d7d232fc77d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 26 Jun 2017 15:13:35 +0200 Subject: [PATCH] wineandroid: Allow putting libraries in the native library directory. Signed-off-by: Alexandre Julliard --- dlls/wineandroid.drv/WineActivity.java | 11 +++++++++-- dlls/wineandroid.drv/build.gradle.in | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/wineandroid.drv/WineActivity.java b/dlls/wineandroid.drv/WineActivity.java index 295ecc47b38..6c6edd51d4d 100644 --- a/dlls/wineandroid.drv/WineActivity.java +++ b/dlls/wineandroid.drv/WineActivity.java @@ -88,7 +88,7 @@ private void loadWine( String cmdline ) HashMap env = new HashMap(); env.put( "WINELOADER", loader.toString() ); env.put( "WINEPREFIX", prefix.toString() ); - env.put( "LD_LIBRARY_PATH", libdir.toString() ); + env.put( "LD_LIBRARY_PATH", libdir.toString() + ":" + getApplicationInfo().nativeLibraryDir ); env.put( "LC_ALL", locale ); env.put( "LANG", locale ); @@ -111,7 +111,14 @@ private void loadWine( String cmdline ) createProgressDialog( 0, "Setting up the Windows environment..." ); - System.load( libdir.toString() + "/libwine.so" ); + try + { + System.loadLibrary( "wine" ); + } + catch (java.lang.UnsatisfiedLinkError e) + { + System.load( libdir.toString() + "/libwine.so" ); + } prefix.mkdirs(); runWine( cmdline, env ); diff --git a/dlls/wineandroid.drv/build.gradle.in b/dlls/wineandroid.drv/build.gradle.in index 8f02a12c49b..53633b7cbbc 100644 --- a/dlls/wineandroid.drv/build.gradle.in +++ b/dlls/wineandroid.drv/build.gradle.in @@ -74,6 +74,7 @@ android { main.assets.srcDirs = [ "assets" ] main.java.srcDirs = [ "@srcdir@" ] + main.jniLibs.srcDirs = [ "lib" ] main.java.excludes = [ "build" ] main.res.srcDirs = [ "res" ] main.manifest.srcFile "@srcdir@/AndroidManifest.xml"