mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
tidy m4 plugin config support
In CLANG_PLUGIN_FILE it is possible for plugin_file to be non-NULL when LLVMgold.so does not exist. configure output is messy, with results not printed against their "checking.." line, eg. checking for clang... (cached) yes checking for clang plugin file... checking for x86_64-pc-linux-gnu-ar... (cached) ar --plugin /usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so /usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so This patch fixes those problems, and a similar interposition of other configure output between AC_MSG_CHECKING and AC_MSG_RESULT in gcc-plugin.m4. It also tidies some of the message text, and makes similar code in gcc-plugin.m4 and clang-plugin.m4 a little more consistent. config/ * clang-plugin.m4 (CLANG_PLUGIN_FILE): Don't place checks for tools (llvm-config, ar) inside AC_MSG_CHECKING..AC_MSG_RESULT for clang plugin file. Clear plugin_file before loop exit. (CLANG_PLUGIN_FILE_FOR_TARGET): Similarly. * gcc-plugin.m4 (GCC_PLUGIN_OPTION): Similarly. (GCC_PLUGIN_OPTION_FOR_TARGET): Correct AC_MSG_CHECKING. Tidy return code. binutils/ * testsuite/lib/binutils-common.exp <llvm_plug_opt>: Set for non-native. * configure: Regenerate. / * configure: Regenerate. bfd/ * configure: Regenerate. gas/ * configure: Regenerate. gdb/ * configure: Regenerate. gprof/ * configure: Regenerate. gprofng/ * configure: Regenerate. * libcollector/configure: Regenerate. ld/ * configure: Regenerate. libbacktrace/ * configure: Regenerate. libctf/ * configure: Regenerate. libiberty/ * configure: Regenerate. libsframe/ * configure: Regenerate. opcodes/ * configure: Regenerate. sim/ * configure: Regenerate. zlib/ * configure: Regenerate.
This commit is contained in:
283
binutils/configure
vendored
283
binutils/configure
vendored
@@ -6127,15 +6127,7 @@ rm -f conftest*
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
|
||||
$as_echo "$clang_cv_is_clang" >&6; }
|
||||
plugin_file=
|
||||
if test $clang_cv_is_clang = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
|
||||
$as_echo_n "checking for clang plugin file... " >&6; }
|
||||
plugin_names="LLVMgold.so"
|
||||
for plugin in $plugin_names; do
|
||||
plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
|
||||
if test x$plugin_file = x$plugin; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -6227,22 +6219,31 @@ else
|
||||
LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
|
||||
fi
|
||||
|
||||
if test "$?" != 0; then
|
||||
as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
|
||||
fi
|
||||
clang_lib_dir=`$LLVM_CONFIG --libdir`
|
||||
if test -f $clang_lib_dir/$plugin; then
|
||||
plugin_file=$clang_lib_dir/$plugin
|
||||
fi
|
||||
if test x$plugin_file != x$plugin; then
|
||||
plugin_file=
|
||||
if test $clang_cv_is_clang = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
|
||||
$as_echo_n "checking for clang plugin file... " >&6; }
|
||||
plugin_names="LLVMgold.so"
|
||||
for plugin in $plugin_names; do
|
||||
plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
|
||||
if test "$plugin_file" != "$plugin"; then
|
||||
break;
|
||||
fi
|
||||
if test -n "${LLVM_CONFIG}"; then
|
||||
plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
|
||||
if test -f "$plugin_file"; then
|
||||
break;
|
||||
fi
|
||||
fi
|
||||
plugin_file=
|
||||
done
|
||||
if test -z $plugin_file; then
|
||||
as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
|
||||
fi
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
if test -z "$plugin_file"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
|
||||
$as_echo "$plugin_file" >&6; }
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -6334,29 +6335,122 @@ else
|
||||
AR="$ac_cv_prog_AR"
|
||||
fi
|
||||
|
||||
if test "${AR}" = "" ; then
|
||||
as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
|
||||
fi
|
||||
plugin_option="--plugin $plugin_file"
|
||||
touch conftest.c
|
||||
${AR} $plugin_option rc conftest.a conftest.c
|
||||
if test "$?" != 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
|
||||
if test -z "${AR}"; then
|
||||
as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
|
||||
fi
|
||||
plugin_option="--plugin $plugin_file"
|
||||
touch conftest.c
|
||||
${AR} $plugin_option rc conftest.a conftest.c
|
||||
if test "$?" != 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
|
||||
$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
|
||||
plugin_file=
|
||||
plugin_file=
|
||||
fi
|
||||
rm -f conftest.*
|
||||
fi
|
||||
rm -f conftest.*
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
|
||||
$as_echo "$plugin_file" >&6; }
|
||||
fi
|
||||
plugin_file="$plugin_file"
|
||||
|
||||
if test -n "$plugin_file"; then
|
||||
plugin_option="--plugin $plugin_file"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
|
||||
$as_echo_n "checking for -plugin option... " >&6; }
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; 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_AR+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$AR"; then
|
||||
ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar"
|
||||
$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
|
||||
|
||||
fi
|
||||
fi
|
||||
AR=$ac_cv_prog_AR
|
||||
if test -n "$AR"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
|
||||
$as_echo "$AR" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_prog_AR"; then
|
||||
ac_ct_AR=$AR
|
||||
# Extract the first word of "ar", so it can be a program name with args.
|
||||
set dummy ar; 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_ac_ct_AR+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$ac_ct_AR"; then
|
||||
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_ac_ct_AR="ar"
|
||||
$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
|
||||
|
||||
fi
|
||||
fi
|
||||
ac_ct_AR=$ac_cv_prog_ac_ct_AR
|
||||
if test -n "$ac_ct_AR"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
|
||||
$as_echo "$ac_ct_AR" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_ct_AR" = x; then
|
||||
AR=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
AR=$ac_ct_AR
|
||||
fi
|
||||
else
|
||||
AR="$ac_cv_prog_AR"
|
||||
fi
|
||||
|
||||
if test -z "${AR}"; then
|
||||
as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
|
||||
$as_echo_n "checking for -plugin option... " >&6; }
|
||||
plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
|
||||
plugin_option=
|
||||
for plugin in $plugin_names; do
|
||||
@@ -6369,117 +6463,22 @@ for plugin in $plugin_names; do
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; 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_AR+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$AR"; then
|
||||
ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar"
|
||||
$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
|
||||
|
||||
fi
|
||||
fi
|
||||
AR=$ac_cv_prog_AR
|
||||
if test -n "$AR"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
|
||||
$as_echo "$AR" >&6; }
|
||||
else
|
||||
if test -z "$plugin_option"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_prog_AR"; then
|
||||
ac_ct_AR=$AR
|
||||
# Extract the first word of "ar", so it can be a program name with args.
|
||||
set dummy ar; 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_ac_ct_AR+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$ac_ct_AR"; then
|
||||
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_ac_ct_AR="ar"
|
||||
$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
|
||||
|
||||
fi
|
||||
fi
|
||||
ac_ct_AR=$ac_cv_prog_ac_ct_AR
|
||||
if test -n "$ac_ct_AR"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
|
||||
$as_echo "$ac_ct_AR" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_ct_AR" = x; then
|
||||
AR=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
AR=$ac_ct_AR
|
||||
fi
|
||||
else
|
||||
AR="$ac_cv_prog_AR"
|
||||
fi
|
||||
|
||||
if test "${AR}" = "" ; then
|
||||
as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
|
||||
fi
|
||||
touch conftest.c
|
||||
${AR} $plugin_option rc conftest.a conftest.c
|
||||
if test "$?" != 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
|
||||
$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
|
||||
plugin_option=
|
||||
fi
|
||||
rm -f conftest.*
|
||||
if test -n "$plugin_option"; then
|
||||
plugin_option="$plugin_option"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
|
||||
$as_echo "$plugin_option" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
touch conftest.c
|
||||
${AR} $plugin_option rc conftest.a conftest.c
|
||||
if test "$?" != 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
|
||||
$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
|
||||
plugin_option=
|
||||
fi
|
||||
rm -f conftest.*
|
||||
fi
|
||||
plugin_option="$plugin_option"
|
||||
|
||||
fi
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
@@ -11456,7 +11455,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11459 "configure"
|
||||
#line 11458 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11562,7 +11561,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11565 "configure"
|
||||
#line 11564 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
||||
@@ -1824,21 +1824,20 @@ if { [isnative] } then {
|
||||
set CLANG_FOR_TARGET clang
|
||||
}
|
||||
}
|
||||
if [info exists CLANG_FOR_TARGET] then {
|
||||
set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]]
|
||||
if { $llvm_plug_so ne "LLVMgold.so" } then {
|
||||
set llvm_plug_opt "--plugin $llvm_plug_so"
|
||||
}
|
||||
|
||||
if { $llvm_plug_opt eq "" } then {
|
||||
# If it is still blank, try llvm-config --libdir. Clang
|
||||
# searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds
|
||||
# to this.
|
||||
catch "exec llvm-config --libdir" got
|
||||
if {[file isdirectory $got] \
|
||||
&& [file isfile $got/LLVMgold.so]} then {
|
||||
set llvm_plug_opt "--plugin $got/LLVMgold.so"
|
||||
}
|
||||
}
|
||||
if [info exists CLANG_FOR_TARGET] then {
|
||||
set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]]
|
||||
if { $llvm_plug_so ne "LLVMgold.so" } then {
|
||||
set llvm_plug_opt "--plugin $llvm_plug_so"
|
||||
}
|
||||
if { $llvm_plug_opt eq "" && [isnative] } then {
|
||||
# If it is still blank, try llvm-config --libdir. Clang
|
||||
# searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds
|
||||
# to this.
|
||||
catch "exec llvm-config --libdir" got
|
||||
if {[file isdirectory $got] \
|
||||
&& [file isfile $got/LLVMgold.so]} then {
|
||||
set llvm_plug_opt "--plugin $got/LLVMgold.so"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user