Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 2015 19:50:53 +0100
From:      Roland Smith <>
To:        Odhiambo Washington <>, Matthew Seaman <>
Cc:        User Questions <>
Subject:   Re: FreeBSD 10 and manually compile applications without gcc
Message-ID:  <20150120185053.GA57651@slackbox.erewhon.home>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 19, 2015 at 01:47:28PM +0000, Matthew Seaman wrote:
> On 2015/01/19 13:29, Odhiambo Washington wrote:
> > Now, suppose I did not install gcc from the ports and I'd like to insta=
> > an application by hand using native tools for FreeBSD 10.x, how do I do
> > that?
> > I need a lecture on this:-)
> This is exactly why the ports exists: the port maintainer understands
> how to make whatever software it is compile smoothly and generally do
> what you want, so you don't have to.

So true. :-)

But if you want to become a power user it is very useful to study how this
machinery works!

> If you insist on building your own de-novo, then you are going to need
> to crawl up that fairly steep learning curve.  I'm afraid I cannot
> deliver a simple lecture on 'do this, and it will work' because, well,
> it's not simple at all.

Every journey begins with a first step. :-)

Running ./configure --help can be helpful. It shows what the possible optio=
and environment variables are.

> Your first hurdle seems to be getting configure to choose consistent
> settings.  configure is expecting 'cc' on FreeBSD 10.x to actually be
> clang -- which is what it usually is. If you want to use gcc instead,
> then you need to tell configure that, which you usually do by setting
> the CC environment variable when you call configure.

Usually, the configure from gnu autoconf expects gcc? I think that the defa=
usage of clang is a feature of the ports tree. At least I often see a messa=
like "patching auto** for FreeBSD 10" whizzing by when compiling a port.

In general you have to set some environment variables for configure to use
clang. For another app that I needed to compile outside of the ports tree I
had to do something like this;

    env LDFLAGS=3D-L/usr/local/lib CPPFLAGS=3D-I/usr/local/include CC=3Dcla=
ng \
    CXX=3Dclang++ CFLAGS=3D-O2 ./configure <configure arguments for the app>
    gmake install

You generally have to use =E2=80=98gmake=E2=80=99 instead of =E2=80=98make=
=E2=80=99, since
autotools Makefiles require extensions that only exist in gmake.

In the best case the program doesn't require FreeBSD specific patches and t=
abovementioned commands work. But since the FreeBSD port of squid *does*
contain FreeBSD specific patches (see in this case
=E2=80=9C/usr/ports/www/squid/files/patch-*=E2=80=9D), you might need to ap=
ply these as well
to get the compile to work.

[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)

Content-Type: application/pgp-signature

Version: GnuPG v2



Want to link to this message? Use this URL: <>