dibbler: fix linking against uClibc++
authorNicolas Thill <nico@openwrt.org>
Mon, 3 Sep 2007 16:04:51 +0000 (16:04 +0000)
committerNicolas Thill <nico@openwrt.org>
Mon, 3 Sep 2007 16:04:51 +0000 (16:04 +0000)
SVN-Revision: 8600

ipv6/dibbler/Makefile
ipv6/dibbler/patches/001-uclibcxx.patch [new file with mode: 0644]

index dcbf2d065061b70a0f5235b6738550613768f7d0..e553c1a85cc91b71f5e47135d54cb3704eb86dd7 100644 (file)
@@ -48,8 +48,8 @@ define Build/Configure
        (cd $(PKG_BUILD_DIR)/poslib; \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(EXTRA_CPPFLAGS)" \
-               LDFLAGS="$(EXTRA_LDFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
@@ -73,13 +73,16 @@ define Build/Configure
        );
 endef
 
-CXX_LIBS:="-nodefaultlibs -Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic,-lm,-lc,-lgcc"
+# link stuff missing from uClibc++ but present in stdc++ statically
+CXX_LIBS:= -nodefaultlibs -luClibc++ -Wl,-Bstatic,-lstdc++,-Bdynamic -lm
+
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
-               PORT_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS) -fno-builtin -fno-rtti" \
-               PORT_LDFLAGS="$(EXTRA_LDFLAGS)" \
+               PORT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -fno-builtin -fno-rtti" \
+               PORT_LDFLAGS="$(TARGET_LDFLAGS)" \
                DEBUGINFO= \
+               CXXLD="$(TARGET_CC)" \
                CLNT_LIBS="$(CXX_LIBS)" \
                SRV_LIBS="$(CXX_LIBS)" \
                server client relay
diff --git a/ipv6/dibbler/patches/001-uclibcxx.patch b/ipv6/dibbler/patches/001-uclibcxx.patch
new file mode 100644 (file)
index 0000000..11f0c13
--- /dev/null
@@ -0,0 +1,70 @@
+diff -ruN dibbler-0.6.0-RC1-old/Makefile dibbler-0.6.0-RC1-new/Makefile
+--- dibbler-0.6.0-RC1-old/Makefile     2007-01-30 21:34:24.000000000 +0100
++++ dibbler-0.6.0-RC1-new/Makefile     2007-09-01 04:55:38.000000000 +0200
+@@ -32,7 +32,7 @@
+ $(CLIENTBIN): libposlib includes commonlibs clntlibs $(MISC)/DHCPClient.o $(CLIENT)
+       @echo "[LINK   ] $(SUBDIR)/$@ ($(LINKPRINT))"
+-      $(CXX) $(CLNT_LDFLAGS) $(OPTS) $(CLNTLINKOPTS) -o $@ $(MISC)/DHCPClient.o $(CLIENT) \
++      $(CXXLD) $(CLNT_LDFLAGS) $(OPTS) $(CLNTLINKOPTS) -o $@ $(MISC)/DHCPClient.o $(CLIENT) \
+       -L$(MISC)         -lMisc         \
+       -L$(ADDRMGR)      -lAddrMgr      \
+       -L$(CLNTADDRMGR)  -lClntAddrMgr  \
+@@ -50,7 +50,8 @@
+       -L$(MESSAGES)     -lMsg            \
+       -lClntOptions -lOptions -lLowLevel \
+       -L$(MISC)         -lMisc           \
+-      -L$(POSLIB)       $(CLNTPOSLIB)
++      -L$(POSLIB)       $(CLNTPOSLIB) \
++      $(CLNT_LIBS)
+ ifndef MOD_CLNT_DISABLE_DNSUPDATE
+ CLNTPOSLIB=-lposlib   
+@@ -60,7 +61,7 @@
+ $(SERVERBIN): libposlib includes commonlibs srvlibs $(MISC)/DHCPServer.o $(SERVER)
+       @echo "[LINK   ] $(SUBDIR)/$@ ($(LINKPRINT))"
+-      $(CXX) $(SRV_LDFLAGS) $(OPTS) -I $(INCDIR) $(SRVLINKOPTS) -o $@ $(MISC)/DHCPServer.o $(SERVER)  \
++      $(CXXLD) $(SRV_LDFLAGS) $(OPTS) -I $(INCDIR) $(SRVLINKOPTS) -o $@ $(MISC)/DHCPServer.o $(SERVER)  \
+       -L$(SRVADDRMGR)   -lSrvAddrMgr     \
+       -L$(ADDRMGR)      -lAddrMgr        \
+       -L$(LOWLEVEL)                      \
+@@ -81,7 +82,8 @@
+       -L$(MISC)        -lMisc            \
+       -L$(LOWLEVEL)    -lLowLevel        \
+       -L$(IFACEMGR)    -lIfaceMgr        \
+-      -L$(POSLIB)      $(SRVPOSLIB)
++      -L$(POSLIB)      $(SRVPOSLIB) \
++      $(SRV_LIBS)
+ ifndef MOD_SRV_DISABLE_DNSUPDATE
+ SRVPOSLIB=-lposlib    
+@@ -91,7 +93,7 @@
+ $(RELAYBIN): poslib-configure includes commonlibs relaylibs $(MISC)/DHCPRelay.o $(RELAY)
+       @echo "[LINK   ] $(SUBDIR)/$@ ($(LINKPRINT))"
+-      $(CXX) $(REL_LDFLAGS) $(OPTS) -I $(INCDIR) $(SRVLINKOPTS) -o $@ $(MISC)/DHCPRelay.o $(RELAY)  \
++      $(CXXLD) $(REL_LDFLAGS) $(OPTS) -I $(INCDIR) $(SRVLINKOPTS) -o $@ $(MISC)/DHCPRelay.o $(RELAY)  \
+       -L$(RELTRANSMGR) -lRelTransMgr  \
+       -L$(RELCFGMGR)   -lRelCfgMgr    \
+       -L$(RELIFACEMGR) -lRelIfaceMgr  \
+@@ -104,7 +106,8 @@
+       -L$(MESSAGES)    -lMsg          \
+       -L$(MISC)        -lMisc         \
+       -L$(OPTIONS)     -lOptions      \
+-      -lMisc -lIfaceMgr -lLowLevel -lRelTransMgr -lRelCfgMgr -lRelMsg -lRelOptions -lOptions
++      -lMisc -lIfaceMgr -lLowLevel -lRelTransMgr -lRelCfgMgr -lRelMsg -lRelOptions -lOptions \
++      $(SRV_LIBS)
+ objs: includes
+       @for dir in $(COMMONSUBDIRS); do \
+diff -ruN dibbler-0.6.0-RC1-old/Makefile.inc dibbler-0.6.0-RC1-new/Makefile.inc
+--- dibbler-0.6.0-RC1-old/Makefile.inc 2007-02-03 19:02:11.000000000 +0100
++++ dibbler-0.6.0-RC1-new/Makefile.inc 2007-09-01 04:56:44.000000000 +0200
+@@ -1,5 +1,6 @@
+ # === used tools ===
+ CXX          = g++
++CXXLD        = $(CXX)
+ CC           = gcc
+ FLEX         = flex
+ BISONPP      = $(PREFIX)/bison++/bison++ -S $(PREFIX)/bison++/bison.cc -H $(PREFIX)/bison++/bison.h