gnome-scan r587 - in trunk: . lib



Author: bersace
Date: Sat May  3 13:51:09 2008
New Revision: 587
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=587&view=rev

Log:
Enable vala.


Added:
   trunk/acinclude.m4
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/lib/Makefile.am

Added: trunk/acinclude.m4
==============================================================================
--- (empty file)
+++ trunk/acinclude.m4	Sat May  3 13:51:09 2008
@@ -0,0 +1,46 @@
+# vala.m4 serial 1 (vala @VERSION@)
+dnl Autoconf scripts for the Vala compiler
+dnl Copyright (C) 2007  Mathias Hasselmann
+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 of the License, or (at your option) any later version.
+
+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 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
+dnl
+dnl Author:
+dnl 	Mathias Hasselmann <mathias hasselmann gmx de>
+dnl --------------------------------------------------------------------------
+
+dnl VALA_PROG_VALAC([MINIMUM-VERSION])
+dnl
+dnl Check whether the Vala compiler exists in `PATH'. If it is found the
+dnl variable VALAC is set. Optionally a minimum release number of the compiler
+dnl can be requested.
+dnl --------------------------------------------------------------------------
+AC_DEFUN([VALA_PROG_VALAC],[
+  AC_PATH_PROG([VALAC], [valac], [])
+  AC_SUBST(VALAC)
+
+  if test -z "x${VALAC}"; then
+    AC_MSG_WARN([No Vala compiler found. You will not be able to recompile .vala source files.])
+  elif test -n "x$1"; then
+    AC_REQUIRE([AC_PROG_AWK])
+    AC_MSG_CHECKING([valac is at least version $1])
+
+    if "${VALAC}" --version | "${AWK}" -v r='$1' 'function vn(s) { if (3 == split(s,v,".")) return (v[1]*1000+v[2])*1000+v[3]; else exit 2; } /^Vala / { exit vn(r) > vn($[2]) }'; then
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+      AC_MSG_ERROR([Vala $1 not found.])
+    fi
+  fi
+])

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat May  3 13:51:09 2008
@@ -9,8 +9,10 @@
 
 #AC_ISC_POSIX
 AC_PROG_CC
-#AM_PROG_CC_STDC
-#AC_HEADER_STDC
+AM_PROG_CC_C_O
+
+dnl VALA
+VALA_PROG_VALAC(0.3.1)
 
 GNOME_COMPILE_WARNINGS([maximum])
 

Modified: trunk/lib/Makefile.am
==============================================================================
--- trunk/lib/Makefile.am	(original)
+++ trunk/lib/Makefile.am	Sat May  3 13:51:09 2008
@@ -5,16 +5,15 @@
 AM_CFLAGS = \
 	-Wall -g
 
-EXTRA_DIST = \
-	gnome-scan-types.h.tpl	\
-	gnome-scan-types.c.tpl
-
 BUILT_HEADER = \
 	$(srcdir)/gnome-scan-types.h
 
 BUILT_SOURCE = \
 	$(srcdir)/gnome-scan-types.c
 
+BUILT_SOURCES = \
+	$(BUILT_SOURCE)
+
 types_deps = \
 	gnome-scan-param-specs.h \
 	gnome-scanner.h \
@@ -24,9 +23,20 @@
 lib_LTLIBRARIES = \
 	lib SONAME@.la 
 
+lib SONAME@_la_VALASOURCES = \
+	gnome-scan-option.vala	\
+	$(NULL)
+
+lib SONAME@_la_VALAPKGADD = \
+	--pkg=glib-2.0	\
+	--pkg=gtk+-2.0	\
+	$(NULL)
+
 lib SONAME@_la_SOURCES = \
 	$(BUILT_SOURCE)	\
 	$(BUILT_HEADER)	\
+	$(lib SONAME@_la_VALASOURCES:.vala=.c)	\
+	$(lib SONAME@_la_VALASOURCES:.vala=.h)	\
 	gnome-scan-settings.h          \
 	gnome-scan-settings.c          \
 	gnome-scan-plugin.h          \
@@ -83,12 +93,6 @@
 	gnome-scan-preview-plugin-rotation.c          \
 	gnome-scan-private.h
 
-
-gnome-scan-types.%: $(types_deps) Makefile gnome-scan-types.%.tpl
-	test ! -e $@ && touch $@; exit 0;
-	test -w $@ && glib-mkenums --template $(srcdir)/$  tpl $(types_deps) > $@; exit 0
-
-
 lib SONAME@_la_CFLAGS = \
 	$(GNOME_SCAN_CFLAGS) \
 	-DMODULE_DIR="\"@MODULE_DIR \""
@@ -116,114 +120,20 @@
 	gnome-scan-param-specs.h        \
 	gnome-scan-init.h 
 
-## File created by the gnome-build tools
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+gnome-scan-types.%: $(types_deps) Makefile gnome-scan-types.%.tpl
+	test ! -e $@ && touch $@; exit 0;
+	test -w $@ && glib-mkenums --template $(srcdir)/$  tpl $(types_deps) > $@; exit 0
 
+gnome-scan.vala.stamp: $(lib SONAME@_la_VALASOURCES)
+	$(VALAC) -C $(lib SONAME@_la_VALAPKGADD) $^
+	touch $@
 
+EXTRA_DIST = \
+	gnome-scan-types.h.tpl	\
+	gnome-scan-types.c.tpl	\
+	gnome-scan.vala.stamp	\
+	$(lib SONAME@_la_VALASOURCES)	\
+	$(NULL)
 
+## File created by the gnome-build tools



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]