[RFA] opcodes: Use autoconf to check for `bfd_mips_elf_get_abiflags' in BFD
Commit Message
On Tue, Dec 27, 2016 at 02:08:41PM +0400, Joel Brobecker wrote:
> The reason for the failure is the following change:
>
> -# development.sh is used to determine -Werror default.
> -CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
> +# development.sh is used to determine -Werror default, libbfd.la is needed
> +# for function availability checks.
> +CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh ../bfd/libbfd.la
>
> It causes the following scenario to fail:
>
> $ ./configure
> $ make configure-host
> $ make distclean
>
> I'm pretty sure "./configure; make; make distclean" fails the same way,
Yes, it does. So let's revert that patch and simply modify the make
rule for mips-dis.lo (ie. provide it to overrided the default automake
rule) to test whether elfxx-mips.c has been compiled in. The top
level makefile already has the required directory dependencies.
* configure.ac: Revert 2016-12-23.
* Makefile.am: Likewise.
(MIPS_DEFS): Define.
(mips-dis.lo): Add rule.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
Diff below excludes the reversion.
Comments
> Yes, it does. So let's revert that patch and simply modify the make
> rule for mips-dis.lo (ie. provide it to overrided the default automake
> rule) to test whether elfxx-mips.c has been compiled in. The top
> level makefile already has the required directory dependencies.
>
> * configure.ac: Revert 2016-12-23.
> * Makefile.am: Likewise.
> (MIPS_DEFS): Define.
> (mips-dis.lo): Add rule.
> * Makefile.in: Regenerate.
> * aclocal.m4: Regenerate.
> * config.in: Regenerate.
> * configure: Regenerate.
Thanks, Alan!
@@ -610,6 +609,19 @@ $(srcdir)/z8k-opc.h: @MAINT@ z8kgen$(EXEEXT_FOR_BUILD)
z8k-dis.lo: $(srcdir)/z8k-opc.h
+MIPS_DEFS=`case \`cat ../bfd/ofiles\` in *elfxx-mips*) echo "-DHAVE_BFD_MIPS_ELF_GET_ABIFLAGS=1";; esac`
+mips-dis.lo: mips-dis.c
+if am__fastdepCC
+ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(MIPS_DEFS) $<
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+else
+if AMDEP
+ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
+ $(LTCOMPILE) -c -o $@ $(MIPS_DEFS) $<
+endif
+
sh-dis.lo: sh-dis.c
if am__fastdepCC
$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ @archdefs@ $(srcdir)/sh-dis.c