diff --git a/configure.ac b/configure.ac
index 9b2459d012817967a77abdc084bbfb2d5309d3c9..d85ec82a1c7261eb8876b57e76d0333024418c37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,6 +191,7 @@ src/Makefile \
 src/sflphone \
 src/audio/Makefile \
 src/audio/gsm/Makefile \
+src/audio/OpenAL/Makefile \
 src/audio/pacpp/Makefile \
 src/audio/pacpp/include/Makefile \
 src/audio/pacpp/include/portaudiocpp/Makefile \
diff --git a/libs/portaudio/Makefile.am b/libs/portaudio/Makefile.am
index 82672e9e22d33006ab4949d94d44e11ec79d2023..a841e0f8f5ee516cce72d8c9176f41d0b81d45c0 100644
--- a/libs/portaudio/Makefile.am
+++ b/libs/portaudio/Makefile.am
@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libportaudio.la
 libportaudio_la_CFLAGS = $(PORTAUDIO_CFLAGS) 
 libportaudio_la_LIBADD = $(PORTAUDIO_LIBS)
 libportaudio_la_CXXFLAGS = $(PORTAUDIO_CXXFLAGS)
-libportaudio_la_CPPFLAGS = $(PORTAUDIO_CPPFLAGS) -I$(top_srcdir)/libs/portaudio/pa_common/
+libportaudio_la_CPPFLAGS = $(PORTAUDIO_CPPFLAGS) 
 
 
 if ENABLE_OSS
diff --git a/libs/utilspp/EmptyType.hpp b/libs/utilspp/EmptyType.hpp
index 42a64f9a782518d1d1de9988d35342f30ae09222..1b0b3378e01781992a58d91356920595418402d5 100644
--- a/libs/utilspp/EmptyType.hpp
+++ b/libs/utilspp/EmptyType.hpp
@@ -27,6 +27,6 @@
 namespace utilspp
 {
   struct EmptyType {};
-};
+}
 
 #endif
diff --git a/libs/utilspp/NonCopyable.hpp b/libs/utilspp/NonCopyable.hpp
index 83ec499a40eb52678273222db97406184b433fe1..43f68e9d328bd81dea38798165c43622095da114 100644
--- a/libs/utilspp/NonCopyable.hpp
+++ b/libs/utilspp/NonCopyable.hpp
@@ -36,6 +36,6 @@ namespace utilspp
          NonCopyable(const NonCopyable&)
          {}
    };
-};
+}
 
 #endif
diff --git a/libs/utilspp/NullType.hpp b/libs/utilspp/NullType.hpp
index 819026474bef06b73aad5a6a5fccc192c952a8fd..5e7800deaac87369ff18c336322c914cff7d4059 100644
--- a/libs/utilspp/NullType.hpp
+++ b/libs/utilspp/NullType.hpp
@@ -27,6 +27,6 @@
 namespace utilspp
 {
 	struct NullType;
-};
+}
 
 #endif
diff --git a/libs/utilspp/SmartPtr.hpp b/libs/utilspp/SmartPtr.hpp
index 43c400be97b389b20e213fa11055ec873cd874a2..b621bb74e625ad6f28f2fc933e7fee250b0c9dd2 100644
--- a/libs/utilspp/SmartPtr.hpp
+++ b/libs/utilspp/SmartPtr.hpp
@@ -181,6 +181,6 @@ namespace utilspp
   private:
     CountingBodyPolicy * mContent;
   };
-};
+}
 
 #endif
diff --git a/libs/utilspp/ThreadingFactoryMutex.hpp b/libs/utilspp/ThreadingFactoryMutex.hpp
index 5bd6225f29f58342919ec2489d09cd2079ff478f..4ded82e7adf2cbb0f8d76267542e503ec5d5bf7d 100644
--- a/libs/utilspp/ThreadingFactoryMutex.hpp
+++ b/libs/utilspp/ThreadingFactoryMutex.hpp
@@ -37,7 +37,7 @@ namespace utilspp
 
          typedef T VolatileType;
       };
-};
+}
 
 #include "ThreadingFactoryMutex.inl"
 
diff --git a/libs/utilspp/ThreadingSingle.hpp b/libs/utilspp/ThreadingSingle.hpp
index bbab15b5c46ad8651c31be092d351338c33dd110..93e6432b2d1690b4310d72d6c0c5483a1a6ce36f 100644
--- a/libs/utilspp/ThreadingSingle.hpp
+++ b/libs/utilspp/ThreadingSingle.hpp
@@ -45,7 +45,7 @@ namespace utilspp
 
          typedef T VolatileType;
       };
