Commit 0a26c701 authored by John van Groningen's avatar John van Groningen

add generate symbol table option

parent c9c169ba
......@@ -329,6 +329,7 @@ where
*/
:+: CheckControl
[ ("Generate Relocations" ,Nothing,toMark lo.generate_relocations,noPS (\ls -> {ls & lo = {ls.lo & generate_relocations = not ls.lo.generate_relocations}}))
, ("Generate Symbol Table" ,Nothing,toMark lo.generate_symbol_table,noPS (\ls -> {ls & lo = {ls.lo & generate_symbol_table = not ls.lo.generate_symbol_table}}))
, ("Generate Link Map" ,Nothing,toMark lo.generate_link_map,noPS (\ls -> {ls & lo = {ls.lo & generate_link_map = not ls.lo.generate_link_map}}))
: PlatformDependant
// winOnly
......
definition module linkargs
import StdString, StdFile, StdMaybe
from UtilStrictLists import :: List
from StdFile import :: Files
from StdMaybe import :: Maybe
from UtilStrictLists import ::List
:: LPathname :== String
......@@ -11,6 +12,7 @@ from UtilStrictLists import :: List
, open_console :: !Bool
, static_link :: !Bool
, gen_relocs :: !Bool
, gen_symbol_table :: !Bool
, gen_linkmap :: !Bool
, link_resources:: !Bool
, object_paths :: !List LPathname
......
......@@ -12,6 +12,7 @@ import UtilOptions, UtilStrictLists
, open_console :: !Bool
, static_link :: !Bool
, gen_relocs :: !Bool
, gen_symbol_table :: !Bool
, gen_linkmap :: !Bool
, link_resources:: !Bool
, object_paths :: !List LPathname
......@@ -31,6 +32,7 @@ emptyLinkInfo` =
, open_console = True
, static_link = True
, gen_relocs = False
, gen_symbol_table = False
, gen_linkmap = False
, link_resources= False
, object_paths = Nil
......@@ -86,20 +88,27 @@ RLO options
# prefs = GetOptions LinkOptionsTable options emptyLinkInfo`
= prefs
bool_to_1_or_0_string True = "1";
bool_to_1_or_0_string False = "0";
is_1_string "1" = True;
is_1_string _ = False;
LinkOptionsTable :: OptionsTable LinkInfo`
LinkOptionsTable =
{ SimpleOption "ExePath" (\a->a.exe_path) (\v a->{a & exe_path=v})
, SimpleOption "ResPath" (\a->a.res_path) (\v a->{a & res_path=v})
, SimpleOption "OpenConsole" (\a->if a.open_console "1" "0") (\v a->{a & open_console=(if (v=="1") True False)})
, SimpleOption "StaticLink" (\a->if a.static_link "1" "0") (\v a->{a & static_link=(if (v=="1") True False)})
, SimpleOption "GenRelocations" (\a->if a.gen_relocs "1" "0") (\v a->{a & gen_relocs=(if (v=="1") True False)})
, SimpleOption "GenLinkMap" (\a->if a.gen_linkmap "1" "0") (\v a->{a & gen_linkmap=(if (v=="1") True False)})
, SimpleOption "LinkResources" (\a->if a.link_resources "1" "0") (\v a->{a & link_resources=(if (v=="1") True False)})
, ListOption "ObjectPaths" (PathOption) "" (\a->a.object_paths) (\v a->{a & object_paths=v})
, ListOption "DynamicLibs" (PathOption) "" (\a->a.dynamic_libs) (\v a->{a & dynamic_libs=v})
, ListOption "StaticLibs" (PathOption) "" (\a->a.static_libs) (\v a->{a & static_libs=v})
, SimpleOption "OpenConsole" (\a->bool_to_1_or_0_string a.open_console) (\v a->{a & open_console=is_1_string v})
, SimpleOption "StaticLink" (\a->bool_to_1_or_0_string a.static_link) (\v a->{a & static_link=is_1_string v})
, SimpleOption "GenRelocations" (\a->bool_to_1_or_0_string a.gen_relocs) (\v a->{a & gen_relocs=is_1_string v})
, SimpleOption "GenSymbolTable" (\a->bool_to_1_or_0_string a.gen_symbol_table) (\v a->{a & gen_symbol_table=is_1_string v})
, SimpleOption "GenLinkMap" (\a->bool_to_1_or_0_string a.gen_linkmap) (\v a->{a & gen_linkmap=is_1_string v})
, SimpleOption "LinkResources" (\a->bool_to_1_or_0_string a.link_resources) (\v a->{a & link_resources=is_1_string v})
, ListOption "ObjectPaths" PathOption "" (\a->a.object_paths) (\v a->{a & object_paths=v})
, ListOption "DynamicLibs" PathOption "" (\a->a.dynamic_libs) (\v a->{a & dynamic_libs=v})
, ListOption "StaticLibs" PathOption "" (\a->a.static_libs) (\v a->{a & static_libs=v})
, SimpleOption "StackSize" (\a->a.stack_size) (\v a->{a & stack_size=v})
, SimpleOption "GenDLL" (\a->if a.gen_dll "1" "0") (\v a->{a & gen_dll=(if (v=="1") True False)})
, SimpleOption "GenDLL" (\a->bool_to_1_or_0_string a.gen_dll) (\v a->{a & gen_dll=is_1_string v})
, SimpleOption "DLLSymbols" (\a->a.dll_names) (\v a->{a & dll_names=v})
, SimpleOption "DynamicLinker" (\a->a.dynamics_path) (\v a->{a & dynamics_path=v})
, SimpleOption "LibNameObjPath" (\a->a.lib_name_obj_path) (\v a->{a & lib_name_obj_path=v})
......
......@@ -926,6 +926,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
optionspath lfiles ofiles sfiles
(lo.method == LM_Static)
lo.generate_relocations
lo.generate_symbol_table
lo.generate_link_map
lo.link_resources
(fulPath app_path prj_path` lo.resource_source)
......
......@@ -307,6 +307,7 @@ LinkOptionsTable =
, ListOption "ExtraLibraries" PathName "" (\a->a.libraries) (\v a->{a & libraries=v})
, SimpleOption "LinkMethod" (\a->a.method) (\v a->{a & method = v})
, SimpleOption "GenerateRelocations" (\a->a.generate_relocations) (\v a->{a & generate_relocations = v})
, SimpleOption "GenerateSymbolTable" (\a->a.generate_symbol_table) (\v a->{a & generate_symbol_table = v})
, SimpleOption "GenerateLinkMap" (\a->a.generate_link_map) (\v a->{a & generate_link_map = v})
, SimpleOption "LinkResources" (\a->a.link_resources) (\v a->{a & link_resources = v})
, SimpleOption "ResourceSource" (\a->a.resource_source) (\v a->{a & resource_source = v})
......
......@@ -304,6 +304,7 @@ eqLinkOpts :: !LinkOptions !LinkOptions -> Bool
eqLinkOpts lo1 lo2 =
lo1.method == lo2.method &&
lo1.generate_relocations == lo2.generate_relocations &&
lo1.generate_symbol_table == lo2.generate_symbol_table &&
lo1.generate_link_map == lo2.generate_link_map &&
lo1.link_resources == lo2.link_resources &&
(if lo1.link_resources (lo1.resource_source == lo2.resource_source) True) &&
......
......@@ -29,6 +29,7 @@ instance fromString Processor
, libraries :: !List {#Char}
, method :: !LinkMethod
, generate_relocations :: !Bool // Win only option?
, generate_symbol_table :: !Bool
, generate_link_map :: !Bool
, link_resources :: !Bool
, resource_source :: !String
......
......@@ -130,6 +130,7 @@ where
, libraries :: !List {#Char}
, method :: !LinkMethod
, generate_relocations :: !Bool // Win only option
, generate_symbol_table :: !Bool
, generate_link_map :: !Bool
, link_resources :: !Bool
, resource_source :: !String
......@@ -160,6 +161,7 @@ DefaultLinkOptions =
, libraries = Nil
, method = LM_Static
, generate_relocations = False
, generate_symbol_table = False
, generate_link_map = False
, link_resources = False
, resource_source = ""
......
......@@ -104,6 +104,7 @@ Link :: // Links the given file:
!(List Pathname) // static library file names
!Bool // link statically?
!Bool // generate relocations?
!Bool // generate symbol table?
!Bool // generate link map?
!Bool // link in resources?
!String // source of resources to link in
......
......@@ -680,12 +680,12 @@ where
*/
Link :: !String !(WindowFun *GeneralSt) !Pathname !ApplicationOptions
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Bool !Bool !Bool !String
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Bool !Bool !Bool !Bool !String
!Bool !String !Pathname !String !Processor !Bool !*GeneralSt
-> (!*GeneralSt,!Bool)
Link linker` winfun path
applicationOptions=:{ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names static_libraries static gen_relocs gen_linkmap
optionspathname library_file_names object_file_names static_libraries static gen_relocs gen_symbol_table gen_linkmap
link_resources resource_path gen_dll dll_syms startupdir dynlstr _ use_64_bit_processor ps
# (ok,linker,linkerdir) = mangleLinker linker` startupdir
| not ok
......@@ -711,6 +711,7 @@ Link linker` winfun path
, open_console = o <> NoConsole
, static_link = static
, gen_relocs = gen_relocs
, gen_symbol_table = gen_symbol_table
, gen_linkmap = gen_linkmap
, link_resources = link_resources
, object_paths = optionspathname :! (RemoveDup object_file_names)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment