freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] wl/freetype-ot-svg-from-scratch-new e7b77e4bf 6/6: [builds/u


From: Werner Lemberg
Subject: [freetype2] wl/freetype-ot-svg-from-scratch-new e7b77e4bf 6/6: [builds/unix] Handle `librsvg` for demo programs.
Date: Mon, 3 Jan 2022 13:29:45 -0500 (EST)

branch: wl/freetype-ot-svg-from-scratch-new
commit e7b77e4bfb2418512c9f73c72f87146b274e31ed
Author: Werner Lemberg <wl@gnu.org>
Commit: Werner Lemberg <wl@gnu.org>

    [builds/unix] Handle `librsvg` for demo programs.
    
    * builds/unix/configure.raw: Check for 'librsvg'.
    (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on...
    (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
    
    * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by...
    (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
    
    * devel/ftoption.h (FT_CONFIG_OPTION_SYSTEM_ZLIB): Activate this by default.
---
 builds/unix/configure.raw | 27 ++++++++++++++++++++++-----
 builds/unix/unix-cc.in    | 10 ++++++----
 devel/ftoption.h          |  2 +-
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index c5221dab9..5659597df 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -514,19 +514,36 @@ if test x"$with_brotli" = xyes -a "$have_brotli" = no; 
then
 fi
 
 
-# check for librt
+# Checks for the demo programs.
 #
-# We need `clock_gettime' for the `ftbench' demo program.
+# FreeType doesn't need this.  However, since the demo program repository
+# doesn't come with a `configure` script of its own, we integrate the tests
+# here for simplicity.
+
+# We need `clock_gettime` from 'librt' for the `ftbench' demo program.
 #
-# The code is modeled after gnulib's file `clock_time.m4', ignoring
+# The code is modeled after gnulib's file `clock_time.m4`, ignoring
 # very old Solaris systems.
-
 LIB_CLOCK_GETTIME=
 AC_SEARCH_LIBS([clock_gettime],
                [rt],
                [test "$ac_cv_search_clock_gettime" = "none required" \
                 || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
-AC_SUBST([LIB_CLOCK_GETTIME])
+
+# librsvg is needed to demonstrate SVG support.
+PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.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"
+  FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
+fi
+
+AC_SUBST([FT_DEMO_CFLAGS])
+AC_SUBST([FT_DEMO_LDFLAGS])
 
 
 # Some options handling SDKs/archs in CFLAGS should be copied
diff --git a/builds/unix/unix-cc.in b/builds/unix/unix-cc.in
index 89be45016..f67e7fa06 100644
--- a/builds/unix/unix-cc.in
+++ b/builds/unix/unix-cc.in
@@ -106,9 +106,7 @@ endif
 
 # Linker flags.
 #
-LDFLAGS           := @LDFLAGS@
-LIB_CLOCK_GETTIME := @LIB_CLOCK_GETTIME@  # for ftbench
-
+LDFLAGS := @LDFLAGS@
 
 # export symbols
 #
@@ -118,11 +116,15 @@ EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym
 CCexe        := $(CCraw_build) # used to compile `apinames' only
 
 
-# Library linking
+# Library linking.
 #
 LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
                           -rpath $(libdir) -version-info $(version_info) \
                           $(LDFLAGS) -no-undefined \
                           -export-symbols $(EXPORTS_LIST)
 
+# For the demo programs.
+FT_DEMO_CFLAGS := @FT_DEMO_CFLAGS@
+FT_DEMO_LDFLAGS := @FT_DEMO_LDFLAGS@
+
 # EOF
diff --git a/devel/ftoption.h b/devel/ftoption.h
index cd3d41d38..f0fec7af1 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -224,7 +224,7 @@ FT_BEGIN_HEADER
    *   `configure` script) and you define this macro, you also have to pass
    *   `SYSTEM_ZLIB=yes` as an argument to make.
    */
-/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
+#define FT_CONFIG_OPTION_SYSTEM_ZLIB
 
 
   /**************************************************************************



reply via email to

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