Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autotools Vala checks #195

Merged
merged 2 commits into from
Feb 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions build/multiterm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ AC_DEFUN([GP_CHECK_MULTITERM],
[
GP_ARG_DISABLE([multiterm], [auto])

AS_IF([test "$enable_multiterm" != "no"],
[
dnl FIXME: if the C sources are present (e.g. in a release tarball),
dnl we don't actually need valac
AM_PROG_VALAC([0.7.0])
AS_IF([test "$VALAC" = "valac"],
[AS_IF([test "$enable_multiterm" = "auto"],
[enable_multiterm=no],
[AC_MSG_ERROR([valac not found])])])
])
GP_CHECK_PLUGIN_VALA([multiterm])
GP_CHECK_PLUGIN_DEPS([multiterm], [MULTITERM], [gtk+-2.0 geany vte])
GP_COMMIT_PLUGIN_STATUS([MultiTerm])

Expand Down
35 changes: 35 additions & 0 deletions build/vala.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
dnl GP_CHECK_VALAC([version], [action-if-found], [action-if-not-found])
dnl Checks for the Vala compiler. Similar to AM_PROG_VALAC but supports
dnl 2nd and 3rd arguments with Automake < 1.12.5
AC_DEFUN([GP_CHECK_VALAC],
[
gp_have_valac=yes
AM_PROG_VALAC([$1],,[gp_have_valac=no])
dnl Automake < 1.12.5 does not support 3rd arg but leaves $VALAC
dnl empty if not found, so emulate it
AS_IF([test "x$VALAC" = x], [gp_have_valac=no])
AS_IF([test "$gp_have_valac" = yes],
[m4_default([$2], [:])],
[m4_default([$3], [:])])
])

dnl GP_CHECK_PLUGIN_VALA(plugin, [valac-version])
dnl Checks for the Vala compiler and takes the appropriate action on
dnl $plugin depending on its presence.
dnl FIXME: take into account that the compiler is optional if we have
dnl the generated C sources
AC_DEFUN([GP_CHECK_PLUGIN_VALA],
[
AS_IF([test "$m4_tolower(AS_TR_SH(enable_$1))" = no],[],
[GP_CHECK_VALAC([$2],
[dnl we fake the checking messages here because
dnl GP_CHECK_VALAC outputs messages itself
AC_MSG_CHECKING([whether the vala compiler is compatible with $1])
AC_MSG_RESULT([yes])],
[AC_MSG_CHECKING([whether the vala compiler is compatible with $1])
AC_MSG_RESULT([no])
AS_IF([test "$m4_tolower(AS_TR_SH(enable_$1))" = yes],
[AC_MSG_ERROR([$1 requires the Vala compiler])],
[test "$m4_tolower(AS_TR_SH(enable_$1))" = auto],
[m4_tolower(AS_TR_SH(enable_$1))=no])])])
])