--- C:/home/Projekte/VirtualBox/VirtualBox-2.1.4-OSE/configure.vbs.orig	Mon Feb 16 16:52:14 2009
+++ C:/home/Projekte/VirtualBox/VirtualBox-2.1.4-OSE/configure.vbs	Thu Feb 19 14:45:30 2009
@@ -1656,7 +1656,7 @@
 
    strPathXml2 = UnixSlashes(PathAbs(strPathXml2))
    CfgPrint "SDK_VBOX_LIBXML2_INCS  := " & strPathXml2 & "/include"
-   CfgPrint "SDK_VBOX_LIBXML2_LIBS  := " & strPathXml2 & "/lib/libxml2.lib"
+   CfgPrint "SDK_VBOX_LIBXML2_LIBS  := " & strPathXml2 & "/lib/libxml2_a.lib"
 
    PrintResult "libxml2", strPathXml2
 end sub
@@ -1673,13 +1673,69 @@
       then
       str = LogFindFile(strPathXml2, "bin/libxml2.dll")
       if str <> "" then
-         if LogFindFile(strPathXml2, "lib/libxml2.lib") then
+         if LogFindFile(strPathXml2, "lib/libxml2_a.lib")<>"" then
             CheckForXml2Sub = True
          end if
       end if
    end if
 end function
 
+' Checks for iconv
+sub CheckForIconv(strOptIconv)
+   dim strPathIconv, str
+   PrintHdr "iconv"
+
+   ' Try find some iconv dll/lib.
+   '
+   strPathIconv = ""
+   if (strPathIconv = "") And (strOptIconv <> "") then
+      if CheckForIconvSub(strOptIconv) then strPathIconv = strOptIconv
+   end if
+
+   if strPathIconv = "" Then
+      str = Which("libiconv_a.lib")
+      if str <> "" Then
+         str = PathParent(PathStripFilename(str))
+         if CheckForIconvSub(str) then strPathIconv = str
+      end if
+   end if
+
+   ' Success?
+   if strPathIconv = "" then
+      if strOptIconv = "" then
+         MsgError "Can't locate iconv. Try specify the path with the --with-iconv=<path> argument. " _
+                & "If still no luck, consult the configure.log and the build requirements."
+      else
+         MsgError "Can't locate iconv. Please consult the configure.log and the build requirements."
+      end if
+      exit sub
+   end if
+
+   strPathIconv = UnixSlashes(PathAbs(strPathIconv))
+   CfgPrint "SDK_VBOX_ICONV 	   =."
+   CfgPrint "SDK_VBOX_ICONV_INCS  := " & strPathIconv & "/include"
+   CfgPrint "SDK_VBOX_ICONV_LIBS  := " & strPathIconv & "/lib/iconv_a.lib"
+
+   PrintResult "iconv", strPathIconv
+end sub
+
+''
+' Checks if the specified path points to an usable libxml2 or not.
+function CheckForIconvSub(strPathIconv)
+   dim str
+
+   CheckForIconvSub = False
+   LogPrint "trying: strPathIconv=" & strPathIconv
+   if LogFileExists(strPathIconv, "include/iconv.h") then
+      str = LogFindFile(strPathIconv, "bin/iconv.dll")
+      if str <> "" then
+         if LogFindFile(strPathIconv, "lib/iconv_a.lib")<>"" then
+            CheckForIconvSub = True
+         end if
+      end if
+   end if
+end function
+
 
 ''
 ' Checks for libxslt.
@@ -1702,7 +1758,7 @@
    end if
 
    if strPathXslt = "" Then
-      str = Which("libxslt.lib")
+      str = Which("libxslt_a.lib")
       if str <> "" Then
          str = PathParent(PathStripFilename(str))
          if CheckForXsltSub(str) then strPathXslt = str
@@ -1736,7 +1792,7 @@
 
    strPathXslt = UnixSlashes(PathAbs(strPathXslt))
    CfgPrint "SDK_VBOX_LIBXSLT_INCS   := " & strPathXslt & "/include"
-   CfgPrint "SDK_VBOX_LIBXSLT_LIBS   := " & strPathXslt & "/lib/libxslt.lib"
+   CfgPrint "SDK_VBOX_LIBXSLT_LIBS   := " & strPathXslt & "/lib/libxslt_a.lib"
 
    PrintResult "libxslt", strPathXslt
 end sub
@@ -1752,9 +1808,9 @@
    if   LogFileExists(strPathXslt, "include/libxslt/namespaces.h") _
     And LogFileExists(strPathXslt, "include/libxslt/xsltutils.h") _
       then
-      str = LogFindFile(strPathXslt, "lib/libxslt.dll")
+      str = LogFindFile(strPathXslt, "bin/libxslt.dll")
       if str <> "" then
