GNU bug report logs - #25350
Automake does not override CC.

Previous Next

Package: automake;

Reported by: MrUmunhum <at> CruzIO.com

Date: Wed, 4 Jan 2017 02:57:01 UTC

Severity: normal

Tags: notabug

Done: Mathieu Lirzin <mthl <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #12 received at control <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: "william estrada" <MrUmunhum <at> CruzIO.com>
Cc: debbugs <control <at> debbugs.gnu.org>, 25350 <at> debbugs.gnu.org
Subject: Re: bug#25350: Automake does not override CC.
Date: Sun, 18 Jun 2017 02:03:03 +0200
tags 25350 notabug
close 25350
thanks

Hello William,

"william estrada" <MrUmunhum <at> CruzIO.com> writes:

> I have a Makefile.am that creates a Makefile that does 3 compiles, one for
> each target CPU.
>  # src/event/Makefile.am
> AM_LDLAGS  = --Pedantic -Wall -Std=C99 -O2
> bin_PROGRAMS =
> include x64.am
> include arm.am
> include i686.am
> ---------------------------------------
> # src/event/x64.am
> bin_PROGRAMS      += event_x64
> event_x64_SOURCES  =  event.c
> event_x64_CFLAGS   = -m64
> ---------------------------------------
> # src/event/i686.am
> bin_PROGRAMS       += event_i686
> event_i686_SOURCES  =  event.c
> event_i686_CFLAGS   = -m32
> ---------------------------------------
> # src/event/arm.am
> bin_PROGRAMS      += event_arm
> event_arm_SOURCES  =  event.c
> event_arm_CFLAGS   = -DARM
> event_arm_CC       =  arm-linux-gnu-gcc
> AM_CC              =  arm-linux-gnu-gcc
>
> My problem is my gcc on my Fedora 23 does not support the '-marm', so I
> need to change the CC flag.
> Using event_arm_CC or AM_CC does not work.
>
> How to change the compiler?

I don't any experience with cross compilation, but AIUI what you try
to achieve doesn't fit in the Autotools model.

What you have to do is to provide a generic build instruction:

--8<---------------cut here---------------start------------->8---
bin_PROGRAMS = event
event_SOURCES = event.c
--8<---------------cut here---------------end--------------->8---

Then when running './configure' you have to define the "--build",
"--host", and "--target" options according to the architecture you want
compile [1][2].  If you want to automate this process for multiple
architectures, you have to create a script running './configure ... &&
make' multiples times

I am closing this bug.  If you have questions regarding cross
compilation with Automake feel free to ask them on <automake <at> gnu.org>.

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

[1] https://www.gnu.org/software/automake/manual/automake.html#Cross_002dCompilation
[2] https://www.gnu.org/software/autoconf/manual/autoconf.html#Specifying-Names




This bug report was last modified 7 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.