avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] avr-libc


From: Senthil Kumar Selvaraj
Subject: Re: [avr-gcc-list] avr-libc
Date: Wed, 1 Aug 2012 19:18:27 +0530
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Aug 01, 2012 at 03:19:58PM +0300, Kaan Akşit wrote:
> I am really confused because if I do not set any prefix during
> configuration; both avr-gcc and avr-binutils will use /usr/local which
> means default is not the supported way.
> 
> So to give an example if I use prefix /usr/local for avr-binutils, should I
> be using something outside of /usr/local ? For example /usr/share/avr.
> Then I need to export both /usr/local and /usr/share/avr as PATH? Did I get
> i right?

You are confusing the object/build directory with the install/prefix
directory. The object/build directory is the one from which you run the
configure script. It is different from the prefix directory, which
specifies where the built binaries go when you run "make install".

For GCC, the build directory must not be a subdirectory of the source
directory.

Let's take it step by step. Let's say you extracted the binutils source
to ~/src/binutils

[~] cd ~
[~] mkdir install
[~] mkdir build-binutils && cd build-binutils
[build-binutils] pwd
~/build-binutils
[build-binutils] ../src/binutils/configure --target=avr 
--prefix=/home/user/install
--disable-nls
[build-binutils] make && make install

This builds and installs binutils binaries into ~/install/bin (or whatever
dir you give as the prefix)

Now add the install folder to the path
[~] export PATH=~/install/bin:$PATH

Assuming gcc is in ~/src/gcc

[~] mkdir build-gcc && cd build-gcc
[build-gcc] pwd
~/build-gcc
[build-gcc] ../src/gcc/configure --target=avr --enable-languages=c
--prefix=/home/user/install
[build-gcc] make && make install

This should build gcc and install avr-gcc and related binaries into
~/install/bin

Assuming avr-libc is in ~/src/avr-libc

[~] cd ~/src/avr-libc
[~/src/avr-libc] ./configure --prefix=/home/user/install --host=avr
--build=<your build machine arch>
[~/src/avr-libc] make and make install

should do the job.

Essentially, for binutils and particularly gcc, the build folder from
which you run the configure script must not be a subdir of source. Make
sure you specify the same prefix for all three configure invocations.

Hope this helps.

Regards
Senthil


> 
> Kaan
> 
> 2012/8/1 Senthil Kumar Selvaraj <address@hidden>
> 
> > On Wed, Aug 01, 2012 at 12:35:47PM +0300, Kaan Akşit wrote:
> > > I am using below code to configure avr-gcc, I don't understand what is
> > > wrong with it:
> > >
> > > ../configure --target=avr --mandir=/usr/share/man --datadir=/usr/share
> > > --prefix=/usr/share/avr --enable-languages="c,c++" --disable-nls
> > > --disable-libssp --with-dwarf2 --with-system-zlib
> > > --enable-version-specific-runtime-libs --with-pkgversion="Pardus Linux"
> > > --with-bugurl=http://bugs.pardus.org.tr
> > >
> > > Kaan
> >
> > Running configure from within a subdirectory of the gcc source directory
> > (as inferred from ../configure) is
> > not supported. See http://gcc.gnu.org/install/configure.html. You need
> > to create a directory outside the toplevel source directory for GCC and
> > run configure from there.
> >
> > Regards
> > Senthil
> >
> > >
> > > 2012/8/1 Georg-Johann Lay <address@hidden>
> > >
> > > > Kaan Akşit schrieb:
> > > >
> > > >
> > > >  $ avr-gcc -mmcu=atmega8 -v -c demo.c
> > > >> Using built-in specs.
> > > >> COLLECT_GCC=avr-gcc
> > > >> Target: avr
> > > >> Configured with: ../configure --target=avr --mandir=/usr/share/man
> > > >>
> > > >
> > > > You still configure in the source tree which is not supported.
> > > >
> > > > Johann
> > > >
> >



reply via email to

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