From 67988bb31f65a513a6d1df64d74aa1ca4946fb54 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 10 Nov 2006 14:30:22 +0000 Subject: [PATCH] * Allow setting the font directory using --datadir / --datarootdir. --- configure.ac | 1 + doc/Makefile.am | 2 +- doc/{toilet.1 => toilet.1.in} | 4 ++-- src/Makefile.am | 1 + src/main.c | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) rename doc/{toilet.1 => toilet.1.in} (98%) diff --git a/configure.ac b/configure.ac index 728b5ab..389af7b 100644 --- a/configure.ac +++ b/configure.ac @@ -77,5 +77,6 @@ AC_OUTPUT([ tools/Makefile fonts/Makefile doc/Makefile + doc/toilet.1 ]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 83612b4..7573e7f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,6 +1,6 @@ # $Id: Makefile.am 871 2006-09-25 15:58:33Z sam $ -EXTRA_DIST = $(man_MANS) +EXTRA_DIST = toilet.1.in man_MANS = toilet.1 diff --git a/doc/toilet.1 b/doc/toilet.1.in similarity index 98% rename from doc/toilet.1 rename to doc/toilet.1.in index d15c5b7..fb87503 100644 --- a/doc/toilet.1 +++ b/doc/toilet.1.in @@ -55,7 +55,7 @@ Use the given font instead of the default value. Fonts are or .B .tlf files stored in the -.B /usr/share/figlet +.B @datarootdir@/figlet directory. There is also a special built-in font called .I term that serves as a fallback if no font is available. @@ -63,7 +63,7 @@ that serves as a fallback if no font is available. .B \-d, \-\-directory Specify the directory in which to look for fonts. The default value is set at build time and usually defaults to -.B /usr/share/figlet. +.B @datarootdir@/figlet. .TP .B \-w, \-\-width Set the output width. By default, diff --git a/src/Makefile.am b/src/Makefile.am index 804ffc6..a909ef1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ toilet_SOURCES = main.c toilet.h \ filter.c filter.h \ export.c export.h \ term.c figlet.c +toilet_CPPFLAGS = -DFONTDIR=\"$(datadir)/figlet\" toilet_CFLAGS = `pkg-config --cflags cucul` toilet_LDFLAGS = `pkg-config --libs cucul` @GETOPT_LIBS@ @ZLIB_LIBS@ diff --git a/src/main.c b/src/main.c index fef4517..919f0c0 100644 --- a/src/main.c +++ b/src/main.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) cx->export = "utf8"; cx->font = "smblock"; - cx->dir = "/usr/share/figlet/"; + cx->dir = FONTDIR; cx->term_width = 80;