summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorRainer Müller <raimue@codingfarm.de>2018-03-31 00:53:56 +0200
committerTingPing <tingping@tingping.se>2018-03-31 01:29:05 +0000
commit5ca767f7f881f480de90882233ed833846bd8a3d (patch)
tree28663f5950cb79a699c5b1f1a357f9be89f9f8c0 /src/fe-gtk
parent111441302c4eb0c719088526c5b8c4be3df6a0dc (diff)
Fix plugins on macOS
The switch to the meson build system broke plugins on macOS. GNU libtool
builds shared libraries with ".dylib" and shared modules (plugins) with
the extension ".so", but meson is using ".dylib" for both.

Although overriding the name_suffix for shared_module() in meson is
possible, this would be messy for other platforms as there is no way to
query the default. Therefore it seems like we have to go with ".dylib"
for now on macOS.

However, G_MODULE_SUFFIX is defined to ".so", because glib follows what
GNU libtool does. Therefore define a separate preprocessor macro that
has the correct extension.

See: https://github.com/mesonbuild/meson/issues/1160
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/plugingui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c
index 4399cd71..83bb745f 100644
--- a/src/fe-gtk/plugingui.c
+++ b/src/fe-gtk/plugingui.c
@@ -162,7 +162,7 @@ plugingui_load (void)
 	char *sub_dir = g_build_filename (get_xdir(), "addons", NULL);
 
 	gtkutil_file_req (_("Select a Plugin or Script to load"), plugingui_load_cb, current_sess,
-							sub_dir, "*."G_MODULE_SUFFIX";*.lua;*.pl;*.py;*.tcl;*.js", FRF_FILTERISINITIAL|FRF_EXTENSIONS);
+							sub_dir, "*."PLUGIN_SUFFIX";*.lua;*.pl;*.py;*.tcl;*.js", FRF_FILTERISINITIAL|FRF_EXTENSIONS);
 
 	g_free (sub_dir);
 }
@@ -185,7 +185,7 @@ plugingui_unload (GtkWidget * wid, gpointer unused)
 	                                    FILEPATH_COLUMN, &file, -1))
 		return;
 
-	if (g_str_has_suffix (file, "."G_MODULE_SUFFIX))
+	if (g_str_has_suffix (file, "."PLUGIN_SUFFIX))
 	{
 		if (plugin_kill (modname, FALSE) == 2)
 			fe_message (_("That plugin is refusing to unload.\n"), FE_MSG_ERROR);