From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id A2C3F3858D28; Sat, 26 Feb 2022 04:08:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2C3F3858D28 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] libgloss: switch to AM_PROG_AR X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 8343db918f7609c49b6f5eb432a82a5a12ab1dd2 X-Git-Newrev: 7f674bb4da562e5df74dfcd144c130397c31411a Message-Id: <20220226040809.A2C3F3858D28@sourceware.org> Date: Sat, 26 Feb 2022 04:08:09 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Feb 2022 04:08:09 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7f674bb4da5= 62e5df74dfcd144c130397c31411a commit 7f674bb4da562e5df74dfcd144c130397c31411a Author: Mike Frysinger Date: Sat Feb 12 05:36:20 2022 -0500 libgloss: switch to AM_PROG_AR =20 Now that we require Automake 1.15, we can use this macro rather than set the tool up ourselves. The current code doesn't properly search for a prefixed ar tool as-is. Diff: --- libgloss/Makefile.in | 1 + libgloss/aarch64/aclocal.m4 | 112 +++++++++++++++++++++++++++ libgloss/aarch64/configure | 176 ++++++++++++++++++++++++++++++++++++++= +++- libgloss/aarch64/configure.ac | 3 +- libgloss/aclocal.m4 | 60 ++++++++++++++ libgloss/arm/aclocal.m4 | 112 +++++++++++++++++++++++++++ libgloss/arm/configure | 176 ++++++++++++++++++++++++++++++++++++++= +++- libgloss/arm/configure.ac | 3 +- libgloss/configure | 144 ++++++++++++++++++++++++++++++++-- libgloss/configure.ac | 4 +- 10 files changed, 776 insertions(+), 15 deletions(-) diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index 239533248..b6e872b4b 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -487,6 +487,7 @@ abs_builddir =3D @abs_builddir@ abs_srcdir =3D @abs_srcdir@ abs_top_builddir =3D @abs_top_builddir@ abs_top_srcdir =3D @abs_top_srcdir@ +ac_ct_AR =3D @ac_ct_AR@ ac_ct_CC =3D @ac_ct_CC@ am__include =3D @am__include@ am__leading_dot =3D @am__leading_dot@ diff --git a/libgloss/aarch64/aclocal.m4 b/libgloss/aarch64/aclocal.m4 index 7b69b7d7a..36a6b1f3a 100644 --- a/libgloss/aarch64/aclocal.m4 +++ b/libgloss/aarch64/aclocal.m4 @@ -12,6 +12,66 @@ # PARTICULAR PURPOSE. =20 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4= _defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=3Dar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=3Dar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable =3D 0;]])], + [am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_= LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&A= S_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # Figure out how to run the assembler. -*- Autoconf -= *- =20 # Copyright (C) 2001-2017 Free Software Foundation, Inc. @@ -32,6 +92,58 @@ AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defau= lts to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) =20 +# AM_AUX_DIR_EXPAND -*- Autoconf -= *- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir=3D'\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING=3D"\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=3D`cd "$ac_aux_dir" && pwd` +]) + # AM_CONDITIONAL -*- Autoconf -= *- =20 # Copyright (C) 1997-2017 Free Software Foundation, Inc. diff --git a/libgloss/aarch64/configure b/libgloss/aarch64/configure index 9273e22b3..4408ef6c3 100755 --- a/libgloss/aarch64/configure +++ b/libgloss/aarch64/configure @@ -591,6 +591,7 @@ host_makefile_frag_path objtype RANLIB LD +ac_ct_AR AR am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE @@ -3105,7 +3106,180 @@ else fi =20 =20 -AR=3D${AR-ar} +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=3D`cd "$ac_aux_dir" && pwd` + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a = program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR=3D"$AR" # 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_AR=3D"$ac_tool_prefix$ac_prog" + $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 +AR=3D$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 + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=3D$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with= args. +set dummy $ac_prog; 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_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR=3D"$ac_ct_AR" # 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_AR=3D"$ac_prog" + $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_AR=3D$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 + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" =3D x; then + AR=3D"false" + 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 + AR=3D$ac_ct_AR + fi +fi + +: ${AR=3Dar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) inter= face" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + + am_cv_ar_interface=3Dar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable =3D 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } = >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; = } >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac =20 LD=3D${LD-ld} =20 diff --git a/libgloss/aarch64/configure.ac b/libgloss/aarch64/configure.ac index cd91c2212..d691f11a7 100644 --- a/libgloss/aarch64/configure.ac +++ b/libgloss/aarch64/configure.ac @@ -11,8 +11,7 @@ AC_PROG_INSTALL AC_NO_EXECUTABLES AC_PROG_CC AM_PROG_AS -AR=3D${AR-ar} -AC_SUBST(AR) +AM_PROG_AR LD=3D${LD-ld} AC_SUBST(LD) AC_PROG_RANLIB diff --git a/libgloss/aclocal.m4 b/libgloss/aclocal.m4 index 0ff41e011..16d4bf841 100644 --- a/libgloss/aclocal.m4 +++ b/libgloss/aclocal.m4 @@ -56,6 +56,66 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) =20 +# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=3Dar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=3Dar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable =3D 0;]])], + [am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_= LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&A= S_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # Figure out how to run the assembler. -*- Autoconf -= *- =20 # Copyright (C) 2001-2017 Free Software Foundation, Inc. diff --git a/libgloss/arm/aclocal.m4 b/libgloss/arm/aclocal.m4 index 7b69b7d7a..36a6b1f3a 100644 --- a/libgloss/arm/aclocal.m4 +++ b/libgloss/arm/aclocal.m4 @@ -12,6 +12,66 @@ # PARTICULAR PURPOSE. =20 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4= _defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=3Dar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=3Dar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable =3D 0;]])], + [am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_= LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&A= S_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # Figure out how to run the assembler. -*- Autoconf -= *- =20 # Copyright (C) 2001-2017 Free Software Foundation, Inc. @@ -32,6 +92,58 @@ AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defau= lts to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) =20 +# AM_AUX_DIR_EXPAND -*- Autoconf -= *- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir=3D'\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING=3D"\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=3D`cd "$ac_aux_dir" && pwd` +]) + # AM_CONDITIONAL -*- Autoconf -= *- =20 # Copyright (C) 1997-2017 Free Software Foundation, Inc. diff --git a/libgloss/arm/configure b/libgloss/arm/configure index c19a83a51..b5ac9db2c 100755 --- a/libgloss/arm/configure +++ b/libgloss/arm/configure @@ -591,6 +591,7 @@ host_makefile_frag_path objtype RANLIB LD +ac_ct_AR AR am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE @@ -3131,7 +3132,180 @@ else fi =20 =20 -AR=3D${AR-ar} +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=3D`cd "$ac_aux_dir" && pwd` + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a = program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR=3D"$AR" # 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_AR=3D"$ac_tool_prefix$ac_prog" + $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 +AR=3D$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 + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=3D$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with= args. +set dummy $ac_prog; 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_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR=3D"$ac_ct_AR" # 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_AR=3D"$ac_prog" + $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_AR=3D$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 + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" =3D x; then + AR=3D"false" + 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 + AR=3D$ac_ct_AR + fi +fi + +: ${AR=3Dar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) inter= face" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + + am_cv_ar_interface=3Dar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable =3D 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } = >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; = } >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac =20 LD=3D${LD-ld} =20 diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac index 2affeb971..44f5f7396 100644 --- a/libgloss/arm/configure.ac +++ b/libgloss/arm/configure.ac @@ -31,8 +31,7 @@ AC_PROG_INSTALL AC_NO_EXECUTABLES AC_PROG_CC AM_PROG_AS -AR=3D${AR-ar} -AC_SUBST(AR) +AM_PROG_AR LD=3D${LD-ld} AC_SUBST(LD) AC_PROG_RANLIB diff --git a/libgloss/configure b/libgloss/configure index 363cc26d4..5b5146f3e 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -605,6 +605,7 @@ I386_CPPFLAGS CPP RANLIB LD +ac_ct_AR AR am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE @@ -4240,8 +4241,12 @@ else fi =20 =20 -# Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=3D$2 + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a = program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_AR+:} false; then : @@ -4257,7 +4262,7 @@ do 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_AR=3D"ar" + ac_cv_prog_AR=3D"$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_= ext" >&5 break 2 fi @@ -4265,7 +4270,6 @@ done done IFS=3D$as_save_IFS =20 - test -z "$ac_cv_prog_AR" && ac_cv_prog_AR=3D":" fi fi AR=3D$ac_cv_prog_AR @@ -4278,7 +4282,136 @@ $as_echo "no" >&6; } fi =20 =20 -AR=3D${AR-ar} + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=3D$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with= args. +set dummy $ac_prog; 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_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR=3D"$ac_ct_AR" # 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_AR=3D"$ac_prog" + $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_AR=3D$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 + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" =3D x; then + AR=3D"false" + 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 + AR=3D$ac_ct_AR + fi +fi + +: ${AR=3Dar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) inter= face" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + + am_cv_ar_interface=3Dar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable =3D 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try=3D'$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } = >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dar + else + am_ar_try=3D'$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; = } >&5 + (eval $am_ar_try) 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=3Dlib + else + am_cv_ar_interface=3Dunknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=3Dc +ac_cpp=3D'$CPP $CPPFLAGS' +ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$= ac_ext $LIBS >&5' +ac_compiler_gnu=3D$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR=3D"$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR=3D"$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac =20 LD=3D${LD-ld} =20 @@ -4379,7 +4512,6 @@ fi $as_echo "#define HAVE_GNU_LD 1" >>confdefs.h =20 =20 - ac_ext=3Dc ac_cpp=3D'$CPP $CPPFLAGS' ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/libgloss/configure.ac b/libgloss/configure.ac index a656fe185..43e791663 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -251,9 +251,7 @@ AM_CONDITIONAL(CONFIG_LIBNOSYS, test x$config_libnosys = =3D xtrue) =20 AC_PROG_CC AM_PROG_AS -AC_CHECK_PROG(AR, ar, ar, :) -AR=3D${AR-ar} -AC_SUBST(AR) +AM_PROG_AR LD=3D${LD-ld} AC_SUBST(LD) AC_PROG_RANLIB