diff --git a/awesome.c b/awesome.c index 8ea72618..797ca252 100644 --- a/awesome.c +++ b/awesome.c @@ -228,7 +228,14 @@ main(int argc, char *argv[]) args_ok = 0; if(!a_strcmp("-v", argv[1]) || !a_strcmp("--version", argv[1])) { - printf("awesome " VERSION " (" RELEASE ")\n"); + 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__); +#endif +#if defined(AWESOME_COMPILE_HOST) && defined(AWESOME_COMPILE_BY) + printf(" (" AWESOME_COMPILE_BY "@" AWESOME_COMPILE_HOST ")"); +#endif + printf("\n"); return EXIT_SUCCESS; } else if(!a_strcmp("-h", argv[1]) || !a_strcmp("--help", argv[1])) diff --git a/configure.ac b/configure.ac index 901a4435..f3597382 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,8 @@ subdir-objects ]) AC_DEFINE_UNQUOTED([RELEASE], ["Productivity Breaker"]) +AC_DEFINE_UNQUOTED([AWESOME_COMPILE_HOST], ["`hostname`"]) +AC_DEFINE_UNQUOTED([AWESOME_COMPILE_BY], ["`whoami`"]) AC_MSG_CHECKING([package version according to autoconf]) AC_MSG_RESULT([${PACKAGE_VERSION}])