Commit 2f260409a4bc4c80554740f3a7f869ffea17ab3b

Werner Lemberg 2002-01-13T06:36:02

* builds/unix/freetype2.a4: The script was still buggy. * builds/unix/freetype-config.in: Make it really work for any install prefix.

diff --git a/ChangeLog b/ChangeLog
index c1bee10..15cd686 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-13  Werner Lemberg  <wl@gnu.org>
+
+	* builds/unix/freetype2.a4: The script was still buggy.
+	* builds/unix/freetype-config.in: Make it really work for any install
+	prefix.
+
 2002-01-10  Werner Lemberg  <wl@gnu.org>
 
 	* builds/unix/freetype2.a4: Fix some serious bugs.
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
index 09bd6e4..b3ed2df 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -18,11 +18,11 @@ EOF
   exit $1
 }
 
-if test $# -eq 0; then
+if test $# -eq 0 ; then
   usage 1 1>&2
 fi
 
-while test $# -gt 0; do
+while test $# -gt 0 ; do
   case "$1" in
   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
   *) optarg= ;;
@@ -65,25 +65,28 @@ while test $# -gt 0; do
 done
 
 if test "$local_prefix" = "yes" ; then
-    if test "$exec_prefix_set" != "yes"; then
+    if test "$exec_prefix_set" != "yes" ; then
       exec_prefix=$prefix
     fi
 fi
 
-if test "$echo_prefix" = "yes"; then
+if test "$echo_prefix" = "yes" ; then
  echo $prefix
 fi
 
-if test "$echo_exec_prefix" = "yes"; then
+if test "$echo_exec_prefix" = "yes" ; then
  echo $exec_prefix
 fi
 
-if test "$echo_cflags" = "yes"; then
+if test "$echo_cflags" = "yes" ; then
  cflags="-I@includedir@/freetype2"
- echo $cflags $includes
+ if test "@includedir@" != "/usr/include" ; then
+  echo -I@includedir@ $cflags
+ else
+  echo $cflags
 fi
 
-if test "$echo_libs" = "yes"; then
+if test "$echo_libs" = "yes" ; then
  libs="-lfreetype"
  if test "@libdir@" != "/usr/lib" ; then
   echo -L@libdir@ $libs
@@ -92,7 +95,7 @@ if test "$echo_libs" = "yes"; then
  fi
 fi
 
-if test "$echo_libtool" = "yes"; then
+if test "$echo_libtool" = "yes" ; then
  convlib="libfreetype.la"
  echo @libdir@/$convlib
 fi
diff --git a/builds/unix/freetype2.m4 b/builds/unix/freetype2.m4
index 29358bd..21c6445 100644
--- a/builds/unix/freetype2.m4
+++ b/builds/unix/freetype2.m4
@@ -55,8 +55,8 @@ else
          sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
   ft_min_micro_version=`echo $min_ft_version | \
          sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-  if test "x$enable_fttest" = "xyes" ; then
-    ft_config_is_lt=no
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
     if test $ft_config_major_version -lt $ft_min_major_version ; then
       ft_config_is_lt=yes
     else
@@ -72,8 +72,8 @@ else
         fi
       fi
     fi
-    if test "x$ft_config_is_lt" = "xno" ; then
-      ifelse([$3], , :, [$3])
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
     else
       ac_save_CFLAGS="$CFLAGS"
       ac_save_LIBS="$LIBS"
@@ -108,9 +108,9 @@ main()
       CFLAGS="$ac_save_CFLAGS"
       LIBS="$ac_save_LIBS"
     fi             # test $ft_config_version -lt $ft_min_version
-  fi               # test "x$enable_fttest" = "xyes"
+  fi               # test x$enable_fttest = xyes
 fi                 # test "$FT2_CONFIG" = "no"
-if test "x$no_ft" = x ; then
+if test x$no_ft = x ; then
    AC_MSG_RESULT(yes)
    ifelse([$2], , :, [$2])
 else
@@ -121,10 +121,18 @@ else
      echo "*** your path, or set the FT2_CONFIG environment variable to the"
      echo "*** full path to freetype-config."
    else
-     echo "*** The FreeType test program failed to run.  If your system uses"
-     echo "*** shared libraries and they are installed outside the normal"
-     echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
-     echo "*** (or whatever is appropiate for your system) is correctly set."
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
    fi
    FT2_CFLAGS=""
    FT2_LIBS=""