Hi Werner,
autoconf is not my cup of tea, but I've tried anyway.
See the patch attached below.
Perhaps you can clean it up and merge manually.
Thanks
Cosimo
On Tue, Jan 9, 2018 at 12:42 PM Werner LEMBERG <[email protected]> wrote:
>
> Buon giorno!
>
>
> > The freetype-config script seems to be required in order to build
> > ttfautohint. The configure.ac errors if it cannot find one.
> > However, building freetype library with cmake, or with nmake (visual
> > studio), does not install that script to the prefix bin.
>
> Indeed, I haven't considered that.
>
> > If I understand well, that's simply a wrapper for pkg-config, or [a
> > shell script] for systems that don't have pkg-config, to get the
> > C preprocessor flags and libraries options to link with freetype.
>
> Exactly.
>
> > Would it be possible to modify the configure.ac so that if the
> > freetype-config script is not found, or if it's set to some empty
> > variable, then the user can provide custom FREETYE_CPPFLAGS and
> > FREETYPE_LIBS variables?
>
> Certainly. Can you provide a patch? It was just my laziness that no
> such solution exists yet.
>
> > Or another option would be to modify the freetype CMakeList.txt to
> > also configure and install the freetype-config script.
>
> This sounds like a useful idea. However, I'm very weak with cmake –
> this is essentially contributed stuff...
>
> > That would allow me to use cmake at least for building freetype (and
> > harfbuzz). For ttfautohint itself, that's more complicated because
> > of gnulib (I've asked on the cmake mailing list for help).
>
> Yes. gnulib is very tightly tied to both make and the GNU autotools.
>
>
> Werner
>
--
Cosimo Lupo
diff --git a/configure.ac b/configure.ac
index f007118..43b8179 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,23 +129,36 @@ AC_ARG_WITH([freetype-config],
[freetype_config=$withval],
[freetype_config=yes])
+AC_ARG_VAR([FREETYPE_CPPFLAGS],
+ [C compiler flags for FREETYPE, overriding freetype-config])
+AC_ARG_VAR([FREETYPE_LIBS],
+ [C linker flags for FREETYPE, overriding freetype-config])
+
if test "$freetype_config" = "yes"; then
AC_PATH_TOOL(ft_config,
freetype-config,
no)
- if test "$ft_config" = "no"; then
- AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
- fi
else
ft_config="$freetype_config"
fi
-FREETYPE_CPPFLAGS="`$ft_config --cflags`"
-FREETYPE_LIBS="`$ft_config --libtool`"
+if test "$ft_config" = "no"; then
+ if { test -z "$FREETYPE_CPPFLAGS" || test -z "$FREETYPE_LIBS"; }; then
+ AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
+ fi
+else
+ if test -z "$FREETYPE_CPPFLAGS"; then
+ FREETYPE_CPPFLAGS="`$ft_config --cflags`"
+ fi
+
+ if test -z "$FREETYPE_LIBS"; then
+ FREETYPE_LIBS="`$ft_config --libtool`"
-# many platforms no longer install .la files for system libraries
-if test ! -f "$FREETYPE_LIBS"; then
- FREETYPE_LIBS="`$ft_config --libs`"
+ # many platforms no longer install .la files for system libraries
+ if test ! -f "$FREETYPE_LIBS"; then
+ FREETYPE_LIBS="`$ft_config --libs`"
+ fi
+ fi
fi
AC_SUBST([FREETYPE_CPPFLAGS])
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel