2008-01-26 18:00:47 +01:00
|
|
|
/*
|
2008-02-27 09:04:17 +01:00
|
|
|
* version.c - version message utility functions
|
2008-01-25 11:49:18 +01:00
|
|
|
*
|
|
|
|
* Copyright © 2008 Julien Danjou <julien@danjou.info>
|
|
|
|
* Copyright © 2008 Hans Ulrich Niedermann <hun@n-dimensional.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2014-03-30 20:07:48 +02:00
|
|
|
#include "config.h"
|
|
|
|
#include "common/version.h"
|
|
|
|
#include "awesome-version-internal.h"
|
|
|
|
|
2008-01-25 11:49:18 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2012-04-23 16:46:53 +02:00
|
|
|
#include <lualib.h>
|
|
|
|
#include <lauxlib.h>
|
|
|
|
|
2008-01-25 11:49:18 +01:00
|
|
|
/** \brief Print version message and quit program.
|
2008-02-27 09:00:42 +01:00
|
|
|
* \param executable program name
|
2008-01-25 11:49:18 +01:00
|
|
|
*/
|
|
|
|
void
|
2009-04-08 18:53:53 +02:00
|
|
|
eprint_version(void)
|
2008-01-25 11:49:18 +01:00
|
|
|
{
|
2009-04-08 18:53:53 +02:00
|
|
|
printf("awesome " AWESOME_VERSION
|
2008-01-25 11:49:18 +01:00
|
|
|
" (" AWESOME_RELEASE ")\n"
|
2009-04-08 18:53:53 +02:00
|
|
|
" • Build:");
|
2008-01-25 11:49:18 +01:00
|
|
|
#if defined(__DATE__) && defined(__TIME__)
|
2008-06-04 20:26:47 +02:00
|
|
|
printf(" " __DATE__ " " __TIME__);
|
2008-01-25 11:49:18 +01:00
|
|
|
#endif
|
|
|
|
printf(" for %s", AWESOME_COMPILE_MACHINE);
|
|
|
|
#if defined(__GNUC__) \
|
|
|
|
&& defined(__GNUC_MINOR__) \
|
|
|
|
&& defined(__GNUC_PATCHLEVEL__)
|
|
|
|
printf(" by gcc version %d.%d.%d",
|
|
|
|
__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
|
|
|
#endif
|
|
|
|
printf(" (%s@%s)\n", AWESOME_COMPILE_BY, AWESOME_COMPILE_HOSTNAME);
|
2012-04-23 16:46:53 +02:00
|
|
|
|
2012-06-08 02:19:07 +02:00
|
|
|
lua_State *L = luaL_newstate();
|
2012-04-23 16:46:53 +02:00
|
|
|
luaopen_base(L);
|
|
|
|
lua_getglobal(L, "_VERSION");
|
|
|
|
printf(" • Compiled against " LUA_RELEASE
|
|
|
|
" (running with %s)\n", lua_tostring(L, -1));
|
|
|
|
lua_close(L);
|
|
|
|
|
2008-08-11 12:08:16 +02:00
|
|
|
printf(" • D-Bus support: ");
|
2008-06-24 20:25:42 +02:00
|
|
|
#ifdef WITH_DBUS
|
2008-07-02 18:26:56 +02:00
|
|
|
printf("✔\n");
|
2008-06-24 20:25:42 +02:00
|
|
|
#else
|
2008-07-02 18:26:56 +02:00
|
|
|
printf("✘\n");
|
2008-06-24 20:25:42 +02:00
|
|
|
#endif
|
2008-01-25 11:49:18 +01:00
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
|
2011-09-11 16:50:01 +02:00
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|