summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-02 11:23:34 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-02 11:23:34 +0900
commit879d93377b219dca00be63f8139fee79b7938147 (patch)
treed6464712113b82a5125e3287e082ea7426333f41 /src
parentdd1d3f0d2d8f7369f7461f54928eac2a4fce99fb (diff)
efl runtime dynamic lib loading - make errors consistent and useful
so drop trying to appease the openbsd packages and stick to "upstream so major versions" and let users fix their systems with symlinks. also report what we are looking for so they have a chance to symlink to make efl happy. at some point we should make a single simple runtime lib linker subsystem in efl so all these errors are reported in the same way, input libray names are listed in a simple consistent way etc. etc. for now we have 3 locations in efl that do this and they are roughly similar. we can unify it later.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_audio/ecore_audio.c14
-rw-r--r--src/lib/ecore_con/ecore_con_url_curl.c32
-rw-r--r--src/lib/edje/edje_main.c12
3 files changed, 35 insertions, 23 deletions
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c
index d09d656008..fbb5ad0ee5 100644
--- a/src/lib/ecore_audio/ecore_audio.c
+++ b/src/lib/ecore_audio/ecore_audio.c
@@ -99,7 +99,7 @@ ecore_audio_pulse_lib_load(void)
99 { 99 {
100 if (!ecore_audio_pulse_lib->mod) 100 if (!ecore_audio_pulse_lib->mod)
101 { 101 {
102 ERR("Cannot find libpulse!"); 102 ERR("Cannot find libpulse at runtime!");
103 return EINA_FALSE; 103 return EINA_FALSE;
104 } 104 }
105 return EINA_TRUE; 105 return EINA_TRUE;
@@ -120,19 +120,25 @@ ecore_audio_pulse_lib_load(void)
120 LOAD("libpulse-0.dll"); 120 LOAD("libpulse-0.dll");
121 LOAD("libpulse.dll"); 121 LOAD("libpulse.dll");
122 LOAD("pulse.dll"); 122 LOAD("pulse.dll");
123 if (!ecore_audio_pulse_lib->mod)
124 ERR("Could not find libpulse-0.dll, libpulse.dll, pulse.dll");
123# elif defined(__APPLE__) && defined(__MACH__) 125# elif defined(__APPLE__) && defined(__MACH__)
124 LOAD("libpulse.0.dylib"); 126 LOAD("libpulse.0.dylib");
125 LOAD("libpulse.0.so"); 127 LOAD("libpulse.0.so");
126 LOAD("libpulse.so.0"); 128 LOAD("libpulse.so.0");
129 if (!ecore_audio_pulse_lib->mod)
130 ERR("Could not find libpulse.0.dylib, libpulse.0.so, libpulse.so.0");
127# else 131# else
128 LOAD("libpulse.so.0"); 132 LOAD("libpulse.so.0");
133 if (!ecore_audio_pulse_lib->mod)
134 ERR("Could not find libpulse.so.0");
129# endif 135# endif
130# undef LOAD 136# undef LOAD
131 if (!ecore_audio_pulse_lib->mod) return EINA_FALSE; 137 if (!ecore_audio_pulse_lib->mod) return EINA_FALSE;
132 138
133#define SYM(x) \ 139#define SYM(x) \
134 if (!(ecore_audio_pulse_lib->x = eina_module_symbol_get(ecore_audio_pulse_lib->mod, #x))) { \ 140 if (!(ecore_audio_pulse_lib->x = eina_module_symbol_get(ecore_audio_pulse_lib->mod, #x))) { \
135 ERR("libpulse - cannot find %s", #x); \ 141 ERR("Cannot find symbol '%s' in'%s", #x, eina_module_file_get(ecore_audio_pulse_lib->mod)); \
136 goto err; \ 142 goto err; \
137 } 143 }
138 SYM(pa_context_new); 144 SYM(pa_context_new);
@@ -186,7 +192,7 @@ ecore_audio_sndfile_lib_load(void)
186 { 192 {
187 if (!ecore_audio_sndfile_lib->mod) 193 if (!ecore_audio_sndfile_lib->mod)
188 { 194 {
189 ERR("Cannot find libsndfile!"); 195 ERR("Cannot find libsndfile at runtime!");
190 return EINA_FALSE; 196 return EINA_FALSE;
191 } 197 }
192 return EINA_TRUE; 198 return EINA_TRUE;
@@ -219,7 +225,7 @@ ecore_audio_sndfile_lib_load(void)
219 225
220#define SYM(x) \ 226#define SYM(x) \
221 if (!(ecore_audio_sndfile_lib->x = eina_module_symbol_get(ecore_audio_sndfile_lib->mod, #x))) { \ 227 if (!(ecore_audio_sndfile_lib->x = eina_module_symbol_get(ecore_audio_sndfile_lib->mod, #x))) { \
222 ERR("libsndfile - cannot find %s", #x); \ 228 ERR("Cannot find symbol '%s' in'%s", #x, eina_module_file_get(ecore_audio_pulse_lib->mod)); \
223 goto err; \ 229 goto err; \
224 } 230 }
225 SYM(sf_open); 231 SYM(sf_open);
diff --git a/src/lib/ecore_con/ecore_con_url_curl.c b/src/lib/ecore_con/ecore_con_url_curl.c
index 56eb424b0c..e241ecd6c1 100644
--- a/src/lib/ecore_con/ecore_con_url_curl.c
+++ b/src/lib/ecore_con/ecore_con_url_curl.c
@@ -32,7 +32,11 @@ _c_init(void)
32 long ms = 0; 32 long ms = 0;
33 33
34 if (_c) return EINA_TRUE; 34 if (_c) return EINA_TRUE;
35 if (_c_fail) return EINA_FALSE; 35 if (_c_fail)
36 {
37 ERR("Cannot find libcurl at runtime!");
38 return EINA_FALSE;
39 }
36 _c = calloc(1, sizeof(Ecore_Con_Curl)); 40 _c = calloc(1, sizeof(Ecore_Con_Curl));
37 if (!_c) goto error; 41 if (!_c) goto error;
38 42
@@ -50,32 +54,28 @@ _c_init(void)
50 LOAD("libcurl-4.dll"); // try correct dll first 54 LOAD("libcurl-4.dll"); // try correct dll first
51 LOAD("libcurl.dll"); // try 1 55 LOAD("libcurl.dll"); // try 1
52 LOAD("curllib.dll"); // if fail try 2 56 LOAD("curllib.dll"); // if fail try 2
57 if (!_c->mod)
58 ERR("Could not find libcurl-5.dll, libcurl-4.dll, libcurl.dll, curllib.dll");
53#elif defined(__APPLE__) && defined(__MACH__) 59#elif defined(__APPLE__) && defined(__MACH__)
54 LOAD("libcurl.5.dylib"); // try 1 60 LOAD("libcurl.5.dylib"); // try 1
55 LOAD("libcurl.4.dylib"); // try 1 61 LOAD("libcurl.4.dylib"); // try 1
56 LOAD("libcurl.so.5"); // if fail try 2 62 LOAD("libcurl.so.5"); // if fail try 2
57 LOAD("libcurl.so.4"); // if fail try 2 63 LOAD("libcurl.so.4"); // if fail try 2
58#elif defined(__OpenBSD__) 64 if (!_c->mod)
59 { 65 ERR("Could not find libcurl.5.dylib, libcurl.4.dylib, libcurl.so.5, libcurl.so.4");
60 char buf[64];
61 int min;
62 int maj = 25;
63
64 for (min = 0; min < 10; min++)
65 {
66 snprintf(buf, sizeof (buf), "libcurl.so.%d.%d", maj, min);
67 LOAD(buf);
68 if (_c->mod) break;
69 }
70 }
71#else 66#else
72 LOAD("libcurl.so.5"); // try only 67 LOAD("libcurl.so.5"); // try only
73 LOAD("libcurl.so.4"); // try only 68 LOAD("libcurl.so.4"); // try only
69 if (!_c->mod)
70 ERR("Could not find libcurl.so.5, libcurl.so.4");
74#endif 71#endif
75 if (!_c->mod) goto error; 72 if (!_c->mod) goto error;
76 73
77#define SYM(x) if (!(_c->x = eina_module_symbol_get(_c->mod, #x))) \ 74#define SYM(x) \
78 goto error 75 if (!(_c->x = eina_module_symbol_get(_c->mod, #x))) { \
76 ERR("Cannot find symbol '%s' in'%s", #x, eina_module_file_get(_c->mod)); \
77 goto error; \
78 }
79 SYM(curl_global_init); 79 SYM(curl_global_init);
80 SYM(curl_global_cleanup); 80 SYM(curl_global_cleanup);
81 SYM(curl_multi_init); 81 SYM(curl_multi_init);
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index ee7ecd2deb..7bb4774b71 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -334,12 +334,11 @@ _edje_ephysics_load(void)
334 { 334 {
335 if (!_edje_ephysics->mod) 335 if (!_edje_ephysics->mod)
336 { 336 {
337 ERR("Cannot find libpulse!"); 337 ERR("Cannot find libephysics at runtime!");
338 return EINA_FALSE; 338 return EINA_FALSE;
339 } 339 }
340 return EINA_TRUE; 340 return EINA_TRUE;
341 } 341 }
342 ERR("PHYYYYYYYYYYYYYYZIKS");
343 _edje_ephysics = calloc(1, sizeof(Edje_Ephysics)); 342 _edje_ephysics = calloc(1, sizeof(Edje_Ephysics));
344 if (!_edje_ephysics) return EINA_FALSE; 343 if (!_edje_ephysics) return EINA_FALSE;
345# define LOAD(x) \ 344# define LOAD(x) \
@@ -353,19 +352,26 @@ _edje_ephysics_load(void)
353 } 352 }
354# if defined(_WIN32) || defined(__CYGWIN__) 353# if defined(_WIN32) || defined(__CYGWIN__)
355 LOAD("libephysics-1.dll"); 354 LOAD("libephysics-1.dll");
355 LOAD("libephysics1.dll");
356 LOAD("libephysics.dll"); 356 LOAD("libephysics.dll");
357 if (!_edje_ephysics->mod)
358 ERR("Could not find libephysics-1.dll, libephysics1.dll, libephysics.dll");
357# elif defined(__APPLE__) && defined(__MACH__) 359# elif defined(__APPLE__) && defined(__MACH__)
358 LOAD("libephysics.1.dylib"); 360 LOAD("libephysics.1.dylib");
359 LOAD("libephysics.1.so"); 361 LOAD("libephysics.1.so");
360 LOAD("libephysics.so.1"); 362 LOAD("libephysics.so.1");
363 if (!_edje_ephysics->mod)
364 ERR("Could not find libephysics.1.dylib, libephysics.1.so, libephysics.so.1");
361# else 365# else
362 LOAD("libephysics.so.1"); 366 LOAD("libephysics.so.1");
367 if (!_edje_ephysics->mod)
368 ERR("Could not find libephysics.so.1");
363# endif 369# endif
364# undef LOAD 370# undef LOAD
365 if (!_edje_ephysics->mod) return EINA_FALSE; 371 if (!_edje_ephysics->mod) return EINA_FALSE;
366# define SYM(x) \ 372# define SYM(x) \
367 if (!(_edje_ephysics->x = eina_module_symbol_get(_edje_ephysics->mod, #x))) { \ 373 if (!(_edje_ephysics->x = eina_module_symbol_get(_edje_ephysics->mod, #x))) { \
368 ERR("libpulse - cannot find %s", #x); \ 374 ERR("Cannot find symbol '%s' in'%s", #x, eina_module_file_get(_edje_ephysics->mod)); \
369 goto err; \ 375 goto err; \
370 } 376 }
371 SYM(ephysics_init); 377 SYM(ephysics_init);