From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id A87A63858401; Tue, 2 Jan 2024 04:35:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A87A63858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704170134; bh=nG9LNyO+0tO3CFKbTKLnDt4BamdxojZZuYkpeBTphBc=; h=From:To:Subject:Date:From; b=dvoWKMQ624AVIs+VmyrU4TPXeh2V3DYA9lZzpe6PWEqj/KWwrgJJVRbxQhKyNdsor nHa6XW6A3P+CxwsPMa1O7lqayIFXSsJ+pd5PHjM0k8Inv4WAyVlh+OrV2d4VKcVbzN VAqbtMf8ofT3fySMb4n7m/if7cGeuz2vgCYOcxUY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/users/vapier/wip] libgloss: check for objcopy & objdump properly X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/users/vapier/wip X-Git-Oldrev: 01f6c45f077705d0b68d56fdbabe56d6583344af X-Git-Newrev: 83da562c52a4b50383b733a6c156e51f7f043325 Message-Id: <20240102043534.A87A63858401@sourceware.org> Date: Tue, 2 Jan 2024 04:35:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D83da562c52a= 4b50383b733a6c156e51f7f043325 commit 83da562c52a4b50383b733a6c156e51f7f043325 Author: Mike Frysinger Date: Wed Dec 27 00:26:14 2023 -0500 libgloss: check for objcopy & objdump properly =20 A bunch of ports hack together these values rather than setting them up in the configure script for everyone. Diff: --- libgloss/Makefile.in | 2 + libgloss/configure | 186 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ libgloss/configure.ac | 2 + 3 files changed, 190 insertions(+) diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index fd845cf5f..deeb31cbc 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -812,6 +812,8 @@ MN10300_BSP_LIST =3D @MN10300_BSP_LIST@ MN10300_SCRIPT_LIST =3D @MN10300_SCRIPT_LIST@ MOXIE_BUILD_CRT0_FALSE =3D @MOXIE_BUILD_CRT0_FALSE@ MOXIE_BUILD_CRT0_TRUE =3D @MOXIE_BUILD_CRT0_TRUE@ +OBJCOPY =3D @OBJCOPY@ +OBJDUMP =3D @OBJDUMP@ OBJEXT =3D @OBJEXT@ PACKAGE =3D @PACKAGE@ PACKAGE_BUGREPORT =3D @PACKAGE_BUGREPORT@ diff --git a/libgloss/configure b/libgloss/configure index 5f6bc5841..1cc042bc5 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -613,6 +613,8 @@ I386_CPPFLAGS ARM_OBJTYPE AARCH64_OBJTYPE CPP +OBJDUMP +OBJCOPY RANLIB LD ac_ct_AR @@ -4618,6 +4620,190 @@ else RANLIB=3D"$ac_cv_prog_RANLIB" fi =20 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a p= rogram name with args. +set dummy ${ac_tool_prefix}objcopy; ac_word=3D$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_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY=3D"$OBJCOPY" # Let the user override the test. +else +as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + 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_OBJCOPY=3D"${ac_tool_prefix}objcopy" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_= ext" >&5 + break 2 + fi +done + done +IFS=3D$as_save_IFS + +fi +fi +OBJCOPY=3D$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJCOPY"; then + ac_ct_OBJCOPY=3D$OBJCOPY + # Extract the first word of "objcopy", so it can be a program name with = args. +set dummy objcopy; ac_word=3D$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_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJCOPY"; then + ac_cv_prog_ac_ct_OBJCOPY=3D"$ac_ct_OBJCOPY" # Let the user override the = test. +else +as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + 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_OBJCOPY=3D"objcopy" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_= ext" >&5 + break 2 + fi +done + done +IFS=3D$as_save_IFS + +fi +fi +ac_ct_OBJCOPY=3D$ac_cv_prog_ac_ct_OBJCOPY +if test -n "$ac_ct_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJCOPY" =3D x; then + OBJCOPY=3D":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not pr= efixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triple= t" >&2;} +ac_tool_warned=3Dyes ;; +esac + OBJCOPY=3D$ac_ct_OBJCOPY + fi +else + OBJCOPY=3D"$ac_cv_prog_OBJCOPY" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a p= rogram name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=3D$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_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP=3D"$OBJDUMP" # Let the user override the test. +else +as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + 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_OBJDUMP=3D"${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_= ext" >&5 + break 2 + fi +done + done +IFS=3D$as_save_IFS + +fi +fi +OBJDUMP=3D$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=3D$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with = args. +set dummy objdump; ac_word=3D$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_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP=3D"$ac_ct_OBJDUMP" # Let the user override the = test. +else +as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + 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_OBJDUMP=3D"objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_= ext" >&5 + break 2 + fi +done + done +IFS=3D$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=3D$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" =3D x; then + OBJDUMP=3D":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not pr= efixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triple= t" >&2;} +ac_tool_warned=3Dyes ;; +esac + OBJDUMP=3D$ac_ct_OBJDUMP + fi +else + OBJDUMP=3D"$ac_cv_prog_OBJDUMP" +fi + =20 =20 $as_echo "#define HAVE_GNU_LD 1" >>confdefs.h diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 268d86c51..c37c1c2c2 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -267,6 +267,8 @@ AM_PROG_AR LD=3D${LD-ld} AC_SUBST(LD) AC_PROG_RANLIB +AC_CHECK_TOOL(OBJCOPY, objcopy, :) +AC_CHECK_TOOL(OBJDUMP, objdump, :) =20 AC_DEFINE(HAVE_GNU_LD, 1, [Using GNU LD])