From c810874990926a9e391ad185e108f78200e212b8 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 3 Apr 2024 13:31:29 +0200 Subject: [PATCH] Check for cargo during libgrust configuration libgrust configuration script did not check for cargo, which is now required in order to build libformat_parser. libgrust/ChangeLog: * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Add check for cargo, error out when cargo is missing. * libproc_macro_internal/Makefile.in: Regenerate. Signed-off-by: Pierre-Emmanuel Patry --- libgrust/Makefile.in | 1 + libgrust/configure | 46 ++++++++++++++++++++- libgrust/configure.ac | 2 + libgrust/libproc_macro_internal/Makefile.in | 1 + 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/libgrust/Makefile.in b/libgrust/Makefile.in index d065584d196f..6d16ec80a65b 100644 --- a/libgrust/Makefile.in +++ b/libgrust/Makefile.in @@ -174,6 +174,7 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CARGO = @CARGO@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ diff --git a/libgrust/configure b/libgrust/configure index dcdc3142fa2e..78a64dbe7264 100755 --- a/libgrust/configure +++ b/libgrust/configure @@ -658,6 +658,7 @@ LD FGREP SED LIBTOOL +CARGO am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE @@ -6439,6 +6440,47 @@ $as_echo "no" >&6; } fi +# Extract the first word of "cargo", so it can be a program name with args. +set dummy cargo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CARGO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CARGO"; then + ac_cv_prog_CARGO="$CARGO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CARGO="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_CARGO" && ac_cv_prog_CARGO="no" +fi +fi +CARGO=$ac_cv_prog_CARGO +if test -n "$CARGO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CARGO" >&5 +$as_echo "$CARGO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test x$CARGO = xno; then : + as_fn_error $? "cargo is required to build some parts of the compiler." "$LINENO" 5 +fi # Enable libtool case `pwd` in @@ -12655,7 +12697,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12658 "configure" +#line 12700 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12761,7 +12803,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12764 "configure" +#line 12806 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgrust/configure.ac b/libgrust/configure.ac index d55e698fdd82..273632e882d4 100644 --- a/libgrust/configure.ac +++ b/libgrust/configure.ac @@ -48,6 +48,8 @@ AC_PROG_CXX AM_PROG_AS AC_PROG_MAKE_SET AC_PROG_INSTALL +AC_CHECK_PROG(CARGO, [cargo], [yes], [no]) +AS_IF(test x$CARGO = xno,AC_MSG_ERROR([cargo is required to build some parts of the compiler.])) # Enable libtool LT_INIT diff --git a/libgrust/libproc_macro_internal/Makefile.in b/libgrust/libproc_macro_internal/Makefile.in index 68aa46106899..1291459c79fb 100644 --- a/libgrust/libproc_macro_internal/Makefile.in +++ b/libgrust/libproc_macro_internal/Makefile.in @@ -135,6 +135,7 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CARGO = @CARGO@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@