Remove excessive optimization

Fix install on non-native architectures

Proper fix for a thread related problem

Add comments to patches
This commit is contained in:
dcoppa 2012-05-08 08:24:40 +00:00
parent 81203ec233
commit aa6705b90d
4 changed files with 51 additions and 29 deletions

View File

@ -1,7 +1,8 @@
# $OpenBSD: Makefile,v 1.47 2012/04/24 12:55:12 dcoppa Exp $
# $OpenBSD: Makefile,v 1.48 2012/05/08 08:24:40 dcoppa Exp $
COMMENT = e-donkey client
DISTNAME = mldonkey-3.1.1
REVISION = 0
CATEGORIES = net
HOMEPAGE = http://mldonkey.sourceforge.net/Main_Page

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-Makefile,v 1.1 2012/05/08 08:24:40 dcoppa Exp $
Remove excessive optimization
--- Makefile.orig Tue May 8 09:21:31 2012
+++ Makefile Tue May 8 09:21:48 2012
@@ -5033,7 +5033,7 @@ ocamldoc_html: $(CORE_DOC) $(libclient_DOC)
$(OCAMLDOC) -sort -dump ocamldoc/ocamldocdump -html -d ocamldoc $(INCLUDES) $(libclient_DOC) $(CORE_DOC)
$(LIB)/md4_cc.o: $(LIB)/md4.c
- $(OCAMLC) -ccopt "$(CFLAGS) -O3 -o $(LIB)/md4_cc.o" -ccopt "" -c $(LIB)/md4.c
+ $(OCAMLC) -ccopt "$(CFLAGS) -o $(LIB)/md4_cc.o" -ccopt "" -c $(LIB)/md4.c
$(CDK)/heap_c.o: $(CDK)/heap_c.c
$(OCAMLC) -ccopt "$(CFLAGS) $(MORECFLAGS) -o $(CDK)/heap_c.o" -ccopt "" -c $(CDK)/heap_c.c

View File

@ -1,6 +1,11 @@
$OpenBSD: patch-config_Makefile_in,v 1.16 2011/09/16 10:04:32 dcoppa Exp $
--- config/Makefile.in.orig Sun Jan 23 16:20:25 2011
+++ config/Makefile.in Fri Sep 16 11:46:16 2011
$OpenBSD: patch-config_Makefile_in,v 1.17 2012/05/08 08:24:40 dcoppa Exp $
Fix install on non-native architectures
Remove excessive optimization
--- config/Makefile.in.orig Wed Apr 4 22:22:49 2012
+++ config/Makefile.in Tue May 8 09:22:18 2012
@@ -633,6 +633,8 @@ uninstall::
rm -f $(BINDIR)/mlnet
rm -f $(BINDIR)/mlgui
@ -10,25 +15,35 @@ $OpenBSD: patch-config_Makefile_in,v 1.16 2011/09/16 10:04:32 dcoppa Exp $
install:: opt
mkdir -p $(DESTDIR)$(prefix)/bin
if test -f mlnet; then \
@@ -652,6 +654,21 @@ install:: opt
@@ -652,7 +654,22 @@ install:: opt
done; \
fi
+else
+
+install::
+ cp -f mlnet.byte $(DESTDIR)$(prefix)/bin/mlnet
+ for link in mlslsk mldonkey mlgnut mldc mlbt; do \
+ ln -s mlnet $(DESTDIR)$(prefix)/bin/$$link; \
+ done
+ cp -f mlgui.byte $(DESTDIR)$(prefix)/bin/mlgui
+ ln -s $(DESTDIR)$(prefix)/bin/mlgui $(DESTDIR)$(prefix)/bin/mldonkey_gui
+ ln -s mlgui $(DESTDIR)$(prefix)/bin/mldonkey_gui
+ cp -f mlnet.byte $(DESTDIR)$(prefix)/bin/mlnet+gui
+ for link in mlslsk+gui mldonkey+gui mlgnut+gui mldc+gui mlbt+gui; do \
+ ln -s mlnet+gui $(DESTDIR)$(prefix)/bin/$$link; \
+ done
+
+endif
+
ifneq ("$(GUI)" , "no")
ifeq ("$(GUI)", "newgui2")
SUBDIRS += $(SRC_GUI) $(SRC_GUI)/x11 $(SRC_GUI)/win32 $(ICONS_CHOICE) +lablgtk2
@@ -1434,7 +1451,7 @@ ocamldoc_html: $(CORE_DOC) $(libclient_DOC)
$(OCAMLDOC) -sort -dump ocamldoc/ocamldocdump -html -d ocamldoc $(INCLUDES) $(libclient_DOC) $(CORE_DOC)
$(LIB)/md4_cc.o: $(LIB)/md4.c
- $(OCAMLC) -ccopt "$(CFLAGS) -O3 -o $(LIB)/md4_cc.o" -ccopt "" -c $(LIB)/md4.c
+ $(OCAMLC) -ccopt "$(CFLAGS) -o $(LIB)/md4_cc.o" -ccopt "" -c $(LIB)/md4.c
$(CDK)/heap_c.o: $(CDK)/heap_c.c
$(OCAMLC) -ccopt "$(CFLAGS) $(MORECFLAGS) -o $(CDK)/heap_c.o" -ccopt "" -c $(CDK)/heap_c.c

