Moved libuuid to the dlls directory, and moved the DirectX GUIDs into
a separate libdxguid library.

diff --git a/Make.rules.in b/Make.rules.in
index 5c54ade..4a295e4 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -78,7 +78,7 @@
 LIBDIR       = $(TOPOBJDIR)/libs
 LIBPORT      = -L$(TOPOBJDIR)/libs/port -lwine_port
 LIBUNICODE   = -L$(TOPOBJDIR)/libs/unicode -lwine_unicode
-LIBUUID      = -L$(TOPOBJDIR)/libs/uuid -lwine_uuid
+LIBUUID      = -luuid -ldxguid
 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
 
 @SET_MAKE@
diff --git a/configure b/configure
index f820d0e..44b7427 100755
--- a/configure
+++ b/configure
@@ -19070,7 +19070,7 @@
 MAKE_PROG_RULES=programs/Makeprog.rules
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/wined3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -19622,7 +19622,6 @@
   "dlls/crtdll/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/crtdll/Makefile" ;;
   "dlls/crypt32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/crypt32/Makefile" ;;
   "dlls/ctl3d/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ctl3d/Makefile" ;;
-  "dlls/wined3d/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wined3d/Makefile" ;;
   "dlls/d3d8/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3d8/Makefile" ;;
   "dlls/d3d9/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3d9/Makefile" ;;
   "dlls/d3dim/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3dim/Makefile" ;;
@@ -19648,6 +19647,7 @@
   "dlls/dsound/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dsound/Makefile" ;;
   "dlls/dsound/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dsound/tests/Makefile" ;;
   "dlls/dswave/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dswave/Makefile" ;;
+  "dlls/dxguid/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dxguid/Makefile" ;;
   "dlls/gdi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/gdi/Makefile" ;;
   "dlls/gdi/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/gdi/tests/Makefile" ;;
   "dlls/glu32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/glu32/Makefile" ;;
@@ -19724,10 +19724,12 @@
   "dlls/urlmon/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/urlmon/tests/Makefile" ;;
   "dlls/user/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/user/Makefile" ;;
   "dlls/user/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/user/tests/Makefile" ;;
+  "dlls/uuid/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/uuid/Makefile" ;;
   "dlls/uxtheme/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/uxtheme/Makefile" ;;
   "dlls/version/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/version/Makefile" ;;
   "dlls/win32s/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/win32s/Makefile" ;;
   "dlls/winaspi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winaspi/Makefile" ;;
+  "dlls/wined3d/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wined3d/Makefile" ;;
   "dlls/winedos/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winedos/Makefile" ;;
   "dlls/wineps/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wineps/Makefile" ;;
   "dlls/wininet/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/wininet/Makefile" ;;
@@ -19745,8 +19747,8 @@
   "dlls/winmm/winealsa/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winealsa/Makefile" ;;
   "dlls/winmm/winearts/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winearts/Makefile" ;;
   "dlls/winmm/wineaudioio/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wineaudioio/Makefile" ;;
-  "dlls/winmm/winenas/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winenas/Makefile" ;;
   "dlls/winmm/winejack/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winejack/Makefile" ;;
+  "dlls/winmm/winenas/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/winenas/Makefile" ;;
   "dlls/winmm/wineoss/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winmm/wineoss/Makefile" ;;
   "dlls/winnls/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winnls/Makefile" ;;
   "dlls/winsock/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/winsock/Makefile" ;;
@@ -19763,7 +19765,6 @@
   "libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/Makefile" ;;
   "libs/port/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/port/Makefile" ;;
   "libs/unicode/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/unicode/Makefile" ;;
-  "libs/uuid/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/uuid/Makefile" ;;
   "libs/wine/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/wine/Makefile" ;;
   "libs/wpp/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/wpp/Makefile" ;;
   "loader/Makefile" ) CONFIG_FILES="$CONFIG_FILES loader/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index 5c363e9..4018a7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1473,7 +1473,6 @@
 dlls/crtdll/Makefile
 dlls/crypt32/Makefile
 dlls/ctl3d/Makefile
