ParserFlags.st
changeset 3500 60e5d213dd64
parent 3462 896d56e60c6a
child 3506 e8b4502d405f
equal deleted inserted replaced
3499:ca9234a7be8f 3500:60e5d213dd64
  1603 
  1603 
  1604     |topDir topDirName vcTop sdkTop bccTop useBorlandC useVisualC useMingw m32|
  1604     |topDir topDirName vcTop sdkTop bccTop useBorlandC useVisualC useMingw m32|
  1605 
  1605 
  1606     topDir := topDirArg.
  1606     topDir := topDirArg.
  1607     OperatingSystem isMSWINDOWSlike ifTrue:[
  1607     OperatingSystem isMSWINDOWSlike ifTrue:[
  1608 	topDirArg isString ifTrue:[
  1608         topDirArg isString ifTrue:[
  1609 	    topDir := topDirArg copyReplaceAll:$/ with:$\.
  1609             topDir := topDirArg copyReplaceAll:$/ with:$\ ifNone:topDirArg.
  1610 	]
  1610         ]
  1611     ].
  1611     ].
  1612     topDir := topDir asFilename.
  1612     topDir := topDir asFilename.
  1613     topDirName := topDir name.
  1613     topDirName := topDir name.
  1614 
  1614 
  1615     "/ if in the development directory, use ./modules
  1615     "/ if in the development directory, use ./modules
  1616     Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
  1616     Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
  1617 	STCModulePath := 'modules'.
  1617         STCModulePath := 'modules'.
  1618     ] ifFalse:[
  1618     ] ifFalse:[
  1619 	STCModulePath := Filename tempDirectory constructString:'modules'.
  1619         STCModulePath := Filename tempDirectory constructString:'modules'.
  1620     ].
  1620     ].
  1621 
  1621 
  1622     (topDir construct:'stc') exists ifFalse:[
  1622     (topDir construct:'stc') exists ifFalse:[
  1623 	('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
  1623         ('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
  1624 	'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
  1624         'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
  1625 	STCCompilation := #never.
  1625         STCCompilation := #never.
  1626     ].
  1626     ].
  1627 
  1627 
  1628     OperatingSystem isMSWINDOWSlike ifTrue:[
  1628     OperatingSystem isMSWINDOWSlike ifTrue:[
  1629 	useBorlandC := useVisualC := useMingw := false.
  1629         useBorlandC := useVisualC := useMingw := false.
  1630 
  1630 
  1631 	STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
  1631         STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
  1632 	(bccTop := BCCTop) isNil ifTrue:[
  1632         (bccTop := BCCTop) isNil ifTrue:[
  1633 	    bccTop := #(
  1633             bccTop := #(
  1634 			'C:\Borland\bcc55'
  1634                         'C:\Borland\bcc55'
  1635 		       ) detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
  1635                        ) detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
  1636 	].
  1636         ].
  1637 
  1637 
  1638 	(bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
  1638         (bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
  1639 	    STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
  1639             STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
  1640 	    LibDirectory := topDirName,'\lib\bc'.
  1640             LibDirectory := topDirName,'\lib\bc'.
  1641 	    LinkArgs := '-L',topDirName,'\lib\bc'.
  1641             LinkArgs := '-L',topDirName,'\lib\bc'.
  1642 	    LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
  1642             LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
  1643 	    CCPath := 'bcc32'.
  1643             CCPath := 'bcc32'.
  1644 	    MakeCommand := 'bmake'.
  1644             MakeCommand := 'bmake'.
  1645 	    LinkCommand := 'ilink32'.
  1645             LinkCommand := 'ilink32'.
  1646 	    CCCompilationOptions := '-w-'.
  1646             CCCompilationOptions := '-w-'.
  1647 	    useBorlandC := true.
  1647             useBorlandC := true.
  1648 	] ifFalse:[
  1648         ] ifFalse:[
  1649 	    (vcTop := VCTop) isNil ifTrue:[
  1649             (vcTop := VCTop) isNil ifTrue:[
  1650 		vcTop := #(
  1650                 vcTop := #(
  1651 			    'C:\Program Files\Microsoft Visual Studio 11.0\VC'
  1651                             'C:\Program Files\Microsoft Visual Studio 11.0\VC'
  1652 			    'C:\Program Files\Microsoft Visual Studio 10.0\VC'
  1652                             'C:\Program Files\Microsoft Visual Studio 10.0\VC'
  1653 			    'C:\Program Files\Microsoft Visual Studio 9.0\VC'
  1653                             'C:\Program Files\Microsoft Visual Studio 9.0\VC'
  1654 			  ) detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]] ifNone:nil.
  1654                           ) detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]] ifNone:nil.
  1655 	    ].
  1655             ].
  1656 	    (vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
  1656             (vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
  1657 		useVisualC := true.
  1657                 useVisualC := true.
  1658 		STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
  1658                 STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
  1659 
  1659 
  1660 		(sdkTop := SDKTop) isNil ifTrue:[
  1660                 (sdkTop := SDKTop) isNil ifTrue:[
  1661 		    sdkTop := #(
  1661                     sdkTop := #(
  1662 				'C:\Program Files\Microsoft SDKs\Windows\v7.0A'
  1662                                 'C:\Program Files\Microsoft SDKs\Windows\v7.0A'
  1663 				'C:\Program Files\Microsoft SDKs\Windows\v6.0A'
  1663                                 'C:\Program Files\Microsoft SDKs\Windows\v6.0A'
  1664 			      ) detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
  1664                               ) detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
  1665 		].
  1665                 ].
  1666 		(sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
  1666                 (sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
  1667 		    STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
  1667                     STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
  1668 		].
  1668                 ].
  1669 		LibDirectory := topDirName,'\lib\vc'.
  1669                 LibDirectory := topDirName,'\lib\vc'.
  1670 		LinkArgs := '-L',topDirName,'\lib\vc'.
  1670                 LinkArgs := '-L',topDirName,'\lib\vc'.
  1671 		LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
  1671                 LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
  1672 		CCPath := vcTop,'\bin\cl.exe'.
  1672                 CCPath := vcTop,'\bin\cl.exe'.
  1673 		LinkCommand := 'ilink32'.
  1673                 LinkCommand := 'ilink32'.
  1674 		MakeCommand := 'vcmake'.
  1674                 MakeCommand := 'vcmake'.
  1675 		CCCompilationOptions := '/nologo /ZI  /w /GF /EHsc /FR.\objvc\'.
  1675                 CCCompilationOptions := '/nologo /ZI  /w /GF /EHsc /FR.\objvc\'.
  1676 	    ] ifFalse:[
  1676             ] ifFalse:[
  1677 		"/ add definitions for lcc, mingc etc.
  1677                 "/ add definitions for lcc, mingc etc.
  1678 		STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
  1678                 STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
  1679 		LibDirectory := topDirName,'\lib\vc'.
  1679                 LibDirectory := topDirName,'\lib\vc'.
  1680 		LinkArgs := '-L',topDirName,'\lib\vc'.
  1680                 LinkArgs := '-L',topDirName,'\lib\vc'.
  1681 		LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
  1681                 LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
  1682 	    ].
  1682             ].
  1683 	].
  1683         ].
  1684 	STCCompilationDefines := '-DWIN32'.
  1684         STCCompilationDefines := '-DWIN32'.
  1685 	STCCompilationOptions := '+optinline +inlineNew'.
  1685         STCCompilationOptions := '+optinline +inlineNew'.
  1686 	(topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
  1686         (topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
  1687 	    STCPath := (topDirName,'\stc\stc.exe').
  1687             STCPath := (topDirName,'\stc\stc.exe').
  1688 	] ifFalse:[
  1688         ] ifFalse:[
  1689 	    STCPath := 'stc.exe'.
  1689             STCPath := 'stc.exe'.
  1690 	].
  1690         ].
  1691 	LibPath := ''.
  1691         LibPath := ''.
  1692 	SearchedLibraries := #('import32.lib').
  1692         SearchedLibraries := #('import32.lib').
  1693 	"/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
  1693         "/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
  1694     ] ifFalse:[
  1694     ] ifFalse:[
  1695 	STCCompilationIncludes := '-I',topDirName,'/include'.
  1695         STCCompilationIncludes := '-I',topDirName,'/include'.
  1696 	STCCompilationDefines := ''.
  1696         STCCompilationDefines := ''.
  1697 	STCCompilationOptions := '+optinline +inlineNew'.
  1697         STCCompilationOptions := '+optinline +inlineNew'.
  1698 	STCPath := topDirName,'/stc/stc'.
  1698         STCPath := topDirName,'/stc/stc'.
  1699 
  1699 
  1700 	m32 := ''.
  1700         m32 := ''.
  1701 	(ExternalAddress pointerSize == 4) ifTrue:[
  1701         (ExternalAddress pointerSize == 4) ifTrue:[
  1702 	    m32 := ' -m32'
  1702             m32 := ' -m32'
  1703 	].
  1703         ].
  1704 	CCCompilationOptions := OperatingSystem getCPUDefine,
  1704         CCCompilationOptions := OperatingSystem getCPUDefine,
  1705 				' -D', self usedCompilerDefine,
  1705                                 ' -D', self usedCompilerDefine,
  1706 				' ', OperatingSystem getOSDefine,
  1706                                 ' ', OperatingSystem getOSDefine,
  1707 				' ', '-O', m32.
  1707                                 ' ', '-O', m32.
  1708 	ParserFlags useGnuC ifTrue:[
  1708         ParserFlags useGnuC ifTrue:[
  1709 	    CCPath := 'gcc'
  1709             CCPath := 'gcc'
  1710 	] ifFalse:[
  1710         ] ifFalse:[
  1711 	    CCPath := 'cc'
  1711             CCPath := 'cc'
  1712 	].
  1712         ].
  1713 	LinkArgs := m32.
  1713         LinkArgs := m32.
  1714 	LinkSharedArgs := '-shared', m32.
  1714         LinkSharedArgs := '-shared', m32.
  1715 	LinkCommand := CCPath.
  1715         LinkCommand := CCPath.
  1716 	LibPath := ''.
  1716         LibPath := ''.
  1717 	SearchedLibraries := #().
  1717         SearchedLibraries := #().
  1718 	MakeCommand := 'make'.
  1718         MakeCommand := 'make'.
  1719     ].
  1719     ].
  1720 
  1720 
  1721     "
  1721     "
  1722      ParserFlags initializeSTCFlagsForTopDirectory:'../..'
  1722      ParserFlags initializeSTCFlagsForTopDirectory:'../..'
  1723     "
  1723     "
  2641 ! !
  2641 ! !
  2642 
  2642 
  2643 !ParserFlags class methodsFor:'documentation'!
  2643 !ParserFlags class methodsFor:'documentation'!
  2644 
  2644 
  2645 version
  2645 version
  2646     ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.117 2014-06-02 13:52:08 cg Exp $'
  2646     ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.118 2014-07-11 00:24:30 cg Exp $'
  2647 !
  2647 !
  2648 
  2648 
  2649 version_CVS
  2649 version_CVS
  2650     ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.117 2014-06-02 13:52:08 cg Exp $'
  2650     ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.118 2014-07-11 00:24:30 cg Exp $'
  2651 ! !
  2651 ! !
  2652 
  2652 
  2653 
  2653 
  2654 ParserFlags initialize!
  2654 ParserFlags initialize!