File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,32 @@ AC_PROG_INSTALL
4848AC_PROG_RANLIB
4949AM_PROG_AR
5050AC_PROG_LN_S
51+ AC_PROG_GREP
5152AC_PROG_MAKE_SET
5253
5354AC_PATH_PROG ( BASH , [ bash] )
5455AC_PATH_PROG ( CARGO_CMD , [ cargo] )
56+ AC_PATH_PROG ( RUSTC_CMD , [ rustc] )
57+ if test x"$RUSTC_CMD" == x""; then
58+ RUSTC_PLATFORM=no
59+ else
60+ # for example, rustc expects x86_64-unknown-linux-gnu instead of x86_64-pc-linux-gnu
61+ # and armv7-unknown-linux-gnueabihf instead of armv7l-unknown-linux-gnueabihf
62+ AC_MSG_CHECKING ( [ rustc --target argument] )
63+ if "$RUSTC_CMD" --print target-list | $GREP "$host" > /dev/null; then
64+ RUSTC_PLATFORM="$host"
65+ else
66+ candidate=`echo "$host_cpu"-unknown-"$host_os" | sed -e 's/armv\(.\)l-/armv\1-/'`
67+ if "$RUSTC_CMD" --print target-list | $GREP "$candidate" > /dev/null; then
68+ RUSTC_PLATFORM="$candidate"
69+ else
70+ AC_MSG_ERROR ( "$RUSTC_CMD knows neither $host nor $candidate" )
71+ fi
72+ AC_MSG_RESULT ( [ "$RUSTC_PLATFORM"] )
73+ fi
74+ fi
75+ AC_SUBST ( RUSTC_PLATFORM )
76+
5577AC_PATH_PROG ( BZIP2_CMD , [ bzip2] )
5678AC_PATH_PROG ( RE2C_CMD , [ re2c] )
5779AM_CONDITIONAL(HAVE_RE2C, test x"$RE2C_CMD" != x"")
Original file line number Diff line number Diff line change @@ -125,11 +125,11 @@ AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) $(USER_CXXFLAGS)
125125if HAVE_CARGO
126126RUST_DEPS_CPPFLAGS = -DHAVE_RUST_DEPS=1
127127PRQLC_DIR = third-party/prqlc-c/target
128- RUST_DEPS_LIBS = $(PRQLC_DIR ) /release/libprqlc_c.a
128+ RUST_DEPS_LIBS = $(PRQLC_DIR ) /$( RUSTC_PLATFORM ) / release/libprqlc_c.a
129129
130130$(RUST_DEPS_LIBS ) : $(srcdir ) /third-party/prqlc-c/src/lib.rs $(srcdir ) /third-party/prqlc-c/Cargo.toml
131131 mkdir -p $(PRQLC_DIR )
132- env CARGO_TARGET_DIR=third-party/prqlc-c/target $(CARGO_CMD ) build --manifest-path \
132+ env CARGO_TARGET_DIR=third-party/prqlc-c/target $(CARGO_CMD ) build --target $( RUSTC_PLATFORM ) -- manifest-path \
133133 $(srcdir ) /third-party/prqlc-c/Cargo.toml --package prqlc-c --release
134134
135135else
You can’t perform that action at this time.
0 commit comments