summaryrefslogtreecommitdiff
blob: a5715ba69ab4e33de6a2fa122f52a18487c88036 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Fix missing ncurses underlinking issue caused by broken detection mechanisms.
https://bugs.gentoo.org/show_bug.cgi?id=521860

--- moc-2.6-alpha1/configure.ac
+++ moc-2.6-alpha1/configure.ac
@@ -340,17 +340,13 @@
 			  [Define if we have __attribute__ extension])])
 
 dnl ncurses
-MP_WITH_CURSES
-if test -z "$CURSES_LIB"
-then
-	AC_MSG_ERROR([You need curses/ncurses library and header files.])
-else
-	AC_CHECK_LIB([$CURSES_LIB], [set_escdelay],
-		AC_DEFINE([HAVE_SET_ESCDELAY], 1, [Define if you have set_escdelay.]),
-		[AC_CHECK_FUNC([setenv], ,
-			AC_MSG_ERROR([Required function setenv not found.]))])
-	EXTRA_LIBS="$EXTRA_LIBS -l$CURSES_LIB"
-fi
+AC_ARG_WITH([ncursesw],
+	AS_HELP_STRING([--without-ncursesw], [Don't use ncursesw (UTF-8 support)]))
+AS_IF([test "x$with_ncursesw" != "xno"],
+	[PKG_CHECK_MODULES([CURSES],[ncursesw])
+	AC_DEFINE([HAVE_NCURSESW], [1], [Define if you have ncursesw])],
+	[PKG_CHECK_MODULES([CURSES],[ncurses])
+	AC_DEFINE([HAVE_CURSES], [1], [Define if you have curses])])
 
 dnl popt
 AC_CHECK_LIB([popt], [poptGetContext], [true], [POPT_MISSING="yes"])
--- moc-2.6-alpha1/interface_elements.c
+++ moc-2.6-alpha1/interface_elements.c
@@ -37,11 +37,10 @@
 # define _XOPEN_SOURCE_EXTENDED /* for wget_wch() */
 #endif
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/interface_elements.h
+++ moc-2.6-alpha1/interface_elements.h
@@ -1,11 +1,10 @@
 #ifndef INTERFACE_ELEMENTS_H
 #define INTERFACE_ELEMENTS_H
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/keys.c
+++ moc-2.6-alpha1/keys.c
@@ -17,11 +17,10 @@
 #include <strings.h>
 #include <assert.h>
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/Makefile.am
+++ moc-2.6-alpha1/Makefile.am
@@ -2,6 +2,7 @@
 SUBDIRS = themes decoder_plugins
 AM_CPPFLAGS = -DSYSTEM_THEMES_DIR=\"$(pkgdatadir)/themes\" \
 	      -DPLUGIN_DIR=\"$(plugindir)/$(DECODER_PLUGIN_DIR)\"
+AM_CFLAGS = @CURSES_CFLAGS@
 
 bin_PROGRAMS = mocp
 mocp_SOURCES = log.c \
@@ -81,7 +82,7 @@
 		     jack.c \
 		     jack.h
 man_MANS = mocp.1
-mocp_LDADD = @EXTRA_OBJS@ -lltdl
+mocp_LDADD = @EXTRA_OBJS@ -lltdl @CURSES_LIBS@
 mocp_DEPENDENCIES = @EXTRA_OBJS@
 mocp_LDFLAGS = @EXTRA_LIBS@ $(RCC_LIBS) -export-dynamic
 EXTRA_DIST = README_equalizer mocp.1 THANKS keymap.example Doxyfile \
--- moc-2.6-alpha1/menu.c
+++ moc-2.6-alpha1/menu.c
@@ -17,11 +17,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/menu.h
+++ moc-2.6-alpha1/menu.h
@@ -1,11 +1,10 @@
 #ifndef MENU_H
 #define MENU_H
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/themes.c
+++ moc-2.6-alpha1/themes.c
@@ -13,11 +13,10 @@
 # include "config.h"
 #endif
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#elif HAVE_CURSES_H
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
 
--- moc-2.6-alpha1/utf8.c
+++ moc-2.6-alpha1/utf8.c
@@ -30,13 +30,13 @@
 # include <langinfo.h>
 #endif
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#else
+#elif HAVE_CURSES
 # include <curses.h>
 #endif
+
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
--- moc-2.6-alpha1/utf8.h
+++ moc-2.6-alpha1/utf8.h
@@ -1,11 +1,10 @@
 #ifndef UTF8_H
 #define UTF8_H
 
-#ifdef HAVE_NCURSESW_H
+#ifdef HAVE_NCURSESW
 # include <ncursesw/curses.h>
-#elif HAVE_NCURSES_H
 # include <ncurses.h>
-#else
+#elif HAVE_CURSES
 # include <curses.h>
 #endif