autoconf: Enable cross-compilation

This commit is contained in:
Ben Gamari 2017-11-05 18:16:11 -05:00 committed by Will Dietz
parent 4f3c8178b8
commit d625f181bd
2 changed files with 45 additions and 1 deletions

View file

@ -0,0 +1,43 @@
commit 4c38abe0967bad78dd6baa61c86923e4d4b346d3
Author: Ben Gamari <ben@smart-cactus.org>
Date: Sun Nov 5 13:14:19 2017 -0500
Fix it
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index dd06a58..f4435b8 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -13,6 +13,32 @@ dnl the same distribution terms as the rest of that program.
# Sets the shell variables enable_plugin and pluginlibs.
AC_DEFUN([GCC_ENABLE_PLUGINS],
[# Check for plugin support
+
+ # Figure out what objdump we will be using.
+ AS_VAR_SET_IF(gcc_cv_objdump,, [
+ if test -f $gcc_cv_binutils_srcdir/configure.ac \
+ && test -f ../binutils/Makefile \
+ && test x$build = x$host; then
+ # Single tree build which includes binutils.
+ gcc_cv_objdump=../binutils/objdump$build_exeext
+ elif test -x objdump$build_exeext; then
+ gcc_cv_objdump=./objdump$build_exeext
+ elif ( set dummy $OBJDUMP_FOR_TARGET; test -x $[2] ); then
+ gcc_cv_objdump="$OBJDUMP_FOR_TARGET"
+ else
+ AC_PATH_PROG(gcc_cv_objdump, $OBJDUMP_FOR_TARGET)
+ fi])
+
+ AC_MSG_CHECKING(what objdump to use)
+ if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then
+ # Single tree build which includes binutils.
+ AC_MSG_RESULT(newly built objdump)
+ elif test x$gcc_cv_objdump = x; then
+ AC_MSG_RESULT(not found)
+ else
+ AC_MSG_RESULT($gcc_cv_objdump)
+ fi
+
AC_ARG_ENABLE(plugin,
[AS_HELP_STRING([--enable-plugin], [enable plugin support])],
enable_plugin=$enableval,

View file

@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4";
};
buildInputs = [ m4 perl ];
nativeBuildInputs = [ m4 perl ];
buildInputs = [ m4 ];
# Work around a known issue in Cygwin. See
# http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for