|
132 | 132 | # compiler which disables this standard behaviour of the C preprocessor.
|
133 | 133 | begin
|
134 | 134 | with_conditional_preprocessing = proc do |command1, command2|
|
135 |
| - Truffle::CExt::Preprocessor.makefile_matcher("#{preprocess_ruby} #{cext_dir}/preprocess.rb $< | #{command1}", command2) |
| 135 | + Truffle::CExt::Preprocessor.makefile_matcher(command1, command2) |
136 | 136 | end
|
137 | 137 |
|
138 | 138 | for_file = proc do |compiler, flags, opt_command|
|
139 | 139 | "#{compiler} #{flags} $< && #{opt_command}"
|
140 | 140 | end
|
141 | 141 |
|
142 | 142 | for_pipe = proc do |compiler, flags, opt_command|
|
143 |
| - "#{compiler} -I$(<D) #{flags} - -o $@ && #{opt_command}" |
| 143 | + "#{preprocess_ruby} #{cext_dir}/preprocess.rb $< | #{compiler} -I$(<D) #{flags} - -o $@ && #{opt_command}" |
144 | 144 | end
|
145 | 145 |
|
146 | 146 | c_flags = '$(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) -xc'
|
147 | 147 | cxx_flags = '$(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) -xc++'
|
148 | 148 | opt_command = "#{opt} #{opt_passes} $@ -o $@"
|
149 | 149 |
|
150 |
| - mkconfig['TRUFFLE_RAW_COMPILE_C'] = for_file.call("$(CC)", c_flags, opt_command) |
| 150 | + mkconfig['TRUFFLE_RAW_COMPILE_C'] = for_pipe.call('$(CC)', c_flags, opt_command) |
151 | 151 | mkconfig['COMPILE_C'] = with_conditional_preprocessing.call(
|
152 | 152 | for_pipe.call('$(CC)', c_flags, opt_command),
|
153 | 153 | for_file.call('$(CC)', c_flags, opt_command))
|
|
160 | 160 | # From mkmf.rb: "$(CC) #{OUTFLAG}#{CONFTEST}#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
|
161 | 161 | mkconfig['TRY_LINK'] = "#{cc} -o conftest $(INCFLAGS) $(CPPFLAGS) #{base_cflags} #{link_o_files} $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
|
162 | 162 |
|
163 |
| -%w[COMPILE_C COMPILE_CXX TRY_LINK].each do |key| |
| 163 | +%w[COMPILE_C COMPILE_CXX TRY_LINK TRUFFLE_RAW_COMPILE_C].each do |key| |
164 | 164 | expanded[key] = mkconfig[key].gsub(/\$\((\w+)\)/) { expanded.fetch($1) { $& } }
|
165 | 165 | end
|
0 commit comments