* Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME,

and GCC_VERSION.
* fhandler_proc.cc (format_proc_version):  Add build machine and GCC
version information as on Linux.
This commit is contained in:
Yaakov Selkowitz 2011-04-04 11:12:48 +00:00
parent 26968b5c05
commit a2ef34bfd8
3 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME,
and GCC_VERSION.
* fhandler_proc.cc (format_proc_version): Add build machine and GCC
version information as on Linux.
2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Corinna Vinschen <corinna@vinschen.de>

View File

@ -287,6 +287,9 @@ sysconf_CFLAGS:=-fomit-frame-pointer
uinfo_CFLAGS:=-fomit-frame-pointer
endif
fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\""
fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\""
_cygwin_crt0_common_STDINCFLAGS:=yes
libstdcxx_wrapper_STDINCFLAGS:=yes
cxx_STDINCFLAGS:=yes

View File

@ -361,15 +361,19 @@ fhandler_proc::fill_filebuf ()
static _off64_t
format_proc_version (void *, char *&destbuf)
{
tmp_pathbuf tp;
char *buf = tp.c_get ();
char *bufptr = buf;
struct utsname uts_name;
uname (&uts_name);
destbuf = (char *) crealloc_abort (destbuf, strlen (uts_name.sysname)
+ strlen (uts_name.release)
+ strlen (uts_name.version)
+ 4);
return __small_sprintf (destbuf, "%s %s %s\n",
uts_name.sysname, uts_name.release, uts_name.version);
bufptr += __small_sprintf (bufptr, "%s version %s (%s@%s) (%s) %s\n",
uts_name.sysname, uts_name.release, USERNAME, HOSTNAME,
GCC_VERSION, uts_name.version);
destbuf = (char *) crealloc_abort (destbuf, bufptr - buf);
memcpy (destbuf, buf, bufptr - buf);
return bufptr - buf;
}
static _off64_t