euphoria
changeset 5264:b1e3058ac542 4.0
* add euphoria dependencies for binder in GNU Makefile
| author | Matt Lewis |
|---|---|
| date | Mon Nov 21 13:45:42 2011 -0500 (18 months ago) |
| parents | e622b812aa26 |
| children | 0e9a47ed2004 87f8e1084f0b |
| files | source/Makefile.gnu source/cominit.e source/il.e source/intinit.e source/pathopen.e source/traninit.e |
line diff
1.1 --- a/source/Makefile.gnu Thu Nov 17 08:15:58 2011 -0500 1.2 +++ b/source/Makefile.gnu Mon Nov 21 13:45:42 2011 -0500 1.3 @@ -282,7 +282,7 @@ 1.4 pathopen.e \ 1.5 common.e \ 1.6 backend.ex 1.7 - 1.8 + 1.9 PREFIXED_PCRE_OBJECTS = $(addprefix $(BUILDDIR)/pcre/,$(PCRE_OBJECTS)) 1.10 1.11 EU_BACKEND_OBJECTS = \ 1.12 @@ -801,7 +801,7 @@ 1.13 $(BUILDDIR)/$(EUDIS) : translator library $(BUILDDIR)/eudis-build/main-.c 1.14 $(MAKE) -C "$(BUILDDIR)/eudis-build" -f dis.mak 1.15 1.16 -$(BUILDDIR)/bind-build/main-.c : $(TRUNKDIR)/source/bind.ex 1.17 +$(BUILDDIR)/bind-build/main-.c : $(TRUNKDIR)/source/bind.ex $(EU_BACKEND_RUNNER_FILES) 1.18 $(BUILDDIR)/$(EECU) -build-dir "$(BUILDDIR)/bind-build" \ 1.19 -o "$(BUILDDIR)/$(EUBIND)" \ 1.20 -makefile -eudir $(TRUNKDIR) \
2.1 --- a/source/cominit.e Thu Nov 17 08:15:58 2011 -0500 2.2 +++ b/source/cominit.e Mon Nov 21 13:45:42 2011 -0500 2.3 @@ -377,7 +377,7 @@ 2.4 -- long option? 2.5 if length( arg ) = 2 then 2.6 -- explicit 'extras' delimiter 2.7 - return { 0, 0 } 2.8 + return { 0, ix - 1 } 2.9 end if 2.10 2.11 return validate_opt( LONGNAME, arg, args, ix ) 2.12 @@ -388,16 +388,16 @@ 2.13 end if 2.14 else 2.15 -- done 2.16 - return {0,0} 2.17 + return {0, ix-1} 2.18 end if 2.19 else 2.20 -- done 2.21 - return { 0, 0 } 2.22 + return { 0, ix-1 } 2.23 end if 2.24 2.25 ix += 1 2.26 end while 2.27 - return {0, 0} 2.28 + return {0, ix-1} 2.29 end function 2.30 2.31 --** 2.32 @@ -405,14 +405,13 @@ 2.33 -- their content to the supplied arguments. 2.34 2.35 export function expand_config_options(sequence args) 2.36 - integer idx = 1 2.37 + integer idx = 3 2.38 sequence next_idx 2.39 + sequence files = {} 2.40 while idx with entry do 2.41 if equal(upper(args[idx]), "-C") then 2.42 - sequence new_args = load_euphoria_config(args[idx+1]) 2.43 - args = args[1..idx-1] & new_args & args[idx + 2..$] 2.44 - -- since the -c was replaced, we continue parsing from 2.45 - -- the same index 2.46 + files = append( files, args[idx+1] ) 2.47 + args = remove( args, idx, idx + 1 ) 2.48 else 2.49 -- jump over the option and parameter, if any 2.50 idx = next_idx[2] 2.51 @@ -421,8 +420,7 @@ 2.52 next_idx = find_next_opt( idx, args ) 2.53 idx = next_idx[1] 2.54 end while 2.55 - 2.56 - return args 2.57 + return args[1..2] & merge_parameters( GetDefaultArgs( files ), args[3..next_idx[2]], options, 1 ) & args[next_idx[2]+1..$] 2.58 end function 2.59 2.60 --**
3.1 --- a/source/il.e Thu Nov 17 08:15:58 2011 -0500 3.2 +++ b/source/il.e Mon Nov 21 13:45:42 2011 -0500 3.3 @@ -67,6 +67,8 @@ 3.4 } 3.5 end ifdef 3.6 3.7 +add_options( OPTIONS ) 3.8 + 3.9 -- options for BIND 3.10 integer list, quiet, full_debug 3.11 integer del_routines, del_vars 3.12 @@ -280,15 +282,7 @@ 3.13 end procedure 3.14 3.15 function extract_options( sequence cl ) 3.16 - sequence argv = cl[1..2] 3.17 - if length(cl) > 2 then 3.18 - argv &= merge_parameters(GetDefaultArgs(), cl[3..$], OPTIONS) 3.19 - else 3.20 - argv &= GetDefaultArgs() 3.21 - end if 3.22 - 3.23 - argv = expand_config_options(argv) 3.24 - 3.25 + sequence argv = expand_config_options( cl ) 3.26 Argv = argv 3.27 Argc = length(Argv) 3.28
4.1 --- a/source/intinit.e Thu Nov 17 08:15:58 2011 -0500 4.2 +++ b/source/intinit.e Mon Nov 21 13:45:42 2011 -0500 4.3 @@ -42,16 +42,9 @@ 4.4 Argc = length(Argv) 4.5 4.6 sequence opts_array = get_options() 4.7 - sequence argv_to_parse = Argv[1..2] 4.8 - 4.9 - if length(Argv) > 2 then 4.10 - argv_to_parse &= merge_parameters(GetDefaultArgs(), Argv[3..$], opts_array) 4.11 - else 4.12 - argv_to_parse &= GetDefaultArgs() 4.13 - end if 4.14 - 4.15 + 4.16 m:map opts = cmd_parse( opts_array, 4.17 - { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg }, argv_to_parse) 4.18 + { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg }, Argv) 4.19 4.20 handle_common_options(opts) 4.21
5.1 --- a/source/pathopen.e Thu Nov 17 08:15:58 2011 -0500 5.2 +++ b/source/pathopen.e Mon Nov 21 13:45:42 2011 -0500 5.3 @@ -362,7 +362,7 @@ 5.4 return new_args 5.5 end function 5.6 5.7 -export function GetDefaultArgs() 5.8 +export function GetDefaultArgs( sequence user_files ) 5.9 object env 5.10 sequence default_args = {} 5.11 sequence conf_file = "eu.cfg" 5.12 @@ -379,8 +379,16 @@ 5.13 5.14 sequence cmd_options = get_options() 5.15 5.16 + default_args = {} 5.17 + 5.18 + -- files specified on the command line come first: 5.19 + for i = 1 to length( user_files ) do 5.20 + sequence user_config = load_euphoria_config( user_files[i] ) 5.21 + default_args = merge_parameters( user_config, default_args, cmd_options, 1 ) 5.22 + end for 5.23 + 5.24 -- From current working directory 5.25 - default_args = load_euphoria_config("./" & conf_file) 5.26 + default_args = merge_parameters( load_euphoria_config("./" & conf_file), default_args, cmd_options, 1 ) 5.27 5.28 -- From where ever the executable is 5.29 env = strip_file_from_path( exe_path() )
6.1 --- a/source/traninit.e Thu Nov 17 08:15:58 2011 -0500 6.2 +++ b/source/traninit.e Mon Nov 21 13:45:42 2011 -0500 6.3 @@ -103,18 +103,10 @@ 6.4 --** 6.5 -- Process the translator command-line options 6.6 6.7 -include std/console.e 6.8 export procedure transoptions() 6.9 sequence tranopts = get_options() 6.10 6.11 - sequence argv_to_parse = Argv[1..2] 6.12 - if length(Argv) > 2 then 6.13 - argv_to_parse &= merge_parameters(GetDefaultArgs(), Argv[3..$], tranopts) 6.14 - else 6.15 - argv_to_parse &= GetDefaultArgs() 6.16 - end if 6.17 - 6.18 - Argv = expand_config_options(argv_to_parse) 6.19 + Argv = expand_config_options( Argv ) 6.20 Argc = length(Argv) 6.21 6.22 map:map opts = cmd_parse( tranopts, , Argv) 6.23 @@ -333,15 +325,16 @@ 6.24 --** 6.25 -- Initialize special stuff for the translator 6.26 procedure InitBackEnd(integer c) 6.27 - init_opcodes() 6.28 - transoptions() 6.29 - 6.30 + 6.31 if c = 1 then 6.32 OpenCFiles() 6.33 6.34 return 6.35 end if 6.36 - 6.37 + 6.38 + init_opcodes() 6.39 + transoptions() 6.40 + 6.41 if compiler_type = COMPILER_UNKNOWN then 6.42 if TWINDOWS then 6.43 compiler_type = COMPILER_WATCOM
