PmTypes.dcl 4.7 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1 2
definition module PmTypes

3
// The types for the Project Manager
Diederik van Arkel's avatar
Diederik van Arkel committed
4

5 6 7 8 9
from	StdPathname			import :: Pathname
from	UtilNewlinesFile	import :: NewlineConvention(..)
import	PmCompilerOptions
from	UtilStrictLists		import :: List
import	UtilDate
Diederik van Arkel's avatar
Diederik van Arkel committed
10 11 12

::	Modulename			:== String

13 14
:: ModuleDirAndName = {mdn_dir :: !{#Char}, mdn_name :: !{#Char}}

Diederik van Arkel's avatar
Diederik van Arkel committed
15
::	Processor //= CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881
16 17
DefaultProcessor :: Processor
PlatformProcessors :: [Processor]
Diederik van Arkel's avatar
Diederik van Arkel committed
18

Diederik van Arkel's avatar
Diederik van Arkel committed
19
ProcessorSuffix :: !Processor -> String
Diederik van Arkel's avatar
Diederik van Arkel committed
20 21 22 23 24 25 26 27 28 29 30 31
instance == Processor
instance toString Processor
instance fromString Processor

:: LinkObjFileName	:== String
:: LinkLibraryName	:== String

::	LinkOptions =
	{ extraObjectModules	:: !List {#Char}
	, libraries				:: !List {#Char}
	, method				:: !LinkMethod
	, generate_relocations	:: !Bool			// Win only option?
32
	, generate_symbol_table	:: !Bool
Diederik van Arkel's avatar
Diederik van Arkel committed
33 34 35 36 37 38
	, generate_link_map		:: !Bool
	, link_resources		:: !Bool
	, resource_source		:: !String

	, generate_dll			:: !Bool
	, dll_export_list_name	:: !String
Diederik van Arkel's avatar
Diederik van Arkel committed
39
	
Diederik van Arkel's avatar
Diederik van Arkel committed
40
//	, add_carb_resource		:: !Bool			// Mac-only!
41 42

	, strip_bytecode		:: !Bool			// strip ABC bytecode
Diederik van Arkel's avatar
Diederik van Arkel committed
43 44 45 46
	}

DefaultLinkOptions		:: LinkOptions

47
:: LinkMethod				// => is really project method/type now?
Diederik van Arkel's avatar
Diederik van Arkel committed
48
	= LM_Static
Diederik van Arkel's avatar
Diederik van Arkel committed
49
//	| LM_Eager
Diederik van Arkel's avatar
Diederik van Arkel committed
50
	| LM_Dynamic
Diederik van Arkel's avatar
Diederik van Arkel committed
51 52
	| LM_StaticLibrary		// produce static library
	| LM_DynamicLibrary		// produce shared library
Diederik van Arkel's avatar
Diederik van Arkel committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66

instance toString LinkMethod
instance fromString LinkMethod
instance == LinkMethod

//	Window position and size

::	WindowPos_and_Size	=
	{ posx	:: !Int
	, posy	:: !Int
	, sizex	:: !Int
	, sizey	:: !Int
	}

67 68 69 70
:: OptionalWindowPosAndSize = NoWindowPosAndSize | WindowPosAndSize !WindowPos_and_Size;

//instance == WindowPos_and_Size
instance == OptionalWindowPosAndSize
Diederik van Arkel's avatar
Diederik van Arkel committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93

DefWindowPos_and_Size	:: WindowPos_and_Size

::	EditOptions	=
	{ newlines	:: !NewlineConvention	// newline convention
/*	
	{ tabs		:: !Int					// tab size
	, fontname	:: !String				// !FontName
	, fontsize	:: !Int					// !FontSize
	, autoi		:: !Bool				// auto-indent
	, newlines	:: !NewlineConvention	// newline convention
	, showtabs	:: !Bool
	, showlins	:: !Bool
	, showsync	:: !Bool
*/
	}

instance == EditOptions

//	The Edit Window parameters: edit options and window position and size

::	EditWdOptions	=
	{ eo			:: !EditOptions
94
	, pos_size		:: !OptionalWindowPosAndSize 
Diederik van Arkel's avatar
Diederik van Arkel committed
95 96 97 98 99
	}

//	The Code Generator Options: default settings for the code generator

::	CodeGenOptions	=
Camil Staps's avatar
Camil Staps committed
100 101 102 103 104 105
	{ cs				:: !Bool		// generate stack checks
	, ci				:: !Bool		// generate index checks
//	, kaf				:: !Bool		// keep abc-files
//	, tp				:: !Processor
	, optimise_abc		:: !Bool		// optimise ABC
	, generate_bytecode	:: !Bool		// generate ABC bytecode
Diederik van Arkel's avatar
Diederik van Arkel committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
	}

instance == CodeGenOptions

DefCodeGenOptions		:: CodeGenOptions

//	The Application Options: default settings for the application.

::	ApplicationOptions	=
	{ hs								:: !Int			// heap size
	, ss								:: !Int			// stack size
	, em								:: !Int			// extra memory
	, heap_size_multiple				:: !Int
	, initial_heap_size					:: !Int
	, set								:: !Bool		// show execution time
	, sgc								:: !Bool		// show garbage collections
	, pss								:: !Bool		// print stack size
	, marking_collection				:: !Bool		// use marking garbage collector
124
	, disable_rts_flags					:: !Bool		// disable checking command line arguments for RTS flags
Diederik van Arkel's avatar
Diederik van Arkel committed
125 126

	, o									:: !Output		// console type
Diederik van Arkel's avatar
Diederik van Arkel committed
127 128
	, fn								:: !String		// font name: only on Mac platform
	, fs								:: !Int			// font size: only on Mac platform
Diederik van Arkel's avatar
Diederik van Arkel committed
129 130 131 132 133 134
	, write_stderr_to_file				:: !Bool

	, memoryProfiling					:: !Bool
	, memoryProfilingMinimumHeapSize	:: !Int
	, profiling							:: !Bool		// time profiling
	, stack_traces						:: !Bool		// stack traces
135
	, dynamics							:: !Bool
136
	, generic_fusion					:: !Bool
137
	, desc_exl							:: !Bool
Diederik van Arkel's avatar
Diederik van Arkel committed
138 139 140 141 142 143 144 145
	, standard_rte						:: !Bool		// DvA: use standard RTE (only in IDE)
	}

DefApplicationOptions	:: ApplicationOptions

::	Output
	= BasicValuesOnly
	| ShowConstructors
146
	| NoReturnType
Diederik van Arkel's avatar
Diederik van Arkel committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160
	| NoConsole

instance == Output
instance toString Output
instance fromString Output

:: ModInfoAndName =
	{ info	:: ModInfo
	, name	:: {#Char}
	}

::	ModInfo =
	{ dir				:: !String				// !Pathname
	, compilerOptions	:: !CompilerOptions
161
	, mod_edit_options	:: !ModEditOptions
Diederik van Arkel's avatar
Diederik van Arkel committed
162 163 164
	, abcLinkInfo		:: !ABCLinkInfo			// found dependant libs and objs
	}

165 166 167 168 169 170 171
::	ModEditOptions = {
		defeo 		:: !EditWdOptions,		// definition module edit options
		impeo		:: !EditWdOptions,		// implementation module edit options
		defopen 	:: !Bool,				// definition module is open
		impopen 	:: !Bool				// implementation module is open
	}

Diederik van Arkel's avatar
Diederik van Arkel committed
172 173 174 175 176 177 178 179 180 181 182 183 184
:: ABCLinkInfo =
	{ linkObjFileNames :: !List LinkObjFileName
	, linkLibraryNames :: !List LinkLibraryName
	}

:: StaticLibInfo =
	{ sLibs :: !List Pathname
	, sDcls :: !List Modulename
	, sDeps :: !List Modulename
	}

isProjLibraryModule :: !.String !StaticLibInfo -> Bool