@@ -61,7 +61,8 @@ let run_cilly (path: string) ~all_cppflags =
6161 remove_comb_files path;
6262 (* Combine source files with make using cilly as compiler *)
6363 let gcc_path = GobConfig. get_string " exp.gcc_path" in
64- let (exit_code, output) = exec_command ~path (" make CC=\" cilly --gcc=" ^ gcc_path ^ " --merge --keepmerged\" CFLAGS+=" ^ String. join " " (List. map Filename. quote all_cppflags) ^ " " ^
64+ let cflags = if List. length all_cppflags > 0 then " CFLAGS+=" ^ Filename. quote (String. join " " all_cppflags) else " " in
65+ let (exit_code, output) = exec_command ~path (" make CC=\" cilly --gcc=" ^ gcc_path ^ " --merge --keepmerged\" " ^ cflags ^ " " ^
6566 " LD=\" cilly --gcc=" ^ gcc_path ^ " --merge --keepmerged\" " ) in
6667 print_string output;
6768 (* fail if make failed *)
@@ -80,9 +81,9 @@ let generate_and_combine makefile ~all_cppflags =
8081 let generate_makefile_with (name , command , file ) = if Sys. file_exists file then (
8182 print_endline (" Trying to run " ^ name ^ " to generate Makefile" );
8283 let exit_code, output = exec_command ~path command in
83- print_endline (command ^ GobUnix. string_of_process_status exit_code ^ " . Output: " ^ output);
84+ print_endline (command ^ " " ^ GobUnix. string_of_process_status exit_code ^ " . Output: " ^ output);
8485 if not (Sys. file_exists makefile) then raise MakefileNotGenerated
85- ); raise MakefileNotGenerated in
86+ ) else raise MakefileNotGenerated in
8687 try generate_makefile_with configure
8788 with MakefileNotGenerated ->
8889 try generate_makefile_with autogen
0 commit comments