From patchwork Thu May 24 18:52:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161194 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 46FCAB6FD7 for ; Fri, 25 May 2012 04:53:12 +1000 (EST) Received: from localhost ([::1]:35650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXd9q-0006qS-42 for incoming@patchwork.ozlabs.org; Thu, 24 May 2012 14:53:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXd9c-0006fT-M0 for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXd9a-00041t-4S for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:56 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:39433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXd9Z-00041F-T2 for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:54 -0400 Received: by obbwd20 with SMTP id wd20so137218obb.4 for ; Thu, 24 May 2012 11:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=/424yrUXc29V9i9DR1Si/0/OXLzFHLwQndsICGhVCxU=; b=II3AQWwal5BIseQv9t5aMUx0CLgd72p2ZwwN3bgn8piL4iYgxZVkhjh8HmvyKNA1pg EKiYa01/J0Xh0lOIwbrMzSDOqx640tWeNX5l3HYhHwBIywrb/tIiSvcYXJ07oZSQnxpU pMBMzOgVkoNasV3bn91OAaZwIuE15uVcp+0qd+ZJVH4WAiR+QS0Uzl5KVajoiDnxl5KD tOKLUZe20CeRi4wifzQ4Sa0ULRqVaqkYqUwqxKMQAMu9vbveo6Y8gPg3IsRBnULmNHcL ANQvkoFb7bN/w1fwSctphuXWSLPk16ZWPbFqeF5quHOxA3fPYlKjKUaq522lTc8M/uS7 e2+Q== Received: by 10.182.152.4 with SMTP id uu4mr447074obb.26.1337885572065; Thu, 24 May 2012 11:52:52 -0700 (PDT) Received: from localhost.localdomain ([32.97.110.59]) by mx.google.com with ESMTPS id h5sm122138obo.21.2012.05.24.11.52.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 May 2012 11:52:51 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 24 May 2012 13:52:40 -0500 Message-Id: <1337885561-10629-2-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1337885561-10629-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1337885561-10629-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.173 Cc: aliguori@us.ibm.com, lcapitulino@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 From: Luiz Capitulino Some systems may declare environ automatically, others don't. Check for it. Signed-off-by: Luiz Capitulino Signed-off-by: Michael Roth --- configure | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) 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)