From ebad47c405beb91a8ae59d937a901a8e327847a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Mon, 29 Feb 2016 00:54:05 +0100 Subject: [PATCH 1/6] Set docdir on Windows builds And remove unused define PKGLIBDIR and quote paths even. --- build/common.m4 | 2 +- build/vars.build.mk | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/common.m4 b/build/common.m4 index ea240a1c7..913eb197e 100644 --- a/build/common.m4 +++ b/build/common.m4 @@ -65,7 +65,7 @@ AC_DEFUN([GP_COMMIT_PLUGIN_STATUS], GP_STATUS_PLUGIN_ADD([$1], [$m4_tolower(AS_TR_SH(enable_$1))]) ]) -dnl GEANY_CHECK_MINGW +dnl GP_CHECK_MINGW dnl Checks whether we're building for MinGW, and defines appropriate stuff dnl if it is the case. dnl Most importantly, AM_CODITIONALs MINGW diff --git a/build/vars.build.mk b/build/vars.build.mk index c759c646e..258d90b4e 100644 --- a/build/vars.build.mk +++ b/build/vars.build.mk @@ -2,11 +2,11 @@ if MINGW LOCAL_AM_CFLAGS = \ -DLOCALEDIR=\""share/locale"\" \ -DPREFIX=\"\" \ - -DDOCDIR=\"\" \ - -DGEANYPLUGINS_DATADIR=\"share\" \ + -DDOCDIR=\""share/doc/geany-plugins"\" \ + -DGEANYPLUGINS_DATADIR=\""share"\" \ -DPKGDATADIR=\""share/geany-plugins"\" \ -DLIBDIR=\""lib"\" \ - -DPKGLIBDIR=\"\" + -DPKGLIBDIR=\""lib/geany-plugins"\" else LOCAL_AM_CFLAGS = \ -DLOCALEDIR=\""$(LOCALEDIR)"\" \ @@ -22,7 +22,7 @@ AM_CFLAGS = \ ${LOCAL_AM_CFLAGS} \ $(GEANY_CFLAGS) \ $(GP_CFLAGS) - + AM_LDFLAGS = -module -avoid-version -no-undefined $(GP_LDFLAGS) From 9371238c0f74cff6a1c1ed75489097e89bc011c0 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 12 Mar 2016 19:35:15 +0100 Subject: [PATCH 2/6] Use $(PACKAGE) instead of hard-coding its value --- build/vars.build.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/vars.build.mk b/build/vars.build.mk index 258d90b4e..fcddc4b40 100644 --- a/build/vars.build.mk +++ b/build/vars.build.mk @@ -2,11 +2,11 @@ if MINGW LOCAL_AM_CFLAGS = \ -DLOCALEDIR=\""share/locale"\" \ -DPREFIX=\"\" \ - -DDOCDIR=\""share/doc/geany-plugins"\" \ + -DDOCDIR=\""share/doc/$(PACKAGE)"\" \ -DGEANYPLUGINS_DATADIR=\""share"\" \ - -DPKGDATADIR=\""share/geany-plugins"\" \ + -DPKGDATADIR=\""share/$(PACKAGE)"\" \ -DLIBDIR=\""lib"\" \ - -DPKGLIBDIR=\""lib/geany-plugins"\" + -DPKGLIBDIR=\""lib/$(PACKAGE)"\" else LOCAL_AM_CFLAGS = \ -DLOCALEDIR=\""$(LOCALEDIR)"\" \ From 85ed43873e440b11781140f0ae43e9d733a7e744 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 12 Mar 2016 17:19:00 +0100 Subject: [PATCH 3/6] Define PLUGIN and PLUGIN{DATA,DOC,LIB}DIR for all plugins This helps for locating data files, and to define those appropriately depending on the platform (Windows). --- addons/src/Makefile.am | 1 + autoclose/src/Makefile.am | 1 + automark/src/Makefile.am | 1 + build/vars.build.mk | 4 ++++ codenav/src/Makefile.am | 1 + commander/src/Makefile.am | 1 - defineformat/src/Makefile.am | 1 + geanyctags/src/Makefile.am | 1 - geanydoc/src/Makefile.am | 1 + geanydoc/tests/Makefile.am | 1 + geanyextrasel/src/Makefile.am | 1 + geanyinsertnum/src/Makefile.am | 1 + geanylatex/src/Makefile.am | 1 + geanylipsum/src/Makefile.am | 1 + geanymacro/src/Makefile.am | 1 + geanyminiscript/src/Makefile.am | 1 + geanynumberedbookmarks/src/Makefile.am | 1 + geanypg/src/Makefile.am | 1 + geanyprj/src/Makefile.am | 1 + geanypy/src/Makefile.am | 1 + geanysendmail/src/Makefile.am | 1 + geanyvc/src/Makefile.am | 1 + geniuspaste/src/Makefile.am | 1 - git-changebar/src/Makefile.am | 3 +-- lineoperations/src/Makefile.am | 1 + pairtaghighlighter/src/Makefile.am | 1 + pretty-printer/src/Makefile.am | 1 + projectorganizer/src/Makefile.am | 2 +- scope/src/Makefile.am | 1 - shiftcolumn/src/Makefile.am | 1 + spellcheck/src/Makefile.am | 1 + tableconvert/src/Makefile.am | 1 + treebrowser/src/Makefile.am | 1 + xmlsnippets/src/Makefile.am | 1 + 34 files changed, 33 insertions(+), 7 deletions(-) diff --git a/addons/src/Makefile.am b/addons/src/Makefile.am index c8a8f51a6..da9b1de55 100644 --- a/addons/src/Makefile.am +++ b/addons/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = addons geanyplugins_LTLIBRARIES = addons.la diff --git a/autoclose/src/Makefile.am b/autoclose/src/Makefile.am index 7b953b57e..2bf464a04 100644 --- a/autoclose/src/Makefile.am +++ b/autoclose/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = autoclose geanyplugins_LTLIBRARIES = autoclose.la diff --git a/automark/src/Makefile.am b/automark/src/Makefile.am index b0f5186dd..bf1e4f3ca 100644 --- a/automark/src/Makefile.am +++ b/automark/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = automark geanyplugins_LTLIBRARIES = automark.la diff --git a/build/vars.build.mk b/build/vars.build.mk index fcddc4b40..98008c802 100644 --- a/build/vars.build.mk +++ b/build/vars.build.mk @@ -20,6 +20,10 @@ endif AM_CFLAGS = \ ${LOCAL_AM_CFLAGS} \ + -DPLUGIN="\"$(plugin)\"" \ + -DPLUGINDATADIR="PKGDATADIR\"/\"PLUGIN" \ + -DPLUGINDOCDIR="DOCDIR\"/\"PLUGIN" \ + -DPLUGINLIBDIR="PKGLIBDIR\"/\"PLUGIN" \ $(GEANY_CFLAGS) \ $(GP_CFLAGS) diff --git a/codenav/src/Makefile.am b/codenav/src/Makefile.am index 99e1f171a..a18911b3b 100644 --- a/codenav/src/Makefile.am +++ b/codenav/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = codenav geanyplugins_LTLIBRARIES = codenav.la diff --git a/commander/src/Makefile.am b/commander/src/Makefile.am index 461ac126a..b7e6b3b6e 100644 --- a/commander/src/Makefile.am +++ b/commander/src/Makefile.am @@ -6,7 +6,6 @@ geanyplugins_LTLIBRARIES = commander.la commander_la_SOURCES = commander-plugin.c commander_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DPLUGIN=\"$(plugin)\" \ -DG_LOG_DOMAIN=\"Commander\" commander_la_CFLAGS = $(AM_CFLAGS) \ $(COMMANDER_CFLAGS) diff --git a/defineformat/src/Makefile.am b/defineformat/src/Makefile.am index 96217b575..d312ceb7d 100644 --- a/defineformat/src/Makefile.am +++ b/defineformat/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = defineformat geanyplugins_LTLIBRARIES = defineformat.la diff --git a/geanyctags/src/Makefile.am b/geanyctags/src/Makefile.am index 2b58e3b63..ffd38a8c2 100644 --- a/geanyctags/src/Makefile.am +++ b/geanyctags/src/Makefile.am @@ -9,7 +9,6 @@ geanyctags_la_SOURCES = \ readtags.c geanyctags_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DPLUGIN=\"$(plugin)\" \ -DG_LOG_DOMAIN=\"GeanyCtags\" geanyctags_la_CFLAGS = $(AM_CFLAGS) geanyctags_la_LIBADD = $(COMMONLIBS) diff --git a/geanydoc/src/Makefile.am b/geanydoc/src/Makefile.am index fb624ca58..ef47408d6 100644 --- a/geanydoc/src/Makefile.am +++ b/geanydoc/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanydoc geanyplugins_LTLIBRARIES = geanydoc.la diff --git a/geanydoc/tests/Makefile.am b/geanydoc/tests/Makefile.am index 7be684890..46c5cb572 100644 --- a/geanydoc/tests/Makefile.am +++ b/geanydoc/tests/Makefile.am @@ -1,5 +1,6 @@ if UNITTESTS include $(top_srcdir)/build/vars.build.mk +plugin = geanydoc TESTS=unittests noinst_PROGRAMS=unittests unittests_SOURCES = unittests.c diff --git a/geanyextrasel/src/Makefile.am b/geanyextrasel/src/Makefile.am index 36e9bc203..ff75a1d09 100644 --- a/geanyextrasel/src/Makefile.am +++ b/geanyextrasel/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanyextrasel geanyplugins_LTLIBRARIES = geanyextrasel.la diff --git a/geanyinsertnum/src/Makefile.am b/geanyinsertnum/src/Makefile.am index 04caa293d..2cbb82415 100644 --- a/geanyinsertnum/src/Makefile.am +++ b/geanyinsertnum/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanyinsertnum geanyplugins_LTLIBRARIES = geanyinsertnum.la diff --git a/geanylatex/src/Makefile.am b/geanylatex/src/Makefile.am index 99ffa4a8a..bbc20cf75 100644 --- a/geanylatex/src/Makefile.am +++ b/geanylatex/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanylatex geanyplugins_LTLIBRARIES = geanylatex.la diff --git a/geanylipsum/src/Makefile.am b/geanylipsum/src/Makefile.am index 969b2ee40..2724ce037 100644 --- a/geanylipsum/src/Makefile.am +++ b/geanylipsum/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanylipsum geanyplugins_LTLIBRARIES = geanylipsum.la diff --git a/geanymacro/src/Makefile.am b/geanymacro/src/Makefile.am index a19baea88..878fb56f1 100644 --- a/geanymacro/src/Makefile.am +++ b/geanymacro/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanymacro geanyplugins_LTLIBRARIES = geanymacro.la diff --git a/geanyminiscript/src/Makefile.am b/geanyminiscript/src/Makefile.am index bc7c7a5a8..e8e4f4d40 100644 --- a/geanyminiscript/src/Makefile.am +++ b/geanyminiscript/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanyminiscript geanyplugins_LTLIBRARIES = geanyminiscript.la diff --git a/geanynumberedbookmarks/src/Makefile.am b/geanynumberedbookmarks/src/Makefile.am index 455aca5b1..f7d9de582 100644 --- a/geanynumberedbookmarks/src/Makefile.am +++ b/geanynumberedbookmarks/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanynumberedbookmarks geanyplugins_LTLIBRARIES = geanynumberedbookmarks.la diff --git a/geanypg/src/Makefile.am b/geanypg/src/Makefile.am index f6116fec0..993fc0e97 100644 --- a/geanypg/src/Makefile.am +++ b/geanypg/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanypg geanyplugins_LTLIBRARIES = geanypg.la diff --git a/geanyprj/src/Makefile.am b/geanyprj/src/Makefile.am index a7c7e7b5c..8533b505e 100644 --- a/geanyprj/src/Makefile.am +++ b/geanyprj/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanyprj geanyplugins_LTLIBRARIES = geanyprj.la diff --git a/geanypy/src/Makefile.am b/geanypy/src/Makefile.am index b172984c9..d38acdb23 100644 --- a/geanypy/src/Makefile.am +++ b/geanypy/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanypy geanyplugin_LTLIBRARIES = geanypy.la geanyplugindir = $(libdir)/geany diff --git a/geanysendmail/src/Makefile.am b/geanysendmail/src/Makefile.am index 3e2f541d9..b9d98cc71 100644 --- a/geanysendmail/src/Makefile.am +++ b/geanysendmail/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanysendmail geanyplugins_LTLIBRARIES = geanysendmail.la diff --git a/geanyvc/src/Makefile.am b/geanyvc/src/Makefile.am index 262224b8f..9531da7e6 100644 --- a/geanyvc/src/Makefile.am +++ b/geanyvc/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = geanyvc geanyplugins_LTLIBRARIES = geanyvc.la diff --git a/geniuspaste/src/Makefile.am b/geniuspaste/src/Makefile.am index 84b79bdf1..5e0dbe39f 100644 --- a/geniuspaste/src/Makefile.am +++ b/geniuspaste/src/Makefile.am @@ -7,7 +7,6 @@ geanyplugins_LTLIBRARIES = geniuspaste.la geniuspaste_la_SOURCES = geniuspaste.c geniuspaste_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ - -DPLUGINDATADIR=\"$(plugindatadir)\" \ -DGEANY_VERSION=\"$(GEANY_VERSION)\" \ -DG_LOG_DOMAIN=\"GeniusPaste\" geniuspaste_la_CFLAGS = \ diff --git a/git-changebar/src/Makefile.am b/git-changebar/src/Makefile.am index c159d28dd..c18554f1c 100644 --- a/git-changebar/src/Makefile.am +++ b/git-changebar/src/Makefile.am @@ -4,8 +4,7 @@ plugin = git-changebar geanyplugins_LTLIBRARIES = git-changebar.la git_changebar_la_SOURCES = gcb-plugin.c -git_changebar_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"GitChangeBar\" \ - -DPLUGIN=\""$(plugin)"\" +git_changebar_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"GitChangeBar\" git_changebar_la_CFLAGS = $(AM_CFLAGS) $(GITCHANGEBAR_CFLAGS) git_changebar_la_LIBADD = $(COMMONLIBS) \ $(GITCHANGEBAR_LIBS) diff --git a/lineoperations/src/Makefile.am b/lineoperations/src/Makefile.am index 724bf6bd5..ae9c5e663 100644 --- a/lineoperations/src/Makefile.am +++ b/lineoperations/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = lineoperations geanyplugins_LTLIBRARIES = lineoperations.la diff --git a/pairtaghighlighter/src/Makefile.am b/pairtaghighlighter/src/Makefile.am index ac781c53d..da3d19b6f 100644 --- a/pairtaghighlighter/src/Makefile.am +++ b/pairtaghighlighter/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = pairtaghighlighter geanyplugins_LTLIBRARIES = pairtaghighlighter.la diff --git a/pretty-printer/src/Makefile.am b/pretty-printer/src/Makefile.am index ee311bb78..444c5518f 100644 --- a/pretty-printer/src/Makefile.am +++ b/pretty-printer/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = pretty-printer geanyplugins_LTLIBRARIES = pretty-printer.la diff --git a/projectorganizer/src/Makefile.am b/projectorganizer/src/Makefile.am index 6d2dadd0e..cf0f2f9c0 100644 --- a/projectorganizer/src/Makefile.am +++ b/projectorganizer/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = projectorganizer geanyplugins_LTLIBRARIES = projectorganizer.la @@ -14,7 +15,6 @@ projectorganizer_la_SOURCES = \ prjorg-menu.c projectorganizer_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DPLUGIN=\"$(plugin)\" \ -DG_LOG_DOMAIN=\"ProjectOrganizer\" projectorganizer_la_CFLAGS = $(AM_CFLAGS) projectorganizer_la_LIBADD = $(COMMONLIBS) diff --git a/scope/src/Makefile.am b/scope/src/Makefile.am index d30a52c69..5a034e1bb 100644 --- a/scope/src/Makefile.am +++ b/scope/src/Makefile.am @@ -54,7 +54,6 @@ scope_la_SOURCES = \ scope_la_LIBADD = $(COMMONLIBS) $(VTE_LIBS) $(PTY_LIBS) scope_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS) \ - -DPLUGINDATADIR=\"$(plugindatadir)\" \ -DPLUGINHTMLDOCDIR=\"$(plugindocdir)/html\" \ -Wno-shadow diff --git a/shiftcolumn/src/Makefile.am b/shiftcolumn/src/Makefile.am index 2253824a7..5c54679bb 100644 --- a/shiftcolumn/src/Makefile.am +++ b/shiftcolumn/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = shiftcolumn geanyplugins_LTLIBRARIES = shiftcolumn.la diff --git a/spellcheck/src/Makefile.am b/spellcheck/src/Makefile.am index 6af787c55..7f0c5d22a 100644 --- a/spellcheck/src/Makefile.am +++ b/spellcheck/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = spellcheck geanyplugins_LTLIBRARIES = spellcheck.la diff --git a/tableconvert/src/Makefile.am b/tableconvert/src/Makefile.am index a43291bdf..bb29add10 100644 --- a/tableconvert/src/Makefile.am +++ b/tableconvert/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = tableconvert geanyplugins_LTLIBRARIES = tableconvert.la diff --git a/treebrowser/src/Makefile.am b/treebrowser/src/Makefile.am index d9a29c44e..1b1e05bf9 100644 --- a/treebrowser/src/Makefile.am +++ b/treebrowser/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = treebrowser geanyplugins_LTLIBRARIES = treebrowser.la diff --git a/xmlsnippets/src/Makefile.am b/xmlsnippets/src/Makefile.am index 652efebdf..7015ebf2c 100644 --- a/xmlsnippets/src/Makefile.am +++ b/xmlsnippets/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/build/vars.build.mk +plugin = xmlsnippets geanyplugins_LTLIBRARIES = xmlsnippets.la From c0e95ae275254025c4650f5e3c95f20c582f16ac Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 12 Mar 2016 19:21:25 +0100 Subject: [PATCH 4/6] Define PLUGIN{DATA,DOC,LIB}DIR more explicitly to try and make MSYS2 happy --- build/vars.build.mk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/vars.build.mk b/build/vars.build.mk index 98008c802..2da84cf69 100644 --- a/build/vars.build.mk +++ b/build/vars.build.mk @@ -6,7 +6,10 @@ LOCAL_AM_CFLAGS = \ -DGEANYPLUGINS_DATADIR=\""share"\" \ -DPKGDATADIR=\""share/$(PACKAGE)"\" \ -DLIBDIR=\""lib"\" \ - -DPKGLIBDIR=\""lib/$(PACKAGE)"\" + -DPKGLIBDIR=\""lib/$(PACKAGE)"\" \ + -DPLUGINDATADIR=\""share/$(PACKAGE)/$(plugin)"\" \ + -DPLUGINDOCDIR=\""$(plugin)"\" \ + -DPLUGINLIBDIR=\""lib/$(PACKAGE)/$(plugin)"\" else LOCAL_AM_CFLAGS = \ -DLOCALEDIR=\""$(LOCALEDIR)"\" \ @@ -15,15 +18,15 @@ LOCAL_AM_CFLAGS = \ -DGEANYPLUGINS_DATADIR=\""$(datadir)"\" \ -DPKGDATADIR=\""$(pkgdatadir)"\" \ -DLIBDIR=\""$(libdir)"\" \ - -DPKGLIBDIR=\""$(pkglibdir)"\" + -DPKGLIBDIR=\""$(pkglibdir)"\" \ + -DPLUGINDATADIR=\""$(pkgdatadir)/$(plugin)"\" \ + -DPLUGINDOCDIR=\""$(docdir)/$(plugin)"\" \ + -DPLUGINLIBDIR=\""$(pkglibdir)/$(plugin)"\" endif AM_CFLAGS = \ ${LOCAL_AM_CFLAGS} \ -DPLUGIN="\"$(plugin)\"" \ - -DPLUGINDATADIR="PKGDATADIR\"/\"PLUGIN" \ - -DPLUGINDOCDIR="DOCDIR\"/\"PLUGIN" \ - -DPLUGINLIBDIR="PKGLIBDIR\"/\"PLUGIN" \ $(GEANY_CFLAGS) \ $(GP_CFLAGS) From 69af4d80499424cbae03cf1cc18123eb147e369a Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 12 Mar 2016 19:58:39 +0100 Subject: [PATCH 5/6] Try and reduce code duplication while simplifying altering paths --- build/vars.build.mk | 50 ++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/build/vars.build.mk b/build/vars.build.mk index 2da84cf69..b7346f82b 100644 --- a/build/vars.build.mk +++ b/build/vars.build.mk @@ -1,32 +1,36 @@ if MINGW -LOCAL_AM_CFLAGS = \ - -DLOCALEDIR=\""share/locale"\" \ - -DPREFIX=\"\" \ - -DDOCDIR=\""share/doc/$(PACKAGE)"\" \ - -DGEANYPLUGINS_DATADIR=\""share"\" \ - -DPKGDATADIR=\""share/$(PACKAGE)"\" \ - -DLIBDIR=\""lib"\" \ - -DPKGLIBDIR=\""lib/$(PACKAGE)"\" \ - -DPLUGINDATADIR=\""share/$(PACKAGE)/$(plugin)"\" \ - -DPLUGINDOCDIR=\""$(plugin)"\" \ - -DPLUGINLIBDIR=\""lib/$(PACKAGE)/$(plugin)"\" +GP_PREFIX = . +GP_DATADIR = $(GP_PREFIX)/share +GP_LOCALEDIR = $(GP_DATADIR)/locale +GP_DOCDIR = $(GP_DATADIR)/doc/$(PACKAGE) +GP_PKGDATADIR = $(GP_DATADIR)/$(PACKAGE) +GP_LIBDIR = $(GP_PREFIX)/lib +GP_PKGLIBDIR = $(GP_LIBDIR)/$(PACKAGE) else -LOCAL_AM_CFLAGS = \ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DPREFIX=\""$(prefix)"\" \ - -DDOCDIR=\""$(docdir)"\" \ - -DGEANYPLUGINS_DATADIR=\""$(datadir)"\" \ - -DPKGDATADIR=\""$(pkgdatadir)"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DPKGLIBDIR=\""$(pkglibdir)"\" \ - -DPLUGINDATADIR=\""$(pkgdatadir)/$(plugin)"\" \ - -DPLUGINDOCDIR=\""$(docdir)/$(plugin)"\" \ - -DPLUGINLIBDIR=\""$(pkglibdir)/$(plugin)"\" +GP_PREFIX = $(prefix) +GP_DATADIR = $(datadir) +GP_LOCALEDIR = $(LOCALEDIR) +GP_DOCDIR = $(docdir) +GP_PKGDATADIR = $(pkgdatadir) +GP_LIBDIR = $(libdir) +GP_PKGLIBDIR = $(pkglibdir) endif +LOCAL_AM_CFLAGS = \ + -DLOCALEDIR=\""$(GP_LOCALEDIR)"\" \ + -DPREFIX=\""$(GP_PREFIX)"\" \ + -DDOCDIR=\""$(GP_DOCDIR)"\" \ + -DGEANYPLUGINS_DATADIR=\""$(GP_DATADIR)"\" \ + -DPKGDATADIR=\""$(GP_PKGDATADIR)"\" \ + -DLIBDIR=\""$(GP_LIBDIR)"\" \ + -DPKGLIBDIR=\""$(GP_PKGLIBDIR)"\" \ + -DPLUGINDATADIR=\""$(GP_PKGDATADIR)/$(plugin)"\" \ + -DPLUGINDOCDIR=\""$(GP_DOCDIR)/$(plugin)"\" \ + -DPLUGINLIBDIR=\""$(GP_PKGLIBDIR)/$(plugin)"\" \ + -DPLUGIN="\"$(plugin)\"" + AM_CFLAGS = \ ${LOCAL_AM_CFLAGS} \ - -DPLUGIN="\"$(plugin)\"" \ $(GEANY_CFLAGS) \ $(GP_CFLAGS) From 229264163c9c84b1f30710a099b129a9fbb55331 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 12 Mar 2016 20:14:13 +0100 Subject: [PATCH 6/6] overview: Fix finding the interface file for the preferences on Windows --- overview/overview/Makefile.am | 3 +-- overview/overview/overviewprefspanel.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/overview/overview/Makefile.am b/overview/overview/Makefile.am index 17cd2b2cb..fb7363a34 100644 --- a/overview/overview/Makefile.am +++ b/overview/overview/Makefile.am @@ -20,8 +20,7 @@ overview_la_SOURCES = \ overview_la_CFLAGS = \ $(AM_CFLAGS) \ - -I$(srcdir)/.. \ - -DOVERVIEW_PREFS_UI_FILE=\""$(pkgdatadir)/overview/prefs.ui"\" + -I$(srcdir)/.. overview_la_LIBADD = \ $(COMMONLIBS) diff --git a/overview/overview/overviewprefspanel.c b/overview/overview/overviewprefspanel.c index c385dbd76..60f01063b 100644 --- a/overview/overview/overviewprefspanel.c +++ b/overview/overview/overviewprefspanel.c @@ -198,16 +198,25 @@ overview_prefs_panel_init (OverviewPrefsPanel *self) GtkBuilder *builder; GError *error = NULL; GtkWidget *overlay_frame; +#ifdef G_OS_WIN32 + gchar *prefix = g_win32_get_package_installation_directory_of_module (NULL); +#else + gchar *prefix = NULL; +#endif + gchar *ui_file_path = g_build_filename (prefix ? prefix : "", PLUGINDATADIR, "prefs.ui", NULL); builder = gtk_builder_new (); - if (! gtk_builder_add_from_file (builder, OVERVIEW_PREFS_UI_FILE, &error)) + if (! gtk_builder_add_from_file (builder, ui_file_path, &error)) { - g_critical ("failed to open UI file '%s': %s", OVERVIEW_PREFS_UI_FILE, error->message); + g_critical ("failed to open UI file '%s': %s", ui_file_path, error->message); g_error_free (error); g_object_unref (builder); return; } + g_free (ui_file_path); + g_free (prefix); + self->prefs_table = builder_get_widget (builder, "prefs-table"); self->width_spin = builder_get_widget (builder, "width-spin"); self->zoom_spin = builder_get_widget (builder, "zoom-spin");