View File

@ -1,18 +1,12 @@
$OpenBSD: patch-src_utils_net_upnp_stubs_c,v 1.2 2012/04/24 12:55:12 dcoppa Exp $
$OpenBSD: patch-src_utils_net_upnp_stubs_c,v 1.3 2012/05/08 08:24:40 dcoppa Exp $
Fix build with latest libnatpmp/miniupnpc
Remove bogus call to pthread_mutex_unlock()
--- src/utils/net/upnp_stubs.c.orig Mon Nov 1 18:19:23 2010
+++ src/utils/net/upnp_stubs.c Tue Apr 24 14:41:55 2012
@@ -164,7 +164,6 @@ static int g_inited = 0;
static int g_running = 0;
static int g_stop = 0;
static pthread_t g_pthread;
-//static pthread_cond_t cond;
static pthread_mutex_t g_mutex;
static pthread_mutex_t g_delay_mutex;
@@ -501,7 +500,7 @@ natpmpPulse( ml_upnpmp_t * map )
+++ src/utils/net/upnp_stubs.c Tue May 8 09:24:59 2012
@@ -501,7 +501,7 @@ natpmpPulse( ml_upnpmp_t * map )
if( map->enabled && ( map->natpmpState == ML_NATPMP_DISCOVER ) )
{
@ -21,7 +15,7 @@ Fix build with latest libnatpmp/miniupnpc
dbg_printf( "initnatpmp = %d\n", val );
val = sendpublicaddressrequest( &map->natpmp );
dbg_printf( "sendpublicaddressrequest = %d\n", val );
@@ -639,7 +638,7 @@ upnpPulse( ml_upnpmp_t * map )
@@ -639,7 +639,7 @@ upnpPulse( ml_upnpmp_t * map )
{
struct UPNPDev * devlist;
errno = 0;
@ -30,7 +24,7 @@ Fix build with latest libnatpmp/miniupnpc
if( devlist == NULL )
{
dbg_printf( "upnpDiscover failed (errno %d - %s)\n", errno, str_errno( errno ) );
@@ -680,7 +679,7 @@ upnpPulse( ml_upnpmp_t * map )
@@ -680,7 +680,7 @@ upnpPulse( ml_upnpmp_t * map )
snprintf( type, sizeof( type ), "%s", ( map->isTcp ? "TCP" : "UDP" ) );
i = UPNP_GetSpecificPortMappingEntry( map->upnpUrls.controlURL,
map->upnpData.first.servicetype, portStr,
@ -39,7 +33,7 @@ Fix build with latest libnatpmp/miniupnpc
if( i != UPNPCOMMAND_SUCCESS )
{
dbg_printf( "Port %d isn't forwarded\n", map->extPort );
@@ -730,7 +729,7 @@ upnpPulse( ml_upnpmp_t * map )
@@ -730,7 +730,7 @@ upnpPulse( ml_upnpmp_t * map )
err = UPNP_AddPortMapping( map->upnpUrls.controlURL,
map->upnpData.first.servicetype,
extPortStr, intPortStr, map->lanaddr,
@ -48,14 +42,11 @@ Fix build with latest libnatpmp/miniupnpc
map->upnpMapped = !err;
}
dbg_printf( "Port forwarding through \"%s\", service \"%s\". (local address[%s:%d])\n", map->upnpUrls.controlURL, map->upnpData.first.servicetype, map->lanaddr, map->intPort );
@@ -898,9 +897,9 @@ upnp_thread_start( )
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- //pthread_cond_init(&cond, NULL);
@@ -901,7 +901,6 @@ upnp_thread_start( )
//pthread_cond_init(&cond, NULL);
pthread_mutex_init(&g_mutex, NULL);
pthread_mutex_init(&g_delay_mutex, NULL);
+ pthread_mutex_trylock(&g_mutex);
pthread_mutex_unlock(&g_mutex);
- pthread_mutex_unlock(&g_mutex);
err = pthread_create(&g_pthread, &attr, upnpNatpmpThread, NULL);