-dlls/wined3d/Makefile
 dlls/d3d8/Makefile
 dlls/d3d9/Makefile
 dlls/d3dim/Makefile
@@ -1499,6 +1498,7 @@
 dlls/dsound/Makefile
 dlls/dsound/tests/Makefile
 dlls/dswave/Makefile
+dlls/dxguid/Makefile
 dlls/gdi/Makefile
 dlls/gdi/tests/Makefile
 dlls/glu32/Makefile
@@ -1575,10 +1575,12 @@
 dlls/urlmon/tests/Makefile
 dlls/user/Makefile
 dlls/user/tests/Makefile
+dlls/uuid/Makefile
 dlls/uxtheme/Makefile
 dlls/version/Makefile
 dlls/win32s/Makefile
 dlls/winaspi/Makefile
+dlls/wined3d/Makefile
 dlls/winedos/Makefile
 dlls/wineps/Makefile
 dlls/wininet/Makefile
@@ -1596,8 +1598,8 @@
 dlls/winmm/winealsa/Makefile
 dlls/winmm/winearts/Makefile
 dlls/winmm/wineaudioio/Makefile
-dlls/winmm/winenas/Makefile
 dlls/winmm/winejack/Makefile
+dlls/winmm/winenas/Makefile
 dlls/winmm/wineoss/Makefile
 dlls/winnls/Makefile
 dlls/winsock/Makefile
@@ -1614,7 +1616,6 @@
 libs/Makefile
 libs/port/Makefile
 libs/unicode/Makefile
-libs/uuid/Makefile
 libs/wine/Makefile
 libs/wpp/Makefile
 loader/Makefile
diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in
index c2baf69..affd99e 100644
--- a/dlls/Makedll.rules.in
+++ b/dlls/Makedll.rules.in
@@ -29,7 +29,7 @@
 	$(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
 
 $(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in
-	$(LDDLL) $(MAINSPEC).o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc
+	$(LDDLL) $(MAINSPEC).o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(ALL_LIBS) -lc
 
 # Rules for .dll files
 
@@ -45,7 +45,7 @@
 $(WIN16_FILES:%=__checklink16__%): checklink16
 
 checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
-	$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o $(ALL_LIBS) && $(RM) checklink
+	$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_LIBS) && $(RM) checklink
 
 checklink:: $(WIN16_FILES:%=__checklink16__%)
 
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index 8db5ebc..5962d46 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -144,9 +144,11 @@
 	d3d9 \
 	d3dx8 \
 	ddraw \
+	dxguid \
 	glu32 \
 	glut32 \
 	opengl32 \
+	uuid \
 	wined3d \
 	x11drv
 
@@ -251,6 +253,8 @@
 	iphlpapi.dll$(DLLEXT) \
 	joystick.drv$(DLLEXT) \
 	kernel32.dll$(DLLEXT) \
+	libdxguid.a \
+	libuuid.a \
 	lz32.dll$(DLLEXT) \
 	mapi32.dll$(DLLEXT) \
 	mcianim.drv$(DLLEXT) \
@@ -812,6 +816,12 @@
 x11drv.dll$(DLLEXT): x11drv/x11drv.dll$(DLLEXT)
 	$(RM) $@ && $(LN_S) x11drv/x11drv.dll$(DLLEXT) $@
 
+libdxguid.a: dxguid/libdxguid.a
+	$(RM) $@ && $(LN_S) dxguid/libdxguid.a $@
+
+libuuid.a: uuid/libuuid.a
+	$(RM) $@ && $(LN_S) uuid/libuuid.a $@
+
 
 # Import libraries
 
@@ -928,6 +938,11 @@
 	libwsock32 \
 	libx11drv
 
+ALL_IMPORT_LIBS = \
+	$(IMPORT_LIBS:%=%.$(IMPLIBEXT)) \
+	libdxguid.a \
+	libuuid.a
+
 libadvapi32.def: advapi32/advapi32.spec.def
 	$(RM) $@ && $(LN_S) advapi32/advapi32.spec.def $@
 libadvapi32.a: advapi32/advapi32.spec.def
@@ -1595,9 +1610,8 @@
 wsock32/wsock32.spec.def: $(WINEBUILD)
 x11drv/x11drv.spec.def: $(WINEBUILD)
 
-$(SUBDIRS): $(IMPORT_LIBS:%=%.$(IMPLIBEXT))
-$(SUBDIRS:%=%/__install__): $(IMPORT_LIBS:%=%.$(IMPLIBEXT))
-$(SUBDIRS:%=%/__crosstest__): $(IMPORT_LIBS:%=%.a)
+$(BUILDSUBDIRS): $(ALL_IMPORT_LIBS)
+$(INSTALLSUBDIRS:%=%/__install__): $(ALL_IMPORT_LIBS)
 
 # Map library name to the corresponding directory
 
@@ -1731,6 +1745,9 @@
 winsock/ws2_32.dll$(DLLEXT): winsock
 wsock32/wsock32.dll$(DLLEXT): wsock32
 x11drv/x11drv.dll$(DLLEXT): x11drv
+dxguid/libdxguid.a: dxguid
+uuid/libuuid.a: uuid
+
 # Rules for auto documentation
 
 $(SUBDIRS:%=%/__man__): dummy
@@ -1752,20 +1769,20 @@
 
 # Misc rules
 
-install install-dev:: $(IMPORT_LIBS:%=%.$(IMPLIBEXT))
+install install-dev:: $(ALL_IMPORT_LIBS)
 	$(MKINSTALLDIRS) $(dlldir)
-	for f in $(IMPORT_LIBS:%=%.$(IMPLIBEXT)); do $(INSTALL_DATA) $$f $(dlldir)/$$f; done
+	for f in $(ALL_IMPORT_LIBS); do $(INSTALL_DATA) $$f $(dlldir)/$$f; done
 
 install install-lib:: $(INSTALLSUBDIRS:%=%/__install__)
 
 uninstall::
-	$(RM) $(IMPORT_LIBS:%=$(dlldir)/%.$(IMPLIBEXT))
+	$(RM) $(ALL_IMPORT_LIBS:%=$(dlldir)/%)
 	-rmdir $(dlldir)
 
-implib: $(IMPORT_LIBS:%=%.$(IMPLIBEXT))
+implib: $(ALL_IMPORT_LIBS)
 
 clean::
-	$(RM) $(IMPORT_LIBS:%=%.a) $(IMPORT_LIBS:%=%.def) $(SYMLINKS)
+	$(RM) $(ALL_IMPORT_LIBS) $(SYMLINKS)
 
 check test:: $(BUILDSUBDIRS:%=%/__test__)
 
diff --git a/dlls/Maketest.rules.in b/dlls/Maketest.rules.in
index a7e6f3c..abf106a 100644
--- a/dlls/Maketest.rules.in
+++ b/dlls/Maketest.rules.in
@@ -41,12 +41,12 @@
 # Rules for .so main module
 
 $(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
-	$(LDDLL) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS) -lc
+	$(LDDLL) $(MODULE).spec.o $(OBJS) -o $@ -L$(DLLDIR) $(ALL_LIBS) -lc
 
 # Rules for .exe main module
 
-$(MODULE): $(OBJS) $(RCOBJS) $(IMPORTLIBS) Makefile.in
-	$(CC) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
+$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
+	$(CC) $(OBJS) $(RCOBJS) -o $@ $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
 
 # Rules for building test list
 
@@ -74,7 +74,7 @@
 crosstest:: @CROSSTEST@
 
 $(CROSSTEST): $(CROSSOBJS) Makefile.in
-	$(CROSSCC) $(CROSSOBJS) -o $@ $(IMPORTS:%=-l%) $(LIBS)
+	$(CROSSCC) $(CROSSOBJS) -o $@ $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
 
 # Rules for cleaning
 
diff --git a/libs/uuid/.cvsignore b/dlls/dxguid/.cvsignore
similarity index 100%
copy from libs/uuid/.cvsignore
copy to dlls/dxguid/.cvsignore
diff --git a/dlls/dxguid/Makefile.in b/dlls/dxguid/Makefile.in
new file mode 100644
index 0000000..10d628e
--- /dev/null
+++ b/dlls/dxguid/Makefile.in
@@ -0,0 +1,23 @@
+DEFS      = -D__WINESRC__
+DLLFLAGS  = @DLLFLAGS@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = libdxguid.a
+
+C_SRCS = \
+	dx8guid.c \
+	dx9guid.c \
+	dxguid.c
+
+all: $(MODULE)
+
+@MAKE_RULES@
+
+$(MODULE): $(OBJS) Makefile.in
+	$(RM) $@
+	$(AR) $@ $(OBJS)
+	$(RANLIB) $@
+
+### Dependencies:
diff --git a/libs/uuid/dx8guid.c b/dlls/dxguid/dx8guid.c
similarity index 100%
rename from libs/uuid/dx8guid.c
rename to dlls/dxguid/dx8guid.c
diff --git a/libs/uuid/dx9guid.c b/dlls/dxguid/dx9guid.c
similarity index 100%
rename from libs/uuid/dx9guid.c
rename to dlls/dxguid/dx9guid.c
diff --git a/libs/uuid/dxguid.c b/dlls/dxguid/dxguid.c
similarity index 100%
rename from libs/uuid/dxguid.c
rename to dlls/dxguid/dxguid.c
diff --git a/dlls/make_dlls b/dlls/make_dlls
index 9c7c74b..b720bf1 100755
--- a/dlls/make_dlls
+++ b/dlls/make_dlls
@@ -24,8 +24,8 @@
 
 my $makefiles = `find . -name Makefile.in -print`;
 
-my %imports = ();
 my %directories = ();
+my %implib_dirs = ();
 my %altnames = ();
 
 # list of special dlls that can be switched on or off by configure
@@ -61,8 +61,14 @@
         if (/^MODULE\s*=\s*([a-zA-Z0-9_.]+)/)
         {
             $module = $1;
-            $imports{$module} = [ ];
-            ($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+            if ($module =~ /^lib.*\.a$/)
+            {
+                ($implib_dirs{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+            }
+            else
+            {
+                ($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+            }
             next;
         }
         if (/^ALTNAMES\s*=\s*(.*)/)
@@ -71,15 +77,8 @@
             $altnames{$module} = \@list;
             next;
         }
-        if (/^(DELAYIMPORTS|IMPORTS)\s*=\s*(.*)/)
-        {
-            my @list = map { /\./ ? $_ : $_ . ".dll"; } split(/\s/,$2);
-            push @{$imports{$module}}, @list;
-            next;
-        }
     }
     close MAKE;
-    push @{$imports{$module}}, "kernel32.dll" unless !defined($module) || @{$imports{$module}} || $module eq "ntdll.dll";
 }
 
 open NEWMAKE,">Makefile.in.new" or die "cannot create Makefile.in.new";
@@ -126,7 +125,7 @@
 }
 
 printf NEWMAKE "\n\nSUBDIRS = \\\n\t\$(BASEDIRS)";
-foreach my $dir (sort keys %special_dlls)
+foreach my $dir (sort (keys %special_dlls, values %implib_dirs))
 {
     printf NEWMAKE " \\\n\t%s", $dir;
 }
@@ -146,13 +145,15 @@
 foreach my $mod (sort keys %directories)
 {
     next if defined($special_dlls{$directories{$mod}});  # skip special dlls
-    $targets{sprintf("%s\$(DLLEXT)",$mod)} = 1;
+    $targets{$mod . "\$(DLLEXT)"} = 1;
     next unless defined $altnames{$mod};
     foreach my $i (sort @{$altnames{$mod}})
     {
         $targets16{sprintf("%s\$(DLLEXT)",$i)} = 1;
     }
 }
+foreach my $mod (sort keys %implib_dirs) { $targets{$mod} = 1; }
+
 print NEWMAKE <<EOF;
 
 \@MAKE_RULES\@
@@ -204,7 +205,11 @@
         printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s\$(DLLEXT) \$@\n\n", $mod;
     }
 }
