summaryrefslogtreecommitdiff
blob: 420f5d4cec319df6c8d6121dd15ee5a93eaede38 (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
--- a/src/Makefile
+++ b/src/Makefile
@@ -45,12 +45,12 @@
 
 CC              ?= gcc
 STATIC          =
-STRIP           = strip
+STRIP           =
 
 ENABLE_NLS = 1
 
 PACKAGE         = wcd
-EXT             = .exe
+EXT             =
 PROGRAM         = $(PACKAGE)$(EXT)
 BIN             = $(PROGRAM)
 
@@ -329,9 +329,9 @@
 # possible values: ncurses, curses, pdcurses, pdcursesw or <empty>
 
 ifdef UCS
-        CURSES = ncursesw
+        CURSES = $(shell ${PKG_CONFIG} --libs ncursesw)
 else
-        CURSES = ncurses
+        CURSES = $(shell ${PKG_CONFIG} --libs ncurses)
 endif
 
 
@@ -361,7 +361,7 @@
 
 ifneq (,$(CURSES))
         DEFS_CURSES = -DWCD_USECURSES
-        LIB_CURSES  = -l$(CURSES)
+        LIB_CURSES  = $(CURSES)
 ifeq (os/2,$(OS))
         LIB_CURSES  += -ltinfo
 endif
@@ -455,15 +455,15 @@
 endif
 
 LDFLAGS_USER   =
-LDFLAGS         = $(RPM_OPT_FLAGS) \
+LIBS            = $(RPM_OPT_FLAGS) \
                   $(LDFLAGS_EXTRA) \
                   $(NLFLAG) \
                   $(LDFLAG_STATIC) \
                   $(LDFLAGS_USER)
 
-LIBS = $(LIB_CURSES) \
-       $(LIB_UNISTRING) \
-       $(LIBS_EXTRA)
+LIBS += $(LIB_CURSES) \
+	$(LIB_UNISTRING) \
+	$(LIBS_EXTRA)
 
 DEFS_USER   =
 DEFS            = $(DEF_UNIX) $(DEFS_CURSES) $(EXTRA_DEFS) $(DEFS_USER)
@@ -520,7 +520,7 @@
 
 $(BIN): $(OBJS1)
 	$(MAKE) status
-	$(CC) $(OBJS1) $(LDFLAGS) $(LIBS) -o $@
+	$(CC) $(LDFLAGS) $(OBJS1) -o $@ $(LIBS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@