-};
+}
 
 #include "ThreadingSingle.inl"
 
diff --git a/libs/utilspp/ThreadingSingle.inl b/libs/utilspp/ThreadingSingle.inl
index fcb395ba2081b99d361fca85deb46cbbc07d5580..633401fe4844c411e2095706380ca73691e1fce2 100644
--- a/libs/utilspp/ThreadingSingle.inl
+++ b/libs/utilspp/ThreadingSingle.inl
@@ -27,7 +27,7 @@
 template< typename T >
 inline
 utilspp::ThreadingSingle< T >::lock::lock()
-{};
+{}
 
 template< typename T >
 inline
@@ -39,12 +39,12 @@ template< typename T >
 inline
 void
 utilspp::ThreadingSingle< T >::mutex::lock()
-{};
+{}
 
 template< typename T >
 inline
 void
 utilspp::ThreadingSingle< T >::mutex::unlock()
-{};
+{}
 
 #endif
diff --git a/libs/utilspp/TypeList.hpp b/libs/utilspp/TypeList.hpp
index 98cdee69f8e7d3268107c87e8ff49a002ccbf770..879fc364cbff18592901ba1f5f6d83eebeb68d25 100644
--- a/libs/utilspp/TypeList.hpp
+++ b/libs/utilspp/TypeList.hpp
@@ -209,7 +209,7 @@ namespace utilspp
       Result;
     };
   };
-};      
+}
 
 
 #endif
diff --git a/libs/utilspp/TypeTrait.hpp b/libs/utilspp/TypeTrait.hpp
index 7046f6ee013fd8ac240afd04a2152e49ac350180..926b197f9eba480c80b382b0ee1cd43c7b53621d 100644
--- a/libs/utilspp/TypeTrait.hpp
+++ b/libs/utilspp/TypeTrait.hpp
@@ -911,6 +911,6 @@ namespace utilspp
     typedef TYPE_LIST_15(W, X, Y, Z, A, B, C, D, E, F, G, H, I, J, K) ParamList;
   };
 
-};
+}
 
 #endif
diff --git a/libs/utilspp/singleton/CreationUsingNew.hpp b/libs/utilspp/singleton/CreationUsingNew.hpp
index 5055db5b8ff0866159e9ad488312cee6e9a900c5..2108d78f2717388f40b85625c08a6e4f1be2889b 100644
--- a/libs/utilspp/singleton/CreationUsingNew.hpp
+++ b/libs/utilspp/singleton/CreationUsingNew.hpp
@@ -36,7 +36,7 @@ namespace utilspp
          static T *create();
          static void destroy( T *obj );
    };
-};
+}
 
 #include "CreationUsingNew.inl"
 
diff --git a/libs/utilspp/singleton/LifetimeDefault.hpp b/libs/utilspp/singleton/LifetimeDefault.hpp
index 9c77138109a0385d267c52626e381fe0f3e5f36e..ff830e76665c0243b107d6be49b5692dbbd69725 100644
--- a/libs/utilspp/singleton/LifetimeDefault.hpp
+++ b/libs/utilspp/singleton/LifetimeDefault.hpp
@@ -36,7 +36,7 @@ namespace utilspp
          static void scheduleDestruction( T *obj, void (*func)() );
          static void onDeadReference();
    };
-};
+}
 
 #include "LifetimeDefault.inl"
 
diff --git a/libs/utilspp/singleton/LifetimeWithLongevity.hpp b/libs/utilspp/singleton/LifetimeWithLongevity.hpp
index 888475126411719da68a0d7043ef358eac7b79da..7683df3d9bcb80e99750063fa387802161ba6324 100644
--- a/libs/utilspp/singleton/LifetimeWithLongevity.hpp
+++ b/libs/utilspp/singleton/LifetimeWithLongevity.hpp
@@ -49,7 +49,7 @@ namespace utilspp
     static void scheduleDestruction( T *obj, void (*func)() );
     static void onDeadReference();
   };
-};
+}
 
 #include "LifetimeWithLongevity.inl"
 
diff --git a/libs/utilspp/singleton/LifetimeWithLongevity.inl b/libs/utilspp/singleton/LifetimeWithLongevity.inl
index aaaf0ebfb5befbf0b528e247ccc0b2157576f499..6b8f3eb32f5b0cc80d4fd15213546b56c901f774 100644
--- a/libs/utilspp/singleton/LifetimeWithLongevity.inl
+++ b/libs/utilspp/singleton/LifetimeWithLongevity.inl
@@ -29,7 +29,7 @@ utilspp::setLongevity( T *obj, unsigned int longevity, TDestroyer d )
    *pos = p;
    mNbElements++;
    std::atexit( &atExitFunc );
-};
+}
 
 template< typename T >
 void 
diff --git a/libs/utilspp/singleton/PrivateMembers.hpp b/libs/utilspp/singleton/PrivateMembers.hpp
index b1fb8cd22e7b9d7356a9e57fa735c1e4f0ff91e8..05079eff5c051817e5e23d884e14787ddd18a523 100644
--- a/libs/utilspp/singleton/PrivateMembers.hpp
+++ b/libs/utilspp/singleton/PrivateMembers.hpp
@@ -85,8 +85,8 @@ namespace utilspp
       void operator()(T*);
       void (*mFunc)();
     };
-  };
-};
+  }
+}
 
 #include "PrivateMembers.inl"
 
diff --git a/libs/utilspp/singleton/SingletonHolder.hpp b/libs/utilspp/singleton/SingletonHolder.hpp
index 8a8590a7b2e31666547357ccef12678244a42e40..d773cd8c42532536b2e5210c008173f4ec0ed172 100644
--- a/libs/utilspp/singleton/SingletonHolder.hpp
+++ b/libs/utilspp/singleton/SingletonHolder.hpp
@@ -59,7 +59,7 @@ namespace utilspp
     static bool mDestroyed;
   };
 
-};
+}
 
 #include "SingletonHolder.inl"
 
diff --git a/libs/utilspp/singleton/SingletonHolder.inl b/libs/utilspp/singleton/SingletonHolder.inl
index 84f27bea9feb7ea73475d31fd5903df56b5c72a8..36e31e3651c3a50aadb45bd2085105ee8404e6ba 100644
--- a/libs/utilspp/singleton/SingletonHolder.inl
+++ b/libs/utilspp/singleton/SingletonHolder.inl
@@ -47,7 +47,7 @@ ThreadingModel
     }
 
     return ( *mInstance );
-};
+}
 
 template
 <
diff --git a/ltmain.sh b/ltmain.sh
index db4982d8a996be09e4531a732861947619b6c177..8fc56db8fc6e3d4895dc6145236caa94f408a325 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -43,8 +43,8 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="1.5.20 Debian 1.5.20-2"
-TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
+VERSION="1.5.22 Debian 1.5.22-2"
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
 # See if we are running on zsh, and set the options which allow our
 # commands through without removal of \ escapes.
@@ -132,6 +132,8 @@ run=
 show="$echo"
 show_help=
 execute_dlfiles=
+duplicate_deps=no
+preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 
@@ -139,6 +141,43 @@ o2lo="s/\\.${objext}\$/.lo/"
 # Shell function definitions:
 # This seems to be the best place for them
 
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+	# Failing that, at least try and use $RANDOM to avoid a race
+	my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+	save_mktempdir_umask=`umask`
+	umask 0077
+	$mkdir "$my_tmpdir"
+	umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+	exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -157,12 +196,11 @@ func_win32_libid ()
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
-      if test "X$win32_nmres" = "Ximport" ; then
-        win32_libid_type="x86 archive import"
-      else
-        win32_libid_type="x86 archive static"
-      fi
+	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
     fi
     ;;
   *DLL*)
@@ -295,9 +333,9 @@ func_extract_archives ()
       $run ${rm}r "$my_xdir"
       $show "$mkdir $my_xdir"
       $run $mkdir "$my_xdir"
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $exit_status
       fi
       case $host in
       *-darwin*)
@@ -352,6 +390,8 @@ func_extract_archives ()
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -468,7 +508,11 @@ do
     preserve_args="$preserve_args $arg"
     ;;
 
-  --tag) prevopt="--tag" prev=tag ;;
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
   --tag=*)
     set tag "$optarg" ${1+"$@"}
     shift
@@ -500,6 +544,18 @@ if test -n "$prevopt"; then
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
@@ -856,9 +912,9 @@ EOF
       if test ! -d "${xdir}$objdir"; then
 	$show "$mkdir ${xdir}$objdir"
 	$run $mkdir ${xdir}$objdir
-	status=$?
-	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $status
+	exit_status=$?
+	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $exit_status
 	fi
       fi
 
@@ -1061,6 +1117,7 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -1089,14 +1146,15 @@ EOF
 	  if test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=yes
 	else
 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=built
 	fi
 	build_libtool_libs=no
 	build_old_libs=yes
-	prefer_static_libs=yes
 	break
 	;;
       esac
@@ -1271,6 +1329,11 @@ EOF
 		  if test -z "$pic_object" || test "$pic_object" = none ; then
 		    arg="$non_pic_object"
 		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
@@ -1354,8 +1417,8 @@ EOF
 	  prev=
 	  continue
 	  ;;
-        darwin_framework)
-	  compiler_flags="$compiler_flags $arg"
+	darwin_framework|darwin_framework_skip)
+	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
 	  compile_command="$compile_command $arg"
 	  finalize_command="$finalize_command $arg"
 	  prev=
@@ -1419,13 +1482,17 @@ EOF
 	continue
 	;;
 
-      -framework|-arch)
-        prev=darwin_framework
-        compiler_flags="$compiler_flags $arg"
+      -framework|-arch|-isysroot)
+	case " $CC " in
+	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
+		prev=darwin_framework_skip ;;
+	  *) compiler_flags="$compiler_flags $arg"
+	     prev=darwin_framework ;;
+	esac
 	compile_command="$compile_command $arg"
 	finalize_command="$finalize_command $arg"
-        continue
-        ;;
+	continue
+	;;
 
       -inst-prefix-dir)
 	prev=inst_prefix
@@ -1453,7 +1520,8 @@ EOF
 	  absdir=`cd "$dir" && pwd`
 	  if test -z "$absdir"; then
 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    exit $EXIT_FAILURE
+	    absdir="$dir"
+	    notinst_path="$notinst_path $dir"
 	  fi
 	  dir="$absdir"
 	  ;;
@@ -1467,10 +1535,15 @@ EOF
 	esac
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$dir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
 	continue
@@ -1479,11 +1552,11 @@ EOF
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
-	  *-*-mingw* | *-*-os2*)
+	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
 	    test "X$arg" = "X-lc" && continue
 	    ;;
@@ -1495,6 +1568,15 @@ EOF
 	    # Rhapsody C and math libraries are in the System framework
 	    deplibs="$deplibs -framework System"
 	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
 	  esac
 	elif test "X$arg" = "X-lc_r"; then
 	 case $host in
@@ -1536,7 +1618,12 @@ EOF
       # +DA*, +DD* enable 64-bit mode on the HP compiler
       # -q* pass through compiler args for the IBM compiler
       # -m* pass through architecture-specific compiler args for GCC
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -pg pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+      -t[45]*|-txscale*|@*)
 
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
@@ -1548,9 +1635,7 @@ EOF
 	esac
         compile_command="$compile_command $arg"
         finalize_command="$finalize_command $arg"
-        if test "$with_gcc" = "yes" ; then
-          compiler_flags="$compiler_flags $arg"
-        fi
+        compiler_flags="$compiler_flags $arg"
         continue
         ;;
 
@@ -1788,6 +1873,11 @@ EOF
 	    if test -z "$pic_object" || test "$pic_object" = none ; then
 	      arg="$non_pic_object"
 	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
@@ -1893,9 +1983,9 @@ EOF
     if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $exit_status
       fi
     fi
 
@@ -1958,7 +2048,6 @@ EOF
     newlib_search_path=
     need_relink=no # whether we're linking any uninstalled libtool libraries
     notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
     case $linkmode in
     lib)
 	passes="conv link"
@@ -2197,7 +2286,7 @@ EOF
 	esac # case $deplib
 	if test "$found" = yes || test -f "$lib"; then :
 	else
-	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
 	  exit $EXIT_FAILURE
 	fi
 
@@ -2448,8 +2537,12 @@ EOF
 	fi
 
 	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	  use_static_libs=no
+	fi
 	if test -n "$library_names" &&
-	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
 	  if test "$installed" = no; then
 	    notinst_deplibs="$notinst_deplibs $lib"
 	    need_relink=yes
@@ -2562,11 +2655,15 @@ EOF
 	      if test "$hardcode_direct" = no; then
 		add="$dir/$linklib"
 		case $host in
-		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
 		    # if the lib is a module then we can not link against
 		    # it, someone is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		    if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
 		      $echo "** Warning, lib $linklib is a module, not a shared library"
 		      if test -z "$old_library" ; then
 		        $echo
@@ -3322,9 +3419,9 @@ EOF
 
       # Eliminate all temporary directories.
       for path in $notinst_path; do
-	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
-	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
-	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
       done
 
       if test -n "$xrpath"; then
@@ -3377,7 +3474,12 @@ EOF
 	    ;;
 	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
 	    ;;
  	  *)
 	    # Add libc to deplibs on all other systems if necessary.
@@ -3421,7 +3523,7 @@ EOF
 	  int main() { return 0; }
 EOF
 	  $rm conftest
-	  $LTCC -o conftest conftest.c $deplibs
+	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
 	  if test "$?" -eq 0 ; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
@@ -3466,7 +3568,7 @@ EOF
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
 		$rm conftest
-		$LTCC -o conftest conftest.c $i
+		$LTCC $LTCFLAGS -o conftest conftest.c $i
 		# Did it work?
 		if test "$?" -eq 0 ; then
 		  ldd_output=`ldd conftest`
@@ -3713,6 +3815,35 @@ EOF
 	deplibs=$newdeplibs
       fi
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3796,6 +3927,7 @@ EOF
 	fi
 
 	lib="$output_objdir/$realname"
+	linknames=
 	for link
 	do
 	  linknames="$linknames $link"
@@ -4227,6 +4359,35 @@ EOF
         ;;
       esac
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -4271,10 +4432,15 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$libdir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
       done
@@ -4391,10 +4557,22 @@ extern \"C\" {
 	      export_symbols="$output_objdir/$outputname.exp"
 	      $run $rm $export_symbols
 	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    else
-	      $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    fi
 	  fi
 
@@ -4511,16 +4689,29 @@ static const void *lt_preloaded_setup() {
 	  esac
 
 	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
 	  # Clean up the generated files.
 	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
 	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
 
 	  # Transform the symbol file into the correct name.
-	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+            else
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            ;;
+          esac
 	  ;;
 	*)
 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
@@ -4545,7 +4736,7 @@ static const void *lt_preloaded_setup() {
 	# We have no uninstalled library dependencies, so finalize right now.
 	$show "$link_command"
 	$run eval "$link_command"
-	status=$?
+	exit_status=$?
 
 	# Delete the generated files.
 	if test -n "$dlsyms"; then
@@ -4553,7 +4744,7 @@ static const void *lt_preloaded_setup() {
 	  $run $rm "$output_objdir/${outputname}S.${objext}"
 	fi
 
-	exit $status
+	exit $exit_status
       fi
 
       if test -n "$shlibpath_var"; then
@@ -4693,10 +4884,12 @@ static const void *lt_preloaded_setup() {
 	esac
 	case $host in
 	  *cygwin* | *mingw* )
-	    cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
-	    cwrapper=`$echo ${output}.exe`
-	    $rm $cwrappersource $cwrapper
-	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            cwrappersource="$output_path/$objdir/lt-$output_name.c"
+            cwrapper="$output_path/$output_name.exe"
+            $rm $cwrappersource $cwrapper
+            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
 	    cat > $cwrappersource <<EOF
 
@@ -4721,6 +4914,9 @@ EOF
 #include <malloc.h>
 #include <stdarg.h>
 #include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
 
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
@@ -4731,15 +4927,19 @@ EOF
 #endif
 
 #ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
 #endif
 
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
-#define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
-#endif
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
 #endif
 
 #ifndef DIR_SEPARATOR_2
@@ -4749,17 +4949,32 @@ EOF
         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
 #endif /* DIR_SEPARATOR_2 */
 
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
 const char *program_name = NULL;
 
 void * xmalloc (size_t num);
 char * xstrdup (const char *string);
-char * basename (const char *name);
-char * fnqualify(const char *path);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
 char * strendzap(char *str, const char *pat);
 void lt_fatal (const char *message, ...);
 
@@ -4769,29 +4984,50 @@ main (int argc, char *argv[])
   char **newargz;
   int i;
 
-  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
   newargz = XMALLOC(char *, argc+2);
 EOF
 
-	    cat >> $cwrappersource <<EOF
-  newargz[0] = "$SHELL";
+            cat >> $cwrappersource <<EOF
+  newargz[0] = (char *) xstrdup("$SHELL");
 EOF
 
-	    cat >> $cwrappersource <<"EOF"
-  newargz[1] = fnqualify(argv[0]);
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
   strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
+
+  for (i=0; i<argc+1; i++)
+  {
+    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
+    ;
+  }
+
 EOF
 
-	    cat >> $cwrappersource <<EOF
+            case $host_os in
+              mingw*)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",(char const **)newargz);
+EOF
+              ;;
+              *)
+                cat >> $cwrappersource <<EOF
   execv("$SHELL",newargz);
 EOF
+              ;;
+            esac
 
-	    cat >> $cwrappersource <<"EOF"
+            cat >> $cwrappersource <<"EOF"
   return 127;
 }
 
@@ -4812,48 +5048,148 @@ xstrdup (const char *string)
 ;
 }
 
-char *
-basename (const char *name)
+const char *
+base_name (const char *name)
 {
   const char *base;
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha (name[0]) && name[1] == ':')
+  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
     name += 2;
 #endif
 
   for (base = name; *name; name++)
     if (IS_DIR_SEPARATOR (*name))
       base = name + 1;
-  return (char *) base;
+  return base;
+}
+
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
 }
 
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
 char *
-fnqualify(const char *path)
+find_executable (const char* wrapper)
 {
-  size_t size;
-  char *p;
+  int has_slash = 0;
+  const char* p;
+  const char* p_next;
+  /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char* concat_name;
 
-  assert(path != NULL);
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
-  /* Is it qualified already? */
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha (path[0]) && path[1] == ':')
-    return xstrdup (path);
+  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+  {
+    concat_name = xstrdup (wrapper);
+    if (check_executable(concat_name))
+      return concat_name;
+    XFREE(concat_name);
+  }
+  else
+  {
+#endif
+    if (IS_DIR_SEPARATOR (wrapper[0]))
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable(concat_name))
+        return concat_name;
+      XFREE(concat_name);
+    }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  }
 #endif
-  if (IS_DIR_SEPARATOR (path[0]))
-    return xstrdup (path);
 
-  /* prepend the current directory */
-  /* doesn't handle '~' */
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+    {
+      has_slash = 1;
+      break;
+    }
+  if (!has_slash)
+  {
+    /* no slashes; search PATH */
+    const char* path = getenv ("PATH");
+    if (path != NULL)
+    {
+      for (p = path; *p; p = p_next)
+      {
+        const char* q;
+        size_t p_len;
+        for (q = p; *q; q++)
+          if (IS_PATH_SEPARATOR(*q))
+            break;
+        p_len = q - p;
+        p_next = (*q == '\0' ? q : q + 1);
+        if (p_len == 0)
+        {
+          /* empty path: current directory */
+          if (getcwd (tmp, LT_PATHMAX) == NULL)
+            lt_fatal ("getcwd failed");
+          tmp_len = strlen(tmp);
+          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, tmp, tmp_len);
+          concat_name[tmp_len] = '/';
+          strcpy (concat_name + tmp_len + 1, wrapper);
+        }
+        else
+        {
+          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, p, p_len);
+          concat_name[p_len] = '/';
+          strcpy (concat_name + p_len + 1, wrapper);
+        }
+        if (check_executable(concat_name))
+          return concat_name;
+        XFREE(concat_name);
+      }
+    }
+    /* not found in PATH; assume curdir */
+  }
+  /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
     lt_fatal ("getcwd failed");
-  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
-  p = XMALLOC(char, size);
-  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
-  return p;
+  tmp_len = strlen(tmp);
+  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable(concat_name))
+    return concat_name;
+  XFREE(concat_name);
+  return NULL;
 }
 
 char *
@@ -4897,16 +5233,16 @@ lt_fatal (const char *message, ...)
   va_end (ap);
 }
 EOF
-	  # we should really use a build-platform specific compiler
-	  # here, but OTOH, the wrappers (shell script and this C one)
-	  # are only useful if you want to execute the "real" binary.
-	  # Since the "real" binary is built for $host, then this
-	  # wrapper might as well be built for $host, too.
-	  $run $LTCC -s -o $cwrapper $cwrappersource
-	  ;;
-	esac
-	$rm $output
-	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
 	$echo > $output "\
 #! $SHELL
@@ -5136,9 +5472,9 @@ fi\
 	    $run ${rm}r "$gentop"
 	    $show "$mkdir $gentop"
 	    $run $mkdir "$gentop"
-	    status=$?
-	    if test "$status" -ne 0 && test ! -d "$gentop"; then
-	      exit $status
+	    exit_status=$?
+	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+	      exit $exit_status
 	    fi
 	  fi
 
@@ -5805,18 +6141,7 @@ relink_command=\"$relink_command\""
 	  outputname=
 	  if test "$fast_install" = no && test -n "$relink_command"; then
 	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir="/tmp"
-	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
-	      tmpdir="$tmpdir/libtool-$$"
-	      save_umask=`umask`
-	      umask 0077
-	      if $mkdir "$tmpdir"; then
-	        umask $save_umask
-	      else
-	        umask $save_umask
-		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
-		continue
-	      fi
+	      tmpdir=`func_mktempdir`
 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
@@ -5940,7 +6265,7 @@ relink_command=\"$relink_command\""
     # Exit here if they wanted silent mode.
     test "$show" = : && exit $EXIT_SUCCESS
 
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     $echo "Libraries have been installed in:"
     for libdir in $libdirs; do
       $echo "   $libdir"
@@ -5973,7 +6298,7 @@ relink_command=\"$relink_command\""
     $echo
     $echo "See any operating system documentation about shared libraries for"
     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
     ;;
 
@@ -6190,9 +6515,17 @@ relink_command=\"$relink_command\""
 	    rmfiles="$rmfiles $objdir/$n"
 	  done
 	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
-	  if test "$mode" = uninstall; then
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
 	      cmds=$postuninstall_cmds
@@ -6225,7 +6558,8 @@ relink_command=\"$relink_command\""
 	      IFS="$save_ifs"
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
-	  fi
+	    ;;
+	  esac
 	fi
 	;;
 
@@ -6524,12 +6858,11 @@ exit $?
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
+disable_libs=shared
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
diff --git a/src/gui/qt/ConfigurationPanel.ui b/src/gui/qt/ConfigurationPanel.ui
index 063c3af1039dc3475e6e0d152bc9c881a9c76259..ced355afca958bfa156d9a880a85b0346cd1ad72 100644
--- a/src/gui/qt/ConfigurationPanel.ui
+++ b/src/gui/qt/ConfigurationPanel.ui
@@ -47,7 +47,7 @@
             </sizepolicy>
         </property>
         <property name="cursor">
-            <cursor>13</cursor>
+            <cursor>2</cursor>
         </property>
         <property name="currentItem">
             <number>-1</number>
@@ -157,7 +157,7 @@
                                     <property name="name">
                                         <cstring>unnamed</cstring>
                                     </property>
-                                    <widget class="QLabel" row="0" column="0" colspan="3">
+                                    <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
                                         <property name="name">
                                             <cstring>lblFullName</cstring>
                                         </property>
@@ -165,7 +165,7 @@
                                             <string>Full name</string>
                                         </property>
                                     </widget>
-                                    <widget class="QLineEdit" row="1" column="0" colspan="3">
+                                    <widget class="QLineEdit" row="1" column="0" rowspan="1" colspan="3">
                                         <property name="name">
                                             <cstring>fullName</cstring>
                                         </property>
@@ -178,7 +178,7 @@
                                             </sizepolicy>
                                         </property>
                                     </widget>
-                                    <widget class="QLabel" row="2" column="0" colspan="3">
+                                    <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
                                         <property name="name">
                                             <cstring>lblUserHostPart</cstring>
                                         </property>
@@ -204,8 +204,8 @@
                                             <cstring>hostPart</cstring>
                                         </property>
                                     </widget>
-				</grid>
-			    </widget>
+                                </grid>
+                            </widget>
                             <widget class="QGroupBox">
                                 <property name="name">
                                     <cstring>groupBox2</cstring>
@@ -217,6 +217,9 @@
                                     <string></string>
                                 </property>
                                 <grid>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
                                     <widget class="QLabel" row="0" column="0">
                                         <property name="name">
                                             <cstring>lblAuthorizationUsre</cstring>
@@ -921,7 +924,7 @@
                     <attribute name="title">
                         <string>Themes</string>
                     </attribute>
-                    <widget class="QComboBox">
+                    <widget class="QListBox">
                         <property name="name">
                             <cstring>SkinChoice</cstring>
                         </property>
@@ -931,29 +934,13 @@
                         <property name="geometry">
                             <rect>
                                 <x>12</x>
-                                <y>42</y>
-                                <width>110</width>
-                                <height>27</height>
+                                <y>20</y>
+                                <width>122</width>
+                                <height>110</height>
                             </rect>
                         </property>
-                    </widget>
-                    <widget class="QPushButton">
-                        <property name="name">
-                            <cstring>buttonApplySkin</cstring>
-                        </property>
-                        <property name="geometry">
-                            <rect>
-                                <x>136</x>
-                                <y>40</y>
-                                <width>80</width>
-                                <height>32</height>
-                            </rect>
-                        </property>
-                        <property name="text">
-                            <string>&amp;Apply</string>
-                        </property>
-                        <property name="accel">
-                            <string>Alt+A</string>
+                        <property name="lineWidth">
+                            <number>10</number>
                         </property>
                     </widget>
                 </widget>
@@ -1401,12 +1388,6 @@ Montreal, Quebec H2T 1S6&lt;/p&gt;</string>
         <receiver>ConfigurationPanel</receiver>
         <slot>accept()</slot>
     </connection>
-    <connection>
-        <sender>buttonApplySkin</sender>
-        <signal>clicked()</signal>
-        <receiver>ConfigurationPanel</receiver>
-        <slot>applySkinSlot()</slot>
-    </connection>
     <connection>
         <sender>Menu</sender>
         <signal>clicked(QListBoxItem*)</signal>
@@ -1443,6 +1424,12 @@ Montreal, Quebec H2T 1S6&lt;/p&gt;</string>
         <receiver>ConfigurationPanel</receiver>
         <slot>useStunSlot(int)</slot>
     </connection>
+    <connection>
+        <sender>SkinChoice</sender>
+        <signal>highlighted(const QString&amp;)</signal>
+        <receiver>ConfigurationPanel</receiver>
+        <slot>applySkinSlot()</slot>
+    </connection>
 </connections>
 <tabstops>
     <tabstop>fullName</tabstop>
@@ -1470,7 +1457,6 @@ Montreal, Quebec H2T 1S6&lt;/p&gt;</string>
     <tabstop>Tab_Preferences</tabstop>
     <tabstop>Tab_About</tabstop>
     <tabstop>useStunNo</tabstop>
-    <tabstop>buttonApplySkin</tabstop>
 </tabstops>
 <includes>
     <include location="local" impldecl="in implementation">ConfigurationPanel.ui.h</include>
@@ -1485,10 +1471,11 @@ Montreal, Quebec H2T 1S6&lt;/p&gt;</string>
     <slot>useStunSlot( int id )</slot>
     <slot>applySkinSlot()</slot>
     <slot>driverSlot( int id )</slot>
+    <slot>updateSkins()</slot>
     <slot>updateRingtones()</slot>
-    <slot>updateAudioDevices()</slot>
     <slot>updateCodecs()</slot>
-    <slot>updateSkins()</slot>
+    <slot>updateAudioDevices()</slot>
+    <slot>SkinChoice_selected( const QString &amp; )</slot>
 </slots>
 <functions>
     <function access="private" specifier="non virtual">init()</function>
diff --git a/src/gui/qt/ConfigurationPanel.ui.h b/src/gui/qt/ConfigurationPanel.ui.h
index 4261c876725337c1425fda302bf606b1b6a91295..1500e56beedee4c18975ea199de50cf4f7b6be92 100644
--- a/src/gui/qt/ConfigurationPanel.ui.h
+++ b/src/gui/qt/ConfigurationPanel.ui.h
@@ -309,7 +309,7 @@ void ConfigurationPanel::updateSkins()
 {
   SkinChoice->clear();
   SkinChoice->insertStringList(SkinManager::instance().getSkins());
-  SkinChoice->setCurrentText(SkinManager::instance().getCurrentSkin());
+  SkinChoice->setSelected(SkinChoice->findItem(SkinManager::instance().getCurrentSkin(), Qt::ExactMatch), true);
 }
 
 void ConfigurationPanel::updateRingtones()
@@ -387,3 +387,9 @@ void ConfigurationPanel::updateAudioDevices()
   // Set position of the button group, with appropriate length
   DriverChoice->setGeometry( QRect( 10, 10, 410, top + 30 ) );
 }
+
+
+void ConfigurationPanel::SkinChoice_selected( const QString & )
+{
+
+}