File htop-stdgnu.patch of Package htop

From 9b5a3912ca328885dee99f3a8aa786738a37a8c8 Mon Sep 17 00:00:00 2001
From: boombatower <jimmy@boombatower.com>
Date: Thu, 11 Feb 2016 12:48:39 -0600
Subject: [PATCH] Makefile/Configure cleanups.

---
 Makefile.am  |  4 ++--
 configure.ac | 24 ++++++------------------
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8b31627..33711ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,9 +12,9 @@ applications_DATA = htop.desktop
 pixmapdir = $(datadir)/pixmaps
 pixmap_DATA = htop.png
 
-htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
+htop_CFLAGS = -Wall -Wextra -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
 htop_LDFLAGS = 
-AM_CPPFLAGS = -DNDEBUG
+AM_CPPFLAGS = -include config.h -DNDEBUG
 
 myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
 ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \
diff --git a/configure.ac b/configure.ac
index 3bd58bc..0a54968 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,14 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.65)
+AC_PREREQ([2.65])
 AC_INIT([htop],[2.0.0],[hisham@gobolinux.org])
 
 year=$(date +%Y)
 
 # The following two lines are required by hwloc scripts
 AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
 AC_CANONICAL_TARGET
 
 AM_INIT_AUTOMAKE([1.11])
@@ -17,13 +18,9 @@ AC_CONFIG_MACRO_DIR([m4])
 
 # Checks for programs.
 # ----------------------------------------------------------------------
-AC_PROG_CC
+AC_PROG_CC_STDC
 AM_PROG_CC_C_O
 
-AC_DISABLE_SHARED
-AC_ENABLE_STATIC
-AC_PROG_LIBTOOL
-
 # Checks for platform.
 # ----------------------------------------------------------------------
 case "$target" in
@@ -46,7 +43,7 @@ esac
 
 # Checks for libraries.
 # ----------------------------------------------------------------------
-AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"])
+AC_SEARCH_LIBS([ceil], [m])
 
 # Checks for header files.
 # ----------------------------------------------------------------------
@@ -55,7 +52,7 @@ AC_HEADER_STDC
 AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[
   missing_headers="$missing_headers $ac_header"
 ])
-AC_CHECK_HEADERS([execinfo.h],[:],[:])
+AC_CHECK_HEADERS_ONCE([execinfo.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 # ----------------------------------------------------------------------
@@ -67,17 +64,8 @@ AC_TYPE_UID_T
 # Checks for library functions and compiler features.
 # ----------------------------------------------------------------------
 AC_FUNC_CLOSEDIR_VOID
-AC_TYPE_SIGNAL
 AC_FUNC_STAT
-AC_CHECK_FUNCS([memmove strncasecmp strstr strdup])
-
-save_cflags="${CFLAGS}"
-CFLAGS="${CFLAGS} -std=c99"
-AC_MSG_CHECKING([whether gcc -std=c99 option works])
-AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [char *a; a = strdup("foo"); int i = 0; i++; // C99],
-   AC_MSG_RESULT([yes]),
-   AC_MSG_ERROR([htop is written in C99. A newer version of gcc is required.]))
-CFLAGS="$save_cflags"
+AC_CHECK_FUNCS_ONCE([memmove strncasecmp strstr strdup])
 
 save_cflags="${CFLAGS}"
 CFLAGS="$CFLAGS -Wextra"
-- 
2.7.0

openSUSE Build Service is sponsored by