* 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> 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Corinna Vinschen <corinna@vinschen.de> Corinna Vinschen <corinna@vinschen.de>

View File

@ -287,6 +287,9 @@ sysconf_CFLAGS:=-fomit-frame-pointer
uinfo_CFLAGS:=-fomit-frame-pointer uinfo_CFLAGS:=-fomit-frame-pointer
endif 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 _cygwin_crt0_common_STDINCFLAGS:=yes
libstdcxx_wrapper_STDINCFLAGS:=yes libstdcxx_wrapper_STDINCFLAGS:=yes
cxx_STDINCFLAGS:=yes cxx_STDINCFLAGS:=yes

View File

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