Index: configure.in =================================================================== RCS file: /home/freeciv/CVS/freeciv/configure.in,v retrieving revision 1.165 diff -u -r1.165 configure.in --- configure.in 2001/08/10 14:54:11 1.165 +++ configure.in 2001/08/28 23:33:52 @@ -476,7 +476,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h) +AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h) dnl Avoid including the unix emulation layer if we build mingw executables dnl There would be type conflicts between winsock and bsd/unix includes if test "x$MINGW32" != "xyes"; then @@ -506,7 +506,7 @@ AC_CHECK_FUNCS(fileno gethostname getpwuid gettimeofday inet_aton \ select snooze strerror strcasecmp strncasecmp \ - strlcat strlcpy strstr usleep vsnprintf) + strlcat strlcpy strstr usleep vsnprintf uname) dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is dnl deliberate. Index: client/clinet.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v retrieving revision 1.41 diff -u -r1.41 clinet.c --- client/clinet.c 2001/08/25 10:25:33 1.41 +++ client/clinet.c 2001/08/28 23:33:52 @@ -53,6 +53,10 @@ #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + #include "capstr.h" #include "fcintl.h" #include "game.h" @@ -312,6 +316,10 @@ char *server; int port; char str[512]; + char machine_string[128]; +#ifdef HAVE_UNAME + struct utsname un; +#endif if ((proxy_url = getenv("http_proxy"))) { if (strncmp(proxy_url,"http://",strlen("http://"))) { @@ -378,13 +386,30 @@ my_closesocket(s); return NULL; } + +#ifdef HAVE_UNAME + uname(&un); + my_snprintf(machine_string,sizeof(machine_string), + "%s %s [%s]", + un.sysname, + un.release, + un.machine); +#else /* ! HAVE_UNAME */ + /* Fill in here if you are making a binary without sys/utsname.h and know + the OS name, release number, and machine architechture */ + my_snprintf(machine_string,sizeof(machine_string), + "unknown unknown [unknown]"); +#endif /* HAVE_UNAME */ + my_snprintf(str,sizeof(str), - "GET %s%s%s HTTP/1.0\r\nUser-Agent: Freeciv/%s %s\r\n\r\n", + "GET %s%s%s HTTP/1.0\r\nUser-Agent: Freeciv/%s %s %s\r\n\r\n", proxy_url ? "" : "/", urlpath, proxy_url ? metaserver : "", VERSION_STRING, - client_string); + client_string, + machine_string); + #ifdef HAVE_FDOPEN f=fdopen(s,"r+"); fwrite(str,1,strlen(str),f);