1 From 6af678616531eb1f3d3d0a052313ef9d8125bac7 Mon Sep 17 00:00:00 2001
2 From: "L. Donnie Smith" <donnie.smith@gatech.edu>
3 Date: Thu, 4 Feb 2010 22:53:41 -0500
4 Subject: [PATCH] fix link options for --as-needed (#90)
6 also fix a couple of includes
8 common/include/app.mak | 2 +-
9 common/include/lib.mak.in | 4 ++--
10 common/include/plugin.mak | 2 +-
11 lswm/Makefile.in | 2 +-
12 python/Makefile.in | 2 +-
13 python/Wiimote.c | 2 +-
14 python/cwiidmodule.c | 2 +-
16 wmgui/Makefile.in | 2 +-
17 wminput/Makefile.in | 2 +-
19 11 files changed, 12 insertions(+), 10 deletions(-)
21 diff --git a/common/include/app.mak b/common/include/app.mak
22 index f00cf12..c26d0ff 100644
23 --- a/common/include/app.mak
24 +++ b/common/include/app.mak
25 @@ -10,7 +10,7 @@ DEST_INST_DIR = $(ROOTDIR)$(INST_DIR)
28 $(APP_NAME): $(OBJECTS)
29 - $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LDLIBS)
30 + $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
33 install -D $(APP_NAME) $(DEST_INST_DIR)/$(APP_NAME)
34 diff --git a/common/include/lib.mak.in b/common/include/lib.mak.in
35 index 5e81ff3..3afbb14 100644
36 --- a/common/include/lib.mak.in
37 +++ b/common/include/lib.mak.in
38 @@ -25,8 +25,8 @@ $(STATIC_LIB): $(OBJECTS)
39 ar rcs $(STATIC_LIB) $(OBJECTS)
41 $(SHARED_LIB): $(OBJECTS)
42 - $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) $(LDLIBS) \
43 - -o $(SHARED_LIB) $(OBJECTS)
44 + $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $(SHARED_LIB) \
45 + $(OBJECTS) $(LDLIBS)
47 install: install_header install_static install_shared
49 diff --git a/common/include/plugin.mak b/common/include/plugin.mak
50 index 0f61502..a2d5c85 100644
51 --- a/common/include/plugin.mak
52 +++ b/common/include/plugin.mak
53 @@ -16,7 +16,7 @@ DEST_INST_DIR = $(INST_DIR)
56 $(LIB_NAME): $(OBJECTS)
57 - $(CC) -shared $(LDFLAGS) $(LDLIBS) -o $(LIB_NAME) $(OBJECTS)
58 + $(CC) -shared $(LDFLAGS) -o $(LIB_NAME) $(OBJECTS) $(LDLIBS)
61 install -D $(LIB_NAME) $(DEST_INST_DIR)/$(LIB_NAME)
62 diff --git a/lswm/Makefile.in b/lswm/Makefile.in
63 index 79e8b5b..017104f 100644
64 --- a/lswm/Makefile.in
65 +++ b/lswm/Makefile.in
66 @@ -8,7 +8,7 @@ SOURCES = lswm.c
68 CFLAGS += -I@top_builddir@/libcwiid
69 LDFLAGS += -L@top_builddir@/libcwiid
71 +LDLIBS += -lcwiid -lbluetooth
74 include $(COMMON)/include/app.mak
75 diff --git a/python/Makefile.in b/python/Makefile.in
76 index 0d7efdf..0ca57ca 100644
77 --- a/python/Makefile.in
78 +++ b/python/Makefile.in
79 @@ -7,7 +7,7 @@ ifdef ROOTDIR
83 - $(PYTHON) setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid
84 + $(PYTHON) setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid -lbluetooth
87 $(PYTHON) setup.py install --install-lib=${libdir}/python@PYTHON_VERSION@/site-packages $(SET_ROOT_DIR)
88 diff --git a/python/Wiimote.c b/python/Wiimote.c
89 index 794e7e2..523185e 100644
90 --- a/python/Wiimote.c
91 +++ b/python/Wiimote.c
93 #include "structmember.h"
95 #include <bluetooth/bluetooth.h>
99 #if (PY_VERSION_HEX < 0x02050000)
100 #ifndef PY_SSIZE_T_MIN
101 diff --git a/python/cwiidmodule.c b/python/cwiidmodule.c
102 index f6a8f33..a01ed82 100644
103 --- a/python/cwiidmodule.c
104 +++ b/python/cwiidmodule.c
111 #include "structmember.h"
113 /* externally defined types */
114 diff --git a/wmdemo/wmdemo.c b/wmdemo/wmdemo.c
115 index 70a25a1..b7aaa7f 100644
116 --- a/wmdemo/wmdemo.c
117 +++ b/wmdemo/wmdemo.c
122 +#include <bluetooth/bluetooth.h>
125 /* This is a sample program written to demonstrate basic CWiid libwiimote
126 diff --git a/wmgui/Makefile.in b/wmgui/Makefile.in
127 index 41b205e..14d1c1e 100644
128 --- a/wmgui/Makefile.in
129 +++ b/wmgui/Makefile.in
130 @@ -8,7 +8,7 @@ SOURCES = main.c interface.c support.c
132 CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid
133 LDFLAGS += -L@top_builddir@/libcwiid
134 -LDLIBS += @GTK_LIBS@ -lm -lcwiid
135 +LDLIBS += @GTK_LIBS@ -lcwiid -lbluetooth -lm
138 include $(COMMON)/include/app.mak
139 diff --git a/wminput/Makefile.in b/wminput/Makefile.in
140 index 009d4d5..d3c3679 100644
141 --- a/wminput/Makefile.in
142 +++ b/wminput/Makefile.in
143 @@ -14,7 +14,7 @@ CFLAGS += -I@top_builddir@/libcwiid \
144 -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \
145 -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\"
147 -LDLIBS += -lcwiid -ldl
148 +LDLIBS += -lcwiid -lbluetooth -ldl -lpthread
149 LDFLAGS += -L@top_builddir@/libcwiid -rdynamic
152 diff --git a/wminput/main.c b/wminput/main.c
153 index c3a7445..bbc98d9 100644
158 #include <sys/types.h>
160 +#include <bluetooth/bluetooth.h>