From f9c1196affcade31dc13b30cdf5eb727c59fe8bf Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 16 Apr 2003 06:51:20 +0000 Subject: [PATCH] configure.in: Unify the code which creates symlinks to a just-built as... * configure.in: Unify the code which creates symlinks to a just-built as, ld, objdump, and nm with the code that detects their presence for purposes of feature tests. * configure: Regenerate. From-SVN: r65677 --- gcc/ChangeLog | 7 +++ gcc/configure | 114 ++++++++++++++++++++++++++--------------------- gcc/configure.in | 56 ++++++++++++++--------- 3 files changed, 106 insertions(+), 71 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f444a970d25..6a9ce450cf6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-04-15 Zack Weinberg + + * configure.in: Unify the code which creates symlinks to a + just-built as, ld, objdump, and nm with the code that detects + their presence for purposes of feature tests. + * configure: Regenerate. + 2003-04-15 Zack Weinberg * varasm.c (output_constant_def): Do not consult diff --git a/gcc/configure b/gcc/configure index d92e7c85ce2..78f285fec47 100755 --- a/gcc/configure +++ b/gcc/configure @@ -2434,7 +2434,7 @@ fi # Find some useful tools -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -7388,22 +7388,6 @@ case $use_collect2 in ;; esac -# If we have gas in the build tree, make a link to it. -if test -f ../gas/Makefile; then - rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null -fi - -# If we have nm and objdump in the build tree, make a link to them. -if test -f ../binutils/Makefile; then - rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null - rm -f objdump; $symbolic_link ../binutils/objdump$host_exeext objdump$host_exeext 2>/dev/null -fi - -# If we have ld in the build tree, make a link to it. -if test -f ../ld/Makefile; then - rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null -fi - # Identify the assembler which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the assembler # which will be driven by the driver program. @@ -7412,7 +7396,7 @@ fi # build->target assembler and hope that it will have the same features # as the host->target assembler we'll be using. echo $ac_n "checking what assembler to use""... $ac_c" 1>&6 -echo "configure:7416: checking what assembler to use" >&5 +echo "configure:7400: checking what assembler to use" >&5 in_tree_gas=no gcc_cv_as= gcc_cv_gas_major_version= @@ -7443,6 +7427,8 @@ gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"` + rm -f as$host_exeext + $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null fi if test "x$gcc_cv_as" = x; then @@ -7521,7 +7507,7 @@ esac # build->target linker and hope that it will have the same features # as the host->target linker we'll be using. echo $ac_n "checking what linker to use""... $ac_c" 1>&6 -echo "configure:7525: checking what linker to use" >&5 +echo "configure:7511: checking what linker to use" >&5 in_tree_ld=no gcc_cv_ld= gcc_cv_gld_major_version= @@ -7532,9 +7518,9 @@ if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" elif test -x "$LD"; then gcc_cv_ld="$LD" -elif test -x ld$host_exeext; then +elif test -x collect-ld$host_exeext; then # Build using linker in the current directory. - gcc_cv_ld=./ld$host_exeext + gcc_cv_ld=./collect-ld$host_exeext elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ && test -f ../ld/Makefile; then # Single tree build which includes ld. @@ -7548,6 +7534,9 @@ elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ done gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` + rm -f collect-ld$host_exeext + $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \ + 2>/dev/null fi if test "x$gcc_cv_ld" = x; then @@ -7619,32 +7608,57 @@ case $in_tree_ld in esac # Figure out what nm we will be using. +gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils echo $ac_n "checking what nm to use""... $ac_c" 1>&6 -echo "configure:7624: checking what nm to use" >&5 +echo "configure:7614: checking what nm to use" >&5 +in_tree_nm=no if test -x nm$host_exeext; then gcc_cv_nm=./nm$host_exeext +elif test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile; then + # Single tree build which includes binutils. + in_tree_nm=yes + gcc_cv_nm=./nm$host_exeext + rm -f nm$host_exeext + $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null elif test "x$program_prefix" != xNONE; then gcc_cv_nm=${program_prefix}nm$host_exeext else gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext fi -echo "$ac_t""$gcc_cv_nm" 1>&6 +case $in_tree_nm in + yes) echo "$ac_t"""newly built nm"" 1>&6 ;; + no) echo "$ac_t""$gcc_cv_nm" 1>&6 ;; +esac # Figure out what objdump we will be using. echo $ac_n "checking what objdump to use""... $ac_c" 1>&6 -echo "configure:7636: checking what objdump to use" >&5 +echo "configure:7637: checking what objdump to use" >&5 +in_tree_objdump=no if test -x objdump$host_exeext; then gcc_cv_objdump=./objdump$host_exeext +elif test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile; then + # Single tree build which includes binutils. + in_tree_objdump=yes + gcc_cv_objdump=./objdump$host_exeext + rm -f objdump$host_exeext + $symbolic_link ../binutils/objdump$host_exeext \ + objdump$host_exeext 2>/dev/null elif test "x$program_prefix" != xNONE; then gcc_cv_objdump=${program_prefix}objdump$host_exeext else - gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext + gcc_cv_objdump=`echo objdump | \ + sed ${program_transform_name}`$host_exeext fi -echo "$ac_t""$gcc_cv_objdump" 1>&6 +case $in_tree_objdump in + yes) echo "$ac_t"""newly built objdump"" 1>&6 ;; + no) echo "$ac_t""$gcc_cv_objdump" 1>&6 ;; +esac # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:7648: checking assembler alignment features" >&5 +echo "configure:7662: checking assembler alignment features" >&5 gcc_cv_as_alignment_features=none if test $in_tree_gas = yes; then # Gas version 2.6 and later support for .balign and .p2align. @@ -7705,7 +7719,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:7709: checking assembler subsection support" >&5 +echo "configure:7723: checking assembler subsection support" >&5 gcc_cv_as_subsections=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -7754,7 +7768,7 @@ fi echo "$ac_t""$gcc_cv_as_subsections" 1>&6 echo $ac_n "checking assembler weak support""... $ac_c" 1>&6 -echo "configure:7758: checking assembler weak support" >&5 +echo "configure:7772: checking assembler weak support" >&5 gcc_cv_as_weak=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -7784,7 +7798,7 @@ fi echo "$ac_t""$gcc_cv_as_weak" 1>&6 echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6 -echo "configure:7788: checking assembler hidden support" >&5 +echo "configure:7802: checking assembler hidden support" >&5 gcc_cv_as_hidden=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -7865,7 +7879,7 @@ esac echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6 -echo "configure:7869: checking assembler leb128 support" >&5 +echo "configure:7883: checking assembler leb128 support" >&5 gcc_cv_as_leb128=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -7919,7 +7933,7 @@ fi echo "$ac_t""$gcc_cv_as_leb128" 1>&6 echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6 -echo "configure:7923: checking assembler eh_frame optimization" >&5 +echo "configure:7937: checking assembler eh_frame optimization" >&5 gcc_cv_as_eh_frame=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8009,7 +8023,7 @@ fi echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6 echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6 -echo "configure:8013: checking assembler section merging support" >&5 +echo "configure:8027: checking assembler section merging support" >&5 gcc_cv_as_shf_merge=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8041,7 +8055,7 @@ fi echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6 echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6 -echo "configure:8045: checking assembler thread-local storage support" >&5 +echo "configure:8059: checking assembler thread-local storage support" >&5 gcc_cv_as_tls=no conftest_s= tls_first_major= @@ -8188,7 +8202,7 @@ case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6 -echo "configure:8192: checking assembler supports explicit relocations" >&5 +echo "configure:8206: checking assembler supports explicit relocations" >&5 if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8241,7 +8255,7 @@ EOF ;; sparc*-*-*) echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:8245: checking assembler .register pseudo-op support" >&5 +echo "configure:8259: checking assembler .register pseudo-op support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8269,7 +8283,7 @@ EOF fi echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6 -echo "configure:8273: checking assembler supports -relax" >&5 +echo "configure:8287: checking assembler supports -relax" >&5 if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8297,7 +8311,7 @@ EOF fi echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 -echo "configure:8301: checking assembler and linker support unaligned pc related relocs" >&5 +echo "configure:8315: checking assembler and linker support unaligned pc related relocs" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8324,7 +8338,7 @@ EOF fi echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6 -echo "configure:8328: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5 +echo "configure:8342: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5 if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8364,7 +8378,7 @@ EOF fi echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6 -echo "configure:8368: checking for assembler offsetable %lo() support" >&5 +echo "configure:8382: checking for assembler offsetable %lo() support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8403,7 +8417,7 @@ EOF i[34567]86-*-* | x86_64-*-*) echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 -echo "configure:8407: checking assembler instructions" >&5 +echo "configure:8421: checking assembler instructions" >&5 gcc_cv_as_instructions= if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8437,7 +8451,7 @@ EOF echo "$ac_t""$gcc_cv_as_instructions" 1>&6 echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6 -echo "configure:8441: checking assembler GOTOFF in data directives" >&5 +echo "configure:8455: checking assembler GOTOFF in data directives" >&5 gcc_cv_as_gotoff_in_data=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8471,7 +8485,7 @@ EOF ia64*-*-*) echo $ac_n "checking assembler supports ltoffx and ldxmov""... $ac_c" 1>&6 -echo "configure:8475: checking assembler supports ltoffx and ldxmov" >&5 +echo "configure:8489: checking assembler supports ltoffx and ldxmov" >&5 if eval "test \"`echo '$''{'gcc_cv_as_ltoffx_ldxmov_relocs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8516,7 +8530,7 @@ EOF esac echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6 -echo "configure:8520: checking assembler dwarf2 debug_line support" >&5 +echo "configure:8534: checking assembler dwarf2 debug_line support" >&5 gcc_cv_as_dwarf2_debug_line=no # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any @@ -8578,7 +8592,7 @@ fi echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6 echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6 -echo "configure:8582: checking assembler --gdwarf2 support" >&5 +echo "configure:8596: checking assembler --gdwarf2 support" >&5 gcc_cv_as_gdwarf2_flag=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8612,7 +8626,7 @@ fi echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6 echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6 -echo "configure:8616: checking assembler --gstabs support" >&5 +echo "configure:8630: checking assembler --gstabs support" >&5 gcc_cv_as_gstabs_flag=no if test $in_tree_gas = yes ; then if test $gcc_cv_gas_major_version -eq 2 \ @@ -8645,7 +8659,7 @@ fi echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6 echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6 -echo "configure:8649: checking linker read-only and read-write section mixing" >&5 +echo "configure:8663: checking linker read-only and read-write section mixing" >&5 gcc_cv_ld_ro_rw_mix=unknown if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then @@ -8683,7 +8697,7 @@ fi echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6 echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6 -echo "configure:8687: checking linker PT_GNU_EH_FRAME support" >&5 +echo "configure:8701: checking linker PT_GNU_EH_FRAME support" >&5 gcc_cv_ld_eh_frame_hdr=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then @@ -8707,7 +8721,7 @@ echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6 case "$target" in mips*-*-*) echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6 -echo "configure:8711: checking whether libgloss uses STARTUP directives consistently" >&5 +echo "configure:8725: checking whether libgloss uses STARTUP directives consistently" >&5 gcc_cv_mips_libgloss_startup=no gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss if test "x$exec_prefix" = xNONE; then @@ -8912,7 +8926,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:8916: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:8930: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" diff --git a/gcc/configure.in b/gcc/configure.in index c6bd2735047..be087f2c74e 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -1437,22 +1437,6 @@ case $use_collect2 in ;; esac -# If we have gas in the build tree, make a link to it. -if test -f ../gas/Makefile; then - rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null -fi - -# If we have nm and objdump in the build tree, make a link to them. -if test -f ../binutils/Makefile; then - rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null - rm -f objdump; $symbolic_link ../binutils/objdump$host_exeext objdump$host_exeext 2>/dev/null -fi - -# If we have ld in the build tree, make a link to it. -if test -f ../ld/Makefile; then - rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null -fi - # Identify the assembler which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the assembler # which will be driven by the driver program. @@ -1478,6 +1462,8 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \ # Single tree build which includes gas. in_tree_gas=yes _gcc_COMPUTE_GAS_VERSION + rm -f as$host_exeext + $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null fi if test "x$gcc_cv_as" = x; then @@ -1566,9 +1552,9 @@ if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" elif test -x "$LD"; then gcc_cv_ld="$LD" -elif test -x ld$host_exeext; then +elif test -x collect-ld$host_exeext; then # Build using linker in the current directory. - gcc_cv_ld=./ld$host_exeext + gcc_cv_ld=./collect-ld$host_exeext elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ && test -f ../ld/Makefile; then # Single tree build which includes ld. @@ -1586,6 +1572,9 @@ changequote(,)dnl gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` changequote([,])dnl + rm -f collect-ld$host_exeext + $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \ + 2>/dev/null fi if test "x$gcc_cv_ld" = x; then @@ -1657,26 +1646,51 @@ case $in_tree_ld in esac # Figure out what nm we will be using. +gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils AC_MSG_CHECKING(what nm to use) +in_tree_nm=no if test -x nm$host_exeext; then gcc_cv_nm=./nm$host_exeext +elif test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile; then + # Single tree build which includes binutils. + in_tree_nm=yes + gcc_cv_nm=./nm$host_exeext + rm -f nm$host_exeext + $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null elif test "x$program_prefix" != xNONE; then gcc_cv_nm=${program_prefix}nm$host_exeext else gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext fi -AC_MSG_RESULT($gcc_cv_nm) +case $in_tree_nm in + yes) AC_MSG_RESULT("newly built nm") ;; + no) AC_MSG_RESULT($gcc_cv_nm) ;; +esac # Figure out what objdump we will be using. AC_MSG_CHECKING(what objdump to use) +in_tree_objdump=no if test -x objdump$host_exeext; then gcc_cv_objdump=./objdump$host_exeext +elif test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile; then + # Single tree build which includes binutils. + in_tree_objdump=yes + gcc_cv_objdump=./objdump$host_exeext + rm -f objdump$host_exeext + $symbolic_link ../binutils/objdump$host_exeext \ + objdump$host_exeext 2>/dev/null elif test "x$program_prefix" != xNONE; then gcc_cv_objdump=${program_prefix}objdump$host_exeext else - gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext + gcc_cv_objdump=`echo objdump | \ + sed ${program_transform_name}`$host_exeext fi -AC_MSG_RESULT($gcc_cv_objdump) +case $in_tree_objdump in + yes) AC_MSG_RESULT("newly built objdump") ;; + no) AC_MSG_RESULT($gcc_cv_objdump) ;; +esac # Figure out what assembler alignment features are present. AC_MSG_CHECKING(assembler alignment features)