This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix in-tree-binutils builds


On Wed, Jul 15, 2015 at 9:11 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 15.07.15 at 18:07, <hjl.tools@gmail.com> wrote:
>> On Wed, Jul 15, 2015 at 1:03 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>> --- a/gcc/acinclude.m4
>>> +++ b/gcc/acinclude.m4
>>> @@ -390,7 +390,7 @@ AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
>>>  [gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
>>>  for f in $gcc_cv_as_bfd_srcdir/configure \
>>>           $gcc_cv_as_gas_srcdir/configure \
>>> -         $gcc_cv_as_gas_srcdir/configure.in \
>>> +         $gcc_cv_as_gas_srcdir/configure.[ai][cn] \
>>>           $gcc_cv_as_gas_srcdir/Makefile.in ; do
>>>    gcc_cv_gas_version=`sed -n -e 's/^[[         ]]*VERSION=[[^0-9A-Za-z_]]*\([[0-9]]*\.[[0-9]]*.*\)/VERSION=\1/p' < $f`
>>
>> How portable is [ai][cn]?
>
> I'm not sure - that's why I asked yesterday whether that approach
> would be acceptable.
>

I updated my patch to check $gcc_cv_as_gas_srcdir/configure.ac
in _gcc_COMPUTE_GAS_VERSION.

My last patch was sent to gcc, not gcc-patches.

-- 
H.J.
From 27bdd94b4b351f677eccf0b03737e61bc5335f0f Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 15 Jul 2015 08:07:04 -0700
Subject: [PATCH] Also check configure.ac in binutils source tree

The configure.in files in binutils source tree have been renamed to
configure.ac.  This patch checks both configure.in and configure.ac in
binutils source tree.

	* acinclude.m4 (_gcc_COMPUTE_GAS_VERSION): Also check
	$gcc_cv_as_gas_srcdir/configure.ac.
	* configure.ac (gcc_cv_as_gas_configure): New.  Set if
	configure.in or configure.ac exist.
	(gcc_cv_ld_gld_configure): Likewise.
	(gcc_cv_binutils_configure): Likewise.
	(gcc_cv_as): Check $gcc_cv_as_gas_configure instead of
	$gcc_cv_as_gas_srcdir/configure.in.
	(gcc_cv_ld): Check $gcc_cv_ld_gld_configure instead of
	$gcc_cv_ld_gld_srcdir/configure.in.
	(gcc_cv_nm): Check $gcc_cv_binutils_configure instead of
	$gcc_cv_binutils_srcdir/configure.in.
	(gcc_cv_objdump): Likewise.
	(gcc_cv_readelf): Likewise.
	* configure: Regenerated.

_gcc_COMPUTE_GAS_VERSION
---
 gcc/acinclude.m4 |  1 +
 gcc/configure    | 31 +++++++++++++++++++++++++------
 gcc/configure.ac | 30 ++++++++++++++++++++++++------
 3 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index 94da88e..3d30b0f 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -390,6 +390,7 @@ AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
 [gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
 for f in $gcc_cv_as_bfd_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure \
+         $gcc_cv_as_gas_srcdir/configure.ac \
          $gcc_cv_as_gas_srcdir/configure.in \
          $gcc_cv_as_gas_srcdir/Makefile.in ; do
   gcc_cv_gas_version=`sed -n -e 's/^[[ 	]]*VERSION=[[^0-9A-Za-z_]]*\([[0-9]]*\.[[0-9]]*.*\)/VERSION=\1/p' < $f`
diff --git a/gcc/configure b/gcc/configure
index e0755f9..a8eac95 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -21668,6 +21668,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_gas_configure=
+if test -f $gcc_cv_as_gas_srcdir/configure.in; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.in;
+elif test -f $gcc_cv_as_gas_srcdir/configure.ac; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.ac
+fi
 
 if test "${gcc_cv_as+set}" = set; then :
 
@@ -21675,7 +21681,7 @@ else
 
 if test -x "$DEFAULT_ASSEMBLER"; then
 	gcc_cv_as="$DEFAULT_ASSEMBLER"
-elif test -f $gcc_cv_as_gas_srcdir/configure.in \
+elif test -n "$gcc_cv_as_gas_configure" \
      && test -f ../gas/Makefile \
      && test x$build = x$host; then
 	gcc_cv_as=../gas/as-new$build_exeext
@@ -21748,6 +21754,7 @@ $as_echo "newly built gas" >&6; }
   gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
 for f in $gcc_cv_as_bfd_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure \
+         $gcc_cv_as_gas_srcdir/configure.ac \
          $gcc_cv_as_gas_srcdir/configure.in \
          $gcc_cv_as_gas_srcdir/Makefile.in ; do
   gcc_cv_gas_version=`sed -n -e 's/^[ 	]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
@@ -21826,6 +21833,12 @@ gcc_cv_gld_minor_version=
 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
 gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_ld_gld_configure=
+if test -f $gcc_cv_ld_gld_srcdir/configure.in; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.in
+elif test -f $gcc_cv_ld_gld_srcdir/configure.ac; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.ac
+fi
 
 if test "${gcc_cv_ld+set}" = set; then :
 
@@ -21838,7 +21851,7 @@ elif test $install_gold_as_default = yes \
      && test -f ../gold/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../gold/ld-new$build_exeext
-elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
+elif test -n "$gcc_cv_ld_gld_configure" \
      && test -f ../ld/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../ld/ld-new$build_exeext
@@ -21954,7 +21967,7 @@ $as_echo "newly built ld" >&6; }
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
-	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_configure $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 		gcc_cv_gld_version=`sed -n -e 's/^[ 	]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
 		if test x$gcc_cv_gld_version != x; then
@@ -21983,11 +21996,17 @@ fi
 
 # Figure out what nm we will be using.
 gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
+gcc_cv_binutils_configure=
+if test -f $gcc_cv_binutils_srcdir/configure.in; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.in
+elif test -f $gcc_cv_binutils_srcdir/configure.ac; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.ac
+fi
 if test "${gcc_cv_nm+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	gcc_cv_nm=../binutils/nm-new$build_exeext
@@ -22066,7 +22085,7 @@ if test "${gcc_cv_objdump+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
@@ -22138,7 +22157,7 @@ if test "${gcc_cv_readelf+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 7af6dbd..fa92a3d 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2080,12 +2080,18 @@ AC_SUBST(enable_fast_install)
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_gas_configure=
+if test -f $gcc_cv_as_gas_srcdir/configure.in; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.in;
+elif test -f $gcc_cv_as_gas_srcdir/configure.ac; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.ac
+fi
 
 m4_pattern_allow([AS_FOR_TARGET])dnl
 AS_VAR_SET_IF(gcc_cv_as,, [
 if test -x "$DEFAULT_ASSEMBLER"; then
 	gcc_cv_as="$DEFAULT_ASSEMBLER"
-elif test -f $gcc_cv_as_gas_srcdir/configure.in \
+elif test -n "$gcc_cv_as_gas_configure" \
      && test -f ../gas/Makefile \
      && test x$build = x$host; then
 	gcc_cv_as=../gas/as-new$build_exeext
@@ -2165,6 +2171,12 @@ gcc_cv_gld_minor_version=
 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
 gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_ld_gld_configure=
+if test -f $gcc_cv_ld_gld_srcdir/configure.in; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.in
+elif test -f $gcc_cv_ld_gld_srcdir/configure.ac; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.ac
+fi
 
 AS_VAR_SET_IF(gcc_cv_ld,, [
 if test -x "$DEFAULT_LINKER"; then
@@ -2174,7 +2186,7 @@ elif test $install_gold_as_default = yes \
      && test -f ../gold/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../gold/ld-new$build_exeext
-elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
+elif test -n "$gcc_cv_ld_gld_configure" \
      && test -f ../ld/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../ld/ld-new$build_exeext
@@ -2238,7 +2250,7 @@ if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
-	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_configure $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 changequote(,)dnl
 		gcc_cv_gld_version=`sed -n -e 's/^[ 	]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
@@ -2270,8 +2282,14 @@ AC_SUBST(ORIGINAL_LD_GOLD_FOR_TARGET)
 
 # Figure out what nm we will be using.
 gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
+gcc_cv_binutils_configure=
+if test -f $gcc_cv_binutils_srcdir/configure.in; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.in
+elif test -f $gcc_cv_binutils_srcdir/configure.ac; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.ac
+fi
 AS_VAR_SET_IF(gcc_cv_nm,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	gcc_cv_nm=../binutils/nm-new$build_exeext
@@ -2303,7 +2321,7 @@ esac
 
 # Figure out what objdump we will be using.
 AS_VAR_SET_IF(gcc_cv_objdump,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
@@ -2328,7 +2346,7 @@ fi
 
 # Figure out what readelf we will be using.
 AS_VAR_SET_IF(gcc_cv_readelf,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
-- 
2.4.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]