Skip to content

Commit

Permalink
Merge pull request #787 from b4n/scope-gtk3-build-fix
Browse files Browse the repository at this point in the history
Fix depending on VTE on Windows and overall checks for utilslib VTE
support.
  • Loading branch information
b4n committed Nov 27, 2018
2 parents 2cdff7c + 81957e3 commit 4d99fcd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
21 changes: 8 additions & 13 deletions build/scope.m4
Expand Up @@ -2,21 +2,16 @@ AC_DEFUN([GP_CHECK_SCOPE],
[
GP_ARG_DISABLE([Scope], [auto])
case "$host_os" in
cygwin* | mingw* | win32*)
PTY_LIBS=""
;;
AS_CASE([$host_os],
[cygwin* | mingw* | win32*],
[PTY_LIBS=""],
*)
[GP_CHECK_GTK3([vte_package=vte-2.91], [vte_package="vte >= 0.17"])
GP_CHECK_PLUGIN_DEPS([scope], [VTE], [$vte_package])
GP_CHECK_UTILSLIB_VTECOMPAT([Scope])
GP_CHECK_GTK3([vte_package=vte-2.91], [vte_package="vte >= 0.17"])
GP_CHECK_PLUGIN_DEPS([scope], [VTE], [$vte_package])
AM_CONDITIONAL([GP_VTE291_USED], [test "$enable_scope" != no && test "$vte_package" = vte-2.91])
AC_CHECK_HEADERS([util.h pty.h libutil.h])
PTY_LIBS="-lutil"
;;
esac
AC_CHECK_HEADERS([util.h pty.h libutil.h])
PTY_LIBS="-lutil"])
AC_SUBST(PTY_LIBS)
Expand Down
18 changes: 18 additions & 0 deletions build/utils.m4
Expand Up @@ -7,6 +7,22 @@ AC_DEFUN([_GP_UTILSLIB_ARG],
[enable_utilslib=auto])
])

dnl GP_CHECK_UTILSLIB_VTECOMPAT(PluginName)
AC_DEFUN([GP_CHECK_UTILSLIB_VTECOMPAT],
[
AS_IF([test "$m4_tolower(AS_TR_SH(enable_$1))" != no],
[GP_CHECK_GTK3([utilslib_vte_package=vte-2.91],
[utilslib_vte_package=vte])
PKG_CHECK_MODULES([UTILSLIB], [$utilslib_vte_package],
[utilslib_have_vte=yes],
[utilslib_have_vte=no])
AS_IF([test "$utilslib_have_vte" != yes || test "$enable_utilslib" = no],
[AS_IF([test "$m4_tolower(AS_TR_SH(enable_$1))" = yes],
[AC_MSG_ERROR([Plugin $1 depends on utilslib VTE support which is not available])],
[m4_tolower(AS_TR_SH(enable_$1))=no])],
[enable_utilslib=yes])])
])

dnl GP_CHECK_UTILSLIB(PluginName)
dnl Check for utils library
AC_DEFUN([GP_CHECK_UTILSLIB],
Expand All @@ -30,5 +46,7 @@ AC_DEFUN([GP_COMMIT_UTILSLIB_STATUS],
])],
[enable_utilslib=no])
AM_CONDITIONAL([ENABLE_UTILSLIB], [test "$enable_utilslib" = "yes"])
AM_CONDITIONAL([ENABLE_UTILSLIB_VTECOMPAT], [test "$enable_utilslib" = yes && test "$utilslib_have_vte" = yes])
GP_STATUS_FEATURE_ADD([Utility library], [$enable_utilslib])
GP_STATUS_FEATURE_ADD([Utility library VTE support], [${utilslib_have_vte-no}])
])
7 changes: 3 additions & 4 deletions utils/src/Makefile.am
Expand Up @@ -6,16 +6,15 @@ libgeanypluginutils_la_SOURCES = \
filelist.h \
filelist.c

if GP_VTE291_USED
if ENABLE_UTILSLIB_VTECOMPAT
libgeanypluginutils_la_SOURCES += \
gp_vtecompat.h \
gp_vtecompat.c
endif

libgeanypluginutils_la_CPPFLAGS = $(AM_CPPFLAGS) \
-DG_LOG_DOMAIN=\"Utils\"
libgeanypluginutils_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS)
libgeanypluginutils_la_LIBADD = $(COMMONLIBS) $(VTE_LIBS)
libgeanypluginutils_la_CFLAGS = $(AM_CFLAGS) $(UTILSLIB_CFLAGS)
libgeanypluginutils_la_LIBADD = $(COMMONLIBS) $(UTILSLIB_LIBS)
libgeanypluginutils_la_LDFLAGS = -no-undefined $(GP_LDFLAGS)
include $(top_srcdir)/build/cppcheck.mk

0 comments on commit 4d99fcd

Please sign in to comment.