diff --git a/xwords4/linux/Makefile b/xwords4/linux/Makefile index 9efa16045..7d2fd3b60 100644 --- a/xwords4/linux/Makefile +++ b/xwords4/linux/Makefile @@ -1,5 +1,5 @@ # -*- 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. # # This program is free software; you can redistribute it and/or @@ -33,6 +33,9 @@ DO_CURSES += -DCURSES_SMALL_SCREEN endif DO_GTK = -DPLATFORM_GTK +# uncomment for standalone build +# STANDALONE = -DXWFEATURE_STANDALONE_ONLY + SVN_REV ?= "$(shell svnversion -n .)" SVNDEF = -D'SVN_REV=$(SVN_REV)' @@ -76,6 +79,9 @@ ifdef CURSES_CELL_WIDTH DEFINES += -DCURSES_CELL_WIDTH=$(CURSES_CELL_WIDTH) endif +# Networking-related features. Only set these if STANDALONE is not set +ifeq ($(STANDALONE),) + # Bluetooth support ifndef NO_BLUETOOTH 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. # DEFINES += -DRELAY_HEARTBEAT DEFINES += -DCOMMS_HEARTBEAT +endif +DEFINES += $(STANDALONE) # Let users pick the tiles going into their trays #DEFINES += -DFEATURE_TRAY_EDIT diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 6194b783f..9c8d49c89 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -1,6 +1,6 @@ /* -*-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 * modify it under the terms of the GNU General Public License @@ -1239,7 +1239,7 @@ heartbeat_timer_func( gpointer data ) static void gtk_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why, - XP_U16 when, + XP_U16 XP_UNUSED_STANDALONE(when), XWTimerProc proc, void* closure ) { GtkAppGlobals* globals = (GtkAppGlobals*)uc->closure; diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index 08e59a201..a2c41cb40 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -1,6 +1,6 @@ /* -*-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. * * 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; char* portNum = NULL; char* hostName = "localhost"; - char* serverPhone = NULL; /* sms */ unsigned int seed = defaultRandomSeed(); LaunchParams mainParams; XP_U16 robotCount = 0; CommsConnType conType = COMMS_CONN_NONE; +#ifdef XWFEATURE_SMS + char* serverPhone = NULL; +#endif #ifdef XWFEATURE_BLUETOOTH const char* btaddr = NULL; #endif @@ -1007,7 +1009,7 @@ main( int argc, char** argv ) 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; #endif diff --git a/xwords4/linux/linuxudp.c b/xwords4/linux/linuxudp.c index c40117f5a..582df2bfb 100644 --- a/xwords4/linux/linuxudp.c +++ b/xwords4/linux/linuxudp.c @@ -1,6 +1,6 @@ /* -*-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. * * 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 { if ( stuff->socket == -1 ) { stuff->socket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); - XP_LOGF( "%s: client made socket = %d", __func__, stuff->socket ); - (*stuff->globals->socketChanged)( stuff->globals->socketChangedClosure, - -1, stuff->socket, &stuff->storage ); + XP_LOGF( "%s: client made socket = %d", __func__, + stuff->socket ); + (*stuff->globals->socketChanged) + ( stuff->globals->socketChangedClosure, + -1, stuff->socket, &stuff->storage ); } addressToServer( &to, addrp ); }