-
+foreach my $mod (sort keys %implib_dirs)
+{
+    printf NEWMAKE "%s: %s/%s\n", $mod, $implib_dirs{$mod}, $mod;
+    printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s \$@\n\n", $implib_dirs{$mod}, $mod;
+}
 
 ################################################################
 # output the import libraries rules
@@ -219,6 +224,11 @@
     $def =~ s/\.(dll|drv)$//;
     printf NEWMAKE " \\\n\tlib%s", $def;
 }
+print NEWMAKE "\n\nALL_IMPORT_LIBS = \\\n\t\$(IMPORT_LIBS:%=%.\$(IMPLIBEXT))";
+foreach my $mod (sort keys %implib_dirs)
+{
+    printf NEWMAKE " \\\n\t%s", $mod;
+}
 print NEWMAKE "\n\n";
 
 foreach my $mod (sort @implibs)
@@ -244,9 +254,8 @@
 
 print NEWMAKE <<EOF;
 
-\$(SUBDIRS): \$(IMPORT_LIBS:%=%.\$(IMPLIBEXT))
-\$(SUBDIRS:%=%/__install__): \$(IMPORT_LIBS:%=%.\$(IMPLIBEXT))
-\$(SUBDIRS:%=%/__crosstest__): \$(IMPORT_LIBS:%=%.a)
+\$(BUILDSUBDIRS): \$(ALL_IMPORT_LIBS)
+\$(INSTALLSUBDIRS:%=%/__install__): \$(ALL_IMPORT_LIBS)
 
 EOF
 
@@ -259,11 +268,16 @@
 {
     printf NEWMAKE "%s/%s\$(DLLEXT): %s\n", $directories{$mod}, $mod, $directories{$mod};
 }
+foreach my $mod (sort keys %implib_dirs)
+{
+    printf NEWMAKE "%s/%s: %s\n", $implib_dirs{$mod}, $mod, $implib_dirs{$mod};
+}
 
 ################################################################
 # makefile trailer
 
 print NEWMAKE <<EOF;
+
 # Rules for auto documentation
 
 \$(SUBDIRS:%=%/__man__): dummy
@@ -285,20 +299,20 @@
 
 # Misc rules
 
-install install-dev:: \$(IMPORT_LIBS:%=%.\$(IMPLIBEXT))
+install install-dev:: \$(ALL_IMPORT_LIBS)
 	\$(MKINSTALLDIRS) \$(dlldir)
-	for f in \$(IMPORT_LIBS:%=%.\$(IMPLIBEXT)); do \$(INSTALL_DATA) \$\$f \$(dlldir)/\$\$f; done
+	for f in \$(ALL_IMPORT_LIBS); do \$(INSTALL_DATA) \$\$f \$(dlldir)/\$\$f; done
 
 install install-lib:: \$(INSTALLSUBDIRS:%=%/__install__)
 
 uninstall::
-	\$(RM) \$(IMPORT_LIBS:%=\$(dlldir)/%.\$(IMPLIBEXT))
+	\$(RM) \$(ALL_IMPORT_LIBS:%=\$(dlldir)/%)
 	-rmdir \$(dlldir)
 
-implib: \$(IMPORT_LIBS:%=%.\$(IMPLIBEXT))
+implib: \$(ALL_IMPORT_LIBS)
 
 clean::
-	\$(RM) \$(IMPORT_LIBS:%=%.a) \$(IMPORT_LIBS:%=%.def) \$(SYMLINKS)
+	\$(RM) \$(ALL_IMPORT_LIBS) \$(SYMLINKS)
 
 check test:: \$(BUILDSUBDIRS:%=%/__test__)
 
