Commit 9c1669ce authored by Corentin Noël's avatar Corentin Noël Committed by Alberto Mardegan

Create the Vapi file at build time as recommended by the Vala documentation.

parent 0288f412
Pipeline #10583527 passed with stages
in 13 minutes and 43 seconds
......@@ -11,7 +11,7 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([libsignon-glib.pc.in])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 -Wall check-news nostdinc silent-rules subdir-objects foreign])
AM_INIT_AUTOMAKE([1.11 -Wall check-news nostdinc silent-rules subdir-objects foreign -Wno-portability])
AC_PROG_CC
AC_PROG_CC_STDC
......@@ -22,6 +22,7 @@ LT_INIT([disable-static])
# Gobject Introspection
GOBJECT_INTROSPECTION_CHECK([1.30.0])
VAPIGEN_CHECK()
PKG_CHECK_MODULES(
[DEPS],
......
......@@ -207,6 +207,17 @@ CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
# Vala bindings
if ENABLE_VAPIGEN
-include $(VAPIGEN_MAKEFILE)
libsignon-glib.vapi: Signon-1.0.gir Signon-1.0.metadata
VAPIGEN_VAPIS = libsignon-glib.vapi
libsignon_glib_vapi_DEPS = gio-2.0
libsignon_glib_vapi_METADATADIRS = $(srcdir)
libsignon_glib_vapi_FILES = Signon-1.0.gir Signon-1.0.metadata
vapidir = $(datadir)/vala/vapi
dist_vapi_DATA = \
signon.vapi
vapi_DATA = $(VAPIGEN_VAPIS)
endif
# Makefile for Vala API Generator (vapigen)
# Written by Evan Nemerson
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
#
# Variables:
#
# VAPIGEN_FILES
#
# VAPIs to create
#
# *_DEPS / VAPIGEN_DEPS
#
# The dependencies. Generally the pkg-config names.
#
# *_METADATADIRS / VAPIGEN_METADATADIRS
#
# Directory containing the metadata.
#
# *_VAPIDIRS / VAPIGEN_VAPIDIRS
#
# Additional location(s) to search for VAPI dependencies.
#
# *_GIRDIRS / VAPIGEN_GIRDIRS
#
# Additional location(s) to search for GIR dependencies.
#
# *_FILES
#
# The files which should be used to generate the VAPI.
_vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
_vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
_vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
_vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_opts_0 = --quiet
$(if $(VAPIGEN),,$(error You must define VAPIGEN))
_vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
define vapigen
$(1): $$($(_vapi_name)_GIR)
$(_vapigen_silent_prefix) $(VAPIGEN) $(_vapigen_silent_opts) \
--library $(1:.vapi=) \
$(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
$(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
$(foreach _gir_dir_name,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_gir_dir_name)) \
$(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
$$($(_vapi_name)_FILES)
endef
$(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))
Identity.signout#signal name="signed_out"
......@@ -177,7 +177,7 @@ auth_query_mechanisms_cb (GObject *object, GAsyncResult *res,
/**
* SignonQueryMethodsCb:
* @auth_service: the #SignonAuthService.
* @methods: (transfer none) (type GStrv): list of available methods.
* @methods: (transfer none) (array zero-terminated=1): list of available methods.
* @error: a #GError if an error occurred, %NULL otherwise.
* @user_data: the user data that was passed when installing this callback.
*
......@@ -219,7 +219,7 @@ signon_auth_service_query_methods (SignonAuthService *auth_service,
* SignonQueryMechanismCb:
* @auth_service: the #SignonAuthService.
* @method: the authentication method being inspected.
* @mechanisms: (transfer none) (type GStrv): list of available mechanisms.
* @mechanisms: (transfer none) (array zero-terminated=1): list of available mechanisms.
* @error: a #GError if an error occurred, %NULL otherwise.
* @user_data: the user data that was passed when installing this callback.
*
......
......@@ -466,7 +466,7 @@ signon_auth_session_get_method (SignonAuthSession *self)
/**
* SignonAuthSessionQueryAvailableMechanismsCb:
* @self: the #SignonAuthSession.
* @mechanisms: (transfer full) (type GStrv): list of available mechanisms.
* @mechanisms: (transfer full) (array zero-terminated=1): list of available mechanisms.
* @error: a #GError if an error occurred, %NULL otherwise.
* @user_data: the user data that was passed when installing this callback.
*
......@@ -476,7 +476,7 @@ signon_auth_session_get_method (SignonAuthSession *self)
/**
* signon_auth_session_query_available_mechanisms:
* @self: the #SignonAuthSession.
* @wanted_mechanisms: a %NULL-terminated list of mechanisms supported by the client.
* @wanted_mechanisms: (array zero-terminated=1): a %NULL-terminated list of mechanisms supported by the client.
* @cb: (scope async): a callback which will be called with the result.
* @user_data: user data to be passed to the callback.
*
......@@ -563,7 +563,7 @@ signon_auth_session_process (SignonAuthSession *self,
* @session_data: (transfer floating): a dictionary of parameters.
* @mechanism: the authentication mechanism to be used.
* @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
* @callback: (scope async): a callback which will be called when the
* @callback: a callback which will be called when the
* authentication reply is available.
* @user_data: user data to be passed to the callback.
*
......
......@@ -36,7 +36,7 @@
*
* An enumeration of errors that are possible from Signon.
*/
#define SIGNON_ERROR_PREFIX SIGNOND_SERVICE_PREFIX ".Error"
#define SIGNON_DBUS_ERROR_PREFIX SIGNOND_SERVICE_PREFIX ".Error"
#include "signon-errors-map.c"
......
......@@ -481,7 +481,7 @@ void signon_identity_info_set_caption (SignonIdentityInfo *info, const gchar *ca
* signon_identity_info_set_method:
* @info: the #SignonIdentityInfo.
* @method: an authentication method.
* @mechanisms: (transfer none) (type GStrv): a %NULL-termianted list of mechanisms.
* @mechanisms: (array zero-terminated=1): a %NULL-termianted list of mechanisms.
*
* Adds a method to the list of allowed methods. If this method is not called
* even once, then all methods are allowed.
......@@ -519,7 +519,7 @@ void signon_identity_info_remove_method (SignonIdentityInfo *info, const gchar *
/**
* signon_identity_info_set_realms:
* @info: the #SignonIdentityInfo.
* @realms: (transfer none) (type GStrv): a %NULL-terminated list of realms.
* @realms: (array zero-terminated=1): a %NULL-terminated list of realms.
*
* Specify what realms this identity can be used in.
*/
......@@ -536,7 +536,7 @@ void signon_identity_info_set_realms (SignonIdentityInfo *info,
/**
* signon_identity_info_set_access_control_list:
* @info: the #SignonIdentityInfo.
* @access_control_list: (transfer none) (type GStrv): a %NULL-terminated list
* @access_control_list: (array zero-terminated=1): a %NULL-terminated list
* of ACL security domains.
*
* Specifies the ACL for this identity. The actual meaning of the ACL depends
......
......@@ -719,7 +719,7 @@ signon_identity_create_session(SignonIdentity *self,
* signon_identity_store_credentials_with_info:
* @self: the #SignonIdentity.
* @info: the #SignonIdentityInfo data to store.
* @cb: (scope async): callback.
* @cb: (scope async) (closure user_data): callback.
* @user_data: user_data.
*
* Stores the data from @info into the identity.
......@@ -760,10 +760,10 @@ signon_identity_store_credentials_with_info(SignonIdentity *self,
* @store_secret: whether signond should store the password.
* @methods: (transfer none) (element-type utf8 GStrv): methods.
* @caption: caption.
* @realms: (transfer none) (type GStrv): realms.
* @access_control_list: (transfer none) (type GStrv): access control list.
* @realms: (transfer none) (array zero-terminated=1): realms.
* @access_control_list: (transfer none) (array zero-terminated=1): access control list.
* @type: the type of the identity.
* @cb: (scope async): callback.
* @cb: (scope async) (closure user_data): callback.
* @user_data: user_data.
*
* Stores the given data into the identity.
......@@ -1011,7 +1011,7 @@ identity_verify_data(SignonIdentity *self,
* signon_identity_verify_secret:
* @self: the #SignonIdentity.
* @secret: the secret (password) to be verified.
* @cb: (scope async): callback.
* @cb: (scope async) (closure user_data): callback.
* @user_data: user_data.
*
* Verifies the given secret.
......@@ -1355,7 +1355,7 @@ identity_void_operation(SignonIdentity *self,
/**
* signon_identity_remove:
* @self: the #SignonIdentity.
* @cb: (scope async): callback to be called when the operation has completed.
* @cb: (scope async) (closure user_data): callback to be called when the operation has completed.
* @user_data: user_data to pass to the callback.
*
* Removes the corresponding credentials record from the database.
......@@ -1382,7 +1382,7 @@ void signon_identity_remove(SignonIdentity *self,
/**
* signon_identity_signout:
* @self: the #SignonIdentity.
* @cb: (scope async): callback.
* @cb: (scope async) (closure user_data): callback.
* @user_data: user_data.
*
* Asks signond to close all authentication sessions for this
......@@ -1410,7 +1410,7 @@ void signon_identity_signout(SignonIdentity *self,
* signon_identity_add_reference:
* @self: the #SignonIdentity.
* @reference: reference to be added
* @cb: callback
* @cb: (scope async) (closure user_data): callback
* @user_data: user_data.
*
* Adds named reference to identity
......@@ -1432,7 +1432,7 @@ void signon_identity_add_reference(SignonIdentity *self,
* signon_identity_remove_reference:
* @self: the #SignonIdentity.
* @reference: reference to be removed
* @cb: callback
* @cb: (scope async) (closure user_data): callback
* @user_data: user_data.
*
* Removes named reference from identity
......@@ -1453,7 +1453,7 @@ void signon_identity_remove_reference(SignonIdentity *self,
/**
* signon_identity_query_info:
* @self: the #SignonIdentity.
* @cb: (scope async): callback.
* @cb: (scope async) (closure user_data): callback.
* @user_data: user_data.
*
* Fetches the #SignonIdentityInfo data associated with this
......
/* signon.vapi generated by vapigen, do not modify. */
[CCode (cprefix = "Signon", gir_namespace = "Signon", gir_version = "1.0", lower_case_cprefix = "signon_")]
namespace Signon {
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", type_id = "signon_auth_service_get_type ()")]
public class AuthService : GLib.Object {
[CCode (has_construct_function = false)]
public AuthService ();
public void query_mechanisms (string method, [CCode (scope = "async")] owned Signon.QueryMechanismCb cb);
public void query_methods ([CCode (scope = "async")] owned Signon.QueryMethodsCb cb);
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", type_id = "signon_auth_session_get_type ()")]
public class AuthSession : GLib.Object {
[CCode (has_construct_function = false)]
public AuthSession (uint id, string method_name) throws GLib.Error;
public void cancel ();
public unowned string get_method ();
[Deprecated (since = "1.8")]
public void process (GLib.HashTable<string,GLib.Value?> session_data, string mechanism, [CCode (scope = "async")] owned Signon.AuthSessionProcessCb cb);
public async GLib.Variant process_async (GLib.Variant session_data, string mechanism, GLib.Cancellable? cancellable) throws GLib.Error;
public void query_available_mechanisms (string wanted_mechanisms, [CCode (scope = "async")] owned Signon.AuthSessionQueryAvailableMechanismsCb cb);
public signal void state_changed (int state, string message);
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", type_id = "signon_identity_get_type ()")]
public class Identity : GLib.Object {
[CCode (has_construct_function = false)]
public Identity ();
public void add_reference (string reference, Signon.IdentityReferenceAddedCb cb, void* user_data);
public Signon.AuthSession create_session (string method) throws GLib.Error;
[CCode (has_construct_function = false)]
public Identity.from_db (uint32 id);
public unowned GLib.Error get_last_error ();
public void query_info ([CCode (scope = "async")] owned Signon.IdentityInfoCb cb);
public void remove ([CCode (scope = "async")] owned Signon.IdentityRemovedCb cb, void* user_data);
public void remove_reference (string reference, Signon.IdentityReferenceRemovedCb cb, void* user_data);
public void store_credentials_with_args (string username, string secret, bool store_secret, GLib.HashTable<string,string[]> methods, string caption, string realms, string access_control_list, Signon.IdentityType type, [CCode (scope = "async")] owned Signon.IdentityStoreCredentialsCb cb);
public void store_credentials_with_info (Signon.IdentityInfo info, [CCode (scope = "async")] owned Signon.IdentityStoreCredentialsCb cb);
public void verify_secret (string secret, [CCode (scope = "async")] owned Signon.IdentityVerifyCb cb);
[NoAccessorMethod]
public uint id { get; set; }
[HasEmitter]
public signal void signout ();
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "signon_identity_info_get_type ()")]
[Compact]
public class IdentityInfo {
[CCode (has_construct_function = false)]
public IdentityInfo ();
public Signon.IdentityInfo copy ();
public void free ();
[CCode (array_length = false, array_null_terminated = true)]
public unowned string[] get_access_control_list ();
public unowned string get_caption ();
public int get_id ();
public Signon.IdentityType get_identity_type ();
public unowned GLib.HashTable<string,string[]> get_methods ();
[CCode (array_length = false, array_null_terminated = true)]
public unowned string[] get_realms ();
public bool get_storing_secret ();
public unowned string get_username ();
public void remove_method (string method);
public void set_access_control_list ([CCode (array_length = false, array_null_terminated = true)] string[] access_control_list);
public void set_caption (string caption);
public void set_identity_type (Signon.IdentityType type);
public void set_method (string method, [CCode (array_length = false, array_null_terminated = true)] string[] mechanisms);
public void set_realms ([CCode (array_length = false, array_null_terminated = true)] string[] realms);
public void set_secret (string secret, bool store_secret);
public void set_username (string username);
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cprefix = "SIGNON_IDENTITY_TYPE_", type_id = "signon_identity_type_get_type ()")]
[Flags]
public enum IdentityType {
OTHER,
APP,
WEB,
NETWORK
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cprefix = "SIGNON_POLICY_", type_id = "signon_session_data_ui_policy_get_type ()")]
public enum SessionDataUiPolicy {
DEFAULT,
REQUEST_PASSWORD,
NO_USER_INTERACTION,
VALIDATION
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cprefix = "SIGNON_ERROR_")]
public errordomain Error {
UNKNOWN,
INTERNAL_SERVER,
INTERNAL_COMMUNICATION,
PERMISSION_DENIED,
METHOD_NOT_KNOWN,
SERVICE_NOT_AVAILABLE,
INVALID_QUERY,
METHOD_NOT_AVAILABLE,
IDENTITY_NOT_FOUND,
STORE_FAILED,
REMOVE_FAILED,
SIGNOUT_FAILED,
IDENTITY_OPERATION_CANCELED,
CREDENTIALS_NOT_AVAILABLE,
REFERENCE_NOT_FOUND,
MECHANISM_NOT_AVAILABLE,
MISSING_DATA,
INVALID_CREDENTIALS,
NOT_AUTHORIZED,
WRONG_STATE,
OPERATION_NOT_SUPPORTED,
NO_CONNECTION,
NETWORK,
SSL,
RUNTIME,
SESSION_CANCELED,
TIMED_OUT,
USER_INTERACTION,
OPERATION_FAILED,
ENCRYPTION_FAILED,
TOS_NOT_ACCEPTED,
FORGOT_PASSWORD,
METHOD_OR_MECHANISM_NOT_ALLOWED,
INCORRECT_DATE,
USER_ERROR;
public static GLib.Quark quark ();
}
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void AuthSessionProcessCb (Signon.AuthSession self, GLib.HashTable<string,GLib.Value?> session_data, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void AuthSessionQueryAvailableMechanismsCb (Signon.AuthSession self, [CCode (array_length = false, array_null_terminated = true)] owned string[] mechanisms, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void AuthSessionQueryAvailableMethodsCb (Signon.AuthSession self, [CCode (array_length = false, array_null_terminated = true)] owned string[] mechanisms, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void IdentityInfoCb (Signon.Identity self, Signon.IdentityInfo info, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 2.9)]
public delegate void IdentityReferenceAddedCb (Signon.Identity self, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 2.9)]
public delegate void IdentityReferenceRemovedCb (Signon.Identity self, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 2.9)]
public delegate void IdentityRemovedCb (Signon.Identity self, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 2.9)]
public delegate void IdentitySignedOutCb (Signon.Identity self, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void IdentityStoreCredentialsCb (Signon.Identity self, uint32 id, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void IdentityVerifyCb (Signon.Identity self, bool valid, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 2.9)]
public delegate void IdentityVoidCb (Signon.Identity self, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 4.9)]
public delegate void QueryMechanismCb (Signon.AuthService auth_service, string method, [CCode (array_length = false, array_null_terminated = true)] string[] mechanisms, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", instance_pos = 3.9)]
public delegate void QueryMethodsCb (Signon.AuthService auth_service, [CCode (array_length = false, array_null_terminated = true)] string[] methods, GLib.Error error);
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_CAPTION")]
public const string SESSION_DATA_CAPTION;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_PROXY")]
public const string SESSION_DATA_PROXY;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_REALM")]
public const string SESSION_DATA_REALM;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_RENEW_TOKEN")]
public const string SESSION_DATA_RENEW_TOKEN;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_SECRET")]
public const string SESSION_DATA_SECRET;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_TIMEOUT")]
public const string SESSION_DATA_TIMEOUT;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_UI_POLICY")]
public const string SESSION_DATA_UI_POLICY;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_USERNAME")]
public const string SESSION_DATA_USERNAME;
[CCode (cheader_filename = "libsignon-glib/signon-glib.h", cname = "SIGNON_SESSION_DATA_WINDOW_ID")]
public const string SESSION_DATA_WINDOW_ID;
}
dnl vapigen.m4
dnl
dnl Copyright 2012 Evan Nemerson
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND_INTROSPECTION], [DEFAULT])
# --------------------------------------
# Check vapigen existence and version
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
AC_DEFUN([VAPIGEN_CHECK],
[
AS_IF([test "x$3" != "xyes"], [
m4_provide_if([GOBJECT_INTROSPECTION_CHECK], [], [
m4_provide_if([GOBJECT_INTROSPECTION_REQUIRE], [], [
AC_MSG_ERROR([[You must call GOBJECT_INTROSPECTION_CHECK or GOBJECT_INTROSPECTION_REQUIRE before using VAPIGEN_CHECK unless using the FOUND_INTROSPECTION argument is "yes"]])
])
])
])
AC_ARG_ENABLE([vala],
[AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[
AS_IF([test "x$4" = "x"], [
enable_vala=auto
], [
enable_vala=$4
])
])
AS_CASE([$enable_vala], [no], [enable_vala=no],
[yes], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
AC_MSG_ERROR([Vala bindings require GObject Introspection])
])
], [auto], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
enable_vala=no
])
], [
AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
])
AS_IF([test "x$2" = "x"], [
vapigen_pkg_name=vapigen
], [
vapigen_pkg_name=vapigen-$2
])
AS_IF([test "x$1" = "x"], [
vapigen_pkg="$vapigen_pkg_name"
], [
vapigen_pkg="$vapigen_pkg_name >= $1"
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_EXISTS([$vapigen_pkg], [
AS_IF([test "$enable_vala" = "auto"], [
enable_vala=yes
])
], [
AS_CASE([$enable_vala], [yes], [
AC_MSG_ERROR([$vapigen_pkg not found])
], [auto], [
enable_vala=no
])
])
AC_MSG_CHECKING([for vapigen])
AS_CASE([$enable_vala],
[yes], [
VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
AS_IF([test "x$2" = "x"], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
])
])
AC_MSG_RESULT([$enable_vala])
AC_SUBST([VAPIGEN])
AC_SUBST([VAPIGEN_VAPIDIR])
AC_SUBST([VAPIGEN_MAKEFILE])
AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment