From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: fluxion From: Michael Roth Date: Thu, 24 May 2012 13:52:40 -0500 Message-Id: <1337885561-10629-2-git-send-email-mdroth@linux.vnet.ibm.com> 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> Subject: [Qemu-devel] [PATCH 1/2] configure: check if environ is declared List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, lcapitulino@redhat.com 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) -- 1.7.4.1