freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master aee6b9472 2/2: * builds/unix/configure.raw: Add optio


From: Werner Lemberg
Subject: [freetype2] master aee6b9472 2/2: * builds/unix/configure.raw: Add option `--with-librsvg`.
Date: Fri, 1 Apr 2022 08:58:17 -0400 (EDT)

branch: master
commit aee6b9472732c627ff844d4fb75a588d388b6570
Author: Werner Lemberg <wl@gnu.org>
Commit: Werner Lemberg <wl@gnu.org>

    * builds/unix/configure.raw: Add option `--with-librsvg`.
    
    Since 'librsvg' is written in Rust, this option allows distributions to
    avoid a dependency on the entire Rust toolchain to provide the FreeType demo
    programs.
    
    Suggested by Lars Wendler in !156.
---
 builds/unix/configure.raw | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index cfb073efa..f4cb228b5 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -530,16 +530,28 @@ AC_SEARCH_LIBS([clock_gettime],
                [test "$ac_cv_search_clock_gettime" = "none required" \
                 || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
 
-# 'librsvg' is needed to demonstrate SVG support.
-PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
-                  [have_librsvg="yes (pkg-config)"], [have_librsvg=no])
-
 FT_DEMO_CFLAGS=""
 FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
 
-if test "$have_librsvg" != no; then
-  FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
-  FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
+# 'librsvg' is needed to demonstrate SVG support.
+AC_ARG_WITH([librsvg],
+  [AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
+                  [support OpenType SVG fonts in FreeType demo programs 
@<:@default=auto@:>@])],
+  [], [with_librsvg=auto])
+
+have_librsvg=no
+if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
+  PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
+                    [have_librsvg="yes (pkg-config)"], [:])
+
+  if test "$have_librsvg" != no; then
+    FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
+    FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
+  fi
+fi
+
+if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
+  AC_MSG_ERROR([librsvg support requested but library not found])
 fi
 
 AC_SUBST([FT_DEMO_CFLAGS])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]