--- freetype-config	2018-01-07 22:47:06.914664432 +1100
+++ freetype-config	2018-01-07 22:45:46.582664432 +1100
@@ -12,10 +12,24 @@
 LC_ALL=C
 export LC_ALL
 
+use_pkg_config=true
 
 # if `pkg-config' is available, use values from `freetype2.pc'
 /usr/bin/pkg-config --atleast-pkgconfig-version 0.24 >/dev/null 2>&1
-if test $? -eq 0 ; then
+if test $? -eq 1; then
+  use_pkg_config=false
+fi
+
+# are we targeting a foreign architecture?
+if test -z $PKG_CONFIG_LIBDIR; then
+  # test if freetyep2.pc is installed for the host architecture
+  /usr/bin/pkg-config freetype2 >/dev/null 2>&1
+  if test $? -eq 1; then
+      use_pkg_config=false
+  fi
+fi
+
+if test "$use_pkg_config" = "true"; then
   # note that option `--variable' is not affected by the
   # PKG_CONFIG_SYSROOT_DIR environment variable
   if test "x$SYSROOT" != "x" ; then
