From aa0fca163e1736e158fd3922cbbc31b85c9c7df7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 1 May 2021 17:16:23 -0400 Subject: sim: add support for build-time ar & ranlib This is needed when building for a target whose ar & ranlib are incompatible with the current build system. For example, building for Windows on a Linux system. Then manually import the automake rule for libigen.a, but tweak the tool variables to use the FOR_BUILD variants. --- sim/m4/sim_ac_toolchain.m4 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sim/m4') diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4 index 9cf7027..2f1a428 100644 --- a/sim/m4/sim_ac_toolchain.m4 +++ b/sim/m4/sim_ac_toolchain.m4 @@ -26,15 +26,21 @@ AC_PROG_INSTALL dnl Setup toolchain settings for build-time tools.. if test "x$cross_compiling" = "xno"; then + : "${AR_FOR_BUILD:=\$(AR)}" : "${CC_FOR_BUILD:=\$(CC)}" + : "${RANLIB_FOR_BUILD:=\$(RANLIB)}" : "${CFLAGS_FOR_BUILD:=\$(CFLAGS)}" : "${LDFLAGS_FOR_BUILD:=\$(LDFLAGS)}" else + : "${AR_FOR_BUILD:=ar}" : "${CC_FOR_BUILD:=gcc}" + : "${RANLIB_FOR_BUILD:=ranlib}" : "${CFLAGS_FOR_BUILD:=-g -O}" : "${LDLFAGS_FOR_BUILD:=}" fi +AC_SUBST(AR_FOR_BUILD) AC_SUBST(CC_FOR_BUILD) +AC_SUBST(RANLIB_FOR_BUILD) AC_SUBST(CFLAGS_FOR_BUILD) AC_SUBST(LDFLAGS_FOR_BUILD) -- cgit v1.1