changeset 21:e0545ef33bb9

trying to fix network problem
author Robert McIntyre <rlm@mit.edu>
date Sun, 04 Mar 2012 16:56:20 -0600
parents ecd30c5e2f5a
children 8870086b716c
files configure.ac src/common/Makefile.am src/gba/Makefile.am src/gba/remote.cpp
diffstat 4 files changed, 28 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/configure.ac	Sun Mar 04 14:35:54 2012 -0600
     1.2 +++ b/configure.ac	Sun Mar 04 16:56:20 2012 -0600
     1.3 @@ -10,42 +10,50 @@
     1.4  AC_CONFIG_SRCDIR([src/lua/lopcodes.c])
     1.5  AC_CONFIG_HEADERS([config.h])
     1.6  
     1.7 -
     1.8  # Checks for programs.
     1.9  AC_PROG_CXX
    1.10  AC_PROG_CC
    1.11 +AC_PROG_AWK
    1.12 +AC_PROG_INSTALL
    1.13  AC_PROG_RANLIB
    1.14 +AC_PROG_CPP
    1.15 +AC_PROG_MKDIR_P
    1.16  
    1.17  
    1.18 -
    1.19 -# SDL stuff 
    1.20 -SDL_VERSION=1.2.2
    1.21 -AM_PATH_SDL($SDL_VERSION,[
    1.22 -],[
    1.23 -AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).])
    1.24 -])
    1.25 +# Checks for libraries.
    1.26 +AC_CHECK_LIB([SDL], [SDL_Init])
    1.27 +AC_CHECK_LIB([pthread], [pthread_create])
    1.28  
    1.29  
    1.30  
    1.31  # Checks for header files.
    1.32 -AC_CHECK_HEADERS([limits.h locale.h stddef.h stdlib.h string.h unistd.h])
    1.33 +AC_CHECK_HEADERS([arpa/inet.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/socket.h unistd.h])
    1.34  
    1.35  # Checks for typedefs, structures, and compiler characteristics.
    1.36  AC_HEADER_STDBOOL
    1.37  AC_C_INLINE
    1.38 +AC_TYPE_INT16_T
    1.39 +AC_TYPE_INT32_T
    1.40 +AC_TYPE_INT64_T
    1.41 +AC_TYPE_INT8_T
    1.42  AC_TYPE_SIZE_T
    1.43 +AC_TYPE_UINT16_T
    1.44 +AC_TYPE_UINT32_T
    1.45 +AC_TYPE_UINT64_T
    1.46 +AC_TYPE_UINT8_T
    1.47  AC_CHECK_TYPES([ptrdiff_t])
    1.48  
    1.49  # Checks for library functions.
    1.50  AC_FUNC_ERROR_AT_LINE
    1.51 +AC_FUNC_FORK
    1.52 +AC_FUNC_MALLOC
    1.53  AC_FUNC_MKTIME
    1.54 -AC_FUNC_MALLOC
    1.55  AC_FUNC_REALLOC
    1.56  AC_FUNC_STRCOLL
    1.57 -AC_CHECK_FUNCS([floor localeconv memchr memset  dnl
    1.58 -                modf pow setlocale sqrt         dnl
    1.59 -                strchr strcspn strerror         dnl
    1.60 -                strpbrk strrchr strstr strtoul])
    1.61 +AC_CHECK_FUNCS([floor ftruncate gethostbyname gethostname inet_ntoa localeconv memchr memset modf pow setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strpbrk strrchr strstr strtoul])
    1.62 +
    1.63 +
    1.64 +
    1.65  
    1.66  AC_CONFIG_FILES([Makefile 
    1.67  	         src/Makefile
     2.1 --- a/src/common/Makefile.am	Sun Mar 04 14:35:54 2012 -0600
     2.2 +++ b/src/common/Makefile.am	Sun Mar 04 16:56:20 2012 -0600
     2.3 @@ -28,4 +28,4 @@
     2.4  	-DSDL				\
     2.5  	-DSYSCONFDIR=\"$(sysconfdir)\"
     2.6  
     2.7 -AM_CXXFLAGS = -fno-exceptions @SDL_CFLAGS@
     2.8 +AM_CXXFLAGS = -fno-exceptions 
     3.1 --- a/src/gba/Makefile.am	Sun Mar 04 14:35:54 2012 -0600
     3.2 +++ b/src/gba/Makefile.am	Sun Mar 04 16:56:20 2012 -0600
     3.3 @@ -45,4 +45,4 @@
     3.4  	-DSDL				\
     3.5  	-DSYSCONFDIR=\"$(sysconfdir)\"
     3.6  
     3.7 -AM_CXXFLAGS = -fno-exceptions @SDL_CFLAGS@
     3.8 +AM_CXXFLAGS = -fno-exceptions 
     4.1 --- a/src/gba/remote.cpp	Sun Mar 04 14:35:54 2012 -0600
     4.2 +++ b/src/gba/remote.cpp	Sun Mar 04 16:56:20 2012 -0600
     4.3 @@ -121,12 +121,15 @@
     4.4  	  fprintf(stderr, "Error listening\n");
     4.5  	  exit(-1);
     4.6  	}
     4.7 -      socklen_t len = sizeof(addr);
     4.8 +
     4.9  
    4.10  #ifdef WIN32
    4.11        int flag = 0;
    4.12        ioctlsocket(s, FIONBIO, (unsigned long *)&flag);
    4.13  #endif // WIN32
    4.14 +
    4.15 +      socklen_t len = sizeof(addr);
    4.16 +
    4.17        int s2 = accept(s, (sockaddr *)&addr, &len);
    4.18        if (s2 > 0)
    4.19  	{