From owner-freebsd-toolchain@FreeBSD.ORG Fri Sep 13 11:33:04 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16FD3B13 for ; Fri, 13 Sep 2013 11:33:04 +0000 (UTC) (envelope-from murray@stokely.org) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C971C2B9A for ; Fri, 13 Sep 2013 11:33:03 +0000 (UTC) Received: by mail-ve0-f182.google.com with SMTP id oy12so862018veb.13 for ; Fri, 13 Sep 2013 04:32:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mZLi62UOSf1KjMnOFESfNFkqO1YRJLEvjECbBOCnYiU=; b=kmk01qjVL/XiJA+BL5cvuQ/yFSL7QLXgiTFl257X4AVTExc0VVHVLCCprJhsv7HPOu ASzeWos7ePPYotTdZxKb4Qc27YANiM8bItpdJBz0UrP2NO9YW3i7Rq6O428zl9AjcHZ2 kNqOCBIY0GLkfOxXRL8QAsXiQZu/j9Ev4tBPY/U7ME/ooe0cUA3qRbr3OEm+kVUOlcGk GOPv9s4TDmoD5fO7hKICrzKwZzbRpDUqm7aBHNBSRcm5gpNTF9vxUVIw5vmJixkjkZxa H657A4tyR8n2kN5krGFG0JLEEs00QhoceChVtalkwRDulUGeXbn2CXhB7/W9q2YoiDaE o/Sw== X-Gm-Message-State: ALoCoQng4XlFowqJ5e5PT5/Veb3U5GAZYNTW06ZKw+g5seg9+6jQomlk9kH91AlcgxKRx/Y1LfnC MIME-Version: 1.0 X-Received: by 10.221.24.70 with SMTP id rd6mr14527vcb.42.1379038243215; Thu, 12 Sep 2013 19:10:43 -0700 (PDT) Received: by 10.220.137.204 with HTTP; Thu, 12 Sep 2013 19:10:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 Sep 2013 19:10:43 -0700 Message-ID: Subject: Re: Best autoconf recipe to use for modern FreeBSD From: Murray Stokely To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 11:33:04 -0000 Well one can do that, yes, but by default any configure script is going to look for g++ first, find an ancient g++4.2 installed in /usr/bin/g++ and use that unless the user specifically sets CC. I'm a bit fuzzy on the timeline of FreeBSD's transition to clang over the last few years and so was hoping for a autoconf recipe that prefers the appropriate compiler (e.g. did we have clang on FreeBSD 7?) when the user doesn't manually specify CC. Given the preference for gcc in configure I guess I could just use something as simple as : if uname="FreeBSD" # override configure preference for gcc since FreeBSD ships an ancient one. AC_PROG_CC(clang llvm-gcc gcc) AC_PROG_CXX(clang++ llvm-g++ g++) else AC_PROG_CC AC_PROG_CXX fi ? - Murray On Thu, Sep 12, 2013 at 6:56 PM, Warner Losh wrote: > > On Sep 12, 2013, at 7:32 PM, Murray Stokely wrote: > > > Some application software I use seems to prefer ancient gcc release or > > gcc46 from ports rather than clang. > > > > Is there a recommended autoconf recipe for third party software to use > the > > right compilers across FreeBSD versions? > > I thought the compiler was passed with the CC variable to gnu configure... > Or are you asking for something else? > > Warner