Here is my first cut at adding a check for the FreeType libraries and
header files to the Wine configuration scripts. It's basically a copy
of Marcus' CUPS stuff.
Since this is the first time I've done anything with autoconf, I figured
I'd post it here for review:
diff -urN ../wine-20010502cvs/configure.in ./configure.in
--- ../wine-20010502cvs/configure.in Wed May 2 12:57:30 2001
+++ ./configure.in Thu May 3 01:44:48 2001
@@ -378,6 +378,19 @@
)
AC_SUBST(CUPSLIBS)
+FREETYPELIBS=""
+dnl **** Check for FreeType 2 ****
+wine_cv_warn_ftsystem_h=no
+AC_CHECK_LIB(freetype,FT_Init_FreeType,
+ AC_CHECK_HEADER(freetype2/freetype/ftsystem.h,
+ AC_DEFINE(HAVE_FREETYPE)
+ FREETYPELIBS="-lfreetype"
+ FREETYPEINCL="-I/usr/include/freetype2",
+ wine_cv_warn_ftsystem_h=yes)
+)
+AC_SUBST(FREETYPELIBS)
+AC_SUBST(FREETYPEINCL)
+
dnl **** Check for IPX (currently Linux only) ****
AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
AC_TRY_COMPILE(
@@ -1316,6 +1329,15 @@
echo "*** Note: You have cups runtime libraries, but no development"
echo "*** libraries. Install the cups-devel package or whichever
package"
echo "*** contains cups.h to enable CUPS support in WINE."
+fi
+
+if test "$wine_cv_warn_ftsystem_h" = "yes"
+then
+ echo
+ echo "*** Note: Your system appears to have the FreeType 2 runtime
libraries"
+ echo "*** installed, but the corresponding header files are not
installed in"
+ echo "*** /usr/include/freetype2/freetype. Install the
freetype-devel package"
+ echo "*** to enable TrueType font support in Wine."
fi
echo
diff -urN ../wine-20010502cvs/dlls/wineps/Makefile.in
./dlls/wineps/Makefile.in
--- ../wine-20010502cvs/dlls/wineps/Makefile.in Sun Apr 29 13:21:22 2001
+++ ./dlls/wineps/Makefile.in Thu May 3 01:45:13 2001
@@ -6,7 +6,8 @@
SOVERSION = 1.0
ALTNAMES = wineps16
IMPORTS = user32 gdi32 winspool.drv kernel32 ntdll
-EXTRALIBS = @CUPSLIBS@
+EXTRALIBS = @CUPSLIBS@ @FREETYPELIBS@
+EXTRAINCL = @FREETYPEINCL@
C_SRCS = \
afm.c \
diff -urN ../wine-20010502cvs/include/acconfig.h ./include/acconfig.h
--- ../wine-20010502cvs/include/acconfig.h Sun Apr 29 13:21:22 2001
+++ ./include/acconfig.h Thu May 3 01:45:04 2001
@@ -122,3 +122,6 @@
/* Define if we have CUPS */
#undef HAVE_CUPS
+
+/* Define if FreeType 2 is installed */
+#undef HAVE_FREETYPE
It seems to work on my system (Red Hat 7.1), although for some reason it
can't even detect the FreeType library when the freetype-devel package
is removed (no great loss).
At this point I have a couple of questions:
* Does anyone see anything wrong with this?
* I've omitted the resulting changes to wine/configure and
wine/include/config.h.in from the patch above. Is this form more
convenient for final submission, or should I include the changes to
those files? (If the latter is the case, I'll probably go ahead and
submit the autoconf changes before I get any code written, so that
wine/configure doesn't get hugely out of sync.)
Thanks!
--
========================================================================
Ian Pilcher ian.pilcher(a)home.com
========================================================================