From owner-freebsd-questions@FreeBSD.ORG Tue Jan 20 18:52:07 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA2832C3 for ; Tue, 20 Jan 2015 18:52:07 +0000 (UTC) Received: from lb2-smtp-cloud6.xs4all.net (lb2-smtp-cloud6.xs4all.net [194.109.24.28]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D617A96 for ; Tue, 20 Jan 2015 18:52:06 +0000 (UTC) Received: from slackbox.erewhon.home ([83.162.243.5]) by smtp-cloud6.xs4all.net with ESMTP id iJqu1p00307iGuj01Jqvz6; Tue, 20 Jan 2015 19:50:55 +0100 Received: by slackbox.erewhon.home (Postfix, from userid 1001) id E8E4312418; Tue, 20 Jan 2015 19:50:53 +0100 (CET) Date: Tue, 20 Jan 2015 19:50:53 +0100 From: Roland Smith To: Odhiambo Washington , Matthew Seaman Subject: Re: FreeBSD 10 and manually compile applications without gcc Message-ID: <20150120185053.GA57651@slackbox.erewhon.home> Mail-Followup-To: Odhiambo Washington , Matthew Seaman , User Questions References: <54BD0AF0.5040809@infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <54BD0AF0.5040809@infracaninophile.co.uk> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.23 (2014-03-12) Cc: User Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 18:52:08 -0000 --4Ckj6UjgE2iN1+kY 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= ll > > 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= ns 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= ult usage of clang is a feature of the ports tree. At least I often see a messa= ge 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 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= he 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. Roland --=20 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) --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature -----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----- --4Ckj6UjgE2iN1+kY--