diff --git a/brix11/lib/brix11/brix/common/cmds/configure/ace_config.rb b/brix11/lib/brix11/brix/common/cmds/configure/ace_config.rb index ea78971..0fa9b1b 100644 --- a/brix11/lib/brix11/brix/common/cmds/configure/ace_config.rb +++ b/brix11/lib/brix11/brix/common/cmds/configure/ace_config.rb @@ -17,6 +17,8 @@ module ACE_Config DEFAULT_FEATURES = File.join('bin', 'MakeProjectCreator', 'config', 'default.features') + OPENDDSCONFIG_H = File.join('dds', 'OpenDDSConfig.h') + def self.config_include(opts) opts[:platform][:config_include] || "config-#{opts[:platform][:os]}.h" end @@ -89,6 +91,18 @@ def self.create_config(cfg) platform_macros_io.close unless cfg.dryrun? end end + if cfg.features.has_key?(:opendds) && cfg.features[:opendds].state + # generate OpenDDS dds/OpenDDSConfig.h OpenDDS enabled + opendds_folder = Exec.get_run_environment('DDS_ROOT') + openddsconfig_h = File.join(opendds_folder, OPENDDSCONFIG_H) + BRIX11.show_msg("Creating #{openddsconfig_h}") + begin + openddsconfig_h_io.puts("#----- #{OPENDDSCONFIG_H} -----") if cfg.dryrun? + openddsconfig_h_io = cfg.dryrun? ? STDOUT : File.new(openddsconfig_h, 'w') + ensure + openddsconfig_h_io.close unless cfg.dryrun? + end + end BRIX11.show_msg("Creating #{default_features}") begin default_features_io = cfg.dryrun? ? STDOUT : File.new(default_features, 'w') diff --git a/brix11/lib/brix11/brix/common/cmds/configure/configurator.rb b/brix11/lib/brix11/brix/common/cmds/configure/configurator.rb index d9eef41..c33e29f 100644 --- a/brix11/lib/brix11/brix/common/cmds/configure/configurator.rb +++ b/brix11/lib/brix11/brix/common/cmds/configure/configurator.rb @@ -430,9 +430,9 @@ def get_test_config_from(features_cfg_file) end def self.print_config(workspace) - # printing the configuration requires an existing ACE_ROOT and config files + # printing the configuration as available on disk + _test_configs = nil if Exec.get_run_environment('ACE_ROOT') && File.exist?(File.join(Exec.get_run_environment('ACE_ROOT'), 'ace', 'config.h')) - _test_configs = nil _ace_root = Exec.get_run_environment('ACE_ROOT') print_file(File.join(_ace_root, 'ace', 'config.h'), 'config.h') _cfg_file = File.join(_ace_root, 'include', 'makeinclude', 'platform_macros.GNU') @@ -442,22 +442,26 @@ def self.print_config(workspace) print_file(_cfg_file, 'default.features') _test_configs = get_test_config_from(_cfg_file) end - if Exec.get_run_environment('TAOX11_ROOT') - _cfg_file = File.join(Exec.get_run_environment('TAOX11_ROOT'), 'bin', 'MPC', 'config', 'MPC.cfg') - print_file(_cfg_file, 'MPC.cfg') if File.exist?(_cfg_file) - end - _cfg_file = File.join(Configurator::ROOT, '.ridlrc') - print_file(_cfg_file, '.ridlrc') if File.exist?(_cfg_file) - _cfg_file = File.join(Configurator::ROOT, '.brix11rc') - print_file(_cfg_file, '.brix11rc') if File.exist?(_cfg_file) - _cfg_file = File.join(Configurator::ROOT, (workspace || 'workspace') + '.mwc') - print_file(_cfg_file, (workspace || 'workspace') + '.mwc') if File.exist?(_cfg_file) - STDOUT.puts('=' * 60) - STDOUT.puts("Test config: #{_test_configs.join(' ')}") if _test_configs - STDOUT.puts else - BRIX11.log_fatal("Cannot find an existing configuration.") - end + BRIX11.log_error("ACE_ROOT has not been defined.") + end + if Exec.get_run_environment('TAOX11_ROOT') + _cfg_file = File.join(Exec.get_run_environment('TAOX11_ROOT'), 'bin', 'MPC', 'config', 'MPC.cfg') + print_file(_cfg_file, 'MPC.cfg') if File.exist?(_cfg_file) + end + if Exec.get_run_environment('DDS_ROOT') + _cfg_file = File.join(Exec.get_run_environment('DDS_ROOT'), 'dds', 'OpenDDSConfig.h') + print_file(_cfg_file, 'OpenDDSConfig.h') if File.exist?(_cfg_file) + end + _cfg_file = File.join(Configurator::ROOT, '.ridlrc') + print_file(_cfg_file, '.ridlrc') if File.exist?(_cfg_file) + _cfg_file = File.join(Configurator::ROOT, '.brix11rc') + print_file(_cfg_file, '.brix11rc') if File.exist?(_cfg_file) + _cfg_file = File.join(Configurator::ROOT, (workspace || 'workspace') + '.mwc') + print_file(_cfg_file, (workspace || 'workspace') + '.mwc') if File.exist?(_cfg_file) + STDOUT.puts('=' * 60) + STDOUT.puts("Test config: #{_test_configs.join(' ')}") if _test_configs + STDOUT.puts end def self.get_test_config diff --git a/brix11/lib/brix11/brix/common/cmds/configure/hostsetup.rb b/brix11/lib/brix11/brix/common/cmds/configure/hostsetup.rb index 127fe32..148c685 100644 --- a/brix11/lib/brix11/brix/common/cmds/configure/hostsetup.rb +++ b/brix11/lib/brix11/brix/common/cmds/configure/hostsetup.rb @@ -58,6 +58,7 @@ module HostSetup 'ace/config.h', 'bin/MakeProjectCreator/config/default.features', 'include/makeinclude/platform_macros.GNU', + 'dds/OpenDDSConfig.h', /.*\.so.*/, ] @@ -104,6 +105,8 @@ def create_build_config(x11_host_root, cfg) ace_config = File.join(x11_host_root, 'ACE', ACE_Config::CONFIG_H) platform_macros = File.join(x11_host_root, 'ACE', ACE_Config::PLATFORM_MACROS) default_features = File.join(x11_host_root, 'ACE', ACE_Config::DEFAULT_FEATURES) + openddsconfig_h = File.join(x11_host_root, 'DDS', ACE_Config::OPENDDSCONFIG_H) + begin config_h_io = cfg.dryrun? ? STDOUT : File.new(ace_config, 'w') config_h_io.puts("//----- HOST #{ACE_Config::CONFIG_H} -----") if cfg.dryrun? @@ -143,6 +146,16 @@ def create_build_config(x11_host_root, cfg) ensure default_features_io.close unless cfg.dryrun? end + + if cfg.features.has_key?(:opendds) && cfg.features[:opendds].state + # generate OpenDDS dds/OpenDDSConfig.h OpenDDS enabled + begin + openddsconfig_h_io = cfg.dryrun? ? STDOUT : File.new(openddsconfig_h, 'w') + openddsconfig_h_io.puts("#----- HOST #{ACE_Config::OPENDDSCONFIG_H} -----") if cfg.dryrun? + ensure + openddsconfig_h_io.close unless cfg.dryrun? + end + end end def create_mwc_config(x11_host_root, cfg)