Regenerate charmonizer.c
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/47d829ec Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/47d829ec Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/47d829ec Branch: refs/heads/c-bindings-wip3 Commit: 47d829ec6ca21b31676657178c56a0a96c714109 Parents: 49dbbec Author: Nick Wellnhofer <[email protected]> Authored: Sat Mar 2 17:52:15 2013 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Sat Mar 9 17:52:04 2013 +0100 ---------------------------------------------------------------------- clownfish/compiler/common/charmonizer.c | 3 + clownfish/runtime/common/charmonizer.c | 66 +++++++++++++++++++++++ common/charmonizer.c | 73 +++++++++++++++++++++++++- 3 files changed, 141 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/47d829ec/clownfish/compiler/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/clownfish/compiler/common/charmonizer.c b/clownfish/compiler/common/charmonizer.c index 9a70eda..e9bec80 100644 --- a/clownfish/compiler/common/charmonizer.c +++ b/clownfish/compiler/common/charmonizer.c @@ -439,6 +439,7 @@ chaz_MakeFile_add_dir_to_cleanup(chaz_MakeFile *makefile, const char *dir); * @param makefile The makefile. * @param exe The name of the executable. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, @@ -450,6 +451,7 @@ chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, * @param makefile The makefile. * @param shared_obj The name of the shared object. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_shared_obj(chaz_MakeFile *makefile, const char *shared_obj, @@ -4108,6 +4110,7 @@ chaz_Headers_probe_posix(void) { "fcntl.h", "grp.h", "pwd.h", + "regex.h", "sys/stat.h", "sys/times.h", "sys/types.h", http://git-wip-us.apache.org/repos/asf/lucy/blob/47d829ec/clownfish/runtime/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c index d24a526..0b7524c 100644 --- a/clownfish/runtime/common/charmonizer.c +++ b/clownfish/runtime/common/charmonizer.c @@ -439,6 +439,7 @@ chaz_MakeFile_add_dir_to_cleanup(chaz_MakeFile *makefile, const char *dir); * @param makefile The makefile. * @param exe The name of the executable. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, @@ -450,6 +451,7 @@ chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, * @param makefile The makefile. * @param shared_obj The name of the shared object. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_shared_obj(chaz_MakeFile *makefile, const char *shared_obj, @@ -1216,6 +1218,24 @@ void chaz_Memory_run(void); /***************************************************************************/ +#line 21 "src/Charmonizer/Probe/RegularExpressions.h" +/* Charmonizer/Probe/RegularExpressions.h -- regular expressions. + */ + +#ifndef H_CHAZ_REGULAREXPRESSIONS +#define H_CHAZ_REGULAREXPRESSIONS + +/* Run the RegularExpressions module. + */ +void chaz_RegularExpressions_run(void); + +#endif /* H_CHAZ_REGULAREXPRESSIONS */ + + + + +/***************************************************************************/ + #line 21 "src/Charmonizer/Probe/Strings.h" /* Charmonizer/Probe/Strings.h */ @@ -4659,6 +4679,7 @@ chaz_Headers_probe_posix(void) { "fcntl.h", "grp.h", "pwd.h", + "regex.h", "sys/stat.h", "sys/times.h", "sys/types.h", @@ -5548,6 +5569,51 @@ chaz_Memory_probe_alloca(void) { /***************************************************************************/ +#line 17 "src/Charmonizer/Probe/RegularExpressions.c" +/* #include "Charmonizer/Core/HeaderChecker.h" */ +/* #include "Charmonizer/Core/ConfWriter.h" */ +/* #include "Charmonizer/Probe/RegularExpressions.h" */ + +void +chaz_RegularExpressions_run(void) { + int has_regex_h = chaz_HeadCheck_check_header("regex.h"); + int has_pcre_h = chaz_HeadCheck_check_header("pcre.h"); + int has_pcreposix_h = chaz_HeadCheck_check_header("pcreposix.h"); + + chaz_ConfWriter_start_module("RegularExpressions"); + + /* PCRE headers. */ + if (has_pcre_h) { + chaz_ConfWriter_add_def("HAS_PCRE_H", NULL); + } + if (has_pcreposix_h) { + chaz_ConfWriter_add_def("HAS_PCREPOSIX_H", NULL); + } + + /* Check for OS X enhanced regexes. */ + if (has_regex_h) { + const char *reg_enhanced_code = + CHAZ_QUOTE( #include <regex.h> ) + CHAZ_QUOTE( int main(int argc, char **argv) { ) + CHAZ_QUOTE( regex_t re; ) + CHAZ_QUOTE( if (regcomp(&re, "^", REG_ENHANCED)) { ) + CHAZ_QUOTE( return 1; ) + CHAZ_QUOTE( } ) + CHAZ_QUOTE( return 0; ) + CHAZ_QUOTE( } ); + + if (chaz_CC_test_compile(reg_enhanced_code)) { + chaz_ConfWriter_add_def("HAS_REG_ENHANCED", NULL); + } + } + + chaz_ConfWriter_end_module(); +} + + + +/***************************************************************************/ + #line 17 "src/Charmonizer/Probe/Strings.c" /* #include "Charmonizer/Core/Compiler.h" */ /* #include "Charmonizer/Core/ConfWriter.h" */ http://git-wip-us.apache.org/repos/asf/lucy/blob/47d829ec/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/common/charmonizer.c b/common/charmonizer.c index 491b6db..326307f 100644 --- a/common/charmonizer.c +++ b/common/charmonizer.c @@ -439,6 +439,7 @@ chaz_MakeFile_add_dir_to_cleanup(chaz_MakeFile *makefile, const char *dir); * @param makefile The makefile. * @param exe The name of the executable. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, @@ -450,6 +451,7 @@ chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe, * @param makefile The makefile. * @param shared_obj The name of the shared object. * @param objects The list of object files. + * @param extra_link_flags Additional link flags. */ chaz_MakeRule* chaz_MakeFile_add_shared_obj(chaz_MakeFile *makefile, const char *shared_obj, @@ -1216,6 +1218,24 @@ void chaz_Memory_run(void); /***************************************************************************/ +#line 21 "src/Charmonizer/Probe/RegularExpressions.h" +/* Charmonizer/Probe/RegularExpressions.h -- regular expressions. + */ + +#ifndef H_CHAZ_REGULAREXPRESSIONS +#define H_CHAZ_REGULAREXPRESSIONS + +/* Run the RegularExpressions module. + */ +void chaz_RegularExpressions_run(void); + +#endif /* H_CHAZ_REGULAREXPRESSIONS */ + + + + +/***************************************************************************/ + #line 21 "src/Charmonizer/Probe/Strings.h" /* Charmonizer/Probe/Strings.h */ @@ -4659,6 +4679,7 @@ chaz_Headers_probe_posix(void) { "fcntl.h", "grp.h", "pwd.h", + "regex.h", "sys/stat.h", "sys/times.h", "sys/types.h", @@ -5548,6 +5569,51 @@ chaz_Memory_probe_alloca(void) { /***************************************************************************/ +#line 17 "src/Charmonizer/Probe/RegularExpressions.c" +/* #include "Charmonizer/Core/HeaderChecker.h" */ +/* #include "Charmonizer/Core/ConfWriter.h" */ +/* #include "Charmonizer/Probe/RegularExpressions.h" */ + +void +chaz_RegularExpressions_run(void) { + int has_regex_h = chaz_HeadCheck_check_header("regex.h"); + int has_pcre_h = chaz_HeadCheck_check_header("pcre.h"); + int has_pcreposix_h = chaz_HeadCheck_check_header("pcreposix.h"); + + chaz_ConfWriter_start_module("RegularExpressions"); + + /* PCRE headers. */ + if (has_pcre_h) { + chaz_ConfWriter_add_def("HAS_PCRE_H", NULL); + } + if (has_pcreposix_h) { + chaz_ConfWriter_add_def("HAS_PCREPOSIX_H", NULL); + } + + /* Check for OS X enhanced regexes. */ + if (has_regex_h) { + const char *reg_enhanced_code = + CHAZ_QUOTE( #include <regex.h> ) + CHAZ_QUOTE( int main(int argc, char **argv) { ) + CHAZ_QUOTE( regex_t re; ) + CHAZ_QUOTE( if (regcomp(&re, "^", REG_ENHANCED)) { ) + CHAZ_QUOTE( return 1; ) + CHAZ_QUOTE( } ) + CHAZ_QUOTE( return 0; ) + CHAZ_QUOTE( } ); + + if (chaz_CC_test_compile(reg_enhanced_code)) { + chaz_ConfWriter_add_def("HAS_REG_ENHANCED", NULL); + } + } + + chaz_ConfWriter_end_module(); +} + + + +/***************************************************************************/ + #line 17 "src/Charmonizer/Probe/Strings.c" /* #include "Charmonizer/Core/Compiler.h" */ /* #include "Charmonizer/Core/ConfWriter.h" */ @@ -6061,8 +6127,12 @@ S_write_makefile() { chaz_MakeRule_add_prereq(rule, json_parser_c); chaz_MakeRule_add_prereq(rule, "$(AUTOGEN_DIR)"); + const char *link_flags = ""; + if (chaz_HeadCheck_check_header("pcre.h")) { + link_flags = "-lpcre"; + } chaz_MakeFile_add_shared_obj(makefile, "$(LUCY_SHOBJ)", "$(LUCY_OBJS)", - ""); + link_flags); chaz_MakeFile_add_rule(makefile, "$(TEST_LUCY_OBJS)", "$(AUTOGEN_DIR)"); @@ -6114,6 +6184,7 @@ int main(int argc, const char **argv) { chaz_Floats_run(); chaz_LargeFiles_run(); chaz_Memory_run(); + chaz_RegularExpressions_run(); chaz_SymbolVisibility_run(); chaz_UnusedVars_run(); chaz_VariadicMacros_run();
