[tasque] [m4] Created m4 macro for gac module checks in configure
- From: Antonius Riha <antoniusri src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tasque] [m4] Created m4 macro for gac module checks in configure
- Date: Thu, 6 Sep 2012 23:57:53 +0000 (UTC)
commit 6dcc5d59fe9f8c77ae596b3f3fa0e59b69352987
Author: Antonius Riha <antoniusriha gmail com>
Date: Fri Sep 7 01:57:15 2012 +0200
[m4] Created m4 macro for gac module checks in configure
This allows dependency checking of dll's that are not distributed
with a .pc file at configure time. Mono.Data:Sqlite is a referenced
dll that needs to be checked, if SQlite backend is enabled. This is
now done via the new macro.
The macro works very much like the PKG_CHECK_MODULES macro. It
uses gacutil to determine if a dll is in the gac or not. It also supports a
custom gacdir via the GACDIR env variable.
configure.ac | 28 ++++++++-------
m4/GAC_CHECK_MODULES.m4 | 84 +++++++++++++++++++++++++++++++++++++++++++++++
src/Makefile.am | 3 +-
3 files changed, 100 insertions(+), 15 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6b95186..53ba7da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,8 @@ AC_INIT([tasque], [0.1.12])
AM_INIT_AUTOMAKE([foreign tar-ustar])
AM_MAINTAINER_MODE
+m4_include([m4/GAC_CHECK_MODULES.m4])
+
GNOME_COMMON_INIT
AC_PROG_INSTALL
@@ -14,6 +16,16 @@ AC_PROG_LIBTOOL
dnl pkg-config
PKG_PROG_PKG_CONFIG
+### Begin GAC tool ###
+PKG_PROG_GACUTIL
+if test -z "$GACUTIL"; then
+ AC_MSG_ERROR([No gacutil tool found])
+fi
+
+GACUTIL_FLAGS='/gacdir $(DESTDIR)$(prefix)'
+AC_SUBST(GACUTIL_FLAGS)
+### End GAC tool ###
+
AC_PROG_INSTALL
AC_PATH_PROG(DMCS, dmcs, no)
@@ -167,6 +179,9 @@ AC_ARG_ENABLE(backend_sqlite,
AC_HELP_STRING([--enable-backend-sqlite],
[Enable the SQLite Backend [default=no]]),
final_backend_sqlite=$enableval, )
+if test "x$final_backend_sqlite" != "xno"; then
+ GAC_CHECK_MODULES([MONO_DATA_SQLITE], [Mono.Data.Sqlite])
+fi
AM_CONDITIONAL(ENABLE_BACKEND_SQLITE, test "x$final_backend_sqlite" != "xno")
#
@@ -222,19 +237,6 @@ fi
AM_CONDITIONAL(ENABLE_BACKEND_RTM, test "x$final_backend_rtm" != "xno")
-### Begin GAC tool ###
-
-AC_PATH_PROG(GACUTIL, gacutil, no)
-if test "x$GACUTIL" = "xno" ; then
- AC_MSG_ERROR([No gacutil tool found])
-fi
-
-AC_SUBST(GACUTIL)
-GACUTIL_FLAGS='/gacdir $(DESTDIR)$(prefix)'
-AC_SUBST(GACUTIL_FLAGS)
-
-### End GAC tool ###
-
AC_CONFIG_FILES([
Makefile
RtmNet/Makefile
diff --git a/m4/GAC_CHECK_MODULES.m4 b/m4/GAC_CHECK_MODULES.m4
new file mode 100644
index 0000000..6020272
--- /dev/null
+++ b/m4/GAC_CHECK_MODULES.m4
@@ -0,0 +1,84 @@
+#
+# GAC_CHECK_MODULES.m4
+#
+# Author:
+# Antonius Riha <antoniusriha gmail com>
+#
+# Copyright (c) 2012 Antonius Riha
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# PKG_PROG_GACUTIL
+# ----------------------------------
+AC_DEFUN([PKG_PROG_GACUTIL],
+[AC_ARG_VAR([GACUTIL], [path to gacutil])
+AC_ARG_VAR([GACUTIL_LIBDIR], [path overriding gacutil's built-in search path])
+
+if test "x$ac_cv_env_GACUTIL_set" != "xset"; then
+ AC_PATH_TOOL([GACUTIL], [gacutil])
+fi[]dnl
+])# PKG_PROG_GACUTIL
+
+# GAC_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------------
+AC_DEFUN([GAC_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_GACUTIL])dnl
+AC_ARG_VAR([$1][_LIBS], [assembly reference compiler flag for $1, overriding gacutil])dnl
+
+AC_MSG_CHECKING([for $1])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_LIBS
+to avoid the need to call gacutil.])
+
+if test -n "$GACUTIL_LIBDIR"; then
+ gacdir_flag="/gacdir $GACUTIL_LIBDIR"
+fi
+
+if test -n "$$1[]_LIBS"; then
+ AC_MSG_RESULT([yes, envvar: $$1[]_LIBS])
+ $3
+elif test -n $GACUTIL && n=$($GACUTIL -l $2 $gacdir_flag 2>/dev/null); then
+ n=$(echo "$n" | tail -n1 | cut -d'=' -f2 | tr -d ' ')
+ if test $n -gt 0; then
+ $1[]_LIBS="-r:$2"
+ AC_MSG_RESULT([yes gac: $$1[]_LIBS])
+ $3
+ else
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met.
+
+Consider adjusting the GACUTIL_LIBDIR environment variable if you
+installed software to a non-standard gac directory.
+
+_PKG_TEXT])[]dnl
+ ])
+ fi
+else
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE([gacutil could not be found.
+Make sure it is in your PATH or set the GACUTIL environment
+variable to the full path to gacutil.
+
+_PKG_TEXT
+
+])[]dnl
+ ])
+fi[]dnl
+])# GAC_CHECK_MODULES
diff --git a/src/Makefile.am b/src/Makefile.am
index dd105e1..c2a3c03 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -38,7 +38,6 @@ SQLITE_CSFILES = \
SQLITE_LIBS = -r:Mono.Data.Sqlite
else
SQLITE_CSFILES =
-SQLITE_LIBS =
endif
if ENABLE_BACKEND_EDS
@@ -167,7 +166,7 @@ ASSEMBLIES = \
$(DBUS_SHARP_10_LIBS) \
$(DBUS_SHARP_GLIB_10_LIBS) \
$(ICE_DESKTOP_LIBS) \
- $(SQLITE_LIBS) \
+ $(MONO_DATA_SQLITE_LIBS) \
$(EVOLUTION_SHARP_LIBS) \
$(APPINDICATOR_SHARP_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]