Date: Tue, 20 Jan 2015 19:50:53 +0100 From: Roland Smith <rsmith@xs4all.nl> To: Odhiambo Washington <odhiambo@gmail.com>, Matthew Seaman <m.seaman@infracaninophile.co.uk> Cc: User Questions <freebsd-questions@freebsd.org> Subject: Re: FreeBSD 10 and manually compile applications without gcc Message-ID: <20150120185053.GA57651@slackbox.erewhon.home> In-Reply-To: <54BD0AF0.5040809@infracaninophile.co.uk> References: <CAAdA2WNpTpnQ_7KO10mEnoz7w9=TU%2BiSOcjo=Wi=asxk5aopww@mail.gmail.com> <54BD0AF0.5040809@infracaninophile.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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 install
> > 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 options
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 default
usage of clang is a feature of the ports tree. At least I often see a message
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=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CC=clang \
CXX=clang++ CFLAGS=-O2 ./configure <configure arguments for the app>
gmake install
You generally have to use ‘gmake’ instead of ‘make’, since
autotools Makefiles require extensions that only exist in gmake.
In the best case the program doesn't require FreeBSD specific patches and the
abovementioned commands work. But since the FreeBSD port of squid *does*
contain FreeBSD specific patches (see in this case
“/usr/ports/www/squid/files/patch-*”), you might need to apply these as well
to get the compile to work.
Roland
--
R.F.Smith http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93 FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABAgAGBQJUvqONAAoJEED21dyjijPgWMEQAIr8R3NU7WeBe9BVEdjNinHr
UAqS6bJW7TOAvWKVU+TnVJdgjrAerDJxwRyDiFEaFb44BI77znnjDP73w4nJVI6K
YfUB48nsjwJdxoMiMOHrfF8tY9pGK/StaHNi6WbN0U65QyfvUNK/Ewv30tWqeDgf
xKdh7sK1TZupGW9yfiCzbJxks9RTro8tfuXHUu7sc7s/h3MciUA7Ledv8w65CcL/
qntoEwugzLRhyaBZzArKDw0UaYSVKHCjq2BvcyU+Y00GYj4DX6A9EseOp/XIzsHu
vSQxfPqvdEltFTSl9iiQ5mV1UwTpSGRKViYWeos4bgjutf6AyUaYmNYcKbKI0THf
5BApBaV0r0ApjfsY9b6WY6mZGDQwkzHudKgd6tlKbpCJzXzCPjzMTbScqEEKczwO
oSyRO3oNvTKdhFXjsbYIEbvbxNO+ye25WTORi2jlGp5eoZdxNhPzeDIk7bZSan8h
2v6F6F8mjUNxgZUq+WyagAtF7qDEfAkLHWzCrTGCGhQ6RjUI3GgZ8GULOYzY2UZE
azC4FFBmYL1ENWjBzK4w6N/FDFvk/t5zHJjHD27nEi44KZ+w2/cf/N3CodZv8Ntz
QqZcl4K0YD3mBVrOxlJaJ5zOr/igwXJ/ldrm7Rnki9ipgzOP0lsj9dhVpBJh3wiN
fMkoT4rlUH6WEEbFl1Yf
=x4Ul
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150120185053.GA57651>
