From patchwork Wed May 23 18:48:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 161021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5AAAAB6FC2 for ; Thu, 24 May 2012 04:48:07 +1000 (EST) Received: from localhost ([::1]:43456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXGbN-0005UM-8L for incoming@patchwork.ozlabs.org; Wed, 23 May 2012 14:48:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXGbE-0005UF-Uv for qemu-devel@nongnu.org; Wed, 23 May 2012 14:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXGbD-0007fl-3S for qemu-devel@nongnu.org; Wed, 23 May 2012 14:47:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXGbC-0007fG-Qy for qemu-devel@nongnu.org; Wed, 23 May 2012 14:47:55 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4NIlqs1001378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 May 2012 14:47:52 -0400 Received: from localhost (ovpn-116-71.ams2.redhat.com [10.36.116.71]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4NIloeP024665; Wed, 23 May 2012 14:47:51 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 23 May 2012 15:48:04 -0300 Message-Id: <1337798885-23070-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1337798885-23070-1-git-send-email-lcapitulino@redhat.com> References: <1337798885-23070-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, eblake@redhat.com, mdroth@linux.vnet.ibm.com, afaerber@suse.de, kraxel@redhat.com Subject: [Qemu-devel] [PATCH 1/2] configure: check if environ is declared X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Some systems may declare environ automatically, others don't. Check for it. Signed-off-by: Luiz Capitulino --- configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure b/configure index b55a792..1f338f8 100755 --- a/configure +++ b/configure @@ -2831,6 +2831,21 @@ if compile_prog "" "" ; then linux_magic_h=yes fi +######################################## +# check if environ is declared + +has_environ=no +cat > $TMPC << EOF +#include +int main(void) { + environ = environ; + return 0; +} +EOF +if compile_prog "" "" ; then + has_environ=yes +fi + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -3342,6 +3357,10 @@ if test "$linux_magic_h" = "yes" ; then echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak fi +if test "$has_environ" = "yes" ; then + echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak +fi + # USB host support case "$usb" in linux)