File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Bug fixes:
10
10
* Fixed a race condition when using the interpolate-once (` /o ` ) modifier in
11
11
regular expressions.
12
12
* Calling ` StringIO#close ` multiple times no longer raises an exception (#1640 ).
13
+ * Fixed a bug in include file resolution when compiling C extensions.
13
14
14
15
New features:
15
16
Original file line number Diff line number Diff line change 113
113
expanded . merge! ( common )
114
114
mkconfig . merge! ( common )
115
115
116
- mkconfig [ 'COMPILE_C' ] = "ruby #{ cext_dir } /preprocess.rb $< | $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) -xc - -o $@ && #{ opt } #{ opt_passes } $@ -o $@"
117
- mkconfig [ 'COMPILE_CXX' ] = "ruby #{ cext_dir } /preprocess.rb $< | $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) -xc++ - -o $@ && #{ opt } #{ opt_passes } $@ -o $@"
116
+ # We use -I$(<D) (the directory portion of the prerequisite - i.e. the
117
+ # C or C++ file) to add the file's path as the first entry on the
118
+ # include path. This is to ensure that files from the source file's
119
+ # directory are include in preference to others on the include path,
120
+ # and is required because we are actually piping the file into the
121
+ # compiler which disables this standard behaviour of the C preprocessor.
122
+ mkconfig [ 'COMPILE_C' ] = "ruby #{ cext_dir } /preprocess.rb $< | $(CC) -I$(<D) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) -xc - -o $@ && #{ opt } #{ opt_passes } $@ -o $@"
123
+ mkconfig [ 'COMPILE_CXX' ] = "ruby #{ cext_dir } /preprocess.rb $< | $(CXX) -I$(<D) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) -xc++ - -o $@ && #{ opt } #{ opt_passes } $@ -o $@"
118
124
119
125
# From mkmf.rb: "$(CC) #{OUTFLAG}#{CONFTEST}#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
120
126
mkconfig [ 'TRY_LINK' ] = "#{ cc } -o conftest $(INCFLAGS) $(CPPFLAGS) #{ base_cflags } #{ link_o_files } $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
You can’t perform that action at this time.
0 commit comments