add support for machine type too

This commit is contained in:
Julien Danjou 2008-01-24 22:10:10 +01:00
parent 00bf08178c
commit d6e5e810ab
2 changed files with 9 additions and 4 deletions

View File

@ -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 ")");

View File

@ -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}])