Cleanup to build with relay enabled; don't enable any network features

if STANDALONE_ONLY is defined.
This commit is contained in:
ehouse 2009-01-03 23:56:20 +00:00
parent 73c32f0441
commit 5e905686fa
4 changed files with 22 additions and 10 deletions

View file

@ -1,5 +1,5 @@
# -*- mode: makefile; compile-command: "make -j MEMDEBUG=TRUE"; -*- # -*- mode: makefile; compile-command: "make -j MEMDEBUG=TRUE"; -*-
# Copyright 2002-2007 by Eric House (xwords@eehouse.org). All rights # Copyright 2002-2009 by Eric House (xwords@eehouse.org). All rights
# reserved. # reserved.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
@ -33,6 +33,9 @@ DO_CURSES += -DCURSES_SMALL_SCREEN
endif endif
DO_GTK = -DPLATFORM_GTK DO_GTK = -DPLATFORM_GTK
# uncomment for standalone build
# STANDALONE = -DXWFEATURE_STANDALONE_ONLY
SVN_REV ?= "$(shell svnversion -n .)" SVN_REV ?= "$(shell svnversion -n .)"
SVNDEF = -D'SVN_REV=$(SVN_REV)' SVNDEF = -D'SVN_REV=$(SVN_REV)'
@ -76,6 +79,9 @@ ifdef CURSES_CELL_WIDTH
DEFINES += -DCURSES_CELL_WIDTH=$(CURSES_CELL_WIDTH) DEFINES += -DCURSES_CELL_WIDTH=$(CURSES_CELL_WIDTH)
endif endif
# Networking-related features. Only set these if STANDALONE is not set
ifeq ($(STANDALONE),)
# Bluetooth support # Bluetooth support
ifndef NO_BLUETOOTH ifndef NO_BLUETOOTH
BLUETOOTH = -DXWFEATURE_BLUETOOTH -DBT_USE_L2CAP BLUETOOTH = -DXWFEATURE_BLUETOOTH -DBT_USE_L2CAP
@ -96,6 +102,8 @@ DEFINES += -DXWFEATURE_IP_DIRECT
# user experience will be very bad!). Is particularly useful with BT. # user experience will be very bad!). Is particularly useful with BT.
# DEFINES += -DRELAY_HEARTBEAT # DEFINES += -DRELAY_HEARTBEAT
DEFINES += -DCOMMS_HEARTBEAT DEFINES += -DCOMMS_HEARTBEAT
endif
DEFINES += $(STANDALONE)
# Let users pick the tiles going into their trays # Let users pick the tiles going into their trays
#DEFINES += -DFEATURE_TRAY_EDIT #DEFINES += -DFEATURE_TRAY_EDIT

View file

@ -1,6 +1,6 @@
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */ /* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */
/* /*
* Copyright 2000-2008 by Eric House (xwords@eehouse.org). All rights reserved. * Copyright 2000-2009 by Eric House (xwords@eehouse.org). All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -1239,7 +1239,7 @@ heartbeat_timer_func( gpointer data )
static void static void
gtk_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why, gtk_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why,
XP_U16 when, XP_U16 XP_UNUSED_STANDALONE(when),
XWTimerProc proc, void* closure ) XWTimerProc proc, void* closure )
{ {
GtkAppGlobals* globals = (GtkAppGlobals*)uc->closure; GtkAppGlobals* globals = (GtkAppGlobals*)uc->closure;

View file

@ -1,6 +1,6 @@
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */ /* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */
/* /*
* Copyright 2000-2008 by Eric House (xwords@eehouse.org). All rights * Copyright 2000-2009 by Eric House (xwords@eehouse.org). All rights
* reserved. * reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -651,12 +651,14 @@ main( int argc, char** argv )
XP_Bool isServer = XP_FALSE; XP_Bool isServer = XP_FALSE;
char* portNum = NULL; char* portNum = NULL;
char* hostName = "localhost"; char* hostName = "localhost";
char* serverPhone = NULL; /* sms */
unsigned int seed = defaultRandomSeed(); unsigned int seed = defaultRandomSeed();
LaunchParams mainParams; LaunchParams mainParams;
XP_U16 robotCount = 0; XP_U16 robotCount = 0;
CommsConnType conType = COMMS_CONN_NONE; CommsConnType conType = COMMS_CONN_NONE;
#ifdef XWFEATURE_SMS
char* serverPhone = NULL;
#endif
#ifdef XWFEATURE_BLUETOOTH #ifdef XWFEATURE_BLUETOOTH
const char* btaddr = NULL; const char* btaddr = NULL;
#endif #endif
@ -1007,7 +1009,7 @@ main( int argc, char** argv )
linux_util_vt_init( MPPARM(mainParams.util->mpool) mainParams.util ); linux_util_vt_init( MPPARM(mainParams.util->mpool) mainParams.util );
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH #ifndef XWFEATURE_STANDALONE_ONLY
mainParams.util->vtable->m_util_addrChange = linux_util_addrChange; mainParams.util->vtable->m_util_addrChange = linux_util_addrChange;
#endif #endif

View file

@ -1,6 +1,6 @@
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE";-*- */ /* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE";-*- */
/* /*
* Copyright 2007 by Eric House (xwords@eehouse.org). All rights * Copyright 2007-2009 by Eric House (xwords@eehouse.org). All rights
* reserved. * reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -239,9 +239,11 @@ linux_udp_send( const XP_U8* buf, XP_U16 buflen, const CommsAddrRec* addrp,
} else { } else {
if ( stuff->socket == -1 ) { if ( stuff->socket == -1 ) {
stuff->socket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); stuff->socket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
XP_LOGF( "%s: client made socket = %d", __func__, stuff->socket ); XP_LOGF( "%s: client made socket = %d", __func__,
(*stuff->globals->socketChanged)( stuff->globals->socketChangedClosure, stuff->socket );
-1, stuff->socket, &stuff->storage ); (*stuff->globals->socketChanged)
( stuff->globals->socketChangedClosure,
-1, stuff->socket, &stuff->storage );
} }
addressToServer( &to, addrp ); addressToServer( &to, addrp );
} }