diff --git a/awesome-version-internal.h.in b/awesome-version-internal.h.in index 4157088f4..85d23b7c6 100644 --- a/awesome-version-internal.h.in +++ b/awesome-version-internal.h.in @@ -1,7 +1,7 @@ #ifndef _AWE_VERSION_INTERNAL_H_ #define _AWE_VERSION_INTERNAL_H_ -#define AWESOME_VERSION_INTERNAL "@AWESOME_VERSION_INTERNAL@" +#define AWESOME_VERSION "@AWESOME_VERSION@" #define AWESOME_COMPILE_MACHINE "@AWESOME_COMPILE_MACHINE@" #define AWESOME_COMPILE_BY "@AWESOME_COMPILE_BY@" #define AWESOME_COMPILE_HOSTNAME "@AWESOME_COMPILE_HOSTNAME@" diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index ebe341041..858fe35d0 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -161,7 +161,7 @@ ENDIF() IF(DEFINED PREFIX) SET(CMAKE_INSTALL_PREFIX ${PREFIX}) ENDIF() -SET(AWESOME_VERSION_INTERNAL devel ) +SET(AWESOME_VERSION ${VERSION} ) SET(AWESOME_COMPILE_MACHINE ${CMAKE_SYSTEM_PROCESSOR} ) SET(AWESOME_COMPILE_HOSTNAME $ENV{HOSTNAME} ) SET(AWESOME_COMPILE_BY $ENV{USER} ) diff --git a/common/version.c b/common/version.c index 50cb72cc1..38f3f5279 100644 --- a/common/version.c +++ b/common/version.c @@ -32,7 +32,7 @@ void eprint_version(const char *const executable) { - printf("%s (awesome) " AWESOME_VERSION_INTERNAL + printf("%s (awesome) " AWESOME_VERSION " (" AWESOME_RELEASE ")\n" "built", executable); @@ -50,4 +50,13 @@ eprint_version(const char *const executable) exit(EXIT_SUCCESS); } +/** Get version string. + * \return A string describing the current version. + */ +const char* +version_string(void) +{ + return AWESOME_VERSION; +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/common/version.h b/common/version.h index d6c1ad5db..4445a671d 100644 --- a/common/version.h +++ b/common/version.h @@ -23,5 +23,6 @@ #define AWESOME_COMMON_VERSION_H void eprint_version(const char *const executable) __attribute__ ((noreturn)); +const char *version_string(void); #endif diff --git a/config.h.in b/config.h.in index 64b993207..41e50aff8 100644 --- a/config.h.in +++ b/config.h.in @@ -1,10 +1,8 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#define AWESOME_RELEASE "@AWESOME_RELEASE@" #define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@" #define AWESOME_CONF_PATH "@AWESOME_CONF_PATH@" -#define VERSION "@VERSION@" #cmakedefine WITH_DBUS #cmakedefine WITH_IMLIB2 diff --git a/lua.c b/lua.c index 9cdb6e57d..47786622a 100644 --- a/lua.c +++ b/lua.c @@ -45,6 +45,7 @@ #include "screen.h" #include "layouts/tile.h" #include "common/socket.h" +#include "common/version.h" extern awesome_t globalconf; @@ -540,7 +541,7 @@ luaA_init(void) luaA_openlib(L, "keybinding", awesome_keybinding_methods, awesome_keybinding_meta); lua_pushliteral(L, "AWESOME_VERSION"); - lua_pushliteral(L, VERSION); + lua_pushstring(L, version_string()); lua_settable(L, LUA_GLOBALSINDEX); luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?.lua\"");