[niepce: 1/29] Rust: bootstrap rustification



commit cfa31f546fd45614bc69f15ee80450e557ed688e
Author: Hubert Figuière <hub figuiere net>
Date:   Sat Jun 3 10:53:28 2017 -0400

    Rust: bootstrap rustification

 .gitignore   |    3 +++
 Cargo.toml   |    9 +++++++++
 Makefile.am  |   14 +++++++++++++-
 README       |    1 +
 configure.ac |   14 ++++++++++++++
 src/lib.rs   |    6 ++++++
 6 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e8f5b59..7baae6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -112,3 +112,6 @@ po/en@quot.header
 po/insert-header.sin
 po/quot.sed
 po/remove-potcdate.s*
+target/
+**/*.rs.bk
+Cargo.lock
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..7bc8d91
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "niepce"
+version = "0.1.0"
+authors = ["Hubert Figuière <hub figuiere net>"]
+
+[dependencies]
+sqlite = "0.23.4"
+exempi = "2.4.0"
+#gphoto = "0.1.1"
\ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
index 2d45514..6e1b596 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,9 @@
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = COPYING AUTHORS README
+EXTRA_DIST = COPYING AUTHORS README \
+       Cargo.toml \
+       Cargo.lock \
+       $(NULL)
 
 if CW_BUILD
 CW_DIR = camerawire
@@ -8,3 +11,12 @@ endif
 
 SUBDIRS =  data src $(CW_DIR) po
 DIST_SUBDIRS = po art data doc src camerawire
+
+all-local:
+       (cd $(top_srcdir) ; CARGO_TARGET_DIR=@abs_top_builddir@/target cargo build --release)
+
+clean-local:
+       -(cd $(top_srcdir) ; CARGO_TARGET_DIR=@abs_top_builddir@/target cargo clean)
+
+check:
+       (cd $(top_srcdir) ; CARGO_TARGET_DIR=@abs_top_builddir@/target cargo test --release)
diff --git a/README b/README
index 8b29e16..1cf26a1 100644
--- a/README
+++ b/README
@@ -19,6 +19,7 @@ To build is you need the following:
 -----------------------------------
 
 A C++11 compiler
+A Rust compiler
 gtk+ 3.12
 cairo 1.1
 glibmm 2.32
diff --git a/configure.ac b/configure.ac
index c00f589..ebab521 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,20 @@ AC_ARG_ENABLE(asan,[  --enable-asan    Turn on address sanitizer],[
 
 ])
 
+AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
+AS_IF(test x$CARGO = xno,
+    AC_MSG_ERROR([cargo is required])
+)
+AC_CHECK_PROG(RUSTC, [rustc], [yes], [no])
+AS_IF(test x$RUSTC = xno,
+    AC_MSG_ERROR([rustc is required])
+)
+
+dnl Release build we do.
+CARGO_TARGET_SUBDIR=release
+AC_SUBST(CARGO_TARGET_SUBDIR)
+
+
 AC_CONFIG_FILES([
 Makefile
 art/Makefile
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..cdfbe1a
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,6 @@
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {
+    }
+}


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