diff --git a/configure b/configure
index 10c6b5025018a6f3ed3a50eaa563fa2f6dfa4bfd..da488b4c5f23c988430c8a90991807406f16e80e 100755
--- a/configure
+++ b/configure
@@ -734,7 +734,6 @@ EXTRACFLAGS
 BUILTINFLAG
 DLLEXT
 DLLFLAGS
-DLLIBS
 LDSHARED
 LDDLLFLAGS
 LIBEXT
@@ -756,6 +755,7 @@ SOCKETLIBS
 MAIN_BINARY
 EXTRA_BINARIES
 LDD
+LIBDL
 LIBPOLL
 LIBOBJS
 LTLIBOBJS'
@@ -7098,36 +7098,19 @@ _ACEOF
 fi
 
 
-for ac_func in gethostbyname
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for _xpg4_setrunelocale in -lxpg4" >&5
+echo $ECHO_N "checking for _xpg4_setrunelocale in -lxpg4... $ECHO_C" >&6; }
+if test "${ac_cv_lib_xpg4__xpg4_setrunelocale+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxpg4  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -7135,18 +7118,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
+char _xpg4_setrunelocale ();
 int
 main ()
 {
-return $ac_func ();
+return _xpg4_setrunelocale ();
   ;
   return 0;
 }
@@ -7185,34 +7161,36 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_lib_xpg4__xpg4_setrunelocale=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_lib_xpg4__xpg4_setrunelocale=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4__xpg4_setrunelocale" >&5
+echo "${ECHO_T}$ac_cv_lib_xpg4__xpg4_setrunelocale" >&6; }
+if test $ac_cv_lib_xpg4__xpg4_setrunelocale = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBXPG4 1
 _ACEOF
 
-else
+  LIBS="-lxpg4 $LIBS"
 
-{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+fi
+
+{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
+LIBS="-lpthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7226,11 +7204,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char gethostbyname ();
+char pthread_create ();
 int
 main ()
 {
-return gethostbyname ();
+return pthread_create ();
   ;
   return 0;
 }
@@ -7269,39 +7247,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_gethostbyname=yes
+  ac_cv_lib_pthread_pthread_create=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_nsl_gethostbyname=no
+	ac_cv_lib_pthread_pthread_create=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
-  LIBS="-lnsl $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  LIBPTHREAD="-lpthread"
 
 fi
 
-fi
-done
 
+XLIB=""
+
+XFILES=""
 
-for ac_func in connect
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+OPENGLFILES=""
+
+GLU32FILES=""
+
+OPENGL_LIBS=""
+
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7310,53 +7290,27 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
 int
 main ()
 {
-return $ac_func ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+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_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7373,7 +7327,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -s conftest.$ac_objext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -7383,81 +7337,105 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_header_stdc=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
 else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
-{ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
-echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_connect+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  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"
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
-char connect ();
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-return connect ();
-  ;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+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>conftest.er1
+  (eval "$ac_link") 2>&5
   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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -7467,178 +7445,68 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_socket_connect=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_socket_connect=no
+( exit $ac_status )
+ac_cv_header_stdc=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; }
-if test $ac_cv_lib_socket_connect = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
 
-  LIBS="-lsocket $LIBS"
 
 fi
-
 fi
-done
-
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
-for ac_func in inet_aton
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+fi
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
-#undef $ac_func
 
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s 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
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
-fi
 
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-else
 
-{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
-echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; }
-if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ 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
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  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
 
-/* 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 inet_aton ();
-int
-main ()
-{
-return inet_aton ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+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_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7655,7 +7523,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -s conftest.$ac_objext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -7665,484 +7533,22 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_resolv_inet_aton=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_resolv_inet_aton=no
+	eval "$as_ac_Header=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; }
-if test $ac_cv_lib_resolv_inet_aton = yes; then
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
-
-  LIBS="-lresolv $LIBS"
-
-fi
-
-fi
-done
-
-
-{ echo "$as_me:$LINENO: checking for _xpg4_setrunelocale in -lxpg4" >&5
-echo $ECHO_N "checking for _xpg4_setrunelocale in -lxpg4... $ECHO_C" >&6; }
-if test "${ac_cv_lib_xpg4__xpg4_setrunelocale+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxpg4  $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 _xpg4_setrunelocale ();
-int
-main ()
-{
-return _xpg4_setrunelocale ();
-  ;
-  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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s 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_lib_xpg4__xpg4_setrunelocale=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_xpg4__xpg4_setrunelocale=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4__xpg4_setrunelocale" >&5
-echo "${ECHO_T}$ac_cv_lib_xpg4__xpg4_setrunelocale" >&6; }
-if test $ac_cv_lib_xpg4__xpg4_setrunelocale = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBXPG4 1
-_ACEOF
-
-  LIBS="-lxpg4 $LIBS"
-
-fi
-
-{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $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 pthread_create ();
-int
-main ()
-{
-return pthread_create ();
-  ;
-  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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s 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_lib_pthread_pthread_create=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pthread_pthread_create=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
-if test $ac_cv_lib_pthread_pthread_create = yes; then
-  LIBPTHREAD="-lpthread"
-
-fi
-
-
-XLIB=""
-
-XFILES=""
-
-OPENGLFILES=""
-
-GLU32FILES=""
-
-OPENGL_LIBS=""
-
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+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.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  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
-  :
-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 )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ 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
-  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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (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
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -15660,8 +15066,6 @@ DLLEXT=""
 
 DLLFLAGS="-D_REENTRANT"
 
-DLLIBS=""
-
 LDSHARED=""
 
 LDDLLFLAGS=""
@@ -15859,74 +15263,104 @@ 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
-    DLLWRAP=$ac_ct_DLLWRAP
-  fi
+    DLLWRAP=$ac_ct_DLLWRAP
+  fi
+else
+  DLLWRAP="$ac_cv_prog_DLLWRAP"
+fi
+
+    if test "$DLLWRAP" = "false"; then
+      LIBEXT="a"
+    else
+            LIBEXT="dll"
+    fi
+    IMPLIBEXT="a"
+        WIN16_FILES=""
+    WIN16_INSTALL=""
+    ;;
+  *)
+      DLLFLAGS="$DLLFLAGS -fPIC"
+      DLLEXT=".so"
+      { echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5
+echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_gnuelf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic"
+cat >conftest.$ac_ext <<_ACEOF
+void myfunc() {}
+_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); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (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); }; } &&
+	 { ac_try='test -s 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_c_dll_gnuelf="yes"
 else
-  DLLWRAP="$ac_cv_prog_DLLWRAP"
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    if test "$DLLWRAP" = "false"; then
-      LIBEXT="a"
-    else
-            LIBEXT="dll"
-    fi
-    IMPLIBEXT="a"
-        WIN16_FILES=""
-    WIN16_INSTALL=""
-    ;;
-  *)
-    if test "$ac_cv_header_dlfcn_h" = "yes"
-    then
+	ac_cv_c_dll_gnuelf="no"
+fi
 
-for ac_func in dlopen
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_gnuelf" >&5
+echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6; }
+      if test "$ac_cv_c_dll_gnuelf" = "yes"
+      then
+        LDSHARED="\$(CC) -shared"
+        LDDLLFLAGS="-shared -Wl,-Bsymbolic"
+        { echo "$as_me:$LINENO: checking whether the linker accepts soname" >&5
+echo $ECHO_N "checking whether the linker accepts soname... $ECHO_C" >&6; }
+if test "${ac_cv_c_sonames+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,confest.so.1"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
 int
 main ()
 {
-return $ac_func ();
+
   ;
   return 0;
 }
@@ -15965,33 +15399,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_c_sonames="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_c_sonames="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_c_sonames" >&5
+echo "${ECHO_T}$ac_cv_c_sonames" >&6; }
+        if test "$ac_cv_c_sonames" = "yes"
+        then
+          LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
+        else
+          { echo "$as_me:$LINENO: checking check to see if -h soname is an alternate" >&5
+echo $ECHO_N "checking check to see if -h soname is an alternate... $ECHO_C" >&6; }
+if test "${ac_cv_c_h_sonames+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -shared -Wl,-h,confest.so.1"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15999,17 +15431,10 @@ 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 dlopen ();
 int
 main ()
 {
-return dlopen ();
+
   ;
   return 0;
 }
@@ -16048,86 +15473,44 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
+  ac_cv_c_h_sonames="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_dl_dlopen=no
+	ac_cv_c_h_sonames="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DLOPEN 1
-_ACEOF
-
-                          DLLIBS="-ldl"
-else
-  LIBEXT="a"
-fi
-
+CFLAGS=$ac_wine_try_cflags_saved
 fi
-done
-
-        ac_wine_check_funcs_save_LIBS="$LIBS"
-LIBS="$LIBS $DLLIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_c_h_sonames" >&5
+echo "${ECHO_T}$ac_cv_c_h_sonames" >&6; }
+          if test "$ac_cv_c_h_sonames" = "yes"
+          then
+            LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
+          fi
+        fi
 
-for ac_func in dladdr
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+        { echo "$as_me:$LINENO: checking whether the linker accepts -z defs" >&5
+echo $ECHO_N "checking whether the linker accepts -z defs... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_zdefs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic,-z,defs"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
 int
 main ()
 {
-return $ac_func ();
+
   ;
   return 0;
 }
@@ -16166,46 +15549,46 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_c_dll_zdefs="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_c_dll_zdefs="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-LIBS="$ac_wine_check_funcs_save_LIBS"
-    else
-        LIBEXT="a"
-    fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_zdefs" >&5
+echo "${ECHO_T}$ac_cv_c_dll_zdefs" >&6; }
+        if test "$ac_cv_c_dll_zdefs" = "yes"
+        then
+          LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
+        fi
 
-    if test "$LIBEXT" = "so"
-    then
-      DLLFLAGS="$DLLFLAGS -fPIC"
-      DLLEXT=".so"
-      { echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5
-echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_gnuelf+set}" = set; then
+        { echo "$as_me:$LINENO: checking whether the linker accepts -init and -fini" >&5
+echo $ECHO_N "checking whether the linker accepts -init and -fini... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_init_fini+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic"
+CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
 cat >conftest.$ac_ext <<_ACEOF
-void myfunc() {}
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -16241,31 +15624,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_dll_gnuelf="yes"
+  ac_cv_c_dll_init_fini="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_dll_gnuelf="no"
+	ac_cv_c_dll_init_fini="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_gnuelf" >&5
-echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6; }
-      if test "$ac_cv_c_dll_gnuelf" = "yes"
-      then
-        LDSHARED="\$(CC) -shared"
-        LDDLLFLAGS="-shared -Wl,-Bsymbolic"
-        { echo "$as_me:$LINENO: checking whether the linker accepts soname" >&5
-echo $ECHO_N "checking whether the linker accepts soname... $ECHO_C" >&6; }
-if test "${ac_cv_c_sonames+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_init_fini" >&5
+echo "${ECHO_T}$ac_cv_c_dll_init_fini" >&6; }
+        if test "$ac_cv_c_dll_init_fini" = "yes"
+        then
+          LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
+        fi
+
+        { echo "$as_me:$LINENO: checking whether the linker accepts version scripts" >&5
+echo $ECHO_N "checking whether the linker accepts version scripts... $ECHO_C" >&6; }
+if test "${ac_cv_c_ld_version_scripts+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,confest.so.1"
+  echo '{ global: *; };' >conftest.map
+           ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -shared -Wl,--version-script=conftest.map"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16315,31 +15700,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_sonames="yes"
+  ac_cv_c_ld_version_scripts="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_sonames="no"
+	ac_cv_c_ld_version_scripts="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
+           rm -f conftest.map
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_sonames" >&5
-echo "${ECHO_T}$ac_cv_c_sonames" >&6; }
-        if test "$ac_cv_c_sonames" = "yes"
+{ echo "$as_me:$LINENO: result: $ac_cv_c_ld_version_scripts" >&5
+echo "${ECHO_T}$ac_cv_c_ld_version_scripts" >&6; }
+        if test "$ac_cv_c_ld_version_scripts" = "yes"
         then
-          LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
-        else
-          { echo "$as_me:$LINENO: checking check to see if -h soname is an alternate" >&5
-echo $ECHO_N "checking check to see if -h soname is an alternate... $ECHO_C" >&6; }
-if test "${ac_cv_c_h_sonames+set}" = set; then
+          LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
+        fi
+
+        { echo "$as_me:$LINENO: checking whether the linker accepts --export-dynamic" >&5
+echo $ECHO_N "checking whether the linker accepts --export-dynamic... $ECHO_C" >&6; }
+if test "${ac_cv_c_export_dynamic+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,-h,confest.so.1"
+CFLAGS="$CFLAGS -fPIC -Wl,--export-dynamic"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16389,33 +15776,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_h_sonames="yes"
+  ac_cv_c_export_dynamic="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_h_sonames="no"
+	ac_cv_c_export_dynamic="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_h_sonames" >&5
-echo "${ECHO_T}$ac_cv_c_h_sonames" >&6; }
-          if test "$ac_cv_c_h_sonames" = "yes"
-          then
-            LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
-          fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_export_dynamic" >&5
+echo "${ECHO_T}$ac_cv_c_export_dynamic" >&6; }
+        if test "$ac_cv_c_export_dynamic" = "yes"
+        then
+          LDEXECFLAGS="-Wl,--export-dynamic"
+
         fi
 
-        { echo "$as_me:$LINENO: checking whether the linker accepts -z defs" >&5
-echo $ECHO_N "checking whether the linker accepts -z defs... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_zdefs+set}" = set; then
+        { echo "$as_me:$LINENO: checking whether the linker accepts --rpath" >&5
+echo $ECHO_N "checking whether the linker accepts --rpath... $ECHO_C" >&6; }
+if test "${ac_cv_ld_rpath+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic,-z,defs"
+CFLAGS="$CFLAGS -fPIC -Wl,--rpath,\$ORIGIN/../lib"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16465,32 +15852,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_dll_zdefs="yes"
+  ac_cv_ld_rpath="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_dll_zdefs="no"
+	ac_cv_ld_rpath="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_zdefs" >&5
-echo "${ECHO_T}$ac_cv_c_dll_zdefs" >&6; }
-        if test "$ac_cv_c_dll_zdefs" = "yes"
+{ echo "$as_me:$LINENO: result: $ac_cv_ld_rpath" >&5
+echo "${ECHO_T}$ac_cv_ld_rpath" >&6; }
+        if test "$ac_cv_ld_rpath" = "yes"
         then
-          LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
+          LDEXERPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
+
+          LDDLLRPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(dlldir) \$(libdir)\`"
+
         fi
 
-        { echo "$as_me:$LINENO: checking whether the linker accepts -init and -fini" >&5
-echo $ECHO_N "checking whether the linker accepts -init and -fini... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_init_fini+set}" = set; then
+        case $host_cpu in
+          *i[3456789]86* | x86_64)
+            { echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x7bf00000" >&5
+echo $ECHO_N "checking whether we can relocate the executable to 0x7bf00000... $ECHO_C" >&6; }
+if test "${ac_cv_ld_reloc_exec+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
+CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7bf00400"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16540,47 +15932,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_dll_init_fini="yes"
+  ac_cv_ld_reloc_exec="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_dll_init_fini="no"
+	ac_cv_ld_reloc_exec="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_init_fini" >&5
-echo "${ECHO_T}$ac_cv_c_dll_init_fini" >&6; }
-        if test "$ac_cv_c_dll_init_fini" = "yes"
-        then
-          LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
-        fi
+{ echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
+echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6; }
+            if test "$ac_cv_ld_reloc_exec" = "yes"
+            then
+              LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
+            fi
+            ;;
+        esac
 
-        { echo "$as_me:$LINENO: checking whether the linker accepts version scripts" >&5
-echo $ECHO_N "checking whether the linker accepts version scripts... $ECHO_C" >&6; }
-if test "${ac_cv_c_ld_version_scripts+set}" = set; then
+      else
+        { echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5
+echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_unixware+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo '{ global: *; };' >conftest.map
-           ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -shared -Wl,--version-script=conftest.map"
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
 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 0;
-}
+void myfunc() {}
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -16616,47 +15998,118 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_ld_version_scripts="yes"
+  ac_cv_c_dll_unixware="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_ld_version_scripts="no"
+	ac_cv_c_dll_unixware="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
-           rm -f conftest.map
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_ld_version_scripts" >&5
-echo "${ECHO_T}$ac_cv_c_ld_version_scripts" >&6; }
-        if test "$ac_cv_c_ld_version_scripts" = "yes"
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_unixware" >&5
+echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6; }
+        if test "$ac_cv_c_dll_unixware" = "yes"
         then
-          LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
-        fi
+          LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
+          LDDLLFLAGS="-Wl,-G,-B,symbolic"
 
-        { echo "$as_me:$LINENO: checking whether the linker accepts --export-dynamic" >&5
-echo $ECHO_N "checking whether the linker accepts --export-dynamic... $ECHO_C" >&6; }
-if test "${ac_cv_c_export_dynamic+set}" = set; then
+        else
+          { echo "$as_me:$LINENO: checking whether we can build a Mach-O (Mac OS X/Darwin) dll" >&5
+echo $ECHO_N "checking whether we can build a Mach-O (Mac OS X/Darwin) dll... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_macho+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -Wl,--export-dynamic"
+CFLAGS="$CFLAGS -bundle"
 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+void myfunc() {}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+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); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (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); }; } &&
+	 { ac_try='test -s 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_c_dll_macho="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-int
-main ()
-{
+	ac_cv_c_dll_macho="no"
+fi
 
-  ;
-  return 0;
-}
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_macho" >&5
+echo "${ECHO_T}$ac_cv_c_dll_macho" >&6; }
+          if test "$ac_cv_c_dll_macho" = "yes"
+          then
+            LIBEXT="dylib"
+            LDDLLFLAGS="-bundle -multiply_defined suppress"
+            LDSHARED="\$(CC) -dynamiclib -install_name @executable_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`/\$(DYNAME)"
+            STRIP="$STRIP -u -r"
+                        COREFOUNDATIONLIB="-framework CoreFoundation"
+
+            IOKITLIB="-framework IOKit -framework CoreFoundation"
+
+            LDEXECFLAGS="-image_base 0x7bf00000 -Wl,-segaddr,WINE_DOS,0x00000000,-segaddr,WINE_SHARED_HEAP,0x7f000000"
+
+	    if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" -a "$ac_cv_header_AudioUnit_AudioUnit_h" = "yes"
+            then
+				COREAUDIO="-framework CoreAudio -framework AudioUnit -framework CoreServices"
+
+	    fi
+            case $host_cpu in
+              *powerpc*)
+                CFLAGS="$CFLAGS -ffixed-r13"
+                LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning"
+                ;;
+            esac
+
+          else
+            { echo "$as_me:$LINENO: checking whether we can build an HP-UX dll" >&5
+echo $ECHO_N "checking whether we can build an HP-UX dll... $ECHO_C" >&6; }
+if test "${ac_cv_c_dll_hpux+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -shared"
+cat >conftest.$ac_ext <<_ACEOF
+void myfunc() {}
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -16692,44 +16145,287 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_export_dynamic="yes"
+  ac_cv_c_dll_hpux="yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_export_dynamic="no"
+	ac_cv_c_dll_hpux="no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_export_dynamic" >&5
-echo "${ECHO_T}$ac_cv_c_export_dynamic" >&6; }
-        if test "$ac_cv_c_export_dynamic" = "yes"
-        then
-          LDEXECFLAGS="-Wl,--export-dynamic"
+{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_hpux" >&5
+echo "${ECHO_T}$ac_cv_c_dll_hpux" >&6; }
+            if test "$ac_cv_c_dll_hpux" = "yes"
+            then
+              LIBEXT="sl"
+              DLLEXT=".sl"
+              LDDLLFLAGS="-shared -fPIC"
+              LDSHARED="\$(CC) -shared"
+            fi
+          fi
+        fi
+      fi
+
+        CROSSTEST=""
+
+    if test "$cross_compiling" = "no"
+    then
+      for ac_prog in i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; 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_prog_CROSSCC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CROSSCC"; then
+  ac_cv_prog_CROSSCC="$CROSSCC" # Let the user override the test.
+else
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CROSSCC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CROSSCC=$ac_cv_prog_CROSSCC
+if test -n "$CROSSCC"; then
+  { echo "$as_me:$LINENO: result: $CROSSCC" >&5
+echo "${ECHO_T}$CROSSCC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$CROSSCC" && break
+done
+test -n "$CROSSCC" || CROSSCC="false"
+
+      for ac_prog in i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; 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_prog_DLLTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+echo "${ECHO_T}$DLLTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$DLLTOOL" && break
+done
+test -n "$DLLTOOL" || DLLTOOL="false"
+
+      for ac_prog in i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; 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_prog_CROSSWINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CROSSWINDRES"; then
+  ac_cv_prog_CROSSWINDRES="$CROSSWINDRES" # Let the user override the test.
+else
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CROSSWINDRES="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CROSSWINDRES=$ac_cv_prog_CROSSWINDRES
+if test -n "$CROSSWINDRES"; then
+  { echo "$as_me:$LINENO: result: $CROSSWINDRES" >&5
+echo "${ECHO_T}$CROSSWINDRES" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$CROSSWINDRES" && break
+done
+test -n "$CROSSWINDRES" || CROSSWINDRES="false"
+
+      if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
+    fi
+    ;;
+esac
+
+if test "$LIBEXT" = "a"; then
+  { { echo "$as_me:$LINENO: error: could not find a way to build shared libraries.
+It is currently not possible to build Wine without shared library
+(.so) support to allow transparent switch between .so and .dll files.
+If you are using Linux, you will need a newer binutils.
+" >&5
+echo "$as_me: error: could not find a way to build shared libraries.
+It is currently not possible to build Wine without shared library
+(.so) support to allow transparent switch between .so and .dll files.
+If you are using Linux, you will need a newer binutils.
+" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+case $build_os in
+  cygwin*|mingw32*)
+    LDPATH="PATH=\"\$(TOOLSDIR)/libs/wine:\$\$PATH\""
+ ;;
+  darwin*|macosx*)
+    LDPATH="DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$DYLD_LIBRARY_PATH\""
+ ;;
+  *)
+    LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$LD_LIBRARY_PATH\""
+ ;;
+esac
+
+case $host_os in
+  mingw32*)
+    CRTLIBS="-lmsvcrt"
+
+    SOCKETLIBS="-lws2_32"
+
+    ;;
+esac
+
+MAIN_BINARY="wine-pthread"
+  case $host_cpu in
+  *i[3456789]86*)
+    case $host_os in
+      linux* | k*bsd*-gnu)
+        MAIN_BINARY="wine-glibc"
+
+        EXTRA_BINARIES="wine-kthread wine-pthread wine-preloader"
+ ;;
+    esac
+    ;;
+esac
+
+
+if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
+then
+  # Extract the first word of "ldd", so it can be a program name with args.
+set dummy ldd; 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_LDD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $LDD in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LDD="$LDD" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/sbin:/usr/sbin:$PATH"
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_LDD="$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
+
+  test -z "$ac_cv_path_LDD" && ac_cv_path_LDD="true"
+  ;;
+esac
+fi
+LDD=$ac_cv_path_LDD
+if test -n "$LDD"; then
+  { echo "$as_me:$LINENO: result: $LDD" >&5
+echo "${ECHO_T}$LDD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-        fi
 
-        { echo "$as_me:$LINENO: checking whether the linker accepts --rpath" >&5
-echo $ECHO_N "checking whether the linker accepts --rpath... $ECHO_C" >&6; }
-if test "${ac_cv_ld_rpath+set}" = set; then
+{ echo "$as_me:$LINENO: checking for -lX11 soname" >&5
+echo $ECHO_N "checking for -lX11 soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_X11+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -Wl,--rpath,\$ORIGIN/../lib"
-cat >conftest.$ac_ext <<_ACEOF
+  ac_get_soname_save_LIBS=$LIBS
+LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $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 XCreateWindow ();
 int
 main ()
 {
-
+return XCreateWindow ();
   ;
   return 0;
 }
@@ -16768,48 +16464,60 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_ld_rpath="yes"
+  case "$LIBEXT" in
+    dylib) ac_cv_lib_soname_X11=`otool -L conftest$ac_exeext | grep libX11\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep libX11\\.so | sed -e "s/^.*\(libX11\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
+  if test "x$ac_cv_lib_soname_X11" = "x"
+  then
+     ac_cv_lib_soname_X11="libX11.$LIBEXT"
+  fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_ld_rpath="no"
+	ac_cv_lib_soname_X11="libX11.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$ac_wine_try_cflags_saved
+  LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_ld_rpath" >&5
-echo "${ECHO_T}$ac_cv_ld_rpath" >&6; }
-        if test "$ac_cv_ld_rpath" = "yes"
-        then
-          LDEXERPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_X11" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_X11" >&6; }
+if test "${ac_cv_lib_soname_X11+set}" = set; then
 
-          LDDLLRPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(dlldir) \$(libdir)\`"
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBX11 "$ac_cv_lib_soname_X11"
+_ACEOF
 
-        fi
+fi
 
-        case $host_cpu in
-          *i[3456789]86* | x86_64)
-            { echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x7bf00000" >&5
-echo $ECHO_N "checking whether we can relocate the executable to 0x7bf00000... $ECHO_C" >&6; }
-if test "${ac_cv_ld_reloc_exec+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lXext soname" >&5
+echo $ECHO_N "checking for -lXext soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_Xext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7bf00400"
-cat >conftest.$ac_ext <<_ACEOF
+  ac_get_soname_save_LIBS=$LIBS
+LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $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 XextCreateExtension ();
 int
 main ()
 {
-
+return XextCreateExtension ();
   ;
   return 0;
 }
@@ -16848,184 +16556,63 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_ld_reloc_exec="yes"
+  case "$LIBEXT" in
+    dylib) ac_cv_lib_soname_Xext=`otool -L conftest$ac_exeext | grep libXext\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep libXext\\.so | sed -e "s/^.*\(libXext\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
+  if test "x$ac_cv_lib_soname_Xext" = "x"
+  then
+     ac_cv_lib_soname_Xext="libXext.$LIBEXT"
+  fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_ld_reloc_exec="no"
+	ac_cv_lib_soname_Xext="libXext.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$ac_wine_try_cflags_saved
+  LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
-echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6; }
-            if test "$ac_cv_ld_reloc_exec" = "yes"
-            then
-              LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
-            fi
-            ;;
-        esac
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xext" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_Xext" >&6; }
+if test "${ac_cv_lib_soname_Xext+set}" = set; then
 
-      else
-        { echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5
-echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_unixware+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
-cat >conftest.$ac_ext <<_ACEOF
-void myfunc() {}
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBXEXT "$ac_cv_lib_soname_Xext"
 _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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s 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_c_dll_unixware="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_dll_unixware="no"
-fi
 
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$ac_wine_try_cflags_saved
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_unixware" >&5
-echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6; }
-        if test "$ac_cv_c_dll_unixware" = "yes"
-        then
-          LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
-          LDDLLFLAGS="-Wl,-G,-B,symbolic"
 
-        else
-          { echo "$as_me:$LINENO: checking whether we can build a Mach-O (Mac OS X/Darwin) dll" >&5
-echo $ECHO_N "checking whether we can build a Mach-O (Mac OS X/Darwin) dll... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_macho+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lXi soname" >&5
+echo $ECHO_N "checking for -lXi soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_Xi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -bundle"
-cat >conftest.$ac_ext <<_ACEOF
-void myfunc() {}
+  ac_get_soname_save_LIBS=$LIBS
+LIBS="-lXi $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _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); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (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); }; } &&
-	 { ac_try='test -s 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_c_dll_macho="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_dll_macho="no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$ac_wine_try_cflags_saved
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_macho" >&5
-echo "${ECHO_T}$ac_cv_c_dll_macho" >&6; }
-          if test "$ac_cv_c_dll_macho" = "yes"
-          then
-            LIBEXT="dylib"
-            LDDLLFLAGS="-bundle -multiply_defined suppress"
-            LDSHARED="\$(CC) -dynamiclib -install_name @executable_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`/\$(DYNAME)"
-            STRIP="$STRIP -u -r"
-                        COREFOUNDATIONLIB="-framework CoreFoundation"
-
-            IOKITLIB="-framework IOKit -framework CoreFoundation"
-
-            LDEXECFLAGS="-image_base 0x7bf00000 -Wl,-segaddr,WINE_DOS,0x00000000,-segaddr,WINE_SHARED_HEAP,0x7f000000"
-
-	    if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" -a "$ac_cv_header_AudioUnit_AudioUnit_h" = "yes"
-            then
-				COREAUDIO="-framework CoreAudio -framework AudioUnit -framework CoreServices"
-
-	    fi
-            case $host_cpu in
-              *powerpc*)
-                CFLAGS="$CFLAGS -ffixed-r13"
-                LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning"
-                ;;
-            esac
-
-          else
-            { echo "$as_me:$LINENO: checking whether we can build an HP-UX dll" >&5
-echo $ECHO_N "checking whether we can build an HP-UX dll... $ECHO_C" >&6; }
-if test "${ac_cv_c_dll_hpux+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -shared"
-cat >conftest.$ac_ext <<_ACEOF
-void myfunc() {}
+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 XOpenDevice ();
+int
+main ()
+{
+return XOpenDevice ();
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -17061,270 +16648,226 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_dll_hpux="yes"
+  case "$LIBEXT" in
+    dylib) ac_cv_lib_soname_Xi=`otool -L conftest$ac_exeext | grep libXi\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_Xi=`$ac_cv_path_LDD conftest$ac_exeext | grep libXi\\.so | sed -e "s/^.*\(libXi\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
+  if test "x$ac_cv_lib_soname_Xi" = "x"
+  then
+     ac_cv_lib_soname_Xi="libXi.$LIBEXT"
+  fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_dll_hpux="no"
+	ac_cv_lib_soname_Xi="libXi.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$ac_wine_try_cflags_saved
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_hpux" >&5
-echo "${ECHO_T}$ac_cv_c_dll_hpux" >&6; }
-            if test "$ac_cv_c_dll_hpux" = "yes"
-            then
-              LIBEXT="sl"
-              DLLEXT=".sl"
-              LDDLLFLAGS="-shared -fPIC"
-              LDSHARED="\$(CC) -shared"
-            fi
-          fi
-        fi
-      fi
-    fi
-
-        CROSSTEST=""
-
-    if test "$cross_compiling" = "no"
-    then
-      for ac_prog in i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; 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_prog_CROSSCC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CROSSCC"; then
-  ac_cv_prog_CROSSCC="$CROSSCC" # Let the user override the test.
-else
-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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CROSSCC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CROSSCC=$ac_cv_prog_CROSSCC
-if test -n "$CROSSCC"; then
-  { echo "$as_me:$LINENO: result: $CROSSCC" >&5
-echo "${ECHO_T}$CROSSCC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  LIBS=$ac_get_soname_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xi" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_Xi" >&6; }
+if test "${ac_cv_lib_soname_Xi+set}" = set; then
 
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBXI "$ac_cv_lib_soname_Xi"
+_ACEOF
 
-  test -n "$CROSSCC" && break
-done
-test -n "$CROSSCC" || CROSSCC="false"
-
-      for ac_prog in i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; 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_prog_DLLTOOL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DLLTOOL="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { echo "$as_me:$LINENO: result: $DLLTOOL" >&5
-echo "${ECHO_T}$DLLTOOL" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
 fi
 
-
-  test -n "$DLLTOOL" && break
-done
-test -n "$DLLTOOL" || DLLTOOL="false"
-
-      for ac_prog in i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; 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_prog_CROSSWINDRES+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lXrender soname" >&5
+echo $ECHO_N "checking for -lXrender soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_Xrender+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$CROSSWINDRES"; then
-  ac_cv_prog_CROSSWINDRES="$CROSSWINDRES" # Let the user override the test.
-else
-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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CROSSWINDRES="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CROSSWINDRES=$ac_cv_prog_CROSSWINDRES
-if test -n "$CROSSWINDRES"; then
-  { echo "$as_me:$LINENO: result: $CROSSWINDRES" >&5
-echo "${ECHO_T}$CROSSWINDRES" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  test -n "$CROSSWINDRES" && break
-done
-test -n "$CROSSWINDRES" || CROSSWINDRES="false"
+  ac_get_soname_save_LIBS=$LIBS
+LIBS="-lXrender $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-      if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
-    fi
-    ;;
+/* 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 XRenderQueryExtension ();
+int
+main ()
+{
+return XRenderQueryExtension ();
+  ;
+  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
-
-if test "$LIBEXT" = "a"; then
-  { { echo "$as_me:$LINENO: error: could not find a way to build shared libraries.
-It is currently not possible to build Wine without shared library
-(.so) support to allow transparent switch between .so and .dll files.
-If you are using Linux, you will need a newer binutils.
-" >&5
-echo "$as_me: error: could not find a way to build shared libraries.
-It is currently not possible to build Wine without shared library
-(.so) support to allow transparent switch between .so and .dll files.
-If you are using Linux, you will need a newer binutils.
-" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-case $build_os in
-  cygwin*|mingw32*)
-    LDPATH="PATH=\"\$(TOOLSDIR)/libs/wine:\$\$PATH\""
- ;;
-  darwin*|macosx*)
-    LDPATH="DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$DYLD_LIBRARY_PATH\""
- ;;
-  *)
-    LDPATH="LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$LD_LIBRARY_PATH\""
- ;;
+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); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (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); }; } &&
+	 { ac_try='test -s 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
+  case "$LIBEXT" in
+    dylib) ac_cv_lib_soname_Xrender=`otool -L conftest$ac_exeext | grep libXrender\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrender\\.so | sed -e "s/^.*\(libXrender\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
+  if test "x$ac_cv_lib_soname_Xrender" = "x"
+  then
+     ac_cv_lib_soname_Xrender="libXrender.$LIBEXT"
+  fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-case $host_os in
-  mingw32*)
-    CRTLIBS="-lmsvcrt"
-
-    SOCKETLIBS="-lws2_32"
-
-    ;;
-esac
+	ac_cv_lib_soname_Xrender="libXrender.$LIBEXT"
+fi
 
-MAIN_BINARY="wine-pthread"
-  case $host_cpu in
-  *i[3456789]86*)
-    case $host_os in
-      linux* | k*bsd*-gnu)
-        MAIN_BINARY="wine-glibc"
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  LIBS=$ac_get_soname_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xrender" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_Xrender" >&6; }
+if test "${ac_cv_lib_soname_Xrender+set}" = set; then
 
-        EXTRA_BINARIES="wine-kthread wine-pthread wine-preloader"
- ;;
-    esac
-    ;;
-esac
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBXRENDER "$ac_cv_lib_soname_Xrender"
+_ACEOF
 
+fi
 
-if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
-then
-  # Extract the first word of "ldd", so it can be a program name with args.
-set dummy ldd; 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_LDD+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lXrandr soname" >&5
+echo $ECHO_N "checking for -lXrandr soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_Xrandr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LDD in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_LDD="$LDD" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/sbin:/usr/sbin:$PATH"
-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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_LDD="$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
+  ac_get_soname_save_LIBS=$LIBS
+LIBS="-lXrandr $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  test -z "$ac_cv_path_LDD" && ac_cv_path_LDD="true"
-  ;;
+/* 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 XRRQueryExtension ();
+int
+main ()
+{
+return XRRQueryExtension ();
+  ;
+  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
-fi
-LDD=$ac_cv_path_LDD
-if test -n "$LDD"; then
-  { echo "$as_me:$LINENO: result: $LDD" >&5
-echo "${ECHO_T}$LDD" >&6; }
+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); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (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); }; } &&
+	 { ac_try='test -s 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
+  case "$LIBEXT" in
+    dylib) ac_cv_lib_soname_Xrandr=`otool -L conftest$ac_exeext | grep libXrandr\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_Xrandr=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrandr\\.so | sed -e "s/^.*\(libXrandr\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
+  if test "x$ac_cv_lib_soname_Xrandr" = "x"
+  then
+     ac_cv_lib_soname_Xrandr="libXrandr.$LIBEXT"
+  fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_soname_Xrandr="libXrandr.$LIBEXT"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  LIBS=$ac_get_soname_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xrandr" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_Xrandr" >&6; }
+if test "${ac_cv_lib_soname_Xrandr+set}" = set; then
+
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBXRANDR "$ac_cv_lib_soname_Xrandr"
+_ACEOF
 
+fi
 
-{ echo "$as_me:$LINENO: checking for -lX11 soname" >&5
-echo $ECHO_N "checking for -lX11 soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_X11+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lfreetype soname" >&5
+echo $ECHO_N "checking for -lfreetype soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_freetype+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $LIBS"
+LIBS="-lfreetype $X_LIBS $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17338,11 +16881,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XCreateWindow ();
+char FT_Init_FreeType ();
 int
 main ()
 {
-return XCreateWindow ();
+return FT_Init_FreeType ();
   ;
   return 0;
 }
@@ -17382,41 +16925,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_X11=`otool -L conftest$ac_exeext | grep libX11\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep libX11\\.so | sed -e "s/^.*\(libX11\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_freetype=`otool -L conftest$ac_exeext | grep libfreetype\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep libfreetype\\.so | sed -e "s/^.*\(libfreetype\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_X11" = "x"
+  if test "x$ac_cv_lib_soname_freetype" = "x"
   then
-     ac_cv_lib_soname_X11="libX11.$LIBEXT"
+     ac_cv_lib_soname_freetype="libfreetype.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_X11="libX11.$LIBEXT"
+	ac_cv_lib_soname_freetype="libfreetype.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_X11" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_X11" >&6; }
-if test "${ac_cv_lib_soname_X11+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_freetype" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_freetype" >&6; }
+if test "${ac_cv_lib_soname_freetype+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBX11 "$ac_cv_lib_soname_X11"
+#define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lXext soname" >&5
-echo $ECHO_N "checking for -lXext soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_Xext+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lGL soname" >&5
+echo $ECHO_N "checking for -lGL soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_GL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+LIBS="-lGL $X_LIBS $X_EXTRA_LIBS $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17430,11 +16973,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XextCreateExtension ();
+char glXQueryExtension ();
 int
 main ()
 {
-return XextCreateExtension ();
+return glXQueryExtension ();
   ;
   return 0;
 }
@@ -17474,41 +17017,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_Xext=`otool -L conftest$ac_exeext | grep libXext\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep libXext\\.so | sed -e "s/^.*\(libXext\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_GL=`otool -L conftest$ac_exeext | grep libGL\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest$ac_exeext | grep libGL\\.so | sed -e "s/^.*\(libGL\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_Xext" = "x"
+  if test "x$ac_cv_lib_soname_GL" = "x"
   then
-     ac_cv_lib_soname_Xext="libXext.$LIBEXT"
+     ac_cv_lib_soname_GL="libGL.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_Xext="libXext.$LIBEXT"
+	ac_cv_lib_soname_GL="libGL.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xext" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_Xext" >&6; }
-if test "${ac_cv_lib_soname_Xext+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_GL" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_GL" >&6; }
+if test "${ac_cv_lib_soname_GL+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBXEXT "$ac_cv_lib_soname_Xext"
+#define SONAME_LIBGL "$ac_cv_lib_soname_GL"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lXi soname" >&5
-echo $ECHO_N "checking for -lXi soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_Xi+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -ldbus-1 soname" >&5
+echo $ECHO_N "checking for -ldbus-1 soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_dbus_1+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lXi $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+LIBS="-ldbus-1  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17522,11 +17065,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XOpenDevice ();
+char dbus_error_init ();
 int
 main ()
 {
-return XOpenDevice ();
+return dbus_error_init ();
   ;
   return 0;
 }
@@ -17566,41 +17109,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_Xi=`otool -L conftest$ac_exeext | grep libXi\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_Xi=`$ac_cv_path_LDD conftest$ac_exeext | grep libXi\\.so | sed -e "s/^.*\(libXi\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_dbus_1=`otool -L conftest$ac_exeext | grep libdbus-1\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest$ac_exeext | grep libdbus-1\\.so | sed -e "s/^.*\(libdbus-1\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_Xi" = "x"
+  if test "x$ac_cv_lib_soname_dbus_1" = "x"
   then
-     ac_cv_lib_soname_Xi="libXi.$LIBEXT"
+     ac_cv_lib_soname_dbus_1="libdbus-1.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_Xi="libXi.$LIBEXT"
+	ac_cv_lib_soname_dbus_1="libdbus-1.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xi" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_Xi" >&6; }
-if test "${ac_cv_lib_soname_Xi+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_dbus_1" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_dbus_1" >&6; }
+if test "${ac_cv_lib_soname_dbus_1+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBXI "$ac_cv_lib_soname_Xi"
+#define SONAME_LIBDBUS_1 "$ac_cv_lib_soname_dbus_1"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lXrender soname" >&5
-echo $ECHO_N "checking for -lXrender soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_Xrender+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lhal soname" >&5
+echo $ECHO_N "checking for -lhal soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_hal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lXrender $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+LIBS="-lhal  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17614,11 +17157,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XRenderQueryExtension ();
+char libhal_ctx_new ();
 int
 main ()
 {
-return XRenderQueryExtension ();
+return libhal_ctx_new ();
   ;
   return 0;
 }
@@ -17658,41 +17201,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_Xrender=`otool -L conftest$ac_exeext | grep libXrender\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrender\\.so | sed -e "s/^.*\(libXrender\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_hal=`otool -L conftest$ac_exeext | grep libhal\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_hal=`$ac_cv_path_LDD conftest$ac_exeext | grep libhal\\.so | sed -e "s/^.*\(libhal\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_Xrender" = "x"
+  if test "x$ac_cv_lib_soname_hal" = "x"
   then
-     ac_cv_lib_soname_Xrender="libXrender.$LIBEXT"
+     ac_cv_lib_soname_hal="libhal.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_Xrender="libXrender.$LIBEXT"
+	ac_cv_lib_soname_hal="libhal.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xrender" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_Xrender" >&6; }
-if test "${ac_cv_lib_soname_Xrender+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_hal" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_hal" >&6; }
+if test "${ac_cv_lib_soname_hal+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBXRENDER "$ac_cv_lib_soname_Xrender"
+#define SONAME_LIBHAL "$ac_cv_lib_soname_hal"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lXrandr soname" >&5
-echo $ECHO_N "checking for -lXrandr soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_Xrandr+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -ltxc_dxtn soname" >&5
+echo $ECHO_N "checking for -ltxc_dxtn soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_txc_dxtn+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lXrandr $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
+LIBS="-ltxc_dxtn  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17706,11 +17249,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char XRRQueryExtension ();
+char fetch_2d_texel_rgba_dxt1 ();
 int
 main ()
 {
-return XRRQueryExtension ();
+return fetch_2d_texel_rgba_dxt1 ();
   ;
   return 0;
 }
@@ -17750,41 +17293,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_Xrandr=`otool -L conftest$ac_exeext | grep libXrandr\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_Xrandr=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrandr\\.so | sed -e "s/^.*\(libXrandr\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_txc_dxtn=`otool -L conftest$ac_exeext | grep libtxc_dxtn\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libtxc_dxtn\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_txc_dxtn=`$ac_cv_path_LDD conftest$ac_exeext | grep libtxc_dxtn\\.so | sed -e "s/^.*\(libtxc_dxtn\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_Xrandr" = "x"
+  if test "x$ac_cv_lib_soname_txc_dxtn" = "x"
   then
-     ac_cv_lib_soname_Xrandr="libXrandr.$LIBEXT"
+     ac_cv_lib_soname_txc_dxtn="libtxc_dxtn.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_Xrandr="libXrandr.$LIBEXT"
+	ac_cv_lib_soname_txc_dxtn="libtxc_dxtn.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xrandr" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_Xrandr" >&6; }
-if test "${ac_cv_lib_soname_Xrandr+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_txc_dxtn" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_txc_dxtn" >&6; }
+if test "${ac_cv_lib_soname_txc_dxtn+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBXRANDR "$ac_cv_lib_soname_Xrandr"
+#define SONAME_LIBTXC_DXTN "$ac_cv_lib_soname_txc_dxtn"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lfreetype soname" >&5
-echo $ECHO_N "checking for -lfreetype soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_freetype+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lcups soname" >&5
+echo $ECHO_N "checking for -lcups soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_cups+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lfreetype $X_LIBS $LIBS"
+LIBS="-lcups  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17798,11 +17341,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char FT_Init_FreeType ();
+char cupsGetDefault ();
 int
 main ()
 {
-return FT_Init_FreeType ();
+return cupsGetDefault ();
   ;
   return 0;
 }
@@ -17842,41 +17385,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_freetype=`otool -L conftest$ac_exeext | grep libfreetype\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep libfreetype\\.so | sed -e "s/^.*\(libfreetype\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_cups=`otool -L conftest$ac_exeext | grep libcups\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest$ac_exeext | grep libcups\\.so | sed -e "s/^.*\(libcups\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_freetype" = "x"
+  if test "x$ac_cv_lib_soname_cups" = "x"
   then
-     ac_cv_lib_soname_freetype="libfreetype.$LIBEXT"
+     ac_cv_lib_soname_cups="libcups.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_freetype="libfreetype.$LIBEXT"
+	ac_cv_lib_soname_cups="libcups.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_freetype" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_freetype" >&6; }
-if test "${ac_cv_lib_soname_freetype+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_cups" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_cups" >&6; }
+if test "${ac_cv_lib_soname_cups+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype"
+#define SONAME_LIBCUPS "$ac_cv_lib_soname_cups"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lGL soname" >&5
-echo $ECHO_N "checking for -lGL soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_GL+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -ljack soname" >&5
+echo $ECHO_N "checking for -ljack soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_jack+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lGL $X_LIBS $X_EXTRA_LIBS $LIBS"
+LIBS="-ljack  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17890,11 +17433,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char glXQueryExtension ();
+char jack_client_new ();
 int
 main ()
 {
-return glXQueryExtension ();
+return jack_client_new ();
   ;
   return 0;
 }
@@ -17934,41 +17477,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_GL=`otool -L conftest$ac_exeext | grep libGL\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest$ac_exeext | grep libGL\\.so | sed -e "s/^.*\(libGL\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_jack=`otool -L conftest$ac_exeext | grep libjack\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libjack\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_jack=`$ac_cv_path_LDD conftest$ac_exeext | grep libjack\\.so | sed -e "s/^.*\(libjack\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_GL" = "x"
+  if test "x$ac_cv_lib_soname_jack" = "x"
   then
-     ac_cv_lib_soname_GL="libGL.$LIBEXT"
+     ac_cv_lib_soname_jack="libjack.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_GL="libGL.$LIBEXT"
+	ac_cv_lib_soname_jack="libjack.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_GL" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_GL" >&6; }
-if test "${ac_cv_lib_soname_GL+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_jack" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_jack" >&6; }
+if test "${ac_cv_lib_soname_jack+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBGL "$ac_cv_lib_soname_GL"
+#define SONAME_LIBJACK "$ac_cv_lib_soname_jack"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -ldbus-1 soname" >&5
-echo $ECHO_N "checking for -ldbus-1 soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_dbus_1+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lfontconfig soname" >&5
+echo $ECHO_N "checking for -lfontconfig soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_fontconfig+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-ldbus-1  $LIBS"
+LIBS="-lfontconfig  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17982,11 +17525,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char dbus_error_init ();
+char FcInit ();
 int
 main ()
 {
-return dbus_error_init ();
+return FcInit ();
   ;
   return 0;
 }
@@ -18026,41 +17569,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_dbus_1=`otool -L conftest$ac_exeext | grep libdbus-1\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest$ac_exeext | grep libdbus-1\\.so | sed -e "s/^.*\(libdbus-1\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_fontconfig=`otool -L conftest$ac_exeext | grep libfontconfig\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest$ac_exeext | grep libfontconfig\\.so | sed -e "s/^.*\(libfontconfig\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_dbus_1" = "x"
+  if test "x$ac_cv_lib_soname_fontconfig" = "x"
   then
-     ac_cv_lib_soname_dbus_1="libdbus-1.$LIBEXT"
+     ac_cv_lib_soname_fontconfig="libfontconfig.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_dbus_1="libdbus-1.$LIBEXT"
+	ac_cv_lib_soname_fontconfig="libfontconfig.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_dbus_1" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_dbus_1" >&6; }
-if test "${ac_cv_lib_soname_dbus_1+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_fontconfig" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_fontconfig" >&6; }
+if test "${ac_cv_lib_soname_fontconfig+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBDBUS_1 "$ac_cv_lib_soname_dbus_1"
+#define SONAME_LIBFONTCONFIG "$ac_cv_lib_soname_fontconfig"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lhal soname" >&5
-echo $ECHO_N "checking for -lhal soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_hal+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lssl soname" >&5
+echo $ECHO_N "checking for -lssl soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_ssl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lhal  $LIBS"
+LIBS="-lssl  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18074,11 +17617,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char libhal_ctx_new ();
+char SSL_library_init ();
 int
 main ()
 {
-return libhal_ctx_new ();
+return SSL_library_init ();
   ;
   return 0;
 }
@@ -18118,41 +17661,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_hal=`otool -L conftest$ac_exeext | grep libhal\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_hal=`$ac_cv_path_LDD conftest$ac_exeext | grep libhal\\.so | sed -e "s/^.*\(libhal\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_ssl=`otool -L conftest$ac_exeext | grep libssl\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libssl\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_ssl=`$ac_cv_path_LDD conftest$ac_exeext | grep libssl\\.so | sed -e "s/^.*\(libssl\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_hal" = "x"
+  if test "x$ac_cv_lib_soname_ssl" = "x"
   then
-     ac_cv_lib_soname_hal="libhal.$LIBEXT"
+     ac_cv_lib_soname_ssl="libssl.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_hal="libhal.$LIBEXT"
+	ac_cv_lib_soname_ssl="libssl.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_hal" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_hal" >&6; }
-if test "${ac_cv_lib_soname_hal+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ssl" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_ssl" >&6; }
+if test "${ac_cv_lib_soname_ssl+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBHAL "$ac_cv_lib_soname_hal"
+#define SONAME_LIBSSL "$ac_cv_lib_soname_ssl"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -ltxc_dxtn soname" >&5
-echo $ECHO_N "checking for -ltxc_dxtn soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_txc_dxtn+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lcrypto soname" >&5
+echo $ECHO_N "checking for -lcrypto soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_crypto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-ltxc_dxtn  $LIBS"
+LIBS="-lcrypto  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18166,11 +17709,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char fetch_2d_texel_rgba_dxt1 ();
+char BIO_new_socket ();
 int
 main ()
 {
-return fetch_2d_texel_rgba_dxt1 ();
+return BIO_new_socket ();
   ;
   return 0;
 }
@@ -18210,41 +17753,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_txc_dxtn=`otool -L conftest$ac_exeext | grep libtxc_dxtn\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libtxc_dxtn\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_txc_dxtn=`$ac_cv_path_LDD conftest$ac_exeext | grep libtxc_dxtn\\.so | sed -e "s/^.*\(libtxc_dxtn\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_crypto=`otool -L conftest$ac_exeext | grep libcrypto\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcrypto\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_crypto=`$ac_cv_path_LDD conftest$ac_exeext | grep libcrypto\\.so | sed -e "s/^.*\(libcrypto\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_txc_dxtn" = "x"
+  if test "x$ac_cv_lib_soname_crypto" = "x"
   then
-     ac_cv_lib_soname_txc_dxtn="libtxc_dxtn.$LIBEXT"
+     ac_cv_lib_soname_crypto="libcrypto.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_txc_dxtn="libtxc_dxtn.$LIBEXT"
+	ac_cv_lib_soname_crypto="libcrypto.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_txc_dxtn" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_txc_dxtn" >&6; }
-if test "${ac_cv_lib_soname_txc_dxtn+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_crypto" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_crypto" >&6; }
+if test "${ac_cv_lib_soname_crypto+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBTXC_DXTN "$ac_cv_lib_soname_txc_dxtn"
+#define SONAME_LIBCRYPTO "$ac_cv_lib_soname_crypto"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lcups soname" >&5
-echo $ECHO_N "checking for -lcups soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_cups+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lncurses soname" >&5
+echo $ECHO_N "checking for -lncurses soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_ncurses+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lcups  $LIBS"
+LIBS="-lncurses  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18258,11 +17801,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char cupsGetDefault ();
+char waddch ();
 int
 main ()
 {
-return cupsGetDefault ();
+return waddch ();
   ;
   return 0;
 }
@@ -18302,41 +17845,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_cups=`otool -L conftest$ac_exeext | grep libcups\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest$ac_exeext | grep libcups\\.so | sed -e "s/^.*\(libcups\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_ncurses=`otool -L conftest$ac_exeext | grep libncurses\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libncurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_ncurses=`$ac_cv_path_LDD conftest$ac_exeext | grep libncurses\\.so | sed -e "s/^.*\(libncurses\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_cups" = "x"
+  if test "x$ac_cv_lib_soname_ncurses" = "x"
   then
-     ac_cv_lib_soname_cups="libcups.$LIBEXT"
+     ac_cv_lib_soname_ncurses="libncurses.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_cups="libcups.$LIBEXT"
+	ac_cv_lib_soname_ncurses="libncurses.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_cups" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_cups" >&6; }
-if test "${ac_cv_lib_soname_cups+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ncurses" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_ncurses" >&6; }
+if test "${ac_cv_lib_soname_ncurses+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBCUPS "$ac_cv_lib_soname_cups"
+#define SONAME_LIBNCURSES "$ac_cv_lib_soname_ncurses"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -ljack soname" >&5
-echo $ECHO_N "checking for -ljack soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_jack+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lcurses soname" >&5
+echo $ECHO_N "checking for -lcurses soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_curses+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-ljack  $LIBS"
+LIBS="-lcurses  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18350,11 +17893,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char jack_client_new ();
+char waddch ();
 int
 main ()
 {
-return jack_client_new ();
+return waddch ();
   ;
   return 0;
 }
@@ -18394,41 +17937,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_jack=`otool -L conftest$ac_exeext | grep libjack\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libjack\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_jack=`$ac_cv_path_LDD conftest$ac_exeext | grep libjack\\.so | sed -e "s/^.*\(libjack\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_curses=`otool -L conftest$ac_exeext | grep libcurses\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_curses=`$ac_cv_path_LDD conftest$ac_exeext | grep libcurses\\.so | sed -e "s/^.*\(libcurses\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_jack" = "x"
+  if test "x$ac_cv_lib_soname_curses" = "x"
   then
-     ac_cv_lib_soname_jack="libjack.$LIBEXT"
+     ac_cv_lib_soname_curses="libcurses.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_jack="libjack.$LIBEXT"
+	ac_cv_lib_soname_curses="libcurses.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_jack" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_jack" >&6; }
-if test "${ac_cv_lib_soname_jack+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_curses" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_curses" >&6; }
+if test "${ac_cv_lib_soname_curses+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBJACK "$ac_cv_lib_soname_jack"
+#define SONAME_LIBCURSES "$ac_cv_lib_soname_curses"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lfontconfig soname" >&5
-echo $ECHO_N "checking for -lfontconfig soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_fontconfig+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -ljpeg soname" >&5
+echo $ECHO_N "checking for -ljpeg soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_jpeg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lfontconfig  $LIBS"
+LIBS="-ljpeg  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18442,11 +17985,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char FcInit ();
+char jpeg_start_decompress ();
 int
 main ()
 {
-return FcInit ();
+return jpeg_start_decompress ();
   ;
   return 0;
 }
@@ -18486,41 +18029,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_fontconfig=`otool -L conftest$ac_exeext | grep libfontconfig\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest$ac_exeext | grep libfontconfig\\.so | sed -e "s/^.*\(libfontconfig\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_jpeg=`otool -L conftest$ac_exeext | grep libjpeg\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_jpeg=`$ac_cv_path_LDD conftest$ac_exeext | grep libjpeg\\.so | sed -e "s/^.*\(libjpeg\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_fontconfig" = "x"
+  if test "x$ac_cv_lib_soname_jpeg" = "x"
   then
-     ac_cv_lib_soname_fontconfig="libfontconfig.$LIBEXT"
+     ac_cv_lib_soname_jpeg="libjpeg.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_fontconfig="libfontconfig.$LIBEXT"
+	ac_cv_lib_soname_jpeg="libjpeg.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_fontconfig" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_fontconfig" >&6; }
-if test "${ac_cv_lib_soname_fontconfig+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_jpeg" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_jpeg" >&6; }
+if test "${ac_cv_lib_soname_jpeg+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBFONTCONFIG "$ac_cv_lib_soname_fontconfig"
+#define SONAME_LIBJPEG "$ac_cv_lib_soname_jpeg"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lssl soname" >&5
-echo $ECHO_N "checking for -lssl soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_ssl+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lungif soname" >&5
+echo $ECHO_N "checking for -lungif soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_ungif+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lssl  $LIBS"
+LIBS="-lungif  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18534,11 +18077,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char SSL_library_init ();
+char DGifOpen ();
 int
 main ()
 {
-return SSL_library_init ();
+return DGifOpen ();
   ;
   return 0;
 }
@@ -18578,41 +18121,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_ssl=`otool -L conftest$ac_exeext | grep libssl\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libssl\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_ssl=`$ac_cv_path_LDD conftest$ac_exeext | grep libssl\\.so | sed -e "s/^.*\(libssl\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_ungif=`otool -L conftest$ac_exeext | grep libungif\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libungif\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_ungif=`$ac_cv_path_LDD conftest$ac_exeext | grep libungif\\.so | sed -e "s/^.*\(libungif\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_ssl" = "x"
+  if test "x$ac_cv_lib_soname_ungif" = "x"
   then
-     ac_cv_lib_soname_ssl="libssl.$LIBEXT"
+     ac_cv_lib_soname_ungif="libungif.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_ssl="libssl.$LIBEXT"
+	ac_cv_lib_soname_ungif="libungif.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ssl" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_ssl" >&6; }
-if test "${ac_cv_lib_soname_ssl+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ungif" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_ungif" >&6; }
+if test "${ac_cv_lib_soname_ungif+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBSSL "$ac_cv_lib_soname_ssl"
+#define SONAME_LIBUNGIF "$ac_cv_lib_soname_ungif"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lcrypto soname" >&5
-echo $ECHO_N "checking for -lcrypto soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_crypto+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lgif soname" >&5
+echo $ECHO_N "checking for -lgif soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_gif+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lcrypto  $LIBS"
+LIBS="-lgif  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18626,11 +18169,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char BIO_new_socket ();
+char DGifOpen ();
 int
 main ()
 {
-return BIO_new_socket ();
+return DGifOpen ();
   ;
   return 0;
 }
@@ -18670,41 +18213,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_crypto=`otool -L conftest$ac_exeext | grep libcrypto\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcrypto\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_crypto=`$ac_cv_path_LDD conftest$ac_exeext | grep libcrypto\\.so | sed -e "s/^.*\(libcrypto\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_gif=`otool -L conftest$ac_exeext | grep libgif\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libgif\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_gif=`$ac_cv_path_LDD conftest$ac_exeext | grep libgif\\.so | sed -e "s/^.*\(libgif\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_crypto" = "x"
+  if test "x$ac_cv_lib_soname_gif" = "x"
   then
-     ac_cv_lib_soname_crypto="libcrypto.$LIBEXT"
+     ac_cv_lib_soname_gif="libgif.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_crypto="libcrypto.$LIBEXT"
+	ac_cv_lib_soname_gif="libgif.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_crypto" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_crypto" >&6; }
-if test "${ac_cv_lib_soname_crypto+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_gif" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_gif" >&6; }
+if test "${ac_cv_lib_soname_gif+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBCRYPTO "$ac_cv_lib_soname_crypto"
+#define SONAME_LIBGIF "$ac_cv_lib_soname_gif"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lncurses soname" >&5
-echo $ECHO_N "checking for -lncurses soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_ncurses+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lcapi20 soname" >&5
+echo $ECHO_N "checking for -lcapi20 soname... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_capi20+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_get_soname_save_LIBS=$LIBS
-LIBS="-lncurses  $LIBS"
+LIBS="-lcapi20  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18718,11 +18261,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char waddch ();
+char capi20_isinstalled ();
 int
 main ()
 {
-return waddch ();
+return capi20_isinstalled ();
   ;
   return 0;
 }
@@ -18762,47 +18305,211 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_ncurses=`otool -L conftest$ac_exeext | grep libncurses\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libncurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_ncurses=`$ac_cv_path_LDD conftest$ac_exeext | grep libncurses\\.so | sed -e "s/^.*\(libncurses\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
+    dylib) ac_cv_lib_soname_capi20=`otool -L conftest$ac_exeext | grep libcapi20\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcapi20\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    so) ac_cv_lib_soname_capi20=`$ac_cv_path_LDD conftest$ac_exeext | grep libcapi20\\.so | sed -e "s/^.*\(libcapi20\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
   esac
-  if test "x$ac_cv_lib_soname_ncurses" = "x"
+  if test "x$ac_cv_lib_soname_capi20" = "x"
   then
-     ac_cv_lib_soname_ncurses="libncurses.$LIBEXT"
+     ac_cv_lib_soname_capi20="libcapi20.$LIBEXT"
   fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_ncurses="libncurses.$LIBEXT"
+	ac_cv_lib_soname_capi20="libcapi20.$LIBEXT"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ncurses" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_ncurses" >&6; }
-if test "${ac_cv_lib_soname_ncurses+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_capi20" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_capi20" >&6; }
+if test "${ac_cv_lib_soname_capi20+set}" = set; then
 
 cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBNCURSES "$ac_cv_lib_soname_ncurses"
+#define SONAME_LIBCAPI20 "$ac_cv_lib_soname_capi20"
 _ACEOF
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lcurses soname" >&5
-echo $ECHO_N "checking for -lcurses soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_curses+set}" = set; then
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in \
+	_lwp_create \
+	_lwp_self \
+	_pclose \
+	_popen \
+	_snprintf \
+	_spawnvp \
+	_stricmp \
+	_strnicmp \
+	_vsnprintf \
+	asctime_r \
+	chsize \
+	clone \
+	connect \
+	dlopen \
+	epoll_create \
+	ffs \
+	finite \
+	fork \
+	fpclass \
+	fstatfs \
+	fstatvfs \
+	ftruncate \
+	futimes \
+	futimesat \
+	getaddrinfo \
+	gethostbyname \
+	getnameinfo \
+	getnetbyname \
+	getopt_long \
+	getpagesize \
+	getprotobyname \
+	getprotobynumber \
+	getpwuid \
+	getservbyport \
+	gettid \
+	gettimeofday \
+	getuid \
+	inet_aton \
+	inet_network \
+	kqueue \
+	lstat \
+	memmove \
+	mmap \
+	pclose \
+	poll \
+	popen \
+	prctl \
+	pread \
+	pwrite \
+	readlink \
+	rfork \
+	sched_yield \
+	select \
+	sendmsg \
+	setrlimit \
+	settimeofday \
+	sigaltstack \
+	sigprocmask \
+	snprintf \
+	spawnvp \
+	statfs \
+	statvfs \
+	strcasecmp \
+	strerror \
+	strncasecmp \
+	tcgetattr \
+	timegm \
+	usleep \
+	vsnprintf \
+	wait4 \
+	waitpid \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_get_soname_save_LIBS=$LIBS
-LIBS="-lcurses  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -18810,11 +18517,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char waddch ();
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-return waddch ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -18853,43 +18567,39 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_curses=`otool -L conftest$ac_exeext | grep libcurses\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_curses=`$ac_cv_path_LDD conftest$ac_exeext | grep libcurses\\.so | sed -e "s/^.*\(libcurses\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
-  esac
-  if test "x$ac_cv_lib_soname_curses" = "x"
-  then
-     ac_cv_lib_soname_curses="libcurses.$LIBEXT"
-  fi
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_curses="libcurses.$LIBEXT"
+	eval "$as_ac_var=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_curses" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_curses" >&6; }
-if test "${ac_cv_lib_soname_curses+set}" = set; then
-
-cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBCURSES "$ac_cv_lib_soname_curses"
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
+done
 
-  { echo "$as_me:$LINENO: checking for -ljpeg soname" >&5
-echo $ECHO_N "checking for -ljpeg soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_jpeg+set}" = set; then
+
+if test "$ac_cv_func_dlopen" = no
+then
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_get_soname_save_LIBS=$LIBS
-LIBS="-ljpeg  $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18902,11 +18612,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char jpeg_start_decompress ();
+char dlopen ();
 int
 main ()
 {
-return jpeg_start_decompress ();
+return dlopen ();
   ;
   return 0;
 }
@@ -18945,48 +18655,62 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_jpeg=`otool -L conftest$ac_exeext | grep libjpeg\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_jpeg=`$ac_cv_path_LDD conftest$ac_exeext | grep libjpeg\\.so | sed -e "s/^.*\(libjpeg\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
-  esac
-  if test "x$ac_cv_lib_soname_jpeg" = "x"
-  then
-     ac_cv_lib_soname_jpeg="libjpeg.$LIBEXT"
-  fi
+  ac_cv_lib_dl_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_jpeg="libjpeg.$LIBEXT"
+	ac_cv_lib_dl_dlopen=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS=$ac_get_soname_save_LIBS
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_jpeg" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_jpeg" >&6; }
-if test "${ac_cv_lib_soname_jpeg+set}" = set; then
-
-cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBJPEG "$ac_cv_lib_soname_jpeg"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_DLOPEN 1
 _ACEOF
+ LIBDL="-ldl"
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lungif soname" >&5
-echo $ECHO_N "checking for -lungif soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_ungif+set}" = set; then
+fi
+ac_wine_check_funcs_save_LIBS="$LIBS"
+LIBS="$LIBS $LIBDL"
+
+for ac_func in dladdr
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_get_soname_save_LIBS=$LIBS
-LIBS="-lungif  $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -18994,11 +18718,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char DGifOpen ();
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-return DGifOpen ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -19037,43 +18768,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_ungif=`otool -L conftest$ac_exeext | grep libungif\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libungif\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_ungif=`$ac_cv_path_LDD conftest$ac_exeext | grep libungif\\.so | sed -e "s/^.*\(libungif\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
-  esac
-  if test "x$ac_cv_lib_soname_ungif" = "x"
-  then
-     ac_cv_lib_soname_ungif="libungif.$LIBEXT"
-  fi
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_ungif="libungif.$LIBEXT"
+	eval "$as_ac_var=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS=$ac_get_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_ungif" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_ungif" >&6; }
-if test "${ac_cv_lib_soname_ungif+set}" = set; then
-
-cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBUNGIF "$ac_cv_lib_soname_ungif"
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
+done
 
-  { echo "$as_me:$LINENO: checking for -lgif soname" >&5
-echo $ECHO_N "checking for -lgif soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_gif+set}" = set; then
+LIBS="$ac_wine_check_funcs_save_LIBS"
+
+if test "$ac_cv_func_poll" = no
+then
+    { echo "$as_me:$LINENO: checking for poll in -lpoll" >&5
+echo $ECHO_N "checking for poll in -lpoll... $ECHO_C" >&6; }
+if test "${ac_cv_lib_poll_poll+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_get_soname_save_LIBS=$LIBS
-LIBS="-lgif  $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpoll  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -19086,11 +18814,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char DGifOpen ();
+char poll ();
 int
 main ()
 {
-return DGifOpen ();
+return poll ();
   ;
   return 0;
 }
@@ -19129,43 +18857,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_gif=`otool -L conftest$ac_exeext | grep libgif\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libgif\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_gif=`$ac_cv_path_LDD conftest$ac_exeext | grep libgif\\.so | sed -e "s/^.*\(libgif\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
-  esac
-  if test "x$ac_cv_lib_soname_gif" = "x"
-  then
-     ac_cv_lib_soname_gif="libgif.$LIBEXT"
-  fi
+  ac_cv_lib_poll_poll=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_gif="libgif.$LIBEXT"
+	ac_cv_lib_poll_poll=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS=$ac_get_soname_save_LIBS
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_gif" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_gif" >&6; }
-if test "${ac_cv_lib_soname_gif+set}" = set; then
-
-cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBGIF "$ac_cv_lib_soname_gif"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_poll_poll" >&5
+echo "${ECHO_T}$ac_cv_lib_poll_poll" >&6; }
+if test $ac_cv_lib_poll_poll = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_POLL 1
 _ACEOF
+ LIBPOLL="-lpoll"
 
 fi
 
-  { echo "$as_me:$LINENO: checking for -lcapi20 soname" >&5
-echo $ECHO_N "checking for -lcapi20 soname... $ECHO_C" >&6; }
-if test "${ac_cv_lib_soname_capi20+set}" = set; then
+fi
+
+if test "$ac_cv_func_gethostbyname" = no
+then
+
+{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_get_soname_save_LIBS=$LIBS
-LIBS="-lcapi20  $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -19178,11 +18904,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char capi20_isinstalled ();
+char gethostbyname ();
 int
 main ()
 {
-return capi20_isinstalled ();
+return gethostbyname ();
   ;
   return 0;
 }
@@ -19221,204 +18947,47 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  case "$LIBEXT" in
-    dylib) ac_cv_lib_soname_capi20=`otool -L conftest$ac_exeext | grep libcapi20\\.[0-9A-Za-z.]*dylib | sed -e "s/^.*\/\(libcapi20\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
-    so) ac_cv_lib_soname_capi20=`$ac_cv_path_LDD conftest$ac_exeext | grep libcapi20\\.so | sed -e "s/^.*\(libcapi20\.so[^	 ]*\).*$/\1/"';2,$d'` ;;
-  esac
-  if test "x$ac_cv_lib_soname_capi20" = "x"
-  then
-     ac_cv_lib_soname_capi20="libcapi20.$LIBEXT"
-  fi
+  ac_cv_lib_nsl_gethostbyname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_soname_capi20="libcapi20.$LIBEXT"
+	ac_cv_lib_nsl_gethostbyname=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS=$ac_get_soname_save_LIBS
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_capi20" >&5
-echo "${ECHO_T}$ac_cv_lib_soname_capi20" >&6; }
-if test "${ac_cv_lib_soname_capi20+set}" = set; then
-
-cat >>confdefs.h <<_ACEOF
-#define SONAME_LIBCAPI20 "$ac_cv_lib_soname_capi20"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
 _ACEOF
 
-fi
+  LIBS="-lnsl $LIBS"
 
 fi
 
+fi
 
+if test "$ac_cv_func_connect" = no
+then
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_func in \
-	_lwp_create \
-	_lwp_self \
-	_pclose \
-	_popen \
-	_snprintf \
-	_spawnvp \
-	_stricmp \
-	_strnicmp \
-	_vsnprintf \
-	asctime_r \
-	chsize \
-	clone \
-	epoll_create \
-	ffs \
-	finite \
-	fork \
-	fpclass \
-	fstatfs \
-	fstatvfs \
-	ftruncate \
-	futimes \
-	futimesat \
-	getaddrinfo \
-	getnameinfo \
-	getnetbyname \
-	getopt_long \
-	getpagesize \
-	getprotobyname \
-	getprotobynumber \
-	getpwuid \
-	getservbyport \
-	gettid \
-	gettimeofday \
-	getuid \
-	inet_network \
-	kqueue \
-	lstat \
-	memmove \
-	mmap \
-	pclose \
-	poll \
-	popen \
-	prctl \
-	pread \
-	pwrite \
-	readlink \
-	rfork \
-	sched_yield \
-	select \
-	sendmsg \
-	setrlimit \
-	settimeofday \
-	sigaltstack \
-	sigprocmask \
-	snprintf \
-	spawnvp \
-	statfs \
-	statvfs \
-	strcasecmp \
-	strerror \
-	strncasecmp \
-	tcgetattr \
-	timegm \
-	usleep \
-	vsnprintf \
-	wait4 \
-	waitpid \
-
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -19426,18 +18995,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
+char connect ();
 int
 main ()
 {
-return $ac_func ();
+return connect ();
   ;
   return 0;
 }
@@ -19476,38 +19038,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_lib_socket_connect=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_lib_socket_connect=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; }
+if test $ac_cv_lib_socket_connect = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBSOCKET 1
 _ACEOF
 
+  LIBS="-lsocket $LIBS"
+
 fi
-done
 
+fi
 
-if test "$ac_cv_func_poll" = no
+if test "$ac_cv_func_inet_aton" = no
 then
-    { echo "$as_me:$LINENO: checking for poll in -lpoll" >&5
-echo $ECHO_N "checking for poll in -lpoll... $ECHO_C" >&6; }
-if test "${ac_cv_lib_poll_poll+set}" = set; then
+
+{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
+echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; }
+if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpoll  $LIBS"
+LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19521,11 +19086,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char poll ();
+char inet_aton ();
 int
 main ()
 {
-return poll ();
+return inet_aton ();
   ;
   return 0;
 }
@@ -19564,25 +19129,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_poll_poll=yes
+  ac_cv_lib_resolv_inet_aton=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_poll_poll=no
+	ac_cv_lib_resolv_inet_aton=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_poll_poll" >&5
-echo "${ECHO_T}$ac_cv_lib_poll_poll" >&6; }
-if test $ac_cv_lib_poll_poll = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; }
+if test $ac_cv_lib_resolv_inet_aton = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRESOLV 1
 _ACEOF
- LIBPOLL="-lpoll"
+
+  LIBS="-lresolv $LIBS"
 
 fi
 
@@ -25514,7 +25080,6 @@ EXTRACFLAGS!$EXTRACFLAGS$ac_delim
 BUILTINFLAG!$BUILTINFLAG$ac_delim
 DLLEXT!$DLLEXT$ac_delim
 DLLFLAGS!$DLLFLAGS$ac_delim
-DLLIBS!$DLLIBS$ac_delim
 LDSHARED!$LDSHARED$ac_delim
 LDDLLFLAGS!$LDDLLFLAGS$ac_delim
 LIBEXT!$LIBEXT$ac_delim
@@ -25536,6 +25101,7 @@ SOCKETLIBS!$SOCKETLIBS$ac_delim
 MAIN_BINARY!$MAIN_BINARY$ac_delim
 EXTRA_BINARIES!$EXTRA_BINARIES$ac_delim
 LDD!$LDD$ac_delim
+LIBDL!$LIBDL$ac_delim
 LIBPOLL!$LIBPOLL$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
diff --git a/configure.ac b/configure.ac
index e530ff4fae6cf69e97755ff4d2257f6325c957c3..1e8a9feac940ac57449ccd63d5424331944f1414 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,12 +136,6 @@ dnl Check for -li386 for NetBSD and OpenBSD
 AC_CHECK_LIB(i386,i386_set_ldt)
 dnl Check for -lossaudio for NetBSD
 AC_CHECK_LIB(ossaudio,_oss_ioctl)
-dnl Check for -lnsl for Solaris
-AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
-dnl Check for -lsocket for Solaris
-AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
-dnl Check for -lresolv for Solaris
-AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
 dnl Check for -lxpg4 for FreeBSD
 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
 dnl Check for -lpthread
@@ -1017,7 +1011,6 @@ dnl **** Check for working dll ****
 
 AC_SUBST(DLLEXT,"")
 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
-AC_SUBST(DLLIBS,"")
 AC_SUBST(LDSHARED,"")
 AC_SUBST(LDDLLFLAGS,"")
 AC_SUBST(LIBEXT,"so")
@@ -1039,20 +1032,6 @@ case $host_os in
     WIN16_INSTALL=""
     ;;
   *)
-    if test "$ac_cv_header_dlfcn_h" = "yes"
-    then
-        AC_CHECK_FUNCS(dlopen,,
-            [AC_CHECK_LIB(dl,dlopen,
-                         [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
-                          DLLIBS="-ldl"],
-                         [LIBEXT="a"])])
-        WINE_CHECK_LIB_FUNCS(dladdr,[$DLLIBS])
-    else
-        LIBEXT="a"
-    fi
-
-    if test "$LIBEXT" = "so"
-    then
       DLLFLAGS="$DLLFLAGS -fPIC"
       DLLEXT=".so"
       AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
@@ -1180,7 +1159,6 @@ case $host_os in
           fi
         fi
       fi
-    fi
 
     dnl Check for cross compiler to build test programs
     AC_SUBST(CROSSTEST,"")
@@ -1274,6 +1252,8 @@ AC_CHECK_FUNCS(\
 	asctime_r \
 	chsize \
 	clone \
+	connect \
+	dlopen \
 	epoll_create \
 	ffs \
 	finite \
@@ -1285,6 +1265,7 @@ AC_CHECK_FUNCS(\
 	futimes \
 	futimesat \
 	getaddrinfo \
+	gethostbyname \
 	getnameinfo \
 	getnetbyname \
 	getopt_long \
@@ -1296,6 +1277,7 @@ AC_CHECK_FUNCS(\
 	gettid \
 	gettimeofday \
 	getuid \
+	inet_aton \
 	inet_network \
 	kqueue \
 	lstat \
@@ -1331,12 +1313,37 @@ AC_CHECK_FUNCS(\
 	waitpid \
 )
 
+dnl Check for -ldl
+if test "$ac_cv_func_dlopen" = no
+then
+    AC_CHECK_LIB(dl,dlopen,[AC_DEFINE(HAVE_DLOPEN,1) AC_SUBST(LIBDL,"-ldl")])
+fi
+WINE_CHECK_LIB_FUNCS(dladdr,[$LIBDL])
+
 dnl Check for -lpoll for Mac OS X/Darwin
 if test "$ac_cv_func_poll" = no
 then
     AC_CHECK_LIB(poll,poll,[AC_DEFINE(HAVE_POLL,1) AC_SUBST(LIBPOLL,"-lpoll")])
 fi
 
+dnl Check for -lnsl for Solaris
+if test "$ac_cv_func_gethostbyname" = no
+then
+    AC_CHECK_LIB(nsl,gethostbyname)
+fi
+
+dnl Check for -lsocket for Solaris
+if test "$ac_cv_func_connect" = no
+then
+    AC_CHECK_LIB(socket,connect)
+fi
+
+dnl Check for -lresolv for Solaris
+if test "$ac_cv_func_inet_aton" = no
+then
+    AC_CHECK_LIB(resolv,inet_aton)
+fi
+
 dnl **** Check for types ****
 
 AC_C_CONST
diff --git a/include/config.h.in b/include/config.h.in
index 129baaf49c167e94bdd734364c3cdc601b7759a4..ee42eeb756d8408f6a73ce0e7c0c40d16cfc4568 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -74,7 +74,7 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
-/* Define if you have dlopen */
+/* Define to 1 if you have the `dlopen' function. */
 #undef HAVE_DLOPEN
 
 /* Define to 1 if you have the <elf.h> header file. */
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index c206b88ce42f39992f3a585d762f230beb950dd7..125ccf63b03212e7f37a64be8f9ae871ef0cde56 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -6,7 +6,7 @@ DLLFLAGS  = @DLLFLAGS@
 LIBEXT    = @LIBEXT@
 MODULE    = libwine.$(LIBEXT)
 VERSCRIPT = $(SRCDIR)/wine.map
-EXTRALIBS = $(LIBPORT) @DLLIBS@ @CRTLIBS@
+EXTRALIBS = $(LIBPORT) @LIBDL@ @CRTLIBS@
 DEFS      = -D__WINESRC__ -DWINE_UNICODE_API=""
 
 VERSION   = 1.0