diff --git a/libs/uuid/.cvsignore b/dlls/uuid/.cvsignore
similarity index 100%
rename from libs/uuid/.cvsignore
rename to dlls/uuid/.cvsignore
diff --git a/dlls/uuid/Makefile.in b/dlls/uuid/Makefile.in
new file mode 100644
index 0000000..a7a4dcf
--- /dev/null
+++ b/dlls/uuid/Makefile.in
@@ -0,0 +1,21 @@
+DEFS      = -D__WINESRC__
+DLLFLAGS  = @DLLFLAGS@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = libuuid.a
+
+C_SRCS = \
+	uuid.c
+
+all: $(MODULE)
+
+@MAKE_RULES@
+
+$(MODULE): $(OBJS) Makefile.in
+	$(RM) $@
+	$(AR) $@ $(OBJS)
+	$(RANLIB) $@
+
+### Dependencies:
diff --git a/libs/uuid/uuid.c b/dlls/uuid/uuid.c
similarity index 100%
rename from libs/uuid/uuid.c
rename to dlls/uuid/uuid.c
diff --git a/libs/Makefile.in b/libs/Makefile.in
index fde6965..94eeab0 100644
--- a/libs/Makefile.in
+++ b/libs/Makefile.in
@@ -7,20 +7,17 @@
 SUBDIRS = \
 	port \
 	unicode \
-	uuid \
 	wine \
 	wpp
 
 INSTALLSUBDIRS = \
 	unicode \
-	uuid \
 	wine
 
 SYMLINKS = \
 	libwine.$(LIBEXT) \
 	libwine_port.a \
 	libwine_unicode.$(LIBEXT) \
-	libwine_uuid.a \
 	libwpp.a
 
 @MAKE_RULES@
@@ -46,9 +43,6 @@
 libwine_port.a: port/libwine_port.a
 	$(RM) $@ && $(LN_S) port/$@ $@
 
-libwine_uuid.a: uuid/libwine_uuid.a
-	$(RM) $@ && $(LN_S) uuid/$@ $@
-
 libwpp.a: wpp/libwpp.a
 	$(RM) $@ && $(LN_S) wpp/$@ $@
 
@@ -57,7 +51,6 @@
 wine/libwine.$(LIBEXT): wine
 unicode/libwine_unicode.$(LIBEXT): unicode
 port/libwine_port.a: port
-uuid/libwine_uuid.a: uuid
 wpp/libwpp.a: wpp
 
 wine wine/__install__ wine/__install-lib__: libwine_port.a
diff --git a/libs/uuid/Makefile.in b/libs/uuid/Makefile.in
deleted file mode 100644
index 53241bc..0000000
--- a/libs/uuid/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-DEFS      = -D__WINESRC__
-DLLFLAGS  = @DLLFLAGS@
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR    = @srcdir@
-VPATH     = @srcdir@
-MODULE    = libwine_uuid.a
-
-C_SRCS = \
-	dx8guid.c \
-	dx9guid.c \
-	dxguid.c \
-	uuid.c
-
-all: $(MODULE)
-
-@MAKE_RULES@
-
-$(MODULE): $(OBJS) Makefile.in
-	$(RM) $@
-	$(AR) $@ $(OBJS)
-	$(RANLIB) $@
-
-install install-dev:: libwine_uuid.a
-	$(MKINSTALLDIRS) $(libdir)
-	$(INSTALL_DATA) libwine_uuid.a $(libdir)/libwine_uuid.a
-
-uninstall::
-	$(RM) $(libdir)/libwine_uuid.a
-
-### Dependencies:
diff --git a/programs/Makeprog.rules.in b/programs/Makeprog.rules.in
index 164d1dd..67e08be 100644
--- a/programs/Makeprog.rules.in
+++ b/programs/Makeprog.rules.in
@@ -29,7 +29,7 @@
 # Rules for .so main module
 
 $(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
-	$(LDDLL) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc
+	$(LDDLL) $(MODULE).spec.o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(ALL_LIBS) -lc
 
 $(BASEMODULE): $(WINEWRAPPER)
 	$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@