avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Can't Install avr-gcc in FreeBSD


From: Brian Dean
Subject: Re: [avr-chat] Can't Install avr-gcc in FreeBSD
Date: Sat, 18 Aug 2007 20:01:54 -0400
User-agent: Mutt/1.5.11

On Sun, Aug 19, 2007 at 12:58:11AM +0200, David Brown wrote:

> Am I right in thinking that you download the port, then the source code 
> (either as part of the port, or referenced by the port?), and the 
> compilation to binary is done on your machine according to the rules in 
> the port, and this binary package is then installed on your machine?  Or 
> is it possible to download a pre-build binary "port"?

In FreeBSD, you have all the "ports" already on your system if you
chose to install them when you installed FreeBSD.  They don't take up
much disk space and are located in /usr/ports and from there
categorized roughly by function.  For example, apache can be found in
/usr/ports/www/apache, Python in /usr/ports/lang/python, while avr-gcc
is in /usr/ports/devel/avr-gcc, and so on.  There are currently almost
16,000 ports in the system.  Tools are avaiable for searching the
ports system to help you find what you are looking for.

The sources don't live in this tree, though, just the recipe.  Part of
the recipe for each port is a list of possible distribution sites for
the sources.  When you change into the port directory and type 'make'
a number of things happen, one of the first is to cycle through that
distribution list and download the source.  Obvously you need an
Internet connection.  Patches may then be automatically applied,
dependencies autmatically checked and satisfied, and finally the port
is built and installed.  All from just the 'make install' command.

A binary port is called a package.  In any port directory, you can
build the binary package.  This is how packages are created.  But YOU
don't have to do that.  The FreeBSD project team does it for you for
all the packages and they are kept on the FreeBSD servers at
FreeBSD.org.  All you have to do is simply:

        pkg_add -r avr-gcc

That looks at the current version of FreeBSD you are running, then
ftp's up to the FreeBSD package repository and downloads the binary
package that was built for your system, i.e., OS release level and
architecture.  Then it then installs the binary package without your
system ever compiling a line of source to get it.

Without the '-r' option, pkg_add just installs the named port by
looking for the file specified on the command line.  So you can
download packages manually if you like and install them that way.  But
'-r' automates the down-load process, looking in known-good locations
for your system.

Or, if you purchase a FreeBSD CD set or download one from one of the
FreeBSD master sites, usually ISO #2 contains all of the pre-built
binary packages that they can fit and that are the most popular.
Thus, even if you don't have a connection or even a fast connection,
you can still install all the ports you'll most likely need for your
system.

Hope that makes sense.  It is a very elegant and easy to use system.
It makes setting up your system with all the third party goodies that
you could ever dream of very simple and painless.  And where it falls
a little short, other "ports" have appeared to help.  For example,
there's the PortUpgrade port, which is almost an essential system tool
for keeping a large set of installed ports up to date and working in
harmony together.  It's not really essential, but it is very handy.

I didn't really mean to answer for Joerg, hope that is OK.  Joerg is
the undisputed guru on FreeBSD, though I've dabbled in it a little
bit myself. :-)

Cheers,
-Brian
-- 
Brian Dean
BDMICRO LLC
http://www.bdmicro.com/
ATmega128 based MAVRIC controllers




reply via email to

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