From: Tomi Ollila Date: Wed, 21 May 2014 19:50:42 +0000 (+0300) Subject: Re: [PATCH] configure: use cc/c++ when GCC not installed X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=61777419dd2a3b8130a0c474ae90bac41ac300fd;p=notmuch-archives.git Re: [PATCH] configure: use cc/c++ when GCC not installed --- diff --git a/6e/7a5643e8c03feab50a0c6c29179d8e33b47bc0 b/6e/7a5643e8c03feab50a0c6c29179d8e33b47bc0 new file mode 100644 index 000000000..0b49cd357 --- /dev/null +++ b/6e/7a5643e8c03feab50a0c6c29179d8e33b47bc0 @@ -0,0 +1,109 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 49AB0431FBC + for ; Wed, 21 May 2014 12:50:56 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id RHWHGtWYVLLx for ; + Wed, 21 May 2014 12:50:47 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id E4CB9431FAE + for ; Wed, 21 May 2014 12:50:46 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 83CF1100090; + Wed, 21 May 2014 22:50:42 +0300 (EEST) +From: Tomi Ollila +To: Fraser Tweedale , notmuch@notmuchmail.org +Subject: Re: [PATCH] configure: use cc/c++ when GCC not installed +In-Reply-To: <1400662721-68562-1-git-send-email-frase@frase.id.au> +References: <1400662721-68562-1-git-send-email-frase@frase.id.au> +User-Agent: Notmuch/0.18+12~g9d41f94 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 21 May 2014 19:50:56 -0000 + +On Wed, May 21 2014, Fraser Tweedale wrote: + +> Some systems (e.g. FreeBSD 10) do not ship with the GNU Compiler +> Collection. Use generic cc/c++ as a fallback when gcc/g++ are not +> available. +> --- +> configure | 12 ++++++++++-- +> 1 file changed, 10 insertions(+), 2 deletions(-) +> +> diff --git a/configure b/configure +> index 9bde2eb..3f4942b 100755 +> --- a/configure +> +++ b/configure +> @@ -43,8 +43,16 @@ fi +> +> # Set several defaults (optionally specified by the user in +> # environment variables) +> -CC=${CC:-gcc} +> -CXX=${CXX:-g++} +> +if which gcc >/dev/null 2>&1; then +> + CC=${CC:-gcc} +> +else +> + CC=${CC:-cc} +> +fi + +perhaps: + +if [ -z "$CC" ]; then + if hash gcc 2>/dev/null; then + CC=gcc + else + CC=cc + fi +fi + +and same for g++ + +hash is builtin in modern shells, and is command in some systems +which(1) is builtin in zsh (only?). Solaris 10 which(1) exits 0 +even the command is not found. + +Tomi + + +> +if which g++ >/dev/null 2>&1; then +> + CXX=${CXX:-g++} +> +else +> + CXX=${CXX:-c++} +> +fi +> CFLAGS=${CFLAGS:--O2} +> CPPFLAGS=${CPPFLAGS:-} +> CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} +> -- +> 1.9.2 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch