small bugfixes and memory optimizations
[swftools.git] / configure
index b76453c..89c2c7b 100755 (executable)
--- a/configure
+++ b/configure
@@ -677,7 +677,6 @@ INSTALL_SCRIPT
 INSTALL_DATA
 LN_S
 UNCOMPRESS
-PKG_CONFIG
 AREXT
 AR
 SLEXT
@@ -697,12 +696,7 @@ HAVE_UNISTD_H
 FREETYPE_CONFIG
 DEVICE_OPENGL
 lame_in_source
-LIBART_CFLAGS
-LIBART_LIBS
 art_in_source
-POPPLER_CFLAGS
-POPPLER_LIBS
-CXXCPP
 xpdf_in_source
 splash_in_source
 AVIFILE_CONFIG
@@ -731,13 +725,7 @@ CPPFLAGS
 CXX
 CXXFLAGS
 CCC
-CPP
-PKG_CONFIG
-LIBART_CFLAGS
-LIBART_LIBS
-POPPLER_CFLAGS
-POPPLER_LIBS
-CXXCPP'
+CPP'
 
 
 # Initialize some variables set by options.
@@ -1326,7 +1314,6 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-external-libart  use external libart library (currently broken)
   --with-poppler          use poppler instead of internal xpdf (currently broken)
 
 Some influential environment variables:
@@ -1340,15 +1327,6 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CPP         C preprocessor
-  PKG_CONFIG  path to pkg-config utility
-  LIBART_CFLAGS
-              C compiler flags for LIBART, overriding pkg-config
-  LIBART_LIBS linker flags for LIBART, overriding pkg-config
-  POPPLER_CFLAGS
-              C compiler flags for POPPLER, overriding pkg-config
-  POPPLER_LIBS
-              linker flags for POPPLER, overriding pkg-config
-  CXXCPP      C++ preprocessor
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1805,12 +1783,6 @@ if test "${enable_lame+set}" = set; then
 fi
 
 
-# Check whether --with-external-libart was given.
-if test "${with_external_libart+set}" = set; then
-  withval=$with_external_libart; EXTERNAL_LIBART=true
-fi
-
-
 # Check whether --with-poppler was given.
 if test "${with_poppler+set}" = set; then
   withval=$with_poppler; USE_POPPLER=true
@@ -1818,7 +1790,7 @@ fi
 
 
 PACKAGE=swftools
-VERSION=2008-07-11-0020
+VERSION=0.9.0
 
 
 # ------------------------------------------------------------------
@@ -1995,6 +1967,10 @@ case $host_os in
        CFLAGS="$CFLAGS"
        CXXFLAGS="$CXXFLAGS -fno-rtti"
        SHARED="-bundle"
+       if test -d /opt/local/include && test -d /opt/local/lib; then
+           CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
+           LDFLAGS="${LDFLAGS} -L/opt/local/lib"
+       fi
        # Use fink packages if available.
        #if test -d /sw/include && test -d /sw/lib; then
        #    CPPFLAGS="${CPPFLAGS} -I/sw/include"
@@ -3327,7 +3303,7 @@ if test "x$GCC_IS_OK" '=' "x";then
     echo "***************************************************"
     echo "* Your gcc is too old to compile this!"
     echo "* "
-    echo "* The last version compilable by this compiler is "
+    echo "* The last version compileable by this compiler is "
     echo "* swftools 0.7.0, which you can download from "
     echo "* http://www.swftools.org/swftools-0.7.0.tar.gz "
     echo "* ."
@@ -3837,126 +3813,6 @@ done
 
 
 
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-       if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-       _pkg_min_version=0.9.0
-       { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
-       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-               { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-       else
-               { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-               PKG_CONFIG=""
-       fi
-
-fi
-
 OBJEXT="o"
 AREXT=".a"
 CXXLIBS="-lstdc++"
@@ -5411,7 +5267,8 @@ done
 
 
 
-for ac_header in zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h
+
+for ac_header in zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/mman.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -6006,7 +5863,8 @@ fi
 
 
 
-for ac_func in popen wcschr wcsdup mkstemp stat lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo
+
+for ac_func in popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -6100,9 +5958,9 @@ fi
 done
 
 
-{ echo "$as_me:$LINENO: checking for signed" >&5
-echo $ECHO_N "checking for signed... $ECHO_C" >&6; }
-if test "${ac_cv_type_signed+set}" = set; then
+{ echo "$as_me:$LINENO: checking for signed char" >&5
+echo $ECHO_N "checking for signed char... $ECHO_C" >&6; }
+if test "${ac_cv_type_signed_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6112,7 +5970,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef signed ac__type_new_;
+typedef signed char ac__type_new_;
 int
 main ()
 {
@@ -6141,26 +5999,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_signed=yes
+  ac_cv_type_signed_char=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_signed=no
+       ac_cv_type_signed_char=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signed" >&5
-echo "${ECHO_T}$ac_cv_type_signed" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_char" >&5
+echo "${ECHO_T}$ac_cv_type_signed_char" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of signed" >&5
-echo $ECHO_N "checking size of signed... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_signed+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of signed char" >&5
+echo $ECHO_N "checking size of signed char... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_signed_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
@@ -6172,7 +6030,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 int
 main ()
 {
@@ -6209,7 +6067,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 int
 main ()
 {
@@ -6263,7 +6121,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 int
 main ()
 {
@@ -6300,7 +6158,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 int
 main ()
 {
@@ -6364,7 +6222,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 int
 main ()
 {
@@ -6403,15 +6261,15 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_signed=$ac_lo;;
-'') if test "$ac_cv_type_signed" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed)
+?*) ac_cv_sizeof_signed_char=$ac_lo;;
+'') if test "$ac_cv_type_signed_char" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed char)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed)
+echo "$as_me: error: cannot compute sizeof (signed char)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed=0
+     ac_cv_sizeof_signed_char=0
    fi ;;
 esac
 else
@@ -6422,7 +6280,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed ac__type_sizeof_;
+   typedef signed char ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -6474,40 +6332,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_signed=`cat conftest.val`
+  ac_cv_sizeof_signed_char=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_signed" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed)
+if test "$ac_cv_type_signed_char" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed char)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed)
+echo "$as_me: error: cannot compute sizeof (signed char)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed=0
+     ac_cv_sizeof_signed_char=0
    fi
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed" >&5
-echo "${ECHO_T}$ac_cv_sizeof_signed" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_char" >&5
+echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED $ac_cv_sizeof_signed
+#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for unsigned" >&5
-echo $ECHO_N "checking for unsigned... $ECHO_C" >&6; }
-if test "${ac_cv_type_unsigned+set}" = set; then
+{ echo "$as_me:$LINENO: checking for signed short" >&5
+echo $ECHO_N "checking for signed short... $ECHO_C" >&6; }
+if test "${ac_cv_type_signed_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6517,7 +6375,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef unsigned ac__type_new_;
+typedef signed short ac__type_new_;
 int
 main ()
 {
@@ -6546,26 +6404,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_unsigned=yes
+  ac_cv_type_signed_short=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_unsigned=no
+       ac_cv_type_signed_short=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_short" >&5
+echo "${ECHO_T}$ac_cv_type_signed_short" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of unsigned" >&5
-echo $ECHO_N "checking size of unsigned... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_unsigned+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of signed short" >&5
+echo $ECHO_N "checking size of signed short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_signed_short+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
@@ -6577,7 +6435,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 int
 main ()
 {
@@ -6614,7 +6472,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 int
 main ()
 {
@@ -6668,7 +6526,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 int
 main ()
 {
@@ -6705,7 +6563,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 int
 main ()
 {
@@ -6769,7 +6627,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 int
 main ()
 {
@@ -6808,15 +6666,15 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned=$ac_lo;;
-'') if test "$ac_cv_type_unsigned" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned)
+?*) ac_cv_sizeof_signed_short=$ac_lo;;
+'') if test "$ac_cv_type_signed_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned)
+echo "$as_me: error: cannot compute sizeof (signed short)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_unsigned=0
+     ac_cv_sizeof_signed_short=0
    fi ;;
 esac
 else
@@ -6827,7 +6685,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned ac__type_sizeof_;
+   typedef signed short ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -6879,40 +6737,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned=`cat conftest.val`
+  ac_cv_sizeof_signed_short=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_unsigned" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned)
+if test "$ac_cv_type_signed_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned)
+echo "$as_me: error: cannot compute sizeof (signed short)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_unsigned=0
+     ac_cv_sizeof_signed_short=0
    fi
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_signed_short" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED $ac_cv_sizeof_unsigned
+#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for signed long" >&5
-echo $ECHO_N "checking for signed long... $ECHO_C" >&6; }
-if test "${ac_cv_type_signed_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for signed" >&5
+echo $ECHO_N "checking for signed... $ECHO_C" >&6; }
+if test "${ac_cv_type_signed+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6922,7 +6780,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef signed long ac__type_new_;
+typedef signed ac__type_new_;
 int
 main ()
 {
@@ -6951,26 +6809,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_signed_long=yes
+  ac_cv_type_signed=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_signed_long=no
+       ac_cv_type_signed=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_long" >&5
-echo "${ECHO_T}$ac_cv_type_signed_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signed" >&5
+echo "${ECHO_T}$ac_cv_type_signed" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of signed long" >&5
-echo $ECHO_N "checking size of signed long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_signed_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of signed" >&5
+echo $ECHO_N "checking size of signed... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_signed+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
@@ -6982,7 +6840,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 int
 main ()
 {
@@ -7019,7 +6877,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 int
 main ()
 {
@@ -7073,7 +6931,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 int
 main ()
 {
@@ -7110,7 +6968,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 int
 main ()
 {
@@ -7174,7 +7032,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 int
 main ()
 {
@@ -7213,15 +7071,15 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_signed_long=$ac_lo;;
-'') if test "$ac_cv_type_signed_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long)
+?*) ac_cv_sizeof_signed=$ac_lo;;
+'') if test "$ac_cv_type_signed" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed long)
+echo "$as_me: error: cannot compute sizeof (signed)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed_long=0
+     ac_cv_sizeof_signed=0
    fi ;;
 esac
 else
@@ -7232,7 +7090,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long ac__type_sizeof_;
+   typedef signed ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -7284,40 +7142,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_signed_long=`cat conftest.val`
+  ac_cv_sizeof_signed=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_signed_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long)
+if test "$ac_cv_type_signed" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed long)
+echo "$as_me: error: cannot compute sizeof (signed)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed_long=0
+     ac_cv_sizeof_signed=0
    fi
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_signed_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed" >&5
+echo "${ECHO_T}$ac_cv_sizeof_signed" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_LONG $ac_cv_sizeof_signed_long
+#define SIZEOF_SIGNED $ac_cv_sizeof_signed
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for unsigned long" >&5
-echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; }
-if test "${ac_cv_type_unsigned_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for signed long long" >&5
+echo $ECHO_N "checking for signed long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_signed_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7327,7 +7185,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef unsigned long ac__type_new_;
+typedef signed long long ac__type_new_;
 int
 main ()
 {
@@ -7356,26 +7214,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_unsigned_long=yes
+  ac_cv_type_signed_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_unsigned_long=no
+       ac_cv_type_signed_long_long=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_signed_long_long" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of unsigned long" >&5
-echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_unsigned_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of signed long long" >&5
+echo $ECHO_N "checking size of signed long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_signed_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
@@ -7387,7 +7245,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 int
 main ()
 {
@@ -7424,7 +7282,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 int
 main ()
 {
@@ -7478,7 +7336,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 int
 main ()
 {
@@ -7515,7 +7373,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 int
 main ()
 {
@@ -7579,7 +7437,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 int
 main ()
 {
@@ -7618,15 +7476,15 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_unsigned_long=$ac_lo;;
-'') if test "$ac_cv_type_unsigned_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
+?*) ac_cv_sizeof_signed_long_long=$ac_lo;;
+'') if test "$ac_cv_type_signed_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long)
+echo "$as_me: error: cannot compute sizeof (signed long long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_unsigned_long=0
+     ac_cv_sizeof_signed_long_long=0
    fi ;;
 esac
 else
@@ -7637,7 +7495,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
+   typedef signed long long ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -7689,40 +7547,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_long=`cat conftest.val`
+  ac_cv_sizeof_signed_long_long=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_unsigned_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
+if test "$ac_cv_type_signed_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long)
+echo "$as_me: error: cannot compute sizeof (signed long long)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_unsigned_long=0
+     ac_cv_sizeof_signed_long_long=0
    fi
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_signed_long_long" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
+#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for signed long long" >&5
-echo $ECHO_N "checking for signed long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_signed_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking for void*" >&5
+echo $ECHO_N "checking for void*... $ECHO_C" >&6; }
+if test "${ac_cv_type_voidp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7732,7 +7590,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef signed long long ac__type_new_;
+typedef void* ac__type_new_;
 int
 main ()
 {
@@ -7761,26 +7619,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_signed_long_long=yes
+  ac_cv_type_voidp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_signed_long_long=no
+       ac_cv_type_voidp=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signed_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_signed_long_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5
+echo "${ECHO_T}$ac_cv_type_voidp" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of signed long long" >&5
-echo $ECHO_N "checking size of signed long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_signed_long_long+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of void*" >&5
+echo $ECHO_N "checking size of void*... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_voidp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
@@ -7792,7 +7650,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -7829,7 +7687,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -7883,7 +7741,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -7920,7 +7778,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -7984,7 +7842,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 int
 main ()
 {
@@ -8023,15 +7881,15 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
-?*) ac_cv_sizeof_signed_long_long=$ac_lo;;
-'') if test "$ac_cv_type_signed_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long)
+?*) ac_cv_sizeof_voidp=$ac_lo;;
+'') if test "$ac_cv_type_voidp" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed long long)
+echo "$as_me: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed_long_long=0
+     ac_cv_sizeof_voidp=0
    fi ;;
 esac
 else
