VirtualBox

Changeset 14460 in vbox


Ignore:
Timestamp:
Nov 21, 2008 2:10:28 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39734
Message:

configure.vbs: removed the xalan/xerces cruft and attempted to put the libxml2/xslt discovery in instead. totally untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r8155 r14460  
    5151g_strDisableCOM = ""
    5252
    53 ' The internal mode is primarily for skipping the xerces and xalan monsters.
     53' The internal mode is primarily for skipping some large libraries.
    5454dim g_blnInternalMode
    5555g_blnInternalMode = False
     
    12821282   ' Skip if no COM/ATL.
    12831283   if g_blnDisableCOM then
    1284       PrintResult "Xerces", "Skipped (" & g_strDisableCOM & ")"
     1284      PrintResult "Midl", "Skipped (" & g_strDisableCOM & ")"
    12851285      exit sub
    12861286   end if
     
    16101610
    16111611
    1612 dim g_strXercesVer
    1613 g_strXercesVer = ""
    1614 
    1615 ''
    1616 ' Checks for xerces.
    1617 sub CheckForXerces(strOptXerces)
    1618    dim strPathXerces, str
    1619    PrintHdr "Xerces"
     1612''
     1613' Checks for libxml2.
     1614sub CheckForXml2(strOptXml2)
     1615   dim strPathXml2, str
     1616   PrintHdr "libxml2"
    16201617
    16211618   ' Skip if no COM/ATL.
    16221619   if g_blnDisableCOM then
    1623       PrintResult "Xerces", "Skipped (" & g_strDisableCOM & ")"
     1620      PrintResult "libxml2", "Skipped (" & g_strDisableCOM & ")"
    16241621      exit sub
    16251622   end if
    16261623
    16271624   '
    1628    ' Try find some xerces dll/lib.
    1629    '
    1630    strPathXerces = ""
    1631    if (strPathXerces = "") And (strOptXerces <> "") then
    1632       if CheckForXercesSub(strOptXerces) then strPathXerces = strOptXerces
    1633    end if
    1634 
    1635    if strPathXerces = "" Then
    1636       str = Which("xerces-c_2_9.lib")
    1637       if str = "" then str = Which("xerces-c_2_8.lib")
    1638       if str = "" then str = Which("xerces-c_2_7.lib")
    1639       if str = "" then str = Which("xerces-c_2_6.lib")
     1625   ' Try find some xml2 dll/lib.
     1626   '
     1627   strPathXml2 = ""
     1628   if (strPathXml2 = "") And (strOptXml2 <> "") then
     1629      if CheckForXml2Sub(strOptXml2) then strPathXml2 = strOptXml2
     1630   end if
     1631
     1632   if strPathXml2 = "" Then
     1633      str = Which("libxml2.lib")
    16401634      if str <> "" Then
    16411635         str = PathParent(PathStripFilename(str))
    1642          if CheckForXercesSub(str) then strPathXerces = str
    1643       end if
    1644    end if
    1645 
    1646    if strPathXerces = "" Then
    1647       str = Which("xerces-c_2_9.dll")
    1648       if str = "" then str = Which("xerces-c_2_8.dll")
    1649       if str = "" then str = Which("xerces-c_2_7.dll")
    1650       if str = "" then str = Which("xerces-c_2_6.dll")
     1636         if CheckForXml2Sub(str) then strPathXml2 = str
     1637      end if
     1638   end if
     1639
     1640   ' Ignore failure if we're in 'internal' mode.
     1641   if (strPathXml2 = "") and g_blnInternalMode then
     1642      PrintResult "libxml2", "ignored (internal mode)"
     1643      exit sub
     1644   end if
     1645
     1646   ' Success?
     1647   if strPathXml2 = "" then
     1648      if strOptXml2 = "" then
     1649         MsgError "Can't locate libxml2. Try specify the path with the --with-libxml2=<path> argument. " _
     1650                & "If still no luck, consult the configure.log and the build requirements."
     1651      else
     1652         MsgError "Can't locate libxml2. Please consult the configure.log and the build requirements."
     1653      end if
     1654      exit sub
     1655   end if
     1656
     1657   strPathXml2 = UnixSlashes(PathAbs(strPathXml2))
     1658   CfgPrint "SDK_VBOX_LIBXML2_INCS  := " & strPathXml2 & "/include"
     1659   CfgPrint "SDK_VBOX_LIBXML2_LIBS  := " & strPathXml2 & "/lib/libxml2.lib"
     1660
     1661   PrintResult "libxml2", strPathXml2
     1662end sub
     1663
     1664''
     1665' Checks if the specified path points to an usable libxml2 or not.
     1666function CheckForXml2Sub(strPathXml2)
     1667   dim str
     1668
     1669   CheckForXml2Sub = False
     1670   LogPrint "trying: strPathXml2=" & strPathXml2
     1671   if   LogFileExists(strPathXml2, "include/libxml/xmlexports.h") _
     1672    And LogFileExists(strPathXml2, "include/libxml/xmlreader.h") _
     1673      then
     1674      str = LogFindFile(strPathXml2, "bin/libxml2.dll")
     1675      if str <> "" then
     1676         if LogFindFile(strPathXml2, "lib/libxml2.lib") then
     1677            CheckForXml2Sub = True
     1678         end if
     1679      end if
     1680   end if
     1681end function
     1682
     1683
     1684''
     1685' Checks for libxslt.
     1686sub CheckForXslt(strOptXslt)
     1687   dim strPathXslt, str
     1688   PrintHdr "libxslt"
     1689
     1690   ' Skip if no COM/ATL.
     1691   if g_blnDisableCOM then
     1692      PrintResult "libxslt", "Skipped (" & g_strDisableCOM & ")"
     1693      exit sub
     1694   end if
     1695
     1696   '
     1697   ' Try find some libxslt dll/lib.
     1698   '
     1699   strPathXslt = ""
     1700   if (strPathXslt = "") And (strOptXslt <> "") then
     1701      if CheckForXsltSub(strOptXslt) then strPathXslt = strOptXslt
     1702   end if
     1703
     1704   if strPathXslt = "" Then
     1705      str = Which("libxslt.lib")
    16511706      if str <> "" Then
    16521707         str = PathParent(PathStripFilename(str))
    1653          if CheckForXercesSub(str) then strPathXerces = str
     1708         if CheckForXsltSub(str) then strPathXslt = str
     1709      end if
     1710   end if
     1711
     1712   if strPathXslt = "" Then
     1713      str = Which("libxslt.dll")
     1714      if str <> "" Then
     1715         str = PathParent(PathStripFilename(str))
     1716         if CheckForXsltSub(str) then strPathXslt = str
    16541717      end if
    16551718   end if
    16561719
    16571720   ' Ignore failure if we're in 'internal' mode.
    1658    if (strPathXerces = "") and g_blnInternalMode then
    1659       PrintResult "Xerces", "ignored (internal mode)"
     1721   if (strPathXslt = "") and g_blnInternalMode then
     1722      PrintResult "libxslt", "ignored (internal mode)"
    16601723      exit sub
    16611724   end if
    16621725
    16631726   ' Success?
    1664    if strPathXerces = "" then
    1665       if strOptXerces = "" then
    1666          MsgError "Can't locate Xerces. Try specify the path with the --with-xerces=<path> argument. " _
     1727   if strPathXslt = "" then
     1728      if strOptXslt = "" then
     1729         MsgError "Can't locate libxslt. Try specify the path with the --with-libxslt=<path> argument. " _
    16671730                & "If still no luck, consult the configure.log and the build requirements."
    16681731      else
    1669          MsgError "Can't locate Xerces. Please consult the configure.log and the build requirements."
     1732         MsgError "Can't locate libxslt. Please consult the configure.log and the build requirements."
    16701733      end if
    16711734      exit sub
    16721735   end if
    16731736
    1674    strPathXerces = UnixSlashes(PathAbs(strPathXerces))
    1675    CfgPrint "SDK_VBOX_XERCES_INCS  := " & strPathXerces & "/include"
    1676    CfgPrint "SDK_VBOX_XERCES_LIBS  := " & strPathXerces & "/lib/xerces-c_" & Left(g_strXercesVer, 1) & ".lib"
    1677    CfgPrint "DLL_SDK_VBOX_XERCES_XERCES := " & strPathXerces & "/bin/xerces-c_" & g_strXercesVer & ".dll"
    1678 
    1679    PrintResult "Xerces", strPathXerces
    1680 end sub
    1681 
    1682 ''
    1683 ' Checks if the specified path points to an usable libSDL or not.
    1684 function CheckForXercesSub(strPathXerces)
     1737   strPathXslt = UnixSlashes(PathAbs(strPathXslt))
     1738   CfgPrint "SDK_VBOX_LIBXSLT_INCS   := " & strPathXslt & "/include"
     1739   CfgPrint "SDK_VBOX_LIBXSLT_LIBS   := " & strPathXslt & "/lib/libxslt.lib"
     1740
     1741   PrintResult "libxslt", strPathXslt
     1742end sub
     1743
     1744''
     1745' Checks if the specified path points to an usable libxslt or not.
     1746function CheckForXsltSub(strPathXslt)
    16851747   dim str
    16861748
    1687    CheckForXercersSub = False
    1688    LogPrint "trying: strPathXerces=" & strPathXerces
    1689    if   LogFileExists(strPathXerces, "include/xercesc/dom/DOM.hpp") _
    1690     And LogFileExists(strPathXerces, "include/xercesc/validators/datatype/DatatypeValidator.hpp") _
     1749   CheckForXsltSub = False
     1750   LogPrint "trying: strPathXslt=" & strPathXslt
     1751
     1752   if   LogFileExists(strPathXslt, "include/libxslt/namespaces.h") _
     1753    And LogFileExists(strPathXslt, "include/libxslt/xsltutils.h") _
    16911754      then
    1692       ' The version is encoded in the dll/lib name, so try first
    1693       ' to find the dll and then a matching lib.
    1694       str = LogFindFile(strPathXerces, "bin/xerces-c_*.dll")
     1755      str = LogFindFile(strPathXslt, "lib/libxslt.dll")
    16951756      if str <> "" then
    1696          g_strXercesVer = Mid(str, Len("xerces-c_") + 1, Len(str) - Len("xerces-c_.dll"))
    1697          ' the library omits the minor version (in the current distro).
    1698          if LogFileExists(strPathXerces, "lib/xerces-c_" & Left(g_strXercesVer, 1) & ".lib") then
    1699             CheckForXercesSub = True
    1700          end if
    1701       end if
    1702    end if
    1703 end function
    1704 
    1705 
    1706 dim g_strXalanVer
    1707 g_strXalanVer = ""
    1708 
    1709 ''
    1710 ' Checks for Xalan.
    1711 sub CheckForXalan(strOptXalan)
    1712    dim strPathXalan, str
    1713    PrintHdr "Xalan"
    1714 
    1715    ' Skip if no COM/ATL.
    1716    if g_blnDisableCOM then
    1717       PrintResult "Xalan", "Skipped (" & g_strDisableCOM & ")"
    1718       exit sub
    1719    end if
    1720 
    1721    '
    1722    ' Try find some Xalan dll/lib.
    1723    '
    1724    strPathXalan = ""
    1725    if (strPathXalan = "") And (strOptXalan <> "") then
    1726       if CheckForXalanSub(strOptXalan) then strPathXalan = strOptXalan
    1727    end if
    1728 
    1729    if strPathXalan = "" Then
    1730       str = Which("Xalan-c_1_12.lib")
    1731       if str = "" then str = Which("Xalan-c_1_11.lib")
    1732       if str = "" then str = Which("Xalan-c_1_10.lib")
    1733       if str = "" then str = Which("Xalan-c_1_9.lib")
    1734       if str <> "" Then
    1735          str = PathParent(PathStripFilename(str))
    1736          if CheckForXalanSub(str) then strPathXalan = str
    1737       end if
    1738    end if
    1739 
    1740    if strPathXalan = "" Then
    1741       str = Which("Xalan-c_1_12.dll")
    1742       if str = "" then str = Which("Xalan-c_1_11.dll")
    1743       if str = "" then str = Which("Xalan-c_1_10.dll")
    1744       if str = "" then str = Which("Xalan-c_1_9.dll")
    1745       if str <> "" Then
    1746          str = PathParent(PathStripFilename(str))
    1747          if CheckForXalanSub(str) then strPathXalan = str
    1748       end if
    1749    end if
    1750 
    1751    ' Ignore failure if we're in 'internal' mode.
    1752    if (strPathXalan = "") and g_blnInternalMode then
    1753       PrintResult "Xalan", "ignored (internal mode)"
    1754       exit sub
    1755    end if
    1756 
    1757    ' Success?
    1758    if strPathXalan = "" then
    1759       if strOptXalan = "" then
    1760          MsgError "Can't locate Xalan. Try specify the path with the --with-Xalan=<path> argument. " _
    1761                 & "If still no luck, consult the configure.log and the build requirements."
    1762       else
    1763          MsgError "Can't locate Xalan. Please consult the configure.log and the build requirements."
    1764       end if
    1765       exit sub
    1766    end if
    1767 
    1768    strPathXalan = UnixSlashes(PathAbs(strPathXalan))
    1769    CfgPrint "SDK_VBOX_XALAN_INCS   := " & strPathXalan & "/include"
    1770    CfgPrint "SDK_VBOX_XALAN_LIBS   := " & strPathXalan & "/lib/Xalan-C_" & Left(g_strXalanVer, 1) & ".lib"
    1771    CfgPrint "DLL_SDK_VBOX_XALAN_XALAN := " & strPathXalan & "/bin/Xalan-C_" & g_strXalanVer & ".dll"
    1772    CfgPrint "DLL_SDK_VBOX_XALAN_XALAN-MESSAGES := " & strPathXalan & "/bin/XalanMessages_" & g_strXalanVer & ".dll"
    1773 
    1774    PrintResult "Xalan", strPathXalan
    1775 end sub
    1776 
    1777 ''
    1778 ' Checks if the specified path points to an usable Xalan or not.
    1779 function CheckForXalanSub(strPathXalan)
    1780    dim str
    1781 
    1782    CheckForXercersSub = False
    1783    LogPrint "trying: strPathXalan=" & strPathXalan
    1784 
    1785    if   LogFileExists(strPathXalan, "include/xalanc/DOMSupport/DOMSupport.hpp") _
    1786     And LogFileExists(strPathXalan, "include/xalanc/XalanDOM/XalanText.hpp") _
    1787       then
    1788       ' The version is encoded in the dll/lib name, so try first
    1789       ' to find the dll and then a matching lib.
    1790       str = LogFindFile(strPathXalan, "bin/Xalan-C_*.dll")
    1791       if str <> "" then
    1792          g_strXalanVer = Mid(str, Len("Xalan-C_") + 1, Len(str) - Len("Xalan-C_.dll"))
    1793          ' the library omits the minor version (in the current distro).
    1794          if   LogFileExists(strPathXalan, "bin/XalanMessages_" & g_strXalanVer & ".dll") _
    1795           And LogFileExists(strPathXalan, "lib/Xalan-C_" & Left(g_strXalanVer, 1) & ".lib") _
     1757         if   LogFileExists(strPathXslt, "lib/libxslt.lib") _
    17961758            then
    1797             CheckForXalanSub = True
     1759            CheckForXsltSub = True
    17981760         end if
    17991761      end if
     
    19991961   Print "  --with-VC-Express-Edition"
    20001962   Print "  --with-W32API=PATH    "
    2001    Print "  --with-Xalan=PATH     "
    2002    Print "  --with-Xerces=PATH    "
     1963   Print "  --with-libxml3=PATH   "
     1964   Print "  --with-libxslt=PATH   "
    20031965end sub
    20041966
     
    20311993   blnOptVCExpressEdition = False
    20321994   strOptW32API = ""
    2033    blnOptXalan = ""
    2034    blnOptXerces = ""
     1995   blnOptXml2 = ""
     1996   blnOptXslt = ""
    20351997   blnOptDisableCOM = False
    20361998   for i = 1 to Wscript.Arguments.Count
     
    20722034         case "--with-w32api"
    20732035            strOptW32API = strPath
    2074          case "--with-xalan"
    2075             strOptXalan = strPath
    2076          case "--with-xerces"
    2077             strOptXerces = strPath
     2036         case "--with-libxml2"
     2037            strOptXml2 = strPath
     2038         case "--with-libxslt"
     2039            strOptXslt = strPath
    20782040         case "--disable-com"
    20792041            blnOptDisableCOM = True
     
    21282090   CheckForMingW strOptMingw, strOptW32API
    21292091   CheckForlibSDL strOptlibSDL
    2130    CheckForXerces strOptXerces
    2131    CheckForXalan strOptXalan
     2092   CheckForXml2 strOptXml2
     2093   CheckForXslt strOptXslt
    21322094   CheckForQt strOptQt
    21332095   if g_blnInternalMode then
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette