aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Steinberg <david@sonabuzz.com>2019-12-17 10:22:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-21 13:17:29 +0000
commit8188d68191b8bc2349319e804aa5e5df6e019ec2 (patch)
tree1e9ffddb1c3cfbc817c424f0990347e6d7d4fa68
parent88c4b717b27092615f8fb08c3e060aaa092d1d11 (diff)
downloadpsplash-8188d68191b8bc2349319e804aa5e5df6e019ec2.tar.gz
psplash-8188d68191b8bc2349319e804aa5e5df6e019ec2.tar.bz2
psplash-8188d68191b8bc2349319e804aa5e5df6e019ec2.zip
Support --with-font configure option to use other font headers
Signed-off-by: David Steinberg <david@sonabuzz.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac6
-rw-r--r--psplash.c6
3 files changed, 11 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 2374fe3..7e0b23e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,11 @@
bin_PROGRAMS=psplash psplash-write
-AM_CFLAGS = $(GCC_FLAGS) -D_GNU_SOURCE
+AM_CFLAGS = $(GCC_FLAGS) -D_GNU_SOURCE -DFONT_HEADER=\"$(FONT_NAME)-font.h\" -DFONT_DEF=$(FONT_NAME)_font
psplash_SOURCES = psplash.c psplash.h psplash-fb.c psplash-fb.h \
psplash-console.c psplash-console.h \
psplash-colors.h psplash-config.h \
- psplash-poky-img.h psplash-bar-img.h radeon-font.h
+ psplash-poky-img.h psplash-bar-img.h $(FONT_NAME)-font.h
psplash_write_SOURCES = psplash-write.c psplash.h
diff --git a/configure.ac b/configure.ac
index 107b182..c2807f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,12 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" = "xyes"])
AC_SUBST(GCC_FLAGS)
+AC_ARG_WITH([font],
+ AS_HELP_STRING([--with-font], [Set font to use (default is 'radeon')]),
+ [FONT_NAME=$withval],
+ [FONT_NAME=radeon])
+AC_SUBST([FONT_NAME])
+
AC_OUTPUT([
Makefile
])
diff --git a/psplash.c b/psplash.c
index 92e7d61..a81a483 100644
--- a/psplash.c
+++ b/psplash.c
@@ -15,7 +15,7 @@
#include "psplash-colors.h"
#include "psplash-poky-img.h"
#include "psplash-bar-img.h"
-#include "radeon-font.h"
+#include FONT_HEADER
#define SPLIT_LINE_POS(fb) \
( (fb)->height \
@@ -37,7 +37,7 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)
{
int w, h;
- psplash_fb_text_size (&w, &h, &radeon_font, msg);
+ psplash_fb_text_size (&w, &h, &FONT_DEF, msg);
DBG("displaying '%s' %ix%i\n", msg, w, h);
@@ -54,7 +54,7 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)
(fb->width-w)/2,
SPLIT_LINE_POS(fb) - h,
PSPLASH_TEXT_COLOR,
- &radeon_font,
+ &FONT_DEF,
msg);
}