Re-add support for old flex (2.5.4a and earlier) while still cleaning up properly in new flex.
This commit was SVN r27657.
Этот коммит содержится в:
родитель
702451111b
Коммит
3e1b13b13a
@ -56,13 +56,11 @@ my $exclude_list;
|
||||
my $ompi_automake_version = "1.11.1";
|
||||
my $ompi_autoconf_version = "2.65";
|
||||
my $ompi_libtool_version = "2.2.6b";
|
||||
my $ompi_flex_version = "2.5.4";
|
||||
|
||||
# Search paths
|
||||
my $ompi_autoconf_search = "autoconf";
|
||||
my $ompi_automake_search = "automake";
|
||||
my $ompi_libtoolize_search = "libtoolize;glibtoolize";
|
||||
my $ompi_flex_search = "flex";
|
||||
|
||||
# One-time setup
|
||||
my $username;
|
||||
@ -809,7 +807,6 @@ tools:
|
||||
GNU Autoconf: $ompi_autoconf_version
|
||||
GNU Automake: $ompi_automake_version
|
||||
GNU Libtool: $ompi_libtool_version
|
||||
Flex: $ompi_flex_version
|
||||
=================================================================\n";
|
||||
my_exit(1);
|
||||
}
|
||||
@ -1028,7 +1025,6 @@ $step. Checking tool versions\n\n";
|
||||
&find_and_check("autoconf", $ompi_autoconf_search, $ompi_autoconf_version);
|
||||
&find_and_check("libtool", $ompi_libtoolize_search, $ompi_libtool_version);
|
||||
&find_and_check("automake", $ompi_automake_search, $ompi_automake_version);
|
||||
&find_and_check("flex", $ompi_flex_search, $ompi_flex_version);
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
@ -100,7 +100,25 @@ NAME_CHAR [A-Za-z0-9_\-\.\\\/]
|
||||
|
||||
%%
|
||||
|
||||
/* Old flex (2.5.4a? and older) does not define a destroy function */
|
||||
#if !defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5)))
|
||||
int btl_openib_ini_yylex_destroy(void)
|
||||
{
|
||||
if (NULL != YY_CURRENT_BUFFER) {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
#if defined(YY_CURRENT_BUFFER_LVALUE)
|
||||
YY_CURRENT_BUFFER_LVALUE = NULL;
|
||||
#else
|
||||
YY_CURRENT_BUFFER = NULL;
|
||||
#endif /* YY_CURRENT_BUFFER_LVALUE */
|
||||
}
|
||||
return YY_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int btl_openib_ini_yywrap(void)
|
||||
{
|
||||
|
@ -95,7 +95,25 @@ NAME_CHAR [A-Za-z0-9_\-\.\\\/]
|
||||
. { return COLL_ML_CONFIG_PARSE_ERROR; }
|
||||
%%
|
||||
|
||||
/* Old flex (2.5.4a? and older) does not define a destroy function */
|
||||
#if !defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5)))
|
||||
int coll_ml_config_yylex_destroy(void)
|
||||
{
|
||||
if (NULL != YY_CURRENT_BUFFER) {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
#if defined(YY_CURRENT_BUFFER_LVALUE)
|
||||
YY_CURRENT_BUFFER_LVALUE = NULL;
|
||||
#else
|
||||
YY_CURRENT_BUFFER = NULL;
|
||||
#endif /* YY_CURRENT_BUFFER_LVALUE */
|
||||
}
|
||||
return YY_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int coll_ml_config_yywrap(void)
|
||||
{
|
||||
|
@ -81,6 +81,25 @@ CHAR [A-Za-z0-9_\-\.]
|
||||
|
||||
%%
|
||||
|
||||
/* Old flex (2.5.4a? and older) does not define a destroy function */
|
||||
#if !defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5)))
|
||||
int opal_util_keyval_yylex_destroy(void)
|
||||
{
|
||||
if (NULL != YY_CURRENT_BUFFER) {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
#if defined(YY_CURRENT_BUFFER_LVALUE)
|
||||
YY_CURRENT_BUFFER_LVALUE = NULL;
|
||||
#else
|
||||
YY_CURRENT_BUFFER = NULL;
|
||||
#endif /* YY_CURRENT_BUFFER_LVALUE */
|
||||
}
|
||||
return YY_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
int opal_util_keyval_yywrap(void)
|
||||
{
|
||||
|
@ -274,20 +274,20 @@ static int load_array(char ***array, const char *filename, const char *topic)
|
||||
if (OPAL_SUCCESS != (ret = open_file(filename, topic))) {
|
||||
return ret;
|
||||
}
|
||||
if (OPAL_SUCCESS != (ret = find_topic(filename, topic))) {
|
||||
fclose(opal_show_help_yyin);
|
||||
return ret;
|
||||
|
||||
ret = find_topic(filename, topic);
|
||||
if (OPAL_SUCCESS == ret) {
|
||||
ret = read_topic(array);
|
||||
}
|
||||
|
||||
ret = read_topic(array);
|
||||
opal_show_help_finish_parsing();
|
||||
fclose(opal_show_help_yyin);
|
||||
opal_show_help_yylex_destroy ();
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
opal_argv_free(*array);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *opal_show_help_vstring(const char *filename, const char *topic,
|
||||
|
@ -171,17 +171,6 @@ OPAL_DECLSPEC char* opal_show_help_vstring(const char *filename,
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_show_help_add_dir(const char *directory);
|
||||
|
||||
/**
|
||||
* \internal
|
||||
*
|
||||
* Internal function to help clean up the flex parser.
|
||||
*
|
||||
* This function is called internally by the SHS to shut down the
|
||||
* flex parser since we may not hit the <<EOF>> rule and call this
|
||||
* function automatically.
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_show_help_finish_parsing(void);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,7 @@
|
||||
BEGIN_C_DECLS
|
||||
int opal_show_help_yylex(void);
|
||||
int opal_show_help_init_buffer(FILE *file);
|
||||
int opal_show_help_yylex_destroy(void);
|
||||
|
||||
extern FILE *opal_show_help_yyin;
|
||||
extern bool opal_show_help_parse_done;
|
||||
|
@ -48,9 +48,6 @@ END_C_DECLS
|
||||
int opal_show_help_yynewlines = 1;
|
||||
bool opal_show_help_parse_done = false;
|
||||
|
||||
#define yyterminate() \
|
||||
return opal_show_help_finish_parsing()
|
||||
|
||||
%}
|
||||
|
||||
WHITE [\f\t\v ]
|
||||
@ -70,12 +67,13 @@ CHAR [A-Za-z0-9_\-\.]
|
||||
|
||||
%%
|
||||
|
||||
/* Old flex (2.5.4a? and older) does not define a destroy function */
|
||||
#if !defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This cleans up at the end of the parse (since, in this case, we
|
||||
* always parse the entire file) and prevents a memory leak.
|
||||
*/
|
||||
int opal_show_help_finish_parsing(void)
|
||||
#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5)))
|
||||
int opal_show_help_yylex_destroy(void)
|
||||
{
|
||||
if (NULL != YY_CURRENT_BUFFER) {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
@ -87,7 +85,7 @@ int opal_show_help_finish_parsing(void)
|
||||
}
|
||||
return YY_NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int opal_show_help_yywrap(void)
|
||||
{
|
||||
|
@ -119,6 +119,26 @@ username { orte_rmaps_rank_file_value.sval = yytext;
|
||||
|
||||
%%
|
||||
|
||||
/* Old flex (2.5.4a? and older) does not define a destroy function */
|
||||
#if !defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5)))
|
||||
int orte_rmaps_rank_file_lex_destroy (void)
|
||||
{
|
||||
if (NULL != YY_CURRENT_BUFFER) {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
#if defined(YY_CURRENT_BUFFER_LVALUE)
|
||||
YY_CURRENT_BUFFER_LVALUE = NULL;
|
||||
#else
|
||||
YY_CURRENT_BUFFER = NULL;
|
||||
#endif /* YY_CURRENT_BUFFER_LVALUE */
|
||||
}
|
||||
return YY_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
int orte_rmaps_rank_file_wrap(void)
|
||||
{
|
||||
orte_rmaps_rank_file_done = true;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user