[geany/geany] 700c05: Autotools: Build plugins with Libtool on MinGW too

Colomban Wendling git-noreply at xxxxx
Tue Jan 20 15:04:54 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Tue, 20 Jan 2015 15:04:54 UTC
Commit:      700c05e413189479259a399878ba2383acbbcceb
             https://github.com/geany/geany/commit/700c05e413189479259a399878ba2383acbbcceb

Log Message:
-----------
Autotools: Build plugins with Libtool on MinGW too


Modified Paths:
--------------
    plugins/Makefile.am

Modified: plugins/Makefile.am
72 lines changed, 26 insertions(+), 46 deletions(-)
===================================================================
@@ -18,50 +18,16 @@ geanyfunctions.h: genapi.py ../src/plugins.c
 all: geanyfunctions.h
 
 
-demoplugin_la_LDFLAGS    = -module -avoid-version
-classbuilder_la_LDFLAGS  = -module -avoid-version
-htmlchars_la_LDFLAGS     = -module -avoid-version
-export_la_LDFLAGS        = -module -avoid-version
-saveactions_la_LDFLAGS   = -module -avoid-version
-filebrowser_la_LDFLAGS   = -module -avoid-version
-splitwindow_la_LDFLAGS   = -module -avoid-version
+demoplugin_la_LDFLAGS    = -module -avoid-version -no-undefined
+classbuilder_la_LDFLAGS  = -module -avoid-version -no-undefined
+htmlchars_la_LDFLAGS     = -module -avoid-version -no-undefined
+export_la_LDFLAGS        = -module -avoid-version -no-undefined
+saveactions_la_LDFLAGS   = -module -avoid-version -no-undefined
+filebrowser_la_LDFLAGS   = -module -avoid-version -no-undefined
+splitwindow_la_LDFLAGS   = -module -avoid-version -no-undefined
 
 if PLUGINS
 
-if MINGW
-# build Geany for Windows on non-Windows systems (cross-compile)
-# (this is a little hack'ish and surely can be improved)
-DLL_LD_FLAGS = -module -avoid-version
-MINGW_CFLAGS = \
-			-DGEANY_DATADIR=\"data\" \
-			-DHAVE_CONFIG_H \
-			-DGTK \
-			-I$(top_srcdir) \
-			-I$(top_srcdir)/src \
-			-I$(top_srcdir)/tagmanager/src \
-			-I$(top_srcdir)/scintilla/include \
-			$(GTK_CFLAGS) \
-			$(PLUGIN_CFLAGS)
-
-.PHONY: all clean
-
-all-local: \
-	classbuilder.dll \
-	htmlchars.dll \
-	export.dll \
-	saveactions.dll \
-	splitwindow.dll \
-	filebrowser.dll
-
-.c.dll:
-	$(CC) $(MINGW_CFLAGS) -o $@.o -c $<
-	$(CC) -shared $@.o $(GTK_LIBS) $(DLL_LD_FLAGS) -o $@
-
-clean:
-	rm -f *.o *.dll
-
-else
-
 # Plugins to be installed
 plugin_LTLIBRARIES = \
 	classbuilder.la \
@@ -99,11 +65,16 @@ saveactions_la_LIBADD   = $(GTK_LIBS)
 filebrowser_la_LIBADD   = $(GTK_LIBS)
 splitwindow_la_LIBADD   = $(GTK_LIBS)
 
-endif # MINGW
 endif # PLUGINS
 
-AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
+if MINGW
+# FIXME: why is this define different than the non-MINGW one?
+AM_CPPFLAGS = -DGEANY_DATADIR=\"data\"
+else
+AM_CPPFLAGS = -DDATADIR=\"$(datadir)\"
+endif
+
+AM_CPPFLAGS += \
 	-DGTK \
 	-I$(top_srcdir)/src \
 	-I$(top_srcdir)/tagmanager/src \
@@ -115,10 +86,19 @@ AM_CPPFLAGS = \
 # This part allows people to build their own plugins in here.
 # Yes, it's a mess.
 #
+custom_plugins_cppflags = -DHAVE_CONFIG_H -I$(top_srcdir)
+custom_plugins_ldflags = -module -avoid-version
+if MINGW
+SUFFIXES = .c .dll
+.c.dll:
+	$(CC) $(AM_CPPFLAGS) $(custom_plugins_cppflags) $(CPPFLAGS) $(CFLAGS) -o $@.o -c $<
+	$(CC) -shared $@.o $(GTK_LIBS) $(custom_plugins_ldflags) $(LIBS) $(PLUGIN_LIBS) $(LDFLAGS) -o $@
+else
 SUFFIXES = .c .so
 .c.so:
-	$(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H -I$(top_srcdir) $(AM_CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo $(PLUGIN_CFLAGS)
-	$(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) -module -avoid-version $(PLUGIN_LIBS)
+	$(LIBTOOL) --mode=compile $(CC) $(AM_CPPFLAGS) $(custom_plugins_cppflags) $(CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo
+	$(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) $(custom_plugins_ldflags) $(PLUGIN_LIBS)
 	@rm -f tmp$@.lo tmp$@.o libtmp$@.la
 	@cp .libs/libtmp$@.so* $@
 	@rm -f .libs/libtmp$@.*
+endif



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list