diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-04 22:18:12 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-04 22:18:12 +0900 |
| commit | 14fe510494c22526b7dd90d87067b2f0a53135cf (patch) | |
| tree | b19a49a6cf8e7351c149b855cfac08fd6366d410 | |
| parent | 571f0d4aca83c0fd72e5d1d85881112100442d19 (diff) | |
| parent | 4d31c036d349bf9053a991caa0037b961b78b490 (diff) | |
| download | mruby-14fe510494c22526b7dd90d87067b2f0a53135cf.tar.gz mruby-14fe510494c22526b7dd90d87067b2f0a53135cf.zip | |
Merge pull request #2187 from take-cheeze/header_searcher_doc
Add document of header searcher of compiler.
| -rw-r--r-- | doc/compile/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/compile/README.md b/doc/compile/README.md index 70fe88311..8928a0086 100644 --- a/doc/compile/README.md +++ b/doc/compile/README.md @@ -110,6 +110,34 @@ Configuration of the C compiler binary, flags and include paths. cc.compile_options = ... end +C Compiler has header searcher to detect installed library. + +If you need a include path of header file use ```search_header_path```: + + # Searches ```iconv.h```. + # If found it will return include path of the header file. + # Otherwise it will return nil . + fail 'iconv.h not found' unless conf.cc.search_header_path 'iconv.h' + +If you need a full file name of header file use ```search_header```: + + # Searches ```iconv.h```. + # If found it will return full path of the header file. + # Otherwise it will return nil . + iconv_h = conf.cc.search_header 'iconv.h' + print "iconv.h found: #{iconv_h}\n" + +Header searcher uses compiler's ```include_paths``` by default. +When you are using GCC toolchain (including clang toolchain since its base is gcc toolchain) +it will use compiler specific include paths too. (For example ```/usr/local/include```, ```/usr/include```) + +If you need a special header search paths define a singleton method ```header_search_paths``` to C compiler: + + def conf.cc.header_search_paths + ['/opt/local/include'] + include_paths + end + + ### Linker Configuration of the Linker binary, flags and library paths. |