@@ -8042,7 +7900,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef signed long long ac__type_sizeof_;
+   typedef void* ac__type_sizeof_;
 static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
 static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
 #include <stdio.h>
@@ -8094,165 +7952,135 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_signed_long_long=`cat conftest.val`
+  ac_cv_sizeof_voidp=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_signed_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long)
+if test "$ac_cv_type_voidp" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (signed long long)
+echo "$as_me: error: cannot compute sizeof (void*)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
    else
-     ac_cv_sizeof_signed_long_long=0
+     ac_cv_sizeof_voidp=0
    fi
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_signed_long_long" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5
+echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long
+#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for unsigned long long" >&5
-echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_unsigned_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef unsigned long long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_unsigned_long_long=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_unsigned_long_long=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; }
 
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of unsigned long long" >&5
-echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then
+# Extract the first word of "freetype-config", so it can be a program name with args.
+set dummy freetype-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_FREETYPE_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
+  case $FREETYPE_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy=""$PATH:/usr/local/bin:/sw/bin:/opt/local/bin""
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FREETYPE_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+  ;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+fi
+FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG
+if test -n "$FREETYPE_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $FREETYPE_CONFIG" >&5
+echo "${ECHO_T}$FREETYPE_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+OLDCPPFLAGS="${CPPFLAGS}"
+OLDLIBS="${LIBS}"
+if test "x${FREETYPE_CONFIG}" '!=' "x"; then
+    CPPFLAGS="$CPPFLAGS "`$FREETYPE_CONFIG --cflags`
+else if test -d /usr/include/freetype2; then
+    CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2"
+else if test -d /usr/local/include/freetype2; then
+    CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2"
+fi
+fi
+fi
+
+if test "x${FREETYPE_CONFIG}" '=' "x";then
+    # if we didn't find the freetype-config program, we won't
+    # know where the libs are expected to be. So just blindly
+    # try to link against them.
+    { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
+echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
+if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfreetype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char FT_Init_FreeType ();
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
+return FT_Init_FreeType ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -8261,80 +8089,53 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_freetype_FT_Init_FreeType=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_lo=`expr $ac_mid + 1`
-                       if test $ac_lo -le $ac_mid; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid + 1`
+       ac_cv_lib_freetype_FT_Init_FreeType=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
+echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
+if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
+  HAVE_LIB_FREETYPE=1
+fi
 
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+
+for ac_header in ft2build.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -8353,785 +8154,106 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_unsigned_long_long=$ac_lo;;
-'') if test "$ac_cv_type_unsigned_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long long)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_unsigned_long_long=0
-   fi ;;
-esac
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
-       return 1;
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
-       return 1;
-      fprintf (f, "%lu\n", i);
-    }
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_long_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_unsigned_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long long)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_unsigned_long_long=0
-   fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
-_ACEOF
-
-
-
-
-
-# Extract the first word of "freetype-config", so it can be a program name with args.
-set dummy freetype-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_FREETYPE_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $FREETYPE_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy=""$PATH:/usr/local/bin:/sw/bin:/opt/local/bin""
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_FREETYPE_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG
-if test -n "$FREETYPE_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $FREETYPE_CONFIG" >&5
-echo "${ECHO_T}$FREETYPE_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-
-OLDCPPFLAGS="${CPPFLAGS}"
-OLDLIBS="${LIBS}"
-if test "x${FREETYPE_CONFIG}" '!=' "x"; then
-    CPPFLAGS="$CPPFLAGS "`$FREETYPE_CONFIG --cflags`
-else if test -d /usr/include/freetype2; then
-    CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2"
-else if test -d /usr/local/include/freetype2; then
-    CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2"
-fi
-fi
-fi
-
-if test "x${FREETYPE_CONFIG}" '=' "x";then
-    # if we didn't find the freetype-config program, we won't
-    # know where the libs are expected to be. So just blindly
-    # try to link against them.
-    { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
-echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FT_Init_FreeType ();
-int
-main ()
-{
-return FT_Init_FreeType ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_freetype_FT_Init_FreeType=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
-echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
-  HAVE_LIB_FREETYPE=1
-fi
-
-fi
-
-
-for ac_header in ft2build.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- HAVE_FT2BUILD_H=1
-fi
-
-done
-
-if test "x${HAVE_FT2BUILD_H}" '=' "x";then
-
-for ac_header in freetype/freetype.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
+       ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- HAVE_FREETYPE_FREETYPE_H=1
-fi
-
-done
-
-fi
-
-if test "x${HAVE_LIB_FREETYPE}" '!=' "x" -o \
-        "x${FREETYPE_CONFIG}" '!=' "x";then
-    if test "x${HAVE_FREETYPE_FREETYPE_H}" '!=' "x";then
-       HAVE_FREETYPE=1
-    fi
-    if test "x${HAVE_FT2BUILD_H}" '!=' "x";then
-       HAVE_FREETYPE=1
-    fi
-fi
-
-if test "x${HAVE_FREETYPE}" = "x1"; then
-    if test "x${FREETYPE_CONFIG}" '!=' "x"; then
-       LIBS="$LIBS "`$FREETYPE_CONFIG --libs`
-    else
-       LIBS="$LIBS -lfreetype"
-    fi
-
-    if test "x${HAVE_FT2BUILD_H}" = "x1"; then
-       HAVE_FT2BUILD_H_DEFINE='#define HAVE_FT2BUILD_H'
-    fi
-
-    { echo "$as_me:$LINENO: checking whether we can compile the freetype test program" >&5
-echo $ECHO_N "checking whether we can compile the freetype test program... $ECHO_C" >&6; }
-
-    cat > conftest.c << EOF
-$HAVE_FT2BUILD_H_DEFINE
-
-#ifdef HAVE_FT2BUILD_H
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include FT_SIZES_H
-#include FT_SFNT_NAMES_H
-#include FT_TRUETYPE_IDS_H
-#include FT_OUTLINE_H
-#else
-#include <freetype/freetype.h>
-#include <freetype/ftglyph.h>
-#include <freetype/ftsizes.h>
-#include <freetype/ftsnames.h>
-#include <freetype/ttnameid.h>
-#include <freetype/ftoutln.h>
-#endif
-
-int main()
-{
-    FT_Library ftlibrary;
-    FT_Face face;
-    FT_Error error;
-    FT_ULong charcode;
-    FT_UInt gindex;
-    FT_Glyph glyph;
-    FT_BBox bbox;
-    FT_Matrix matrix;
-    FT_UInt i;
-    char* name = 0;
-    char italic, bold;
-
-    FT_Init_FreeType(&ftlibrary);
-    FT_New_Face(ftlibrary, "filename", 0, &face);
-    i = face->num_glyphs - 1;
-    italic = face->style_flags&FT_STYLE_FLAG_ITALIC;
-    bold = face->style_flags&FT_STYLE_FLAG_BOLD;
-    FT_Get_Postscript_Name(face);
-    FT_Get_Char_Index(face, 33);
-    FT_Get_First_Char(face, &i);
-    FT_Get_Next_Char(face, 33, &i);
-    if(FT_HAS_GLYPH_NAMES(face)) {
-       FT_Get_Glyph_Name(face, 33, name, 127);
-    }
-    FT_Load_Glyph(face, 33, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
-    FT_Get_Glyph(face->glyph, &glyph);
-    FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &bbox);
-    FT_Done_Glyph(glyph);
-    FT_Done_Face(face);
-    FT_Done_FreeType(ftlibrary);
-    return 0;
-}
-EOF
-
-    ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
-    if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-       { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FREETYPE 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FREETYPE_FREETYPE_H 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_FREETYPE 1
-_ACEOF
-  # for ttf2tp1
-    else
-       echo "configure: failed program was:" >&5
-       cat conftest.c >&5
-       HAVE_FREETYPE=0
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-    fi
-    rm -f conftest*
-fi
-
-# if the above didn't work out, reset all changes to the compiler variables.
-if test "x${HAVE_FREETYPE}" '!=' "x1"; then
-    CPPFLAGS=$OLDCPPFLAGS
-    LIBS=$OLDLIBS
-fi
-
-
-
-OLDCPPFLAGS="${CPPFLAGS}"
-OLDLIBS="${LIBS}"
-
-if test -d /usr/include/fontconfig; then
-    CPPFLAGS="$CPPFLAGS -I/usr/include/fontconfig"
-fi
-
-{ echo "$as_me:$LINENO: checking for FcInit in -lfontconfig" >&5
-echo $ECHO_N "checking for FcInit in -lfontconfig... $ECHO_C" >&6; }
-if test "${ac_cv_lib_fontconfig_FcInit+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfontconfig  $LIBS"
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FcInit ();
-int
-main ()
-{
-return FcInit ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_fontconfig_FcInit=yes
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_fontconfig_FcInit=no
+  ac_header_preproc=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcInit" >&5
-echo "${ECHO_T}$ac_cv_lib_fontconfig_FcInit" >&6; }
-if test $ac_cv_lib_fontconfig_FcInit = yes; then
-  HAVE_LIB_FONTCONFIG=1
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ HAVE_FT2BUILD_H=1
 fi
 
+done
 
-for ac_header in fontconfig.h
+if test "x${HAVE_FT2BUILD_H}" '=' "x";then
+
+for ac_header in freetype/freetype.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -9265,246 +8387,144 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
- HAVE_FONTCONFIG_H=1
+ HAVE_FREETYPE_FREETYPE_H=1
 fi
 
 done
 
-
-if test "x${HAVE_LIB_FONTCONFIG}" != "x";then
-if test "x${HAVE_FONTCONFIG_H}" != "x";then
-    HAVE_FONTCONFIG=1
 fi
-fi
-
-if test "x${HAVE_FONTCONFIG}" = "x1"; then
-    LIBS="$LIBS -lfontconfig"
-{ echo "$as_me:$LINENO: checking whether we can compile the fontconfig test program" >&5
-echo $ECHO_N "checking whether we can compile the fontconfig test program... $ECHO_C" >&6; }
 
-if (echo $LIBS | grep lfreetype >/dev/null 2>&1); then
-    #move freetype library to the end of libraries, otherwise fontconfig
-    #won't compile.
-    LIBS=`echo $LIBS | sed -e 's/-lfreetype//g' -e 's/$/ -lfreetype/'`
+if test "x${HAVE_LIB_FREETYPE}" '!=' "x" -o \
+        "x${FREETYPE_CONFIG}" '!=' "x";then
+    if test "x${HAVE_FREETYPE_FREETYPE_H}" '!=' "x";then
+       HAVE_FREETYPE=1
+    fi
+    if test "x${HAVE_FT2BUILD_H}" '!=' "x";then
+       HAVE_FREETYPE=1
+    fi
 fi
 
-cat > conftest.c << EOF
-#include <string.h>
-#include <fontconfig.h>
-
-int main()
-{
-    FcPattern *pattern, *match;
-    FcResult result;
-    FcChar8 *v;
-    char*s1="abc",*s2="ABC";
-    strcasecmp(s1,s2);
-    FcInit();
-    pattern = FcPatternBuild(0, FC_FAMILY, FcTypeString, "", 0);
-    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
-    FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
-
-    FcConfig*c = FcConfigCreate();
-    FcConfigParseAndLoad(c, (FcChar8*)"", 1);
-    FcConfigBuildFonts(c);
-    FcConfigSetCurrent(c);
-
-    FcFontSet * set =  FcConfigGetFonts(c, FcSetSystem);
-    FcFontSetDestroy(set);
-
-    FcConfigSubstitute(0, pattern, FcMatchPattern);
-    FcDefaultSubstitute(pattern);
-    match = FcFontMatch(0, pattern, &result);
-    FcPatternGetString(match, "family", 0, &v) == FcResultMatch;
-    FcPatternGetBool(match, "family", 0, &v) == FcResultMatch;
-    FcPatternPrint(pattern);
-    FcPatternDestroy(pattern);
-    FcPatternDestroy(match);
-    FcFini();
-    return 0;
-}
-EOF
-
-    ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
-    if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-       { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FONTCONFIG 1
-_ACEOF
-
+if test "x${HAVE_FREETYPE}" = "x1"; then
+    if test "x${FREETYPE_CONFIG}" '!=' "x"; then
+       LIBS="$LIBS "`$FREETYPE_CONFIG --libs`
     else
-       echo "configure: failed program was:" >&5
-       cat conftest.c >&5
-       HAVE_FONTCONFIG=0
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+       LIBS="$LIBS -lfreetype"
     fi
-    rm -f conftest*
-fi
-
-# if the above didn't work out, reset all changes to the compiler variables.
-if test "x${HAVE_FONTCONFIG}" "!=" "x1"; then
-    CPPFLAGS=$OLDCPPFLAGS
-    LIBS=$OLDLIBS
-fi
-
 
+    if test "x${HAVE_FT2BUILD_H}" = "x1"; then
+       HAVE_FT2BUILD_H_DEFINE='#define HAVE_FT2BUILD_H'
+    fi
 
-OLDCPPFLAGS="${CPPFLAGS}"
-OLDLIBS="${LIBS}"
-
+    { echo "$as_me:$LINENO: checking whether we can compile the freetype test program" >&5
+echo $ECHO_N "checking whether we can compile the freetype test program... $ECHO_C" >&6; }
 
-{ echo "$as_me:$LINENO: checking for glBegin in -lGL" >&5
-echo $ECHO_N "checking for glBegin in -lGL... $ECHO_C" >&6; }
-if test "${ac_cv_lib_GL_glBegin+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    cat > conftest.c << EOF
+$HAVE_FT2BUILD_H_DEFINE
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+#ifdef HAVE_FT2BUILD_H
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
+#include FT_SIZES_H
+#include FT_SFNT_NAMES_H
+#include FT_TRUETYPE_IDS_H
+#include FT_OUTLINE_H
+#else
+#include <freetype/freetype.h>
+#include <freetype/ftglyph.h>
+#include <freetype/ftsizes.h>
+#include <freetype/ftsnames.h>
+#include <freetype/ttnameid.h>
+#include <freetype/ftoutln.h>
 #endif
-char glBegin ();
-int
-main ()
-{
-return glBegin ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_GL_glBegin=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_GL_glBegin=no
-fi
+int main()
+{
+    FT_Library ftlibrary;
+    FT_Face face;
+    FT_Error error;
+    FT_ULong charcode;
+    FT_UInt gindex;
+    FT_Glyph glyph;
+    FT_BBox bbox;
+    FT_Matrix matrix;
+    FT_UInt i;
+    char* name = 0;
+    char italic, bold;
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glBegin" >&5
-echo "${ECHO_T}$ac_cv_lib_GL_glBegin" >&6; }
-if test $ac_cv_lib_GL_glBegin = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGL 1
-_ACEOF
+    FT_Init_FreeType(&ftlibrary);
+    FT_New_Face(ftlibrary, "filename", 0, &face);
+    i = face->num_glyphs - 1;
+    italic = face->style_flags&FT_STYLE_FLAG_ITALIC;
+    bold = face->style_flags&FT_STYLE_FLAG_BOLD;
+    FT_Get_Postscript_Name(face);
+    FT_Get_Char_Index(face, 33);
+    FT_Get_First_Char(face, &i);
+    FT_Get_Next_Char(face, 33, &i);
+    if(FT_HAS_GLYPH_NAMES(face)) {
+       FT_Get_Glyph_Name(face, 33, name, 127);
+    }
+    FT_Load_Glyph(face, 33, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
+    FT_Get_Glyph(face->glyph, &glyph);
+    FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &bbox);
+    FT_Done_Glyph(glyph);
+    FT_Done_Face(face);
+    FT_Done_FreeType(ftlibrary);
+    return 0;
+}
+EOF
 
-  LIBS="-lGL $LIBS"
+    ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
+    if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+       { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREETYPE 1
+_ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for gluBeginSurface in -lGLU" >&5
-echo $ECHO_N "checking for gluBeginSurface in -lGLU... $ECHO_C" >&6; }
-if test "${ac_cv_lib_GLU_gluBeginSurface+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREETYPE_FREETYPE_H 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gluBeginSurface ();
-int
-main ()
-{
-return gluBeginSurface ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_GLU_gluBeginSurface=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_GLU_gluBeginSurface=no
+cat >>confdefs.h <<\_ACEOF
+#define USE_FREETYPE 1
+_ACEOF
+  # for ttf2tp1
+    else
+       echo "configure: failed program was:" >&5
+       cat conftest.c >&5
+       HAVE_FREETYPE=0
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    fi
+    rm -f conftest*
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+# if the above didn't work out, reset all changes to the compiler variables.
+if test "x${HAVE_FREETYPE}" '!=' "x1"; then
+    CPPFLAGS=$OLDCPPFLAGS
+    LIBS=$OLDLIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluBeginSurface" >&5
-echo "${ECHO_T}$ac_cv_lib_GLU_gluBeginSurface" >&6; }
-if test $ac_cv_lib_GLU_gluBeginSurface = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGLU 1
-_ACEOF
 
-  LIBS="-lGLU $LIBS"
 
-fi
 
+OLDCPPFLAGS="${CPPFLAGS}"
+OLDLIBS="${LIBS}"
+
+if test -d /usr/include/fontconfig; then
+    CPPFLAGS="$CPPFLAGS -I/usr/include/fontconfig"
+fi
 
-{ echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5
-echo $ECHO_N "checking for glutInit in -lglut... $ECHO_C" >&6; }
-if test "${ac_cv_lib_glut_glutInit+set}" = set; then
+{ echo "$as_me:$LINENO: checking for FcInit in -lfontconfig" >&5
+echo $ECHO_N "checking for FcInit in -lfontconfig... $ECHO_C" >&6; }
+if test "${ac_cv_lib_fontconfig_FcInit+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lglut  $LIBS"
+LIBS="-lfontconfig  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9518,11 +8538,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char glutInit ();
+char FcInit ();
 int
 main ()
 {
-return glutInit ();
+return FcInit ();
   ;
   return 0;
 }
@@ -9545,32 +8565,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_glut_glutInit=yes
+  ac_cv_lib_fontconfig_FcInit=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_glut_glutInit=no
+       ac_cv_lib_fontconfig_FcInit=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5
-echo "${ECHO_T}$ac_cv_lib_glut_glutInit" >&6; }
-if test $ac_cv_lib_glut_glutInit = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGLUT 1
-_ACEOF
-
-  LIBS="-lglut $LIBS"
-
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcInit" >&5
+echo "${ECHO_T}$ac_cv_lib_fontconfig_FcInit" >&6; }
+if test $ac_cv_lib_fontconfig_FcInit = yes; then
+  HAVE_LIB_FONTCONFIG=1
 fi
 
 
-
-for ac_header in GL/gl.h GL/glut.h
+for ac_header in fontconfig.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -9704,99 +8718,104 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-
+ HAVE_FONTCONFIG_H=1
 fi
 
 done
 
 
+if test "x${HAVE_LIB_FONTCONFIG}" != "x";then
+if test "x${HAVE_FONTCONFIG_H}" != "x";then
+    HAVE_FONTCONFIG=1
+fi
+fi
+
+if test "x${HAVE_FONTCONFIG}" = "x1"; then
+    LIBS="$LIBS -lfontconfig"
+{ echo "$as_me:$LINENO: checking whether we can compile the fontconfig test program" >&5
+echo $ECHO_N "checking whether we can compile the fontconfig test program... $ECHO_C" >&6; }
+
+if (echo $LIBS | grep lfreetype >/dev/null 2>&1); then
+    #move freetype library to the end of libraries, otherwise fontconfig
+    #won't compile.
+    LIBS=`echo $LIBS | sed -e 's/-lfreetype//g' -e 's/$/ -lfreetype/'`
+fi
+
 cat > conftest.c << EOF
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <GL/glut.h>
+#include <string.h>
+#include <fontconfig.h>
 
-int main(int argc, char*argv)
+int main()
 {
-    glutInit(&argc, argv);
-    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
-    glutInitWindowSize(320,200);
-    glutInitWindowPosition(0,0);
-    glutCreateWindow("main");
-    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-    glShadeModel(GL_SMOOTH);
-    glEnable (GL_LINE_SMOOTH);
-    glEnable (GL_POLYGON_SMOOTH);
-    glEnable (GL_BLEND);
-    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
-    glHint (GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
+    FcPattern *pattern, *match;
+    FcResult result;
+    FcChar8 *v;
+    char*s1="abc",*s2="ABC";
+    strcasecmp(s1,s2);
+    FcInit();
+    pattern = FcPatternBuild(0, FC_FAMILY, FcTypeString, "", 0);
+    FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+    FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
+
+    FcConfig*c = FcConfigCreate();
+    FcConfigParseAndLoad(c, (FcChar8*)"", 1);
+    FcConfigBuildFonts(c);
+    FcConfigSetCurrent(c);
+
+    FcFontSet * set =  FcConfigGetFonts(c, FcSetSystem);
+    FcFontSetDestroy(set);
+
+    FcConfigSubstitute(0, pattern, FcMatchPattern);
+    FcDefaultSubstitute(pattern);
+    match = FcFontMatch(0, pattern, &result);
+    FcPatternGetString(match, "family", 0, &v) == FcResultMatch;
+    FcPatternGetBool(match, "family", 0, &v) == FcResultMatch;
+    FcPatternPrint(pattern);
+    FcPatternDestroy(pattern);
+    FcPatternDestroy(match);
+    FcFini();
+    return 0;
 }
 EOF
 
-{ echo "$as_me:$LINENO: checking whether we can compile the opengl test program" >&5
-echo $ECHO_N "checking whether we can compile the opengl test program... $ECHO_C" >&6; }
-
-ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
-if { (eval echo opengl.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-    { echo "$as_me:$LINENO: result: yes" >&5
+    ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
+    if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+       { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
-    HAVE_OPENGL=1
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_OPENGL 1
+#define HAVE_FONTCONFIG 1
 _ACEOF
 
-else
-    echo "configure: failed program was:" >&5
-    cat conftest.c >&5
-    HAVE_OPENGL=
-    { echo "$as_me:$LINENO: result: no" >&5
+    else
+       echo "configure: failed program was:" >&5
+       cat conftest.c >&5
+       HAVE_FONTCONFIG=0
+       { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
+    fi
+    rm -f conftest*
 fi
-rm -f conftest*
 
 # if the above didn't work out, reset all changes to the compiler variables.
-if test "x${HAVE_OPENGL}" "!=" "x1"; then
+if test "x${HAVE_FONTCONFIG}" "!=" "x1"; then
     CPPFLAGS=$OLDCPPFLAGS
     LIBS=$OLDLIBS
 fi
 
-if test "$HAVE_OPENGL";then
-    DEVICE_OPENGL='devices/opengl.$(O)'
-
-fi
 
-lame_in_source=
-lame_makefile=
-if test "x${DISABLE_LAME}" = "xtrue"; then
-    echo "*" Disabling lame support...
-else
-    # old lame code at lib/lame
-    if test -f lib/lame/Makefile.in; then
-       lame_in_source='$(lame_objects)'
-       lame_makefile="lib/lame/Makefile"
-       CPPFLAGS="$CPPFLAGS -Ilame"
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LAME 1
-_ACEOF
+OLDCPPFLAGS="${CPPFLAGS}"
+OLDLIBS="${LIBS}"
 
-    else
-       if test -d /usr/include/lame; then
-           CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
-       else
-           if test -d /usr/local/include/lame; then
-               CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
-           fi
-       fi
 
-{ echo "$as_me:$LINENO: checking for lame_init in -lmp3lame" >&5
-echo $ECHO_N "checking for lame_init in -lmp3lame... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then
+{ echo "$as_me:$LINENO: checking for glBegin in -lGL" >&5
+echo $ECHO_N "checking for glBegin in -lGL... $ECHO_C" >&6; }
+if test "${ac_cv_lib_GL_glBegin+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmp3lame  $LIBS"
+LIBS="-lGL  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9810,11 +8829,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char lame_init ();
+char glBegin ();
 int
 main ()
 {
-return lame_init ();
+return glBegin ();
   ;
   return 0;
 }
@@ -9837,65 +8856,67 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_mp3lame_lame_init=yes
+  ac_cv_lib_GL_glBegin=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_mp3lame_lame_init=no
+       ac_cv_lib_GL_glBegin=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame_lame_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mp3lame_lame_init" >&6; }
-if test $ac_cv_lib_mp3lame_lame_init = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glBegin" >&5
+echo "${ECHO_T}$ac_cv_lib_GL_glBegin" >&6; }
+if test $ac_cv_lib_GL_glBegin = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBMP3LAME 1
+#define HAVE_LIBGL 1
 _ACEOF
 
-  LIBS="-lmp3lame $LIBS"
+  LIBS="-lGL $LIBS"
 
-else
-  NO_LIBMP3LAME=1
 fi
 
 
-for ac_header in lame.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for gluBeginSurface in -lGLU" >&5
+echo $ECHO_N "checking for gluBeginSurface in -lGLU... $ECHO_C" >&6; }
+if test "${ac_cv_lib_GLU_gluBeginSurface+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGLU  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gluBeginSurface ();
+int
+main ()
+{
+return gluBeginSurface ();
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -9904,197 +8925,105 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_GLU_gluBeginSurface=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       ac_cv_lib_GLU_gluBeginSurface=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluBeginSurface" >&5
+echo "${ECHO_T}$ac_cv_lib_GLU_gluBeginSurface" >&6; }
+if test $ac_cv_lib_GLU_gluBeginSurface = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGLU 1
+_ACEOF
 
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+  LIBS="-lGLU $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5
+echo $ECHO_N "checking for glutInit in -lglut... $ECHO_C" >&6; }
+if test "${ac_cv_lib_glut_glutInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lglut  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char glutInit ();
+int
+main ()
+{
+return glutInit ();
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-       if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
-           cat >>confdefs.h <<\_ACEOF
-#define HAVE_LAME 1
-_ACEOF
-
-       fi
-    fi
-fi
-
-
-art_in_source='$(art_objects)'
-
-cat >>confdefs.h <<\_ACEOF
-#define INTERNAL_LIBART 1
-_ACEOF
-
-
-if test "x$EXTERNAL_LIBART" = "xtrue"; then
-    art_in_source=
-
-pkg_failed=no
-{ echo "$as_me:$LINENO: checking for LIBART" >&5
-echo $ECHO_N "checking for LIBART... $ECHO_C" >&6; }
-
-if test -n "$PKG_CONFIG"; then
-    if test -n "$LIBART_CFLAGS"; then
-        pkg_cv_LIBART_CFLAGS="$LIBART_CFLAGS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libart-2.0\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libart-2.0") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_LIBART_CFLAGS=`$PKG_CONFIG --cflags "libart-2.0" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
-    fi
-else
-       pkg_failed=untried
-fi
-if test -n "$PKG_CONFIG"; then
-    if test -n "$LIBART_LIBS"; then
-        pkg_cv_LIBART_LIBS="$LIBART_LIBS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libart-2.0\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libart-2.0") 2>&5
-  ac_status=$?
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_LIBART_LIBS=`$PKG_CONFIG --libs "libart-2.0" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
-    fi
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_glut_glutInit=yes
 else
-       pkg_failed=untried
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_lib_glut_glutInit=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5
+echo "${ECHO_T}$ac_cv_lib_glut_glutInit" >&6; }
+if test $ac_cv_lib_glut_glutInit = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGLUT 1
+_ACEOF
 
-if test $pkg_failed = yes; then
+  LIBS="-lglut $LIBS"
 
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
 fi
-        if test $_pkg_short_errors_supported = yes; then
-               LIBART_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libart-2.0"`
-        else
-               LIBART_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libart-2.0"`
-        fi
-       # Put the nasty error message in config.log where it belongs
-       echo "$LIBART_PKG_ERRORS" >&5
 
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-                libart_pkgconfig_libart=no
-elif test $pkg_failed = untried; then
-       libart_pkgconfig_libart=no
-else
-       LIBART_CFLAGS=$pkg_cv_LIBART_CFLAGS
-       LIBART_LIBS=$pkg_cv_LIBART_LIBS
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-       :
-fi
-    if test "x$libart_pkgconfig_libart" = "xno"; then
 
