require 'mxx_ru/cpp'

module	Ace
	class	Base < Mxx_ru::Cpp::Lib_or_dll_target
		TAG = "ace/prj.rb"
		def	initialize( a_alias = TAG )
			super( a_alias, TAG )

			threading_mode( Mxx_ru::Cpp::THREADING_MULTI )

			target( "ACE.5.4" )

			init_dll_block(
				Proc.new {
					rtl_mode( Mxx_ru::Cpp::RTL_SHARED )
					implib_path( "lib" )
					define( "ACE_BUILD_DLL" )
					define( "ACE_OS_BUILD_DLL" )
				})
			init_lib_block(
				Proc.new {
					target_root( "lib" )

					define( "ACE_AS_STATIC_LIBS", OPT_UPSPREAD )
				})

			setup_platform_flags()

			setup_sources()
		end

		def	setup_platform_flags()
			if toolset.tag( "target_os" ) == "mswin"
				define( "MXX_RU_ACE__PLATFORM_WIN32", OPT_UPSPREAD )
				define( "WIN32", OPT_UPSPREAD )

				if "vc" == toolset.name ||
						"bcc" == toolset.name
					define( "MXX_RU_ACE__ACE_HAS_STANDARD_CPP_LIBRARY",
							OPT_UPSPREAD )
				end

				lib( "user32.lib" )
				lib( "advapi32.lib" )

				if "bcc" == toolset.name
					lib( "ws2_32.lib" )
				end

			elsif toolset.tag( "target_os" ) == "unix"
				if toolset.tag( "unix_port" ) == "cygwin"
					define( "MXX_RU_ACE__PLATFORM_CYGWIN32", OPT_UPSPREAD )
				elsif toolset.tag( "unix_port" ) == "linux"
					define( "MXX_RU_ACE__PLATFORM_LINUX", OPT_UPSPREAD )
					lib( "pthread" )
					lib( "dl" )
					lib( "rt" )
				end 
			elsif toolset.tag( "target_os" ) == "tandem_oss"
				define( "MXX_RU_ACE__PLATFORM_TANDEM_OSS", OPT_UPSPREAD )

				compiler_option( "-Wextensions", OPT_UPSPREAD )
				compiler_option( "-D _XOPEN_SOURCE_EXTENDED=1", OPT_UPSPREAD )

				lib( "zsptsrl" )
			end
		end

		def setup_sources()
			cpp_source( "ACE.cpp" )
			cpp_source( "ACE_crc32.cpp" )
			cpp_source( "ACE_crc_ccitt.cpp" )
			cpp_source( "ARGV.cpp" )
			cpp_source( "ATM_Acceptor.cpp" )
			cpp_source( "ATM_Addr.cpp" )
			cpp_source( "ATM_Connector.cpp" )
			cpp_source( "ATM_Params.cpp" )
			cpp_source( "ATM_QoS.cpp" )
			cpp_source( "ATM_Stream.cpp" )
			cpp_source( "Activation_Queue.cpp" )
			cpp_source( "Active_Map_Manager.cpp" )
			cpp_source( "Addr.cpp" )
			cpp_source( "Arg_Shifter.cpp" )
			cpp_source( "Argv_Type_Converter.cpp" )
			cpp_source( "Asynch_IO.cpp" )
			cpp_source( "Asynch_IO_Impl.cpp" )
			cpp_source( "Asynch_Pseudo_Task.cpp" )
			cpp_source( "Atomic_Op.cpp" )
			cpp_source( "Auto_Event.cpp" )
			cpp_source( "Barrier.cpp" )
			cpp_source( "Base_Thread_Adapter.cpp" )
			cpp_source( "Based_Pointer_Repository.cpp" )
			cpp_source( "Basic_Stats.cpp" )
			cpp_source( "Basic_Types.cpp" )
			cpp_source( "CDR_Base.cpp" )
			cpp_source( "CDR_Stream.cpp" )
			cpp_source( "Capabilities.cpp" )
			cpp_source( "Cleanup.cpp" )
			cpp_source( "Codecs.cpp" )
			cpp_source( "Codeset_IBM1047.cpp" )
			cpp_source( "Codeset_Registry.cpp" )
			cpp_source( "Codeset_Registry_db.cpp" )
			cpp_source( "Condition_Recursive_Thread_Mutex.cpp" )
			cpp_source( "Condition_Thread_Mutex.cpp" )
			cpp_source( "Configuration.cpp" )
			cpp_source( "Configuration_Import_Export.cpp" )
			cpp_source( "Connection_Recycling_Strategy.cpp" )
			cpp_source( "Container_Instantiations.cpp" )
			cpp_source( "Containers.cpp" )
			cpp_source( "Copy_Disabled.cpp" )
			cpp_source( "DEV.cpp" )
			cpp_source( "DEV_Addr.cpp" )
			cpp_source( "DEV_Connector.cpp" )
			cpp_source( "DEV_IO.cpp" )
			cpp_source( "DLL.cpp" )
			cpp_source( "DLL_Manager.cpp" )
			cpp_source( "Date_Time.cpp" )
			cpp_source( "Dev_Poll_Reactor.cpp" )
			cpp_source( "Dirent.cpp" )
			cpp_source( "Dirent_Selector.cpp" )
			cpp_source( "Dump.cpp" )
			cpp_source( "Dynamic.cpp" )
			cpp_source( "Dynamic_Service_Base.cpp" )
			cpp_source( "Event.cpp" )
			cpp_source( "Event_Handler.cpp" )
			cpp_source( "FIFO.cpp" )
			cpp_source( "FIFO_Recv.cpp" )
			cpp_source( "FIFO_Recv_Msg.cpp" )
			cpp_source( "FIFO_Send.cpp" )
			cpp_source( "FIFO_Send_Msg.cpp" )
			cpp_source( "FILE.cpp" )
			cpp_source( "FILE_Addr.cpp" )
			cpp_source( "FILE_Connector.cpp" )
			cpp_source( "FILE_IO.cpp" )
			cpp_source( "File_Lock.cpp" )
			cpp_source( "Filecache.cpp" )
			cpp_source( "FlReactor.cpp" )
			cpp_source( "Flag_Manip.cpp" )
			cpp_source( "Framework_Component.cpp" )
			cpp_source( "Functor.cpp" )
			cpp_source( "Functor_String.cpp" )
			cpp_source( "Get_Opt.cpp" )
			cpp_source( "Handle_Ops.cpp" )
			cpp_source( "Handle_Set.cpp" )
			cpp_source( "Hash_Map_Manager.cpp" )
			cpp_source( "Hashable.cpp" )
			cpp_source( "High_Res_Timer.cpp" )
			cpp_source( "ICMP_Socket.cpp" )
			cpp_source( "INET_Addr.cpp" )
			cpp_source( "IOStream.cpp" )
			cpp_source( "IO_SAP.cpp" )
			cpp_source( "IPC_SAP.cpp" )
			cpp_source( "Init_ACE.cpp" )
			cpp_source( "LSOCK.cpp" )
			cpp_source( "LSOCK_Acceptor.cpp" )
			cpp_source( "LSOCK_CODgram.cpp" )
			cpp_source( "LSOCK_Connector.cpp" )
			cpp_source( "LSOCK_Dgram.cpp" )
			cpp_source( "LSOCK_Stream.cpp" )
			cpp_source( "Lib_Find.cpp" )
			cpp_source( "Local_Memory_Pool.cpp" )
			cpp_source( "Local_Name_Space.cpp" )
			cpp_source( "Local_Tokens.cpp" )
			cpp_source( "Lock.cpp" )
			cpp_source( "Log_Msg.cpp" )
			cpp_source( "Log_Msg_Backend.cpp" )
			cpp_source( "Log_Msg_Callback.cpp" )
			cpp_source( "Log_Msg_IPC.cpp" )
			cpp_source( "Log_Msg_NT_Event_Log.cpp" )
			cpp_source( "Log_Msg_UNIX_Syslog.cpp" )
			cpp_source( "Log_Record.cpp" )
			cpp_source( "Logging_Strategy.cpp" )
			cpp_source( "MEM_Acceptor.cpp" )
			cpp_source( "MEM_Addr.cpp" )
			cpp_source( "MEM_Connector.cpp" )
			cpp_source( "MEM_IO.cpp" )
			cpp_source( "MEM_SAP.cpp" )
			cpp_source( "MEM_Stream.cpp" )
			cpp_source( "MMAP_Memory_Pool.cpp" )
			cpp_source( "Malloc.cpp" )
			cpp_source( "Malloc_Allocator.cpp" )
			cpp_source( "Malloc_Instantiations.cpp" )
			cpp_source( "Manual_Event.cpp" )
			cpp_source( "Mem_Map.cpp" )
			cpp_source( "Message_Block.cpp" )
			cpp_source( "Message_Queue.cpp" )
			cpp_source( "Method_Request.cpp" )
			cpp_source( "Metrics_Cache.cpp" )
			cpp_source( "Msg_WFMO_Reactor.cpp" )
			cpp_source( "Multihomed_INET_Addr.cpp" )
			cpp_source( "Mutex.cpp" )
			cpp_source( "NT_Service.cpp" )
			cpp_source( "Name_Proxy.cpp" )
			cpp_source( "Name_Request_Reply.cpp" )
			cpp_source( "Name_Space.cpp" )
			cpp_source( "Naming_Context.cpp" )
			cpp_source( "Notification_Strategy.cpp" )
			cpp_source( "OS_Errno.cpp" )
			cpp_source( "OS_Log_Msg_Attributes.cpp" )
			cpp_source( "OS_NS_Thread.cpp" )
			cpp_source( "OS_NS_arpa_inet.cpp" )
			cpp_source( "OS_NS_ctype.cpp" )
			cpp_source( "OS_NS_dirent.cpp" )
			cpp_source( "OS_NS_dlfcn.cpp" )
			cpp_source( "OS_NS_errno.cpp" )
			cpp_source( "OS_NS_fcntl.cpp" )
			cpp_source( "OS_NS_math.cpp" )
			cpp_source( "OS_NS_netdb.cpp" )
			cpp_source( "OS_NS_poll.cpp" )
			cpp_source( "OS_NS_pwd.cpp" )
			cpp_source( "OS_NS_regex.cpp" )
			cpp_source( "OS_NS_signal.cpp" )
			cpp_source( "OS_NS_stdio.cpp" )
			cpp_source( "OS_NS_stdlib.cpp" )
			cpp_source( "OS_NS_string.cpp" )
			cpp_source( "OS_NS_strings.cpp" )
			cpp_source( "OS_NS_stropts.cpp" )
			cpp_source( "OS_NS_sys_mman.cpp" )
			cpp_source( "OS_NS_sys_msg.cpp" )
			cpp_source( "OS_NS_sys_resource.cpp" )
			cpp_source( "OS_NS_sys_select.cpp" )
			cpp_source( "OS_NS_sys_shm.cpp" )
			cpp_source( "OS_NS_sys_socket.cpp" )
			cpp_source( "OS_NS_sys_stat.cpp" )
			cpp_source( "OS_NS_sys_time.cpp" )
			cpp_source( "OS_NS_sys_uio.cpp" )
			cpp_source( "OS_NS_sys_utsname.cpp" )
			cpp_source( "OS_NS_sys_wait.cpp" )
			cpp_source( "OS_NS_time.cpp" )
			cpp_source( "OS_NS_unistd.cpp" )
			cpp_source( "OS_NS_wchar.cpp" )
			cpp_source( "OS_QoS.cpp" )
			cpp_source( "OS_TLI.cpp" )
			cpp_source( "OS_Thread_Adapter.cpp" )
			cpp_source( "OS_main.cpp" )
			cpp_source( "Obchunk.cpp" )
			cpp_source( "Object_Manager.cpp" )
			cpp_source( "Object_Manager_Base.cpp" )
			cpp_source( "Obstack.cpp" )
			cpp_source( "PI_Malloc.cpp" )
			cpp_source( "POSIX_Asynch_IO.cpp" )
			cpp_source( "POSIX_CB_Proactor.cpp" )
			cpp_source( "POSIX_Proactor.cpp" )
			cpp_source( "Pagefile_Memory_Pool.cpp" )
			cpp_source( "Parse_Node.cpp" )
			cpp_source( "Ping_Socket.cpp" )
			cpp_source( "Pipe.cpp" )
			cpp_source( "Priority_Reactor.cpp" )
			cpp_source( "Proactor.cpp" )
			cpp_source( "Process.cpp" )
			cpp_source( "Process_Manager.cpp" )
			cpp_source( "Process_Mutex.cpp" )
			cpp_source( "Process_Semaphore.cpp" )
			cpp_source( "Profile_Timer.cpp" )
			cpp_source( "QtReactor.cpp" )
			cpp_source( "RW_Mutex.cpp" )
			cpp_source( "RW_Process_Mutex.cpp" )
			cpp_source( "RW_Thread_Mutex.cpp" )
			cpp_source( "Reactor.cpp" )
			cpp_source( "Reactor_Notification_Strategy.cpp" )
			cpp_source( "Read_Buffer.cpp" )
			cpp_source( "Recursive_Thread_Mutex.cpp" )
			cpp_source( "Recyclable.cpp" )
			cpp_source( "Refcountable.cpp" )
			cpp_source( "Registry.cpp" )
			cpp_source( "Registry_Name_Space.cpp" )
			cpp_source( "Remote_Name_Space.cpp" )
			cpp_source( "Remote_Tokens.cpp" )
			cpp_source( "SOCK.cpp" )
			cpp_source( "SOCK_Acceptor.cpp" )
			cpp_source( "SOCK_CODgram.cpp" )
			cpp_source( "SOCK_Connector.cpp" )
			cpp_source( "SOCK_Dgram.cpp" )
			cpp_source( "SOCK_Dgram_Bcast.cpp" )
			cpp_source( "SOCK_Dgram_Mcast.cpp" )
			cpp_source( "SOCK_IO.cpp" )
			cpp_source( "SOCK_SEQPACK_Acceptor.cpp" )
			cpp_source( "SOCK_SEQPACK_Association.cpp" )
			cpp_source( "SOCK_SEQPACK_Connector.cpp" )
			cpp_source( "SOCK_Stream.cpp" )
			cpp_source( "SPIPE.cpp" )
			cpp_source( "SPIPE_Acceptor.cpp" )
			cpp_source( "SPIPE_Addr.cpp" )
			cpp_source( "SPIPE_Connector.cpp" )
			cpp_source( "SPIPE_Stream.cpp" )
			cpp_source( "SString.cpp" )
			cpp_source( "SUN_Proactor.cpp" )
			cpp_source( "SV_Message.cpp" )
			cpp_source( "SV_Message_Queue.cpp" )
			cpp_source( "SV_Semaphore_Complex.cpp" )
			cpp_source( "SV_Semaphore_Simple.cpp" )
			cpp_source( "SV_Shared_Memory.cpp" )
			cpp_source( "Sample_History.cpp" )
			cpp_source( "Sbrk_Memory_Pool.cpp" )
			cpp_source( "Sched_Params.cpp" )
			cpp_source( "Select_Reactor.cpp" )
			cpp_source( "Select_Reactor_Base.cpp" )
			cpp_source( "Semaphore.cpp" )
			cpp_source( "Service_Config.cpp" )
			cpp_source( "Service_Manager.cpp" )
			cpp_source( "Service_Object.cpp" )
			cpp_source( "Service_Repository.cpp" )
			cpp_source( "Service_Templates.cpp" )
			cpp_source( "Service_Types.cpp" )
			cpp_source( "Shared_Memory.cpp" )
			cpp_source( "Shared_Memory_MM.cpp" )
			cpp_source( "Shared_Memory_Pool.cpp" )
			cpp_source( "Shared_Memory_SV.cpp" )
			cpp_source( "Shared_Object.cpp" )
			cpp_source( "Signal.cpp" )
			cpp_source( "Sock_Connect.cpp" )
			cpp_source( "Stats.cpp" )
			cpp_source( "String_Base_Const.cpp" )
			cpp_source( "Svc_Conf_Lexer_Guard.cpp" )
			cpp_source( "Svc_Conf_l.cpp" )
			cpp_source( "Svc_Conf_y.cpp" )
			cpp_source( "Synch_Options.cpp" )
			cpp_source( "System_Time.cpp" )
			cpp_source( "TLI.cpp" )
			cpp_source( "TLI_Acceptor.cpp" )
			cpp_source( "TLI_Connector.cpp" )
			cpp_source( "TLI_Stream.cpp" )
			cpp_source( "TP_Reactor.cpp" )
			cpp_source( "TSS_Adapter.cpp" )
			cpp_source( "TTY_IO.cpp" )
			cpp_source( "Task.cpp" )
			cpp_source( "Thread.cpp" )
			cpp_source( "Thread_Adapter.cpp" )
			cpp_source( "Thread_Control.cpp" )
			cpp_source( "Thread_Exit.cpp" )
			cpp_source( "Thread_Hook.cpp" )
			cpp_source( "Thread_Manager.cpp" )
			cpp_source( "Thread_Mutex.cpp" )
			cpp_source( "Thread_Semaphore.cpp" )
			cpp_source( "Time_Request_Reply.cpp" )
			cpp_source( "Time_Value.cpp" )
			cpp_source( "Timeprobe.cpp" )
			cpp_source( "Timer_Hash.cpp" )
			cpp_source( "Timer_Heap.cpp" )
			cpp_source( "Timer_List.cpp" )
			cpp_source( "Timer_Queue.cpp" )
			cpp_source( "Timer_Wheel.cpp" )
			cpp_source( "TkReactor.cpp" )
			cpp_source( "Token.cpp" )
			cpp_source( "Token_Collection.cpp" )
			cpp_source( "Token_Invariants.cpp" )
			cpp_source( "Token_Manager.cpp" )
			cpp_source( "Token_Request_Reply.cpp" )
			cpp_source( "Trace.cpp" )
			cpp_source( "UNIX_Addr.cpp" )
			cpp_source( "UPIPE_Acceptor.cpp" )
			cpp_source( "UPIPE_Connector.cpp" )
			cpp_source( "UPIPE_Stream.cpp" )
			cpp_source( "UUID.cpp" )
			cpp_source( "WFMO_Reactor.cpp" )
			cpp_source( "WIN32_Asynch_IO.cpp" )
			cpp_source( "WIN32_Proactor.cpp" )
			cpp_source( "XML_Svc_Conf.cpp" )
			cpp_source( "XTI_ATM_Mcast.cpp" )
			cpp_source( "XtReactor.cpp" )
			cpp_source( "gethrtime.cpp" )
		end
	end
end

