From ce0ae81d9530ce96c5e573da1d94c65559ccb1cb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 17 Jan 2020 16:40:38 +0100 Subject: [PATCH] rust: fix vendor use on MinGW --- configure.ac | 9 +++++++-- rust/.cargo/config.in | 2 +- rust/Makefile.am | 3 +-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 3a76ece0e3..8ca1f6744e 100644 --- a/configure.ac +++ b/configure.ac @@ -85,7 +85,7 @@ AC_PROG_GREP AC_PATH_PROG(HAVE_CYGPATH, cygpath, "no") - AM_CONDITIONAL([HAVE_CYGPATH], [test "x$enable_cygpath" = "xyes"]) + AM_CONDITIONAL([HAVE_CYGPATH], [test "x$HAVE_CYGPATH" != "xno"]) AC_PATH_PROG(HAVE_PKG_CONFIG, pkg-config, "no") if test "$HAVE_PKG_CONFIG" = "no"; then @@ -2415,7 +2415,12 @@ fi AC_SUBST(RUST_SURICATA_LIB) AC_SUBST(RUST_LDADD) if test "x$CARGO_HOME" = "x"; then - AC_SUBST([CARGO_HOME], [~/.cargo]) + if test "x$HAVE_CYGPATH" != "no"; then + CYGPATH_CARGO_HOME=$(cygpath -a -t mixed ~/.cargo) + AC_SUBST([CARGO_HOME], [$CYGPATH_CARGO_HOME]) + else + AC_SUBST([CARGO_HOME], [~/.cargo]) + fi else AC_SUBST([CARGO_HOME], [$CARGO_HOME]) fi diff --git a/rust/.cargo/config.in b/rust/.cargo/config.in index 86b29f81c4..e96f9fbc1d 100644 --- a/rust/.cargo/config.in +++ b/rust/.cargo/config.in @@ -5,4 +5,4 @@ @rust_vendor_comment@replace-with = 'vendored-sources' @rust_vendor_comment@ @rust_vendor_comment@[source.vendored-sources] -@rust_vendor_comment@directory = '@abs_top_srcdir@/rust/vendor' +@rust_vendor_comment@directory = '@e_rustdir@/vendor' diff --git a/rust/Makefile.am b/rust/Makefile.am index aaa589e1a7..747a59fb05 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -27,10 +27,9 @@ if HAVE_PYTHON cd $(top_srcdir)/rust && $(HAVE_PYTHON) ./gen-c-headers.py endif if HAVE_CYGPATH - rustpath=`cygpath -a -t mixed $(abs_top_builddir)` @rustup_home@ \ CARGO_HOME="$(CARGO_HOME)" \ - CARGO_TARGET_DIR="$$rustpath/rust/target" \ + CARGO_TARGET_DIR="$(e_rustdir)/target" \ $(CARGO) build $(RELEASE) \ --features "$(RUST_FEATURES)" $(RUST_TARGET) else