bemused: Compile fixes
authorMichael Büsch <mb@bu3sch.de>
Sun, 6 Mar 2011 13:21:09 +0000 (13:21 +0000)
committerMichael Büsch <mb@bu3sch.de>
Sun, 6 Mar 2011 13:21:09 +0000 (13:21 +0000)
SVN-Revision: 25885

utils/bemused/Makefile
utils/bemused/patches/200-cxx-compile-fixes.patch [new file with mode: 0644]

index a306f8ec2d4b0057a476755d001a73b14ea95a64..2e6bbd447331426826bdb43aa984e9cae4723a11 100644 (file)
@@ -15,6 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.origo.ethz.ch/bemused-lnx-mpdhack/526
 PKG_MD5SUM:=aed8b41aed530e9177e43d9bebad10b7
 
+PKG_BUILD_PARALLEL:=1
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
@@ -33,15 +35,22 @@ define Package/bemusedlinuxserver/description
     Check http://jamse.sourceforge.net/ for a mobile phone client.
 endef
 
+EXTRA_CPPFLAGS:= \
+       -I$(STAGING_DIR)/usr/include/glib-1.2 \
+       -I$(STAGING_DIR)/usr/lib/glib/include \
+       -I$(ICONV_PREFIX)/include
+
+EXTRA_LDFLAGS:= \
+       -L$(ICONV_PREFIX)/lib
+
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \
-       LDFLAGS="$(TARGET_LDFLAGS) " \
-       CPPFLAGS="$(TARGET_CPPFLAGS)" \
-       INCL="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/glib-1.2 -I$(STAGING_DIR)/usr/lib/glib/include -I$(ICONV_PREFIX)/include" \
-       MYLIBS="-lbluetooth -lglib -L$(ICONV_PREFIX)/lib -liconv"
-       $(STRIP) $(PKG_BUILD_DIR)/bemusedlinuxserver
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+               CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
+               LDLIBS="-lbluetooth -lglib -liconv"
 endef
 
 define Package/bemusedlinuxserver/install
diff --git a/utils/bemused/patches/200-cxx-compile-fixes.patch b/utils/bemused/patches/200-cxx-compile-fixes.patch
new file mode 100644 (file)
index 0000000..4a6ef0e
--- /dev/null
@@ -0,0 +1,71 @@
+Index: bemused-mpd-r062/Makefile
+===================================================================
+--- bemused-mpd-r062.orig/Makefile     2008-03-31 09:43:54.000000000 +0200
++++ bemused-mpd-r062/Makefile  2011-03-06 14:19:07.933096517 +0100
+@@ -1,8 +1,15 @@
+-SHELL = /bin/sh
++LDLIBS = -lbluetooth -lglib -liconv
++CPPFLAGS = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./
++CFLAGS = -Os
++CXXFLAGS = -Os
+-#optimized for openwrt use! mylibs should be -lbluetooth, liconv and -lglib
+-MYLIBS = -lbluetooth -lglib -liconv
+-INCL = -I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I./
++%.o: %.c
++      $(CC) -c $(CFLAGS) $(CPPFLAGS) $^ -o $@
+-bemusedlinuxserver:   main.cpp BemusedServerDlg.cpp mpdctrl.c
+-                      $(CXX) -Os -o bemusedlinuxserver $(INCL) $(LDFLAGS) $(MYLIBS) main.cpp BemusedServerDlg.cpp mpdctrl.c libmpdclient.c
++%.o: %.cpp
++      $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $^ -o $@
++
++bemusedlinuxserver: main.o BemusedServerDlg.o mpdctrl.o libmpdclient.o
++      $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
++
++all: bemusedlinuxserver
+Index: bemused-mpd-r062/libmpdclient.h
+===================================================================
+--- bemused-mpd-r062.orig/libmpdclient.h       2008-04-28 23:03:52.000000000 +0200
++++ bemused-mpd-r062/libmpdclient.h    2011-03-06 14:15:34.821307043 +0100
+@@ -68,11 +68,10 @@
+ #define MPD_ACK_ERROR_EXIST                   56
+ #include <stdlib.h>
+-#include <iostream>
+-//#ifdef __cplusplus
+-//extern "C" {
+-//#endif
++#ifdef __cplusplus
++extern "C" {
++#endif
+ typedef enum mpd_TagItems {
+     MPD_TAG_ITEM_ARTIST,
+@@ -654,8 +653,8 @@ void mpd_sendPlaylistAddCommand(mpd_Conn
+ void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to);
+ void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos);
+-//#ifdef __cplusplus
+-//}
+-//#endif
++#ifdef __cplusplus
++}
++#endif
+ #endif
+Index: bemused-mpd-r062/mpdctrl.c
+===================================================================
+--- bemused-mpd-r062.orig/mpdctrl.c    2008-04-28 23:03:52.000000000 +0200
++++ bemused-mpd-r062/mpdctrl.c 2011-03-06 14:15:34.821307043 +0100
+@@ -59,6 +59,9 @@
+ #define ERROR_DISPLAY 5
++#define false 0
++#define true  (!false)
++
+ static int l_totalTimeSec;
+ static int l_elapsedTimeSec;
+ static int l_bitRate;