blob: 0a25aeb7fa23747792895e9c73a21af1ddadaaf6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
From bc5d46982f3504000567e00f59e4f7a5905597a9 Mon Sep 17 00:00:00 2001
From: Michael Klein <michael.klein@puffin.lb.shuttle.de>
Date: Mon, 26 Feb 2018 14:19:01 +0100
Subject: [PATCH] use CFLAGS from ncurses*-config, if present (#745)
Fixes #695.
---
configure.ac | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 36aebc5e..d4bb36b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,19 +164,25 @@ m4_define([HTOP_CHECK_SCRIPT],
[
if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then
# to be used to set the path to ncurses*-config when cross-compiling
- htop_config_script=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null)
+ htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null)
+ htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null)
else
- htop_config_script=$([$4] --libs 2> /dev/null)
+ htop_config_script_libs=$([$4] --libs 2> /dev/null)
+ htop_config_script_cflags=$([$4] --cflags 2> /dev/null)
fi
htop_script_success=no
htop_save_LDFLAGS="$LDFLAGS"
- if test ! "x$htop_config_script" = x; then
- LDFLAGS="$htop_config_script $LDFLAGS"
+ htop_save_CFLAGS="$CFLAGS"
+ if test ! "x$htop_config_script_libs" = x; then
+ LDFLAGS="$htop_config_script_libs $LDFLAGS"
+ CFLAGS="$htop_config_script_cflags $CFLAGS"
AC_CHECK_LIB([$1], [$2], [
AC_DEFINE([$3], 1, [The library is present.])
- LIBS="$htop_config_script $LIBS "
+ LIBS="$htop_config_script_libs $LIBS "
htop_script_success=yes
- ], [])
+ ], [
+ CFLAGS="$htop_save_CFLAGS"
+ ])
LDFLAGS="$htop_save_LDFLAGS"
fi
if test "x$htop_script_success" = xno; then
|