A way to check at runtime, since freetype 2.0.9, is<br><br>    - A  new function  named  `FT_Library_Version' has  been added  to<br>      return  the current  library's major,  minor, and  patch version<br>      numbers.   This is  important since  the  macros FREETYPE_MAJOR,<br>
      FREETYPE_MINOR,  and  FREETYPE_PATCH  cannot  be used  when  the<br>      library is dynamically linked by a program.<br><br>So it is possible to have compile-time, link-time,<br>and run-time library versions checked.<br>
<br>---<br><br>BTW, I just can't believe that building a simple program<br>with recent microsoft compilers can be so difficult.<br>There must be a saner way.<br><br>Martin<br><br><br><div class="gmail_quote">On Fri, Aug 21, 2009 at 12:20, Kelly O'Hair <span dir="ltr"><<a href="mailto:Kelly.Ohair@sun.com">Kelly.Ohair@sun.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Humm...  as much as building a freetype application tells us that the<br>
libraries work, I'm wondering if we could just do something like this<br>
in the makefile sanity check:<br>
<br>
ifdef OPENJDK<br>
  FREETYPE_VERSION_H=$(FREETYPE_HEADERS_PATH)/freetype/freetype.h<br>
  _FREETYPE_VER := \<br>
    if [ -f "${FREETYPE_VERSION_H}" ] ; then \<br>
      _major="`${GREP} 'define FREETYPE_MAJOR' | ${CUT} -d' ' -f3`" ; \<br>
      _minor="`${GREP} 'define FREETYPE_MINOR' | ${CUT} -d' ' -f3`" ; \<br>
      _micro="`${GREP} 'define FREETYPE_PATCH' | ${CUT} -d' ' -f3`" ; \<br>
      $(ECHO) "${_major}.${_minor}.${_micro}"; \<br>
    else \<br>
      $(ECHO) "0.0.0"; \<br>
    fi<br>
  FREETYPE_VER :=$(call GetVersion,"$(_FREETYPE_VER)")<br>
  FREETYPE_CHECK :=$(call CheckVersions,$(FREETYPE_VER),$(REQUIRED_FREETYPE_VERSION))<br>
<br>
sane-freetype:<br>
        @if [ "$(FREETYPE_CHECK)" != "same" -a "$(FREETYPE_CHECK)" != "newer" ]; then \<br>
          $(ECHO) "ERROR: The version of freetype being used is older than \n" \<br>
              "    the required version of '$(REQUIRED_FREETYPE_VERSION)'. \n" \<br>
              "    The version of freetype found was '$(FREETYPE_VER)'. \n" \<br>
              "" >> $(ERROR_FILE) ; \<br>
        fi<br>
<br>
else<br>
<br>
#do nothing  (not OpenJDK)<br>
sane-freetype:<br>
<br>
endif<br>
<br>
<br>
---<br>
Just a thought.... Then that whole freetype check program can go away,<br>
but if the libraries are wrong, we won't find out at sanity check time.<br>
<br>
(I have not tested the above logic)<br>
<br>
-kto<div><div></div><div class="h5"><br>
<br>
Tim Bell wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Kelly O'Hair wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Looks good Tim.<br>
</blockquote>
<br>
Thanks, Kelly.  I plan to push this fix to the build forest later today.<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I wish that freetype just had a simple version.h file we could check. :^(<br>
</blockquote>
<br>
I checked the freetype 2.3.5 include files... we could use this from<br>
include/freetype/freetype.h:<br>
<br>
  /*************************************************************************<br>
   *<br>
   *  @enum:<br>
   *    FREETYPE_XXX<br>
   *<br>
   *  @description:<br>
   *    These three macros identify the FreeType source code version.<br>
   *    Use @FT_Library_Version to access them at runtime.<br>
   *<br>
   *  @values:<br>
   *    FREETYPE_MAJOR :: The major version number.<br>
   *    FREETYPE_MINOR :: The minor version number.<br>
   *    FREETYPE_PATCH :: The patch level.<br>
   *<br>
   *  @note:<br>
   *    The version number of FreeType if built as a dynamic link library<br>
   *    with the `libtool' package is _not_ controlled by these three<br>
   *    macros.<br>
   */<br>
#define FREETYPE_MAJOR  2<br>
#define FREETYPE_MINOR  3<br>
#define FREETYPE_PATCH  5<br>
<br>
<br>
<br>
Tim<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-kto<br>
<br>
Tim Bell wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Folks<br>
<br>
When building OpenJDK, the freetype sanity check compiles a<br>
little program to test that the freetype include files and<br>
libraries are available, and also that the version number is<br>
acceptable.<br>
<br>
If building on Windows and using a Visual Studio compiler<br>
newer than 2003, this program will fail due to the new<br>
rules for accessing MSVCR??.dll. [1]<br>
<br>
I didn't make the up the rules, in fact I am extremely<br>
puzzled that Microsoft is forcing ALL external developers<br>
and ISVs to solve this problem.  I am trying to get the<br>
OpenJDK build to deal with them or at least tolerate<br>
them for those people out there who build OpenJDK on<br>
Windows.<br>
<br>
The bugzilla report:<br>
  <a href="https://bugs.openjdk.java.net/show_bug.cgi?id=100101" target="_blank">https://bugs.openjdk.java.net/show_bug.cgi?id=100101</a><br>
<br>
The code review:<br>
  <a href="http://cr.openjdk.java.net/%7Etbell/6705913/webrev.00/" target="_blank">http://cr.openjdk.java.net/~tbell/6705913/webrev.00/</a><br>
<br>
These changes build OK on all JPRT systems:<br>
<br>
linux_i586_2.6<br>
linux_x64_2.6<br>
solaris_i586_5.10<br>
solaris_sparc_5.10<br>
solaris_sparcv9_5.10<br>
solaris_x64_5.10-<br>
windows_i586_5.0<br>
windows_x64_5.2<br>
<br>
They also work on my Windows XP SP2 / Visual Studio 2008<br>
build machine.<br>
<br>
Thanks in advance-<br>
<br>
Tim<br>
<br>
[1] How to redistribute the Visual C++ Libraries with your application (Ben Anderson)<br>
<a href="http://blogs.msdn.com/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx" target="_blank">http://blogs.msdn.com/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx</a><br>

</blockquote></blockquote>
<br>
</blockquote>
</div></div></blockquote></div><br>