[librsvg/rustification] Check for Rust/Cargo in configure.ac; make Makefile.am smarter about rust
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] Check for Rust/Cargo in configure.ac; make Makefile.am smarter about rust
- Date: Wed, 14 Dec 2016 03:29:14 +0000 (UTC)
commit bbca5c907ab84c8ea3e954195a4e14a53ba54039
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 13 17:33:17 2016 -0600
Check for Rust/Cargo in configure.ac; make Makefile.am smarter about rust
This works, but "make distcheck" fails since we can't "cargo build" in
the srcdir when under "make distcheck": it makes the srcdir directory
read-only.
Makefile.am | 32 +++++++++++++++++++++++++++++---
configure.ac | 25 ++++++++++++++++++-------
tests/Makefile.am | 46 ++++++++++++++++++++++++----------------------
3 files changed, 71 insertions(+), 32 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 4920733..ae78b0c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -71,11 +71,36 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES = \
librsvg-enum-types.h \
$(NULL)
+RUST_SOURCES = \
+ rust/Cargo.toml \
+ rust/src/bbox.rs \
+ rust/src/drawing_ctx.rs \
+ rust/src/gradient.rs \
+ rust/src/handle.rs \
+ rust/src/length.rs \
+ rust/src/lib.rs \
+ rust/src/marker.rs \
+ rust/src/node.rs \
+ rust/src/path_builder.rs \
+ rust/src/path_parser.rs \
+ rust/src/property_bag.rs \
+ rust/src/shapes.rs \
+ rust/src/state.rs \
+ rust/src/strtod.rs
+
RUST_LIB = rust/target/debug/librsvg_internals.a
-.PHONY: rust/target/debug/librsvg_internals.a
-rust/target/debug/librsvg_internals.a:
- cd rust && \
+check-local:
+ cd $(srcdir)/rust && \
+ cargo test
+
+clean-local:
+ cd $(srcdir)/rust && \
+ cargo clean
+
+.PHONY: $(RUST_LIB)
+$(RUST_LIB):
+ cd $(srcdir)/rust && \
cargo build --verbose
librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
@@ -164,6 +189,7 @@ rsvg_view_3_LDFLAGS += -mwindows
endif # OS_WIN32
EXTRA_DIST = \
+ $(RUST_SOURCES) \
librsvg.doap \
AUTHORS \
NEWS \
diff --git a/configure.ac b/configure.ac
index 911184f..db49a6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,13 @@ AC_SUBST([RSVG_API_MAJOR_VERSION])
AC_SUBST([RSVG_API_MINOR_VERSION])
AC_SUBST([RSVG_API_VERSION_U],[AS_TR_SH([$RSVG_API_VERSION])])
+# ===========================================================================
+
+AC_SUBST([RSVG_LT_VERSION_INFO],[rsvg_lt_version_info])
+AC_SUBST([LIBRSVG_MAJOR_VERSION],[rsvg_major_version])
+AC_SUBST([LIBRSVG_MINOR_VERSION],[rsvg_minor_version])
+AC_SUBST([LIBRSVG_MICRO_VERSION],[rsvg_micro_version])
+
dnl ===========================================================================
GLIB_REQUIRED=2.12.0
@@ -40,13 +47,6 @@ GDK_PIXBUF_REQUIRED=2.20
GTK3_REQUIRED=3.10.0
CROCO_REQUIRED=0.6.1
-# ===========================================================================
-
-AC_SUBST([RSVG_LT_VERSION_INFO],[rsvg_lt_version_info])
-AC_SUBST([LIBRSVG_MAJOR_VERSION],[rsvg_major_version])
-AC_SUBST([LIBRSVG_MINOR_VERSION],[rsvg_minor_version])
-AC_SUBST([LIBRSVG_MICRO_VERSION],[rsvg_micro_version])
-
dnl ===========================================================================
AC_PROG_LN_S
@@ -66,6 +66,17 @@ LT_LIB_M
dnl ===========================================================================
+AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
+AS_IF(test x$CARGO = xno,
+ AC_MSG_ERROR([cargo is required. Please install the Rust toolchain from https://www.rust-lang.org/])
+)
+AC_CHECK_PROG(RUSTC, [rustc], [yes], [no])
+AS_IF(test x$RUSTC = xno,
+ AC_MSG_ERROR([rustc is required. Please install the Rust toolchain from https://www.rust-lang.org/])
+)
+
+dnl ===========================================================================
+
#AC_CANONICAL_HOST
AC_MSG_CHECKING([for some Win32 platform])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 62b04ca..acb5ca5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,26 +37,28 @@ INCLUDES = -I$(srcdir) \
-DTOP_SRC_DIR="\"$(top_srcdir)\"" \
$(LIBRSVG_CFLAGS)
-dist_installed_test_data = \
- $(wildcard $(srcdir)/fixtures/crash/*.svg) \
- $(wildcard $(srcdir)/fixtures/crash/*.png) \
- $(wildcard $(srcdir)/fixtures/reftests/*.svg) \
- $(wildcard $(srcdir)/fixtures/reftests/*.png) \
- $(wildcard $(srcdir)/fixtures/reftests/bugs*.svg) \
- $(wildcard $(srcdir)/fixtures/reftests/bugs*.png) \
- fixtures/dimensions/bug564527.svg \
- fixtures/dimensions/bug614018.svg \
- fixtures/dimensions/bug612951.svg \
- fixtures/dimensions/bug608102.svg \
- fixtures/dimensions/sub-rect-no-unit.svg \
- fixtures/styles/bug620693.svg \
- fixtures/styles/bug614704.svg \
- fixtures/styles/bug614606.svg \
- fixtures/styles/important.svg \
- fixtures/styles/svg-class.svg \
- fixtures/styles/bug592207.svg \
- fixtures/styles/bug338160.svg \
- fixtures/styles/bug379629.svg \
- fixtures/styles/bug614643.svg \
- fixtures/styles/bug418823.svg \
+dist_installed_test_data = \
+ $(wildcard $(srcdir)/fixtures/crash/*.svg) \
+ $(wildcard $(srcdir)/fixtures/crash/*.png) \
+ $(wildcard $(srcdir)/fixtures/reftests/*.svg) \
+ $(wildcard $(srcdir)/fixtures/reftests/*.png) \
+ $(wildcard $(srcdir)/fixtures/reftests/bugs*.svg) \
+ $(wildcard $(srcdir)/fixtures/reftests/bugs*.png) \
+ $(wildcard $(srcdir)/fixtures/reftests/svg1.1/*.svg) \
+ $(wildcard $(srcdir)/fixtures/reftests/svg1.1/*.png) \
+ fixtures/dimensions/bug564527.svg \
+ fixtures/dimensions/bug614018.svg \
+ fixtures/dimensions/bug612951.svg \
+ fixtures/dimensions/bug608102.svg \
+ fixtures/dimensions/sub-rect-no-unit.svg \
+ fixtures/styles/bug620693.svg \
+ fixtures/styles/bug614704.svg \
+ fixtures/styles/bug614606.svg \
+ fixtures/styles/important.svg \
+ fixtures/styles/svg-class.svg \
+ fixtures/styles/bug592207.svg \
+ fixtures/styles/bug338160.svg \
+ fixtures/styles/bug379629.svg \
+ fixtures/styles/bug614643.svg \
+ fixtures/styles/bug418823.svg \
fixtures/styles/order.svg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]