[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] avr-gcc with Autotools
From: |
Russell Shaw |
Subject: |
Re: [avr-gcc-list] avr-gcc with Autotools |
Date: |
Sun, 05 Sep 2010 13:12:30 +1000 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20091109) |
Marcelo Politzer wrote:
Hi, I'm developing a lib with autotools for more than one avr MCU, and
got stuck with the folowing situation:
I need to add a -mmcu corresponding to the correct mcu, and also add the
diferent folders according to that,
currently I can make the configure recognize that Im building for AVR
when I do a `./configure --host avr', the
ideal way for me would do it like `./configure --host avr --mcu atmega8'
but that gives me an error.
In my makefile.am <http://makefile.am> im using a entry that depends on
that, like:
pio_SOURCES=specific/$(ARCH)/$(MCU)/pio.c
and it depends on that iformation.
My question is: how can I add a -mmcu at configure level, is it
possible, or even worth it?
Those double-dash options are hard-wired in to autoconf option
parsing iirc. Maybe you could do: ./configure --host atmega8'
AC_PREREQ([2.65])
AC_INIT([Avrproj], [0.01], address@hidden, [avrproj])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADER([src/config.h])
AC_CANONICAL_HOST
case $host_cpu in
atmega8*-*-* )
CFLAGS="$CFLAGS ${EXTRA_CFLAGS}"
CPPFLAGS="$CPPFLAGS ${EXTRA_CPPFLAGS}"
root="root-wherever"
arch="mega"
mcu="atmega8"
;;
atmega16*-*-* )
# like above
;;
* )
# some default
;;
esac
AC_SUBST(ROOT, ["$root"])
AC_SUBST(ARCH, ["$arch"])
AC_SUBST(MCU, ["$mcu"])
Also, you could abuse the cpu-vendor-os triplet options and do:
./configure --host avrmega-atmega8'
case $host_cpu in
avr-atmega8*-* )
CFLAGS="$CFLAGS ${EXTRA_CFLAGS}"
CPPFLAGS="$CPPFLAGS ${EXTRA_CPPFLAGS}"
root="root-wherever"
;;
avr-atmega16*-* )
...
AC_SUBST(ROOT, ["$root"])
AC_SUBST(ARCH, ["$host_cpu"])
AC_SUBST(MCU, ["$host_vendor"])
http://www.gnu.org/software/autoconf/manual/autoconf.html