From 45cade613be579e425c15b524b1bd66e6571595a Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 18 Sep 2010 09:05:43 +0400
Subject: [PATCH 3/9] Use macros from configure stage instead of HAVE_UTSNAME
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
Makefile.am | 6 ------
configure.ac | 4 ----
flashrom.c | 5 +++--
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index ee6780c..5bdbeab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,6 @@ man_MANS = flashrom.8
# FIXME use "config.h" in the future
DEFS += -DFLASHROM_VERSION=\"@VERSION@\"
-if HAVE_SYS_UTSNAME
-if HAVE_UNAME
-DEFS += -DHAVE_UTSNAME=1
-endif
-endif
-
if HAVE_DMIDECODE
DEFS += -DDMIDECODE_PATH=\"@DMIDECODE@\"
else
diff --git a/configure.ac b/configure.ac
index 3c09493..7946c99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,10 +307,6 @@ AM_CONDITIONAL(HAVE_SERIAL, test "$serial" = "yes")
AM_CONDITIONAL(HAVE_PCI, test "$pci" = "yes")
AM_CONDITIONAL(HAVE_PRINT_WIKI, test "$print_wiki" = "yes")
-# FIXME remove in the future
-AM_CONDITIONAL(HAVE_SYS_UTSNAME, test "$ac_cv_header_sys_utsname_h" = "yes")
-AM_CONDITIONAL(HAVE_UNAME, test "$ac_cv_func_uname" = "yes")
-
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/flashrom.c b/flashrom.c
index a54348d..4eeed24 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -31,7 +31,8 @@
#include <stdlib.h>
#include <ctype.h>
#include <getopt.h>
-#if HAVE_UTSNAME == 1
+
+#if HAVE_SYS_UTSNAME_H == 1
#include <sys/utsname.h>
#endif
#include "flash.h"
@@ -1484,7 +1485,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
void print_sysinfo(void)
{
-#if HAVE_UTSNAME == 1
+#if HAVE_UNAME == 1
struct utsname osinfo;
uname(&osinfo);
--
1.7.10.1