summaryrefslogtreecommitdiff
path: root/data/sc-im/makefile.diff
blob: 6d3ab2b0caf3df6951e89a40b2c3ef58869304f7 (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
diff -Naur sc-im-0.7.0/src/Makefile sc-im-0.7.0+iPhone/src/Makefile
--- sc-im-0.7.0/src/Makefile	2017-12-13 17:48:59.000000000 +0000
+++ sc-im-0.7.0+iPhone/src/Makefile	2019-04-17 17:23:24.489629635 +0000
@@ -68,63 +68,68 @@
 # Have threads? Set these two, if you want the autobackup feature to work with threads.
 CFLAGS += -DHAVE_PTHREAD
 
-ifneq ($(shell uname -s),Darwin)
+#ifneq ($(shell uname -s),Darwin)
   LDLIBS += -pthread
-endif
+#endif
 
 # NOTE: libxlsxwriter is required for xlsx file export support
-ifneq (,$(wildcard /usr/include/xlsxwriter.h))
-  CFLAGS += -DXLSX_EXPORT
-  LDLIBS += -lxlsxwriter
-endif
-ifneq (,$(wildcard /usr/local/include/xlsxwriter.h))
-  CFLAGS += -DXLSX_EXPORT
-  LDLIBS += -lxlsxwriter
-endif
+#ifneq (,$(wildcard /usr/include/xlsxwriter.h))
+#  CFLAGS += -DXLSX_EXPORT
+#  LDLIBS += -lxlsxwriter
+#endif
+#ifneq (,$(wildcard /usr/local/include/xlsxwriter.h))
+#  CFLAGS += -DXLSX_EXPORT
+#  LDLIBS += -lxlsxwriter
+#endif
 
 # Check for gnuplot existance
-ifneq (, $(shell which gnuplot))
-  CFLAGS += -DGNUPLOT
-endif
+#ifneq (, $(shell which gnuplot))
+#  CFLAGS += -DGNUPLOT
+#endif
 
 # dynamic linking (should not be used in FreeBSD
-ifneq ($(shell uname -s),FreeBSD)
-  LDLIBS += -ldl
-endif
+#ifneq ($(shell uname -s),FreeBSD)
+#  LDLIBS += -ldl
+#endif
 
-ifneq (, $(shell which pkg-config))
+PKGCONFIG := pkg-config
+
+ifneq ($(PKGCONFIG),)
   # Any system with pkg-config
 
   # NOTE: ncursesw (required)
   ifeq ($(shell uname -s),Darwin)
     # macOS' ncurses is built with wide-char support
     LDFLAGS += -lncurses
-  else ifneq ($(shell pkg-config --exists ncursesw || echo 'no'),no)
-    CFLAGS += $(shell pkg-config --cflags ncursesw)
-    LDLIBS += $(shell pkg-config --libs ncursesw)
-  else ifneq ($(shell pkg-config --exists ncurses || echo 'no'),no)
+  else ifneq ($(shell $(PKGCONFIG) --exists ncursesw || echo 'no'),no)
+    CFLAGS += $(shell $(PKGCONFIG) --cflags ncursesw)
+    LDLIBS += $(shell $(PKGCONFIG) --libs ncursesw)
+  else ifneq ($(shell $(PKGCONFIG) --exists ncurses || echo 'no'),no)
     # hopefully this includes wide character support then
-    CFLAGS += $(shell pkg-config --cflags ncurses)
-    LDLIBS += $(shell pkg-config --libs ncurses)
+    CFLAGS += $(shell $(PKGCONFIG) --cflags ncurses)
+    LDLIBS += $(shell $(PKGCONFIG) --libs ncurses)
   else
     LDLIBS += -lncursesw
   endif
 
   # NOTE: libxml and libzip are required for xlsx file import support
-  ifneq ($(shell pkg-config --exists libzip libxml-2.0 || echo 'no'),no)
-    CFLAGS += -DXLSX $(shell pkg-config --cflags libxml-2.0 libzip)
-    LDLIBS += $(shell pkg-config --libs libxml-2.0 libzip)
+  ifneq ($(shell $(PKGCONFIG) --exists libzip libxml-2.0 || echo 'no'),no)
+    CFLAGS += -DXLSX $(shell $(PKGCONFIG) --cflags libzip)
+    LDLIBS += $(shell $(PKGCONFIG) --libs libzip)
+    # The pkg-wrapper can't handle two at once for some reason.
+    CFLAGS += $(shell $(PKGCONFIG) --cflags libxml-2.0 )
+    LDLIBS += $(shell $(PKGCONFIG) --libs libxml-2.0)
   endif
 
   # NOTE: lua support
-  ifneq ($(shell pkg-config --exists lua51 || echo 'no'),no)
-    CFLAGS += -DXLUA $(shell pkg-config --cflags lua51)
-    LDLIBS += $(shell pkg-config --libs lua51) -Wl,--export-dynamic
-  else ifneq ($(shell pkg-config --exists lua-5.1 || echo 'no'),no) # FreeBSD
-    CFLAGS += -DXLUA $(shell pkg-config --cflags lua-5.1)
-    LDLIBS += $(shell pkg-config --libs lua-5.1) -Wl,--export-dynamic
+  ifneq ($(shell $(PKGCONFIG) --exists lua51 || echo 'no'),no)
+    CFLAGS += -DXLUA $(shell $(PKGCONFIG) --cflags lua51)
+    LDLIBS += $(shell $(PKGCONFIG) --libs lua51) -Wl,--export-dynamic
+  else ifneq ($(shell $(PKGCONFIG) --exists lua-5.1 || echo 'no'),no) # FreeBSD
+    CFLAGS += -DXLUA $(shell $(PKGCONFIG) --cflags lua-5.1)
+    LDLIBS += $(shell $(PKGCONFIG) --libs lua-5.1) -Wl,--export-dynamic
   endif
-else ifeq ($(shell uname -s),Darwin)
+else ifeq ($(echo Darwin),Darwin)
   # macOS without pkg-config
 
   # macOS' ncurses is built with wide-char support