diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_global.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_global.cpp | 99 |
1 files changed, 94 insertions, 5 deletions
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index d24446abc8e..370eb6e2b18 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -92,6 +92,7 @@ BE_GlobalData::BE_GlobalData (void) stub_include_dir_ (0), skel_output_dir_ (0), anyop_output_dir_ (0), + exec_output_dir_ (0), any_support_ (true), cdr_support_ (true), tc_support_ (true), @@ -139,6 +140,7 @@ BE_GlobalData::BE_GlobalData (void) gen_ciao_exec_idl_ (false), gen_ciao_exec_impl_ (false), gen_ciao_exec_reactor_impl_ (false), + overwrite_not_exec_(false), gen_ciao_conn_impl_ (false), gen_dds_typesupport_idl_ (false), gen_ciao_valuefactory_reg_ (true), @@ -182,7 +184,8 @@ be_change_idl_file_extension (UTL_String* idl_file, const char *new_extension, bool base_name_only = false, bool for_anyop = false, - bool for_skel = false) + bool for_skel = false, + bool for_exec = false) { // @@ This shouldn't happen anyway; but a better error handling // mechanism is needed. @@ -227,7 +230,7 @@ be_change_idl_file_extension (UTL_String* idl_file, // Anyop * skel file output defaults to general output dir if not set. const char *output_path = - be_util::get_output_path (for_anyop, for_skel); + be_util::get_output_path (for_anyop, for_skel, for_exec); if (!base_name_only && output_path != 0) { @@ -272,7 +275,6 @@ be_change_idl_file_extension (UTL_String* idl_file, // Append the newextension. ACE_OS::strcat (fname, new_extension); - return fname; } @@ -443,7 +445,10 @@ BE_GlobalData::be_get_ciao_exec_header (UTL_String *idl_file_name, { return be_change_idl_file_extension (idl_file_name, be_global->ciao_exec_header_ending (), - base_name_only); + base_name_only, + false, + false, + true); } const char * @@ -452,7 +457,10 @@ BE_GlobalData::be_get_ciao_exec_source (UTL_String *idl_file_name, { return be_change_idl_file_extension (idl_file_name, be_global->ciao_exec_source_ending (), - base_name_only); + base_name_only, + false, + false, + true); } const char * @@ -1498,6 +1506,17 @@ BE_GlobalData::output_dir (void) const { return this->output_dir_; } +bool +BE_GlobalData::overwrite_not_exec (void) const +{ + return this->overwrite_not_exec_; +} + +void +BE_GlobalData::overwrite_not_exec (bool val) +{ + this->overwrite_not_exec_ = val; +} void BE_GlobalData::skel_output_dir (const char* s) @@ -1539,6 +1558,18 @@ BE_GlobalData::anyop_output_dir (void) const } void +BE_GlobalData::exec_output_dir (const char* s) +{ + ACE::strdelete (this->exec_output_dir_); + this->exec_output_dir_ = ACE::strnew (s); +} + +const char* +BE_GlobalData::exec_output_dir (void) const +{ + return this->exec_output_dir_; +} +void BE_GlobalData::any_support (bool val) { this->any_support_ = val; @@ -2032,6 +2063,9 @@ BE_GlobalData::destroy (void) ACE::strdelete (this->anyop_output_dir_); this->anyop_output_dir_ = 0; + ACE::strdelete (this->exec_output_dir_); + this->exec_output_dir_ = 0; + if (0 != this->messaging_) { this->messaging_->destroy (); @@ -2924,6 +2958,61 @@ BE_GlobalData::parse_args (long &i, char **av) )); } } + else if (av[i][2] == 'E') + { + if (av[i][3] == '\0') + { + idl_global->append_idl_flag (av[i + 1]); + int result = ACE_OS::mkdir (av[i + 1]); + + #if !defined (__BORLANDC__) + if (result != 0 && errno != EEXIST) + #else + // The Borland RTL doesn't give EEXIST back, only EACCES in + // case the directory exists, reported to Borland as QC 9495 + if (result != 0 && errno != EEXIST && errno != EACCES) + #endif + { + ACE_ERROR (( + LM_ERROR, + ACE_TEXT ("IDL: unable to create directory %C") + ACE_TEXT (" specified by -oE option\n"), + av[i + 1] + )); + + break; + } + + be_global->exec_output_dir (av[i + 1]); + ++i; + } + else + { + ACE_ERROR (( + LM_ERROR, + ACE_TEXT ("IDL: I don't understand") + ACE_TEXT (" the '%C' option\n"), + av[i] + )); + } + } + else if (av[i][2] == 'N') + { + if (av[i][3] == '\0') + { + // Don't overwrite exec files. + be_global->overwrite_not_exec (true); + } + else + { + ACE_ERROR (( + LM_ERROR, + ACE_TEXT ("IDL: I don't understand") + ACE_TEXT (" the '%C' option\n"), + av[i] + )); + } + } else if (av[i][2] == 'S') { if (av[i][3] == '\0') |