From d6e5e810abc7bf4bde5fbf1d53a4bb5c1a852996 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 24 Jan 2008 22:10:10 +0100 Subject: [PATCH] add support for machine type too --- awesome.c | 8 ++++++-- configure.ac | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/awesome.c b/awesome.c index 797ca252..4a6db01c 100644 --- a/awesome.c +++ b/awesome.c @@ -229,8 +229,12 @@ main(int argc, char *argv[]) if(!a_strcmp("-v", argv[1]) || !a_strcmp("--version", argv[1])) { printf("awesome version " VERSION " (" RELEASE ")\ncompiled on "__DATE__" "__TIME__); -#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) - printf(" by gcc version %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); +#if defined(__GNUC__) \ + && defined(__GNUC_MINOR__) \ + && defined(__GNUC_PATCHLEVEL__) \ + && defined(AWESOME_COMPILE_MACHINE) + printf(" for %s by gcc version %d.%d.%d", + AWESOME_COMPILE_MACHINE, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); #endif #if defined(AWESOME_COMPILE_HOST) && defined(AWESOME_COMPILE_BY) printf(" (" AWESOME_COMPILE_BY "@" AWESOME_COMPILE_HOST ")"); diff --git a/configure.ac b/configure.ac index f3597382..69c559d9 100644 --- a/configure.ac +++ b/configure.ac @@ -25,8 +25,9 @@ subdir-objects ]) AC_DEFINE_UNQUOTED([RELEASE], ["Productivity Breaker"]) -AC_DEFINE_UNQUOTED([AWESOME_COMPILE_HOST], ["`hostname`"]) -AC_DEFINE_UNQUOTED([AWESOME_COMPILE_BY], ["`whoami`"]) +AC_DEFINE_UNQUOTED([AWESOME_COMPILE_HOST], ["`type hostname > /dev/null && hostname`"]) +AC_DEFINE_UNQUOTED([AWESOME_COMPILE_BY], ["`type whoami > /dev/null && whoami`"]) +AC_DEFINE_UNQUOTED([AWESOME_COMPILE_MACHINE], ["`type uname > /dev/null && uname -m`"]) AC_MSG_CHECKING([package version according to autoconf]) AC_MSG_RESULT([${PACKAGE_VERSION}])