avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [RFC] per-device crt/libs; autoconf/automake update


From: Theodore A. Roth
Subject: [avr-libc-dev] [RFC] per-device crt/libs; autoconf/automake update
Date: Wed, 28 Apr 2004 15:51:14 -0700 (PDT)

Hi,

I've made some progress with my autoconf-branch work. I have
successfully built and installed all the crt*.o files into
${prefix}/avr/lib/<target_dev>/. For example, here's a snippet of the
install tree relative to ${prefix}:

  ./avr/lib/atmega323
  ./avr/lib/atmega323/crtm323.o
  ./avr/lib/atmega64
  ./avr/lib/atmega64/crtm64.o
  ./avr/lib/at86rf401
  ./avr/lib/at86rf401/crt86401.o
  ./avr/lib/at43usb320
  ./avr/lib/at43usb320/crt43320.o

I'm proposing to add new directories to the source tree as such
(relative to top of the source tree):

  ./avr/lib/atmega128/
  ./avr/lib/at90s1200/
  ...

One directory for each target device. The Makefile.am in each target
device directory will include the AvrCommon.am fragment from the
top_srcdir directory (NOTE: automake does the include, not make). The
AvrCommon.am file will have generic rules for building the crtXXXX.o
file and the lib*.a files for each target device. The target device
Makefile.am will set a bunch of AVR_TARGET* variables that AvrCommon.am
will use to build the libs for that target device.

To avoid creating potentially short-lived directories in the cvs repo,
I've written a script (devtools/gen-avr-lib-tree.sh) which gets run by
the bootstrap script (which replaces reconf) to automagically create and
populate the ./avr/lib/* tree before running autoconf and friends. I
have yet to decide if this generation-by-script method will be the final
approach. It makes some sense because it centralizes all the target
device build info in to a single file. Any comments on this?

If anyone wishes to give the new stuff a go, check out the branch and
the following should work:

  $ ./bootstrap
  $ mkdir obj && cd obj
  $ ../configure --prefix=$PWD/_install

That last step will seem to fail, but it should be obvious what to do.
I leave it to the adventurous to tell me that it's not obvious. ;-)

  $ cd avr/
  $ make
  $ make install
  $ (cd ..; find _install)
  $ make uninstall
  $ (cd ..; find _install)

Running make from the top dir isn't working yet.

This new approach seems to be (at least to me) a lot simpler than the
previous multilib with config-ml.in approach. The configure script will
now only be run once (instead of 5 times). If you run configure from
outside of the source tree, you will no longer get the avr[345] dirs
in the source tree (durn, I hated that). You shouldn't need to run
bootstrap very often (if at all except for after an initial checkout
from cvs). The old method was broken in some strange ways (anyone else
notice that editing a Makefile.am, then doing a 'make clean' would send
the build into an infinite loop? There was also the fact that 'make
distcheck' would actually install stuff into whatever you gave as
--prefix. D'oh! I'm sure there's others too.).

There's still a lot of work to do, but I think I've gotten over the
major conceptual/technical hurdles already.

Next item is getting the lib*.a files built and installed.

Now would be a good time to voice any concerns about what I'm doing...

---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]