summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2017-11-20 17:20:34 +0530
committerAkira TAGOH <akira@tagoh.org>2017-11-20 17:29:39 +0530
commit64895e719dd8d18c52a31d66cd189915bc8c00b8 (patch)
treee6d0c7e99df095d8622b9d95e43de2655ef634b0
parente73b5dcbf2248b538e06bc92a71700dacbec983b (diff)
Add the check of PCF_CONFIG_OPTION_LONG_FAMILY_NAMES back
This isn't enabled by default in freetype so need to check it for testsuites
-rw-r--r--configure.ac13
-rw-r--r--test/Makefile.am12
-rw-r--r--test/out.expected-long-family-names (renamed from test/out.expected)0
-rw-r--r--test/out.expected-no-long-family-names8
-rw-r--r--test/run-test.sh2
5 files changed, 33 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 7fa755f3..71f32c10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,9 +321,22 @@ AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
fontconfig_save_libs="$LIBS"
+fontconfig_save_cflags="$CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS"
+CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
AC_CHECK_FUNCS(FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_Get_X11_Font_Format)
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <ft2build.h>
+ #include FT_CONFIG_OPTIONS_H
+ #ifndef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
+ # error "No pcf long family names support"
+ #endif
+ ]])], [have_pcf_long_family_names=yes], [have_pcf_long_family_names=no])
+AM_CONDITIONAL(FREETYPE_PCF_LONG_FAMILY_NAMES, test "x$have_pcf_long_family_names" = xyes)
+
LIBS="$fontconfig_save_libs"
+CFLAGS="$fontconfig_save_cflags"
#
# Check expat configuration
diff --git a/test/Makefile.am b/test/Makefile.am
index 9f8fe656..2e7f2433 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -8,11 +8,21 @@ AM_TESTS_ENVIRONMENT= \
EXEEXT=${EXEEXT}; export EXEEXT; \
$(NULL)
+BUILT_SOURCES = out.expected
+
SH_LOG_COMPILER = sh
TESTS=run-test.sh
TESTDATA=4x6.pcf 8x16.pcf out.expected fonts.conf.in
+if FREETYPE_PCF_LONG_FAMILY_NAMES
+out.expected: $(srcdir)/out.expected-long-family-names
+ cp $(srcdir)/out.expected-long-family-names out.expected
+else
+out.expected: $(srcdir)/out.expected-no-long-family-names
+ cp $(srcdir)/out.expected-no-long-family-names out.expected
+endif
+
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
check_PROGRAMS =
@@ -45,7 +55,7 @@ check_PROGRAMS += test-bz96676
test_bz96676_LDADD = $(top_builddir)/src/libfontconfig.la
TESTS += test-bz96676
-EXTRA_DIST=run-test.sh $(TESTDATA)
+EXTRA_DIST=run-test.sh $(TESTDATA) out.expected-long-family-names out.expected-no-long-family-names
CLEANFILES=
diff --git a/test/out.expected b/test/out.expected-long-family-names
index d0697236..d0697236 100644
--- a/test/out.expected
+++ b/test/out.expected-long-family-names
diff --git a/test/out.expected-no-long-family-names b/test/out.expected-no-long-family-names
new file mode 100644
index 00000000..39634c50
--- /dev/null
+++ b/test/out.expected-no-long-family-names
@@ -0,0 +1,8 @@
+Fixed:pixelsize=16
+Fixed:pixelsize=6
+=
+Fixed:pixelsize=16
+Fixed:pixelsize=6
+=
+Fixed:pixelsize=16
+Fixed:pixelsize=6
diff --git a/test/run-test.sh b/test/run-test.sh
index 0697f722..e5bc32c3 100644
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -46,7 +46,7 @@ check () {
echo "=" >> out
$FCLIST - family pixelsize | sort >> out
tr -d '\015' <out >out.tmp; mv out.tmp out
- if cmp out $TESTDIR/$EXPECTED > /dev/null ; then : ; else
+ if cmp out $EXPECTED > /dev/null ; then : ; else
echo "*** Test failed: $TEST"
echo "*** output is in 'out', expected output in '$EXPECTED'"
exit 1