Freetype version check failure - copy of DLL failed

Tim Bell Tim.Bell at Sun.COM
Wed Sep 30 21:50:24 UTC 2009


Pete Brunet wrote:
> Thanks Tim,  It must be something else.  Here are my two environment
> variables:
> 
> ALT_FREETYPE_HEADERS_PATH=C:/Progra~1/GnuWin32/include
> ALT_FREETYPE_LIB_PATH=C:/Progra~1/GnuWin32/lib

Good - that looks OK.

>>> freetype was installed via the binary installer at
>>> http://gnuwin32.sourceforge.net/packages/freetype.htm.

After installing bits from there, I needed to copy bin/freetype6.dll
to lib/freetype6.dll

> At a minimum I have to edit
> C:\OpenJDK\jdk7\jdk\make\tools\freetypecheck\Makefile as follows:
> # change freetype.dll to freetype6.dll
> FREETYPE_DLL = $(FREETYPE_LIB_PATH)/freetype6.dll
> because there is no freetype.dll in C:\Program Files\GnuWin32, just
> freetype6.dll.

And then edit the makefile to reach for freetype6.dll, as you
did.  Here are my diffs:

% pwd
/cygdrive/g/OpenJDK/jdk/make/tools/freetypecheck

$ diff -u  Makefile.00 Makefile
--- Makefile.00 2009-08-19 18:39:51.531250000 -0700
+++ Makefile    2009-09-30 13:49:28.794625000 -0700
@@ -36,7 +36,7 @@
 # Start with CFLAGS (which gets us the required -xarch setting on solaris)
 ifeq ($(PLATFORM), windows)
   FT_OPTIONS  = /nologo $(CC_OBJECT_OUTPUT_FLAG)$(TEMPDIR)
-  FREETYPE_DLL = $(FREETYPE_LIB_PATH)/freetype.dll
+  FREETYPE_DLL = $(FREETYPE_LIB_PATH)/freetype6.dll
   FT_LD_OPTIONS  = $(FREETYPE_LIB_PATH)/freetype.lib
 else
   FT_OPTIONS  = $(CFLAGS)

Unfortunately, the freetype_versioncheck.exe that is created after
doing that fails to initialize:

When run in a Cygwin window:
$ g:/OpenJDK/build/windows-i586/btbins/freetype_versioncheck.exe
$ echo $?
34

When run in a DOS cmd window, I get an "Application Error" pop-up
that reads "The application failed to initialize properly (0xc0000022).
Click on OK to terminate the application" [OK]

If I look at freetype_versioncheck.exe using the dependancywalker
tool [1], it shows an unresolved reference to ZLIB1.DLL


When I switch my OpenJDK build environment back to use my existing
copy of freetype 2.3.4 [2], the versioncheck program builds, works
OK (no mention of ZLIB1.DLL), and prints:

$ g:/OpenJDK/build/windows-i586/btbins/freetype_versioncheck.exe
Required version of freetype: 2.3.0
Detected freetype headers: 2.3.4
Detected freetype library: 2.3.4
$ echo $?
0


> Here is my "make sanity" output:
> 
> ERROR: FreeType version  2.3.0  or higher is required.
>  make[2]: Entering directory
> `/cygdrive/c/OpenJDK/jdk7/jdk/make/tools/freetypecheck'
> c:/OpenJDK/jdk7/build/windows-i586/btbins/freetype_versioncheck.exe
> make[2]: Leaving directory
> `/cygdrive/c/OpenJDK/jdk7/jdk/make/tools/freetypecheck'
> Failed to build freetypecheck.
> 
> BTW, How do I put prints in the make file to see the values of the
> variables?

You could add "echo" lines to the commands run by a make rule.
Also, make commands are prefixed with '@' to make them silent.
Remove the '@' to see more output.

HTH-
  Tim

[1] http://www.dependencywalker.com/

[2] See step 8:
    http://blogs.sun.com/TimBell/entry/building_openjdk7_on_32_bit

    The files I modified are available here:
    http://cr.openjdk.java.net/~tbell/freetype/



More information about the build-dev mailing list