summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Cavalcante de Sousa <lucas@Mac-mini-de-Lucas.local>2020-11-25 10:40:17 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-11-25 10:43:47 -0300
commit4de94638a645517d9fd23454f81383a531a5c1b2 (patch)
tree183bdbefe26d466ddf2e9b4f246aa1701d0e15da
parentccc1849263d8019c712e0fee02673de15f30b3c5 (diff)
efl-mono: Correctly load dynamic libs for OSX
Summary: OSX libs end with `.dylib`, so it made failed to load libs, for instance dl name is `dl.dylib` making it unable to load as it was before (`libdl.so`). Test Plan: Compare with master and note that this diff is able to fail on tests, and not about importing libs. - Configure as especified by Enlightenment man page + `-Dbindigns=mono -Ddotnet=true`: ``` meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false -Dopengl=full -Dcocoa=true -Dnls=false -Demotion-loaders-disabler=gstreamer1,libvlc,xine -Decore-imf-loaders-disabler=scim,ibus -Dbindigns=cxx,mono -Ddotnet=true --prefix=$PWD/prefix build ``` - Build normally - Test `efl-mono-suite` Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: stefan_schmidt, cedric, #reviewers, #committers, woohyun Tags: #efl, #expertise_solutions Differential Revision: https://phab.enlightenment.org/D12156
-rw-r--r--src/bindings/mono/efl_mono/efl_libs.cs.in2
-rw-r--r--src/bindings/mono/efl_mono/meson.build5
-rw-r--r--src/bindings/mono/eo_mono/NativeModule_Unix.cs16
3 files changed, 22 insertions, 1 deletions
diff --git a/src/bindings/mono/efl_mono/efl_libs.cs.in b/src/bindings/mono/efl_mono/efl_libs.cs.in
index fcf5b18183..af811d494a 100644
--- a/src/bindings/mono/efl_mono/efl_libs.cs.in
+++ b/src/bindings/mono/efl_mono/efl_libs.cs.in
@@ -33,7 +33,7 @@ internal class Libs {
33 33
34 internal const string CustomExports = "@CUSTOM_EXPORTS_MONO_DL_MONO@"; 34 internal const string CustomExports = "@CUSTOM_EXPORTS_MONO_DL_MONO@";
35 35
36 internal const string Libdl = "libdl.so"; 36 internal const string Libdl = "@LIBDL_DL_MONO@";
37 internal const string Kernel32 = "kernel32.dll"; 37 internal const string Kernel32 = "kernel32.dll";
38 38
39 internal static readonly Efl.Eo.NativeModule EflModule = new Efl.Eo.NativeModule(Efl); 39 internal static readonly Efl.Eo.NativeModule EflModule = new Efl.Eo.NativeModule(Efl);
diff --git a/src/bindings/mono/efl_mono/meson.build b/src/bindings/mono/efl_mono/meson.build
index 165b6d55bd..5ca6f116d6 100644
--- a/src/bindings/mono/efl_mono/meson.build
+++ b/src/bindings/mono/efl_mono/meson.build
@@ -16,6 +16,11 @@ efl_libs = configuration_data()
16efl_libs.set('EFL_MONO_LIBRARY_MAP', map) 16efl_libs.set('EFL_MONO_LIBRARY_MAP', map)
17efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono') 17efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
18efl_libs.set('EVIL_DL_MONO', 'dl') 18efl_libs.set('EVIL_DL_MONO', 'dl')
19if sys_osx
20 efl_libs.set('LIBDL_DL_MONO', 'dl.dylib')
21else
22 efl_libs.set('LIBDL_DL_MONO', 'libdl.so')
23endif
19 24
20foreach mono_libs : mono_sublibs 25foreach mono_libs : mono_sublibs
21 key = mono_libs[0].to_upper()+'_DL_MONO' 26 key = mono_libs[0].to_upper()+'_DL_MONO'
diff --git a/src/bindings/mono/eo_mono/NativeModule_Unix.cs b/src/bindings/mono/eo_mono/NativeModule_Unix.cs
index 67409e02d1..b4dfeb8aea 100644
--- a/src/bindings/mono/eo_mono/NativeModule_Unix.cs
+++ b/src/bindings/mono/eo_mono/NativeModule_Unix.cs
@@ -56,6 +56,12 @@ internal partial class NativeModule
56 ///<item> 56 ///<item>
57 ///<description><c>libfilename.so</c></description> 57 ///<description><c>libfilename.so</c></description>
58 ///</item> 58 ///</item>
59 ///<item>
60 ///<description><c>filename.dylib</c></description>
61 ///</item>
62 ///<item>
63 ///<description><c>libfilename.dylib</c></description>
64 ///</item>
59 ///</list> 65 ///</list>
60 ///</summary> 66 ///</summary>
61 ///<param name="filename">The name to search for.</param> 67 ///<param name="filename">The name to search for.</param>
@@ -73,6 +79,16 @@ internal partial class NativeModule
73 if (r == IntPtr.Zero) 79 if (r == IntPtr.Zero)
74 { 80 {
75 r = dlopen("lib" + filename + ".so", RTLD_NOW | RTLD_GLOBAL); 81 r = dlopen("lib" + filename + ".so", RTLD_NOW | RTLD_GLOBAL);
82 if (r == IntPtr.Zero)
83 {
84 r = dlopen(filename + ".dylib", RTLD_NOW | RTLD_GLOBAL);
85 if (r == IntPtr.Zero)
86 {
87 r = dlopen("lib" + filename + ".dylib", RTLD_NOW | RTLD_GLOBAL);
88 }
89 }
90
91
76 } 92 }
77 } 93 }
78 } 94 }