-         if   LogFileExists(strPathXslt, "lib/libxslt.lib") _
+         if   LogFileExists(strPathXslt, "lib/libxslt_a.lib") _
             then
             CheckForXsltSub = True
          end if
@@ -1834,6 +1890,8 @@
    else
       CfgPrint "VBOX_PATH_QT          := " & strPathQt
       CfgPrint "QTDIR                  = $(VBOX_PATH_QT)"
+      CfgPrint "PATH_SDK_QT3          := " & strPathQt
+      CfgPrint "PATH_TOOL_QT3_BIN          = $(PATH_SDK_QT3)/bin"
 
       if blnQtWinFree = True then     ' The "qtwin"
          PrintResult "Qt (v" & g_strQtVer & ", QtWin/Free)", strPathQt
@@ -1847,6 +1905,38 @@
 end sub
 
 
+sub CheckForQt4(strOptQt4)
+   dim strPathQt, str, blnQtWinFree
+
+   PrintHdr "Qt4"
+
+   '
+   ' Try find the Qt4 installation (user specified path with --with-qt4=).
+   '
+   strPathQt4 = ""
+   blnQtWinFree = False
+
+   LogPrint "Checking for user specified path of Qt ..."
+   if (strPathQt4 = "") And (strOptQt4 <> "") then
+      strOptQt4 = UnixSlashes(strOptQt4)
+      if CheckForQt4Sub(strOptQt4) then strPathQt4 = strOptQt4
+
+   end if
+
+   '' @todo check for Qt installations and stuff later.
+
+   ' Found anything?
+   if strPathQt4 = "" then
+      CfgPrint "VBOX_WITH_QT4GUI="	
+      PrintResult "Qt4", "not found"
+   else
+      CfgPrint "PATH_SDK_QT4         := " & strPathQt4
+      CfgPrint "PATH_TOOL_QT4_BIN         = $(PATH_SDK_QT4)/bin"
+
+      PrintResult "Qt4 ", strPathQt4
+   end if
+end sub
+
 ''
 ' Checks if the specified path points to an usable Qt install or not.
 function CheckForQtSub(strPathQt)
@@ -1902,6 +1992,27 @@
 
 end function
 
+''
+' Checks if the specified path points to an usable Qt install or not.
+function CheckForQt4Sub(strPathQt4)
+
+   CheckForQt4Sub = False
+   LogPrint "trying: strPathQt4=" & strPathQt4
+
+   'based on Qt 4.4.3
+   dim str
+   if   LogFileExists(strPathQt4, "bin/moc.exe") _
+    And LogFileExists(strPathQt4, "bin/uic.exe") _
+    And LogFileExists(strPathQt4, "include/Qt/qwidget.h") _
+    And LogFileExists(strPathQt4, "include/QtGui/QApplication") _
+    And LogFileExists(strPathQt4, "include/QtNetwork/QHostAddress") _
+    And LogFileExists(strPathQt4, "lib/QtCore4.lib") _
+    And LogFileExists(strPathQt4, "lib/QtNetwork4.lib") _
+      then
+          CheckForQt4Sub = True
+   end if
+
+end function
 
 ''
 ' Checks if the specified path points to an usable "qtwin" Qt/Free install or not.
@@ -1954,13 +2065,15 @@
    Print "  --with-kBuild=PATH    "
    Print "  --with-libSDL=PATH    "
    Print "  --with-MinGW=PATH     "
-   Print "  --with-Qt3=PATH       "
+   Print "  --with-Iconv=PATH     "
+   Print "  --with-Qt=PATH       "
+   Print "  --with-Qt4=PATH       "
    Print "  --with-SDK=PATH       "
    Print "  --with-VC=PATH        "
    Print "  --with-VC-Common=PATH "
    Print "  --with-VC-Express-Edition"
    Print "  --with-W32API=PATH    "
-   Print "  --with-libxml3=PATH   "
+   Print "  --with-libxml2=PATH   "
    Print "  --with-libxslt=PATH   "
 end sub
 
@@ -2021,8 +2134,12 @@
             strOptlibSDL = strPath
          case "--with-mingw"
             strOptMingW = strPath
+         case "--with-iconv"
+            strOptIconv = strPath
          case "--with-qt"
             strOptQt = strPath
+         case "--with-qt4"
+            strOptQt4 = strPath
          case "--with-sdk"
             strOptSDK = strPath
          case "--with-vc"
@@ -2091,7 +2208,9 @@
    CheckForlibSDL strOptlibSDL
    CheckForXml2 strOptXml2
    CheckForXslt strOptXslt
+   CheckForIconv strOptIconv
    CheckForQt strOptQt
+   CheckForQt4 strOptQt4
    if g_blnInternalMode then
       EnvPrint "call " & g_strPathDev & "/env.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9"
    end if