-for ac_header in libart_lgpl/libart.h
+
+for ac_header in GL/gl.h GL/glut.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -10229,416 +9158,166 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-
-{ echo "$as_me:$LINENO: checking for art_new in -lart_lgpl_2" >&5
-echo $ECHO_N "checking for art_new in -lart_lgpl_2... $ECHO_C" >&6; }
-if test "${ac_cv_lib_art_lgpl_2_art_new+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lart_lgpl_2  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char art_new ();
-int
-main ()
-{
-return art_new ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_art_lgpl_2_art_new=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_art_lgpl_2_art_new=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_art_lgpl_2_art_new" >&5
-echo "${ECHO_T}$ac_cv_lib_art_lgpl_2_art_new" >&6; }
-if test $ac_cv_lib_art_lgpl_2_art_new = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBART_LGPL_2 1
-_ACEOF
-
-  LIBS="-lart_lgpl_2 $LIBS"
-
-fi
-
-
-else
-  { { echo "$as_me:$LINENO: error: No libart library found. This library is required." >&5
-echo "$as_me: error: No libart library found. This library is required." >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
 done
 
-    else
-       CPPFLAGS="$CPPFLAGS $LIBART_CFLAGS"
-        cat >>confdefs.h <<\_ACEOF
-#define INTERNAL_LIBART 0
-_ACEOF
-
-        LIBS="$LIBS $LIBART_LIBS"
-    fi
-fi
-
-
-xpdf_in_source='$(xpdf_objects)'
-splash_in_source='$(splash_objects)'
-
-if test "x$USE_POPPLER" = "xtrue"; then
-    xpdf_in_source=
-    splash_in_source=
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POPPLER 1
-_ACEOF
-
-
-pkg_failed=no
-{ echo "$as_me:$LINENO: checking for POPPLER" >&5
-echo $ECHO_N "checking for POPPLER... $ECHO_C" >&6; }
-
-if test -n "$PKG_CONFIG"; then
-    if test -n "$POPPLER_CFLAGS"; then
-        pkg_cv_POPPLER_CFLAGS="$POPPLER_CFLAGS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler poppler-splash\"") >&5
-  ($PKG_CONFIG --exists --print-errors "poppler poppler-splash") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler poppler-splash" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
-    fi
-else
-       pkg_failed=untried
-fi
-if test -n "$PKG_CONFIG"; then
-    if test -n "$POPPLER_LIBS"; then
-        pkg_cv_POPPLER_LIBS="$POPPLER_LIBS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler poppler-splash\"") >&5
-  ($PKG_CONFIG --exists --print-errors "poppler poppler-splash") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_POPPLER_LIBS=`$PKG_CONFIG --libs "poppler poppler-splash" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
-    fi
-else
-       pkg_failed=untried
-fi
-
 
+cat > conftest.c << EOF
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glut.h>
 
-if test $pkg_failed = yes; then
+int main(int argc, char*argv)
+{
+    glutInit(&argc, argv);
+    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
+    glutInitWindowSize(320,200);
+    glutInitWindowPosition(0,0);
+    glutCreateWindow("main");
+    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+    glShadeModel(GL_SMOOTH);
+    glEnable (GL_LINE_SMOOTH);
+    glEnable (GL_POLYGON_SMOOTH);
+    glEnable (GL_BLEND);
+    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
+    glHint (GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
+}
+EOF
 
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-               POPPLER_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "poppler poppler-splash"`
-        else
-               POPPLER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "poppler poppler-splash"`
-        fi
-       # Put the nasty error message in config.log where it belongs
-       echo "$POPPLER_PKG_ERRORS" >&5
+{ echo "$as_me:$LINENO: checking whether we can compile the opengl test program" >&5
+echo $ECHO_N "checking whether we can compile the opengl test program... $ECHO_C" >&6; }
 
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-                poppler_pkgconfig=no
-elif test $pkg_failed = untried; then
-       poppler_pkgconfig=no
-else
-       POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS
-       POPPLER_LIBS=$pkg_cv_POPPLER_LIBS
-        { echo "$as_me:$LINENO: result: yes" >&5
+ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
+if { (eval echo opengl.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+    { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
-       :
-fi
-    if test "x$poppler_pkgconfig" = "xno"; then
-        ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
+    HAVE_OPENGL=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENGL 1
+_ACEOF
 
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    echo "configure: failed program was:" >&5
+    cat conftest.c >&5
+    HAVE_OPENGL=
+    { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+rm -f conftest*
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
+# if the above didn't work out, reset all changes to the compiler variables.
+if test "x${HAVE_OPENGL}" "!=" "x1"; then
+    CPPFLAGS=$OLDCPPFLAGS
+    LIBS=$OLDLIBS
 fi
 
-rm -f conftest.err conftest.$ac_ext
+if test "$HAVE_OPENGL";then
+    DEVICE_OPENGL='devices/opengl.$(O)'
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
 fi
 
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
+lame_in_source=
+lame_makefile=
+if test "x${DISABLE_LAME}" = "xtrue"; then
+    echo "*" Disabling lame support...
+else
+    # old lame code at lib/lame
+    if test -f lib/lame/Makefile.in; then
+       lame_in_source='$(lame_objects)'
+       lame_makefile="lib/lame/Makefile"
+       CPPFLAGS="$CPPFLAGS -Ilame -Ilib/lame"
 
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LAME 1
+_ACEOF
+
+    else
+       if test -d /usr/include/lame; then
+           CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
+       else
+           if test -d /usr/local/include/lame; then
+               CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
+           fi
+       fi
+
+{ echo "$as_me:$LINENO: checking for lame_init in -lmp3lame" >&5
+echo $ECHO_N "checking for lame_init in -lmp3lame... $ECHO_C" >&6; }
+if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmp3lame  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
 #endif
-                    Syntax error
+char lame_init ();
+int
+main ()
+{
+return lame_init ();
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       }; then
-  :
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_mp3lame_lame_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
+       ac_cv_lib_mp3lame_lame_init=no
 fi
 
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Passes both tests.
-ac_preproc_ok=:
-break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame_lame_init" >&5
+echo "${ECHO_T}$ac_cv_lib_mp3lame_lame_init" >&6; }
+if test $ac_cv_lib_mp3lame_lame_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMP3LAME 1
+_ACEOF
 
-rm -f conftest.err conftest.$ac_ext
+  LIBS="-lmp3lame $LIBS"
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
 else
-  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  NO_LIBMP3LAME=1
 fi
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
+        HASLAMEHEADER=
 
-
-for ac_header in OutputDev.h
+for ac_header in lame.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -10677,7 +9356,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_cxx_werror_flag" ||
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
@@ -10716,7 +9395,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
        }; then
   ac_header_preproc=yes
@@ -10732,7 +9411,7 @@ rm -f conftest.err conftest.$ac_ext
 echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
@@ -10772,96 +9451,32 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
+ HASLAMEHEADER=1
+fi
 
+done
 
-{ echo "$as_me:$LINENO: checking for main in -lpoppler" >&5
-echo $ECHO_N "checking for main in -lpoppler... $ECHO_C" >&6; }
-if test "${ac_cv_lib_poppler_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpoppler  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
+       if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$HASLAMEHEADER" '!=' "x";then
+           cat >>confdefs.h <<\_ACEOF
+#define HAVE_LAME 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_cxx_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_poppler_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_poppler_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+       fi
+    fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_poppler_main" >&5
-echo "${ECHO_T}$ac_cv_lib_poppler_main" >&6; }
-if test $ac_cv_lib_poppler_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPOPPLER 1
-_ACEOF
-
-  LIBS="-lpoppler $LIBS"
 
-fi
 
 
-else
-  { { echo "$as_me:$LINENO: error: No poppler library found. This library is required." >&5
-echo "$as_me: error: No poppler library found. This library is required." >&2;}
-   { (exit 1); exit 1; }; }
-fi
+cat >>confdefs.h <<\_ACEOF
+#define INTERNAL_LIBART 1
+_ACEOF
 
-done
+art_in_source='$(art_objects)'
+splash_in_source='$(splash_objects)'
+xpdf_in_source='$(xpdf_objects)'
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-    else
-       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
-        cat >>confdefs.h <<\_ACEOF
-#define HAVE_POPPLER 1
-_ACEOF
 
-        LIBS="$LIBS $POPPLER_LIBS"
-    fi
-fi
 
 
 
@@ -11221,8 +9836,8 @@ else
     if test "x$PYTHON_LIB" '!=' "x" -o "x$PYTHON_INCLUDES" '!=' "x";then
         echo "Set both PYTHON_LIB and PYTHON_INCLUDES, or none at all"
     fi
-    # iterate through version 2.2 to 2.5
-    for v in 2 3 4 5; do
+    # iterate through version 2.2 to 2.6
+    for v in 2 3 4 5 6; do
         # Linux
         if test -f "/usr/include/python2.$v/Python.h";then
             PY_VERSION=2.$v
@@ -11235,17 +9850,16 @@ else
             fi
            PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION"
         # Mac OS X
-        elif test -f "/System/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then
-            #TODO: test for /System/Library/Frameworks/Python.framework/Versions/2.3/Python ?
+        elif test -f "/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then
             PY_VERSION=2.$v
             PYTHON_LIB="-framework Python"
-            if test -f "/Library/Python/2.$v/PIL/_imaging.so";then
+            if test -f "/Library/Frameworks/Python.framework/Versions/2.$v/site-packages/PIL/_imaging.so";then
                 PYTHON_LIB2="$PYTHON_LIB /Library/Python/2.$v/PIL/_imaging.so"
                 HAVE_PYTHON_IMAGING_LIB=1
             else
                 PYTHON_LIB2="$PYTHON_LIB"
             fi
-            PYTHON_INCLUDES="-I/System/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/"
+            PYTHON_INCLUDES="-I/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/"
        # Mac OS X [Fink]:
         elif test "(" -f "/sw/lib/python2.$v/config/libpython2.$v.dylib" \
                   -o -f "/sw/lib/python2.$v/config/libpython2.$v.a" \
@@ -11430,7 +10044,7 @@ LIBPDF='libpdf$(A)'
 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
   echo "* Disabling pdf2swf tool..."
   rm -f lib/pdf/Makefile
-  echo all install uninstall clean: > lib/pdf/Makefile
+  echo all install uninstall clean libpdf: > lib/pdf/Makefile
   pdf2swf_makefile=""
   PDF2SWF=
   LIBPDF=
 
 
 
-#ifdef HAVE_POPPLER
-#define GString GooString
-#define GHash GooHash
-#endif
-
-
 if test -f "release.in"; then release_in="./release"; fi
-FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile pdf2swf/fonts/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/readers/Makefile"
+if test -f "Makefile.new.in"; then mk_in="./Makefile.new"; fi
+FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/readers/Makefile"
 ac_config_files="$ac_config_files ${FILES}"
 
 cat >confcache <<\_ACEOF
@@ -12173,7 +10782,6 @@ INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
 INSTALL_DATA!$INSTALL_DATA$ac_delim
 LN_S!$LN_S$ac_delim
 UNCOMPRESS!$UNCOMPRESS$ac_delim
-PKG_CONFIG!$PKG_CONFIG$ac_delim
 AREXT!$AREXT$ac_delim
 AR!$AR$ac_delim
 SLEXT!$SLEXT$ac_delim
@@ -12193,12 +10801,7 @@ HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim
 FREETYPE_CONFIG!$FREETYPE_CONFIG$ac_delim
 DEVICE_OPENGL!$DEVICE_OPENGL$ac_delim
 lame_in_source!$lame_in_source$ac_delim
-LIBART_CFLAGS!$LIBART_CFLAGS$ac_delim
-LIBART_LIBS!$LIBART_LIBS$ac_delim
 art_in_source!$art_in_source$ac_delim
-POPPLER_CFLAGS!$POPPLER_CFLAGS$ac_delim
-POPPLER_LIBS!$POPPLER_LIBS$ac_delim
-CXXCPP!$CXXCPP$ac_delim
 xpdf_in_source!$xpdf_in_source$ac_delim
 splash_in_source!$splash_in_source$ac_delim
 AVIFILE_CONFIG!$AVIFILE_CONFIG$ac_delim
@@ -12206,6 +10809,12 @@ VIDEO_LIBS!$VIDEO_LIBS$ac_delim
 VIDEO_CFLAGS!$VIDEO_CFLAGS$ac_delim
 USE_GZIP!$USE_GZIP$ac_delim
 PYTHON_LIB!$PYTHON_LIB$ac_delim
+PYTHON_INCLUDES!$PYTHON_INCLUDES$ac_delim
+HAVE_PYTHON_IMAGING!$HAVE_PYTHON_IMAGING$ac_delim
+PDF2SWF!$PDF2SWF$ac_delim
+LIBPDF!$LIBPDF$ac_delim
+JPEG2SWF!$JPEG2SWF$ac_delim
+GIF2SWF!$GIF2SWF$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -12247,18 +10856,12 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
-PYTHON_INCLUDES!$PYTHON_INCLUDES$ac_delim
-HAVE_PYTHON_IMAGING!$HAVE_PYTHON_IMAGING$ac_delim
-PDF2SWF!$PDF2SWF$ac_delim
-LIBPDF!$LIBPDF$ac_delim
-JPEG2SWF!$JPEG2SWF$ac_delim
-GIF2SWF!$GIF2SWF$ac_delim
 PNG2SWF!$PNG2SWF$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5