genunifont
src/static_shaders.c
src/genshader.c
-src/githead.h
+src/shl_githead.c
src/font_unifont_data.bin
docs/reference/*.txt
docs/reference/*.bak
#
# GIT-HEAD helper
-# The file ./src/githead.h contains a constant BUILD_GIT_HEAD which is defined
-# to the string returned by "git describe". We need to adjust this string for
-# every build and correctly rebuild any sources that depend on it. Therefore,
-# you should use this file rarely as it causes rebuilds on every git-commit.
+# The file ./src/shl_githead.c contains a constant "shl_git_head" which is
+# defined to the string returned by "git describe". We need to adjust this
+# string for every build and correctly rebuild any sources that depend on it.
+# Therefore, you should use this file rarely as it causes rebuilds on every
+# git-commit.
#
-# We have a helper-script ./src/genversion.sh that takes as argument the header
+# We have a helper-script ./src/genversion.sh that takes as argument the source
# file and creates it if necessary. It updates it only if the new git-describe
# string is different to the old one. So the file is only modified on changes.
# Hence, we can use it as normal dependency in this Makefile.
# "simply expanded" variable (:=) so the shell command is executed on
# variable-declaration and not during expansion.
#
-# Note that we must not clean ./src/githead.h ever! If we would, a distribution
-# tarball might delete that file and have no way to recreate it.
+# Note that we must not clean ./src/shl_githead.c ever! If we would, a
+# distribution tarball might delete that file and have no way to recreate it.
# We could delete it on something like "make maintainerclean", but then again,
# it seems unnecessary so lets simply not clean it at all.
#
# If the helper-script is executed in a directory that is not a git-repository
-# (like a distribution tarball) and githead.h exists, then it does nothing as it
-# expects githead.h to be correctly written by "make dist".
-# However, if githead.h does not exist, it will print a warning and write
-# "<unknown>" as git-revision.
-# This guarantees, that githead.h is always present and has the most correct
+# (like a distribution tarball) and shl_githead.c exists, then it does nothing
+# as it expects shl_githead.c to be correctly written by "make dist".
+# However, if shl_githead.c does not exist, it will print a warning and write
+# an unknown random git-revision.
+# This guarantees, that shl_githead.c is always present and has the most correct
# value that we can get under any conditions.
#
# The $(emptyvariable) expansion below is used for broken $(shell ...)
#
EXTRA_DIST += src/genversion.sh
-GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/githead.h")
+GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/shl_githead.c")
#
# SHL - Static Helper Library
noinst_LTLIBRARIES += libshl.la
libshl_la_SOURCES = \
+ src/shl_githead.h \
+ src/shl_githead.c \
src/shl_dlist.h \
src/shl_array.h \
src/shl_hashtable.h \
mod_unifont_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/font_unifont.c \
src/kmscon_mod_unifont.c
EXTRA_mod_unifont_la_DEPENDENCIES = $(UNIFONT_BIN)
mod_freetype2_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/font_freetype2.c \
src/kmscon_mod_freetype2.c
mod_freetype2_la_CPPFLAGS = \
mod_pango_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/font_pango.c \
src/kmscon_mod_pango.c
mod_pango_la_CPPFLAGS = \
mod_bbulk_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/text_bbulk.c \
src/kmscon_mod_bbulk.c
mod_bbulk_la_LIBADD = libshl.la
mod_gltex_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/text_gltex.c \
src/static_gl.h \
src/static_gl_math.c \
mod_cairo_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/text_cairo.c \
src/kmscon_mod_cairo.c
mod_cairo_la_CPPFLAGS = \
mod_pixman_la_SOURCES = \
src/kmscon_module_interface.h \
- src/githead.h \
src/text_pixman.c \
src/kmscon_mod_pixman.c
mod_pixman_la_CPPFLAGS = \
endif
kmscon_SOURCES = \
- src/githead.h \
src/conf.h \
src/conf.c \
src/pty.h \
#
# Generate $1 with:
-# #define BUILD_GIT_HEAD "<git-head-revision>"
+# const char shl_git_head[] = "<git-head-revision>";
# But do not touch $1 if the git-revision is already up-to-date.
#
else
if test $ISGIT = 0 ; then
echo "WARNING: version file $1 is missing"
- echo "#define BUILD_GIT_HEAD \"unknown-revision\""
+ echo "const char shl_git_head[] = \"UnknownRevision\";" >"$1"
exit 0
fi
fi
NEWREV=`git describe`
-NEWREV="#define BUILD_GIT_HEAD \"$NEWREV\""
+NEWREV="const char shl_git_head[] = \"$NEWREV\";"
#
# Exit if the file is already up to date.
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include "githead.h"
#include "kmscon_module.h"
#include "kmscon_module_interface.h"
#include "shl_dlist.h"
+#include "shl_githead.h"
#include "shl_log.h"
#include "shl_misc.h"
goto err_unload;
}
- if (strcmp(module->info.githead, BUILD_GIT_HEAD)) {
+ if (strcmp(module->info.githead, shl_git_head)) {
log_error("incompatible module %s (%s != %s)",
- file, module->info.githead, BUILD_GIT_HEAD);
+ file, module->info.githead, shl_git_head);
ret = -EFAULT;
goto err_unload;
}
#include <stdbool.h>
#include <stdlib.h>
-#include "githead.h"
#include "kmscon_module.h"
#include "shl_dlist.h"
+#include "shl_githead.h"
#include "shl_misc.h"
struct kmscon_module_info {
#define KMSCON_MODULE(_init, _load, _unload, _exit) \
struct kmscon_module module = { \
.info = { \
- .githead = BUILD_GIT_HEAD, \
+ .githead = shl_git_head, \
.date = __DATE__, \
.time = __TIME__, \
.init = _init, \
--- /dev/null
+/*
+ * shl - GIT-HEAD
+ *
+ * Copyright (c) 2011-2013 David Herrmann <dh.herrmann@googlemail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef SHL_GITHEAD_H
+#define SHL_GITHEAD_H
+
+extern const char shl_git_head[];
+
+#endif /* SHL_GITHEAD_H */
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
-#include "githead.h"
+#include "shl_githead.h"
#include "shl_log.h"
#include "shl_misc.h"
appname = "<unknown>";
log_format(LOG_DEFAULT_CONF, NULL, LOG_NOTICE,
"%s Revision %s %s %s", appname,
- BUILD_GIT_HEAD, __DATE__, __TIME__);
+ shl_git_head, __DATE__, __TIME__);
}