Commit fa46d2fd authored by Ivan Frade's avatar Ivan Frade Committed by Martyn Russell

libtracker-sparql: Dirty 'sed' only when really needed

If vala is recent enough, the "sed" operation is not needed.
Also, run the sed trick only once on the file.

Vala version is checked via new m4 function.

Removed the .gir from the CLEANFILES. It must be cleaned only when
the library it comes from is cleaned.
parent f972a2e7
......@@ -481,6 +481,9 @@ fi
AC_SUBST(VALAC)
AX_VALA_CHECK_VERSION([0.11.8], vala_good_gir=true, vala_good_gir=false)
AM_CONDITIONAL(VALA_GOOD_GIR, test "x$vala_good_gir" == "xtrue")
####################################################################
# Check gettext/intltool support
####################################################################
......
dnl Copyright (C) 2011 Nokia <ivan.frade@nokia.com>
dnl This file is free software; unlimited permission to copy and/or distribute
dnl it is given, with or without modifications, as long as this notice is
dnl preserved.
dnl AX_VALA_CHECK_VERSION([MIN_VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
dnl ---------------------------------------------------------------------------
dnl Run ACTION-IF-TRUE if the vala compiler is installed AND has version >= VERSION.
dnl Run ACTION-IF-FALSE otherwise.
dnl This macro doesn't check if valac is installed (use AM_PROG_VALAC or your
dnl own AC_PATH_PROG to check that)
AC_DEFUN([AX_VALA_CHECK_VERSION],
[
AC_MSG_CHECKING([valac generates proper GIR])
AS_IF([test "x$VALAC" != "x"], [], [AC_PATH_PROG([VALAC], [valac], [])])
am__vala_version=`$VALAC --version | sed 's/Vala *//'`
AS_VERSION_COMPARE([$1], ["$am__vala_version"],
[AC_MSG_RESULT([yes])
$2],
[AC_MSG_RESULT([yes])
$2],
[AC_MSG_RESULT([no])
$3])
])
......@@ -60,9 +60,16 @@ EXTRA_DIST = \
-include $(INTROSPECTION_MAKEFILE)
if HAVE_INTROSPECTION
# set introspectable=0 to the function that uses va_list. This is not needed with a modern vala ( > 23/03/2011)
Tracker-@TRACKER_API_VERSION@.gir: $(lib_LTLIBRARIES)
sed -i $@ -e "s/c\:identifier\=\"tracker_sparql_escape_uri_vprintf\"/c\:identifier\=\"tracker_sparql_escape_uri_vprintf\"\ introspectable=\"0\"/g"
# set introspectable=0 to the function that uses va_list. This is not needed with a modern vala ( >= 0.11.8)
if VALA_GOOD_GIR
Tracker-@TRACKER_API_VERSION@.gir: $(lib_LTLIBRARIES) Makefile
else
Tracker-@TRACKER_API_VERSION@.gir: $(lib_LTLIBRARIES) Makefile
if [[ -z `grep tracker_sparql_escape_uri_vprintf $@ |grep introspectable` ]] ; then \
sed -i $@ -e "s/c\:identifier\=\"tracker_sparql_escape_uri_vprintf\"/c\:identifier\=\"tracker_sparql_escape_uri_vprintf\"\ introspectable=\"0\"/g" ; \
fi
endif
Tracker-@TRACKER_API_VERSION@.typelib: Tracker-$(TRACKER_API_VERSION).gir
@INTROSPECTION_COMPILER@ --shared-library=libtracker-sparql-@TRACKER_API_VERSION@.so -o $@ $^
......@@ -73,5 +80,5 @@ dist_gir_DATA = Tracker-$(TRACKER_API_VERSION).gir
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = Tracker-$(TRACKER_API_VERSION).typelib
CLEANFILES = $(dist_gir_DATA) $(typelib_DATA)
CLEANFILES = $(typelib_DATA)
endif
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