package third_party.qpid

@Build(stage=2,script="$(EXTERNAL_MAKE)")
@BuildArtifactPath(cppflags="-I$(abspath $(EXTERNAL_BUILD_DIR))/third_party/qpid/core/install/include -I$(abspath $(EXTERNAL_BUILD_DIR))/third_party/qpid/core/install/include/qpid",
		ldflags="-L$(abspath $(EXTERNAL_BUILD_DIR))/third_party/qpid/core/install/lib")
@BuildDepends(third_party.boost.libs)
@BuildDepends(third_party.e2fsprogs.core)
/* NOTE this was static module, until some day I tried to connect to broker via tcp.
   TCPConnector class was missing, that registers tcp proto in static constructor of
   some artifical class. Since noone reference that, tcp was disabled.
   I turn this module into not static, and TCPConnector starts to register.
   Anton Kozlov
*/
module core {
	@AddPrefix("^BUILD/extbld/^MOD_PATH/install/lib")
	source "libqpidbroker.a", "libqpidclient.a",
		"libqpidcommon.a", "libqpidmessaging.a", "libqpidtypes.a"

	@NoRuntime depends embox.compat.posix.file_system
	@NoRuntime depends embox.compat.posix.ipc.pipe
	@NoRuntime depends embox.compat.posix.index_descriptor
	@NoRuntime depends embox.compat.posix.net.gai_strerror
	@NoRuntime depends embox.compat.posix.net.getaddrinfo
	@NoRuntime depends embox.compat.posix.net.getnameinfo
	@NoRuntime depends embox.compat.posix.net.socket
	@NoRuntime depends embox.compat.posix.util.gethostname
	@NoRuntime depends embox.compat.posix.util.sleep
	@NoRuntime depends embox.compat.posix.util.utsname
	@NoRuntime depends embox.compat.libc.all
	@NoRuntime depends embox.net.lib.getifaddrs
	@NoRuntime depends third_party.boost.libs
	@NoRuntime depends third_party.e2fsprogs.core
	@NoRuntime depends embox.compat.posix.pthread_key
	@NoRuntime depends embox.compat.posix.regex
	@NoRuntime depends embox.compat.posix.sys.mman.msync
	@NoRuntime depends embox.compat.posix.net.socketpair_stub
}

@Build(stage=2,script="true")
@BuildDepends(core)
@Cmd(name = "qpidd",
	help = "qpidd",
	man = '''
		AUTHORS
			Alexander Kalmuk
	''')
module qpidd {
	@Rule(script="$(MAIN_STRIPPING)")
	@AddPrefix("^BUILD/extbld/third_party/qpid/core/install/bin")
	source "strip.QpiddBroker.o"

	@AddPrefix("^BUILD/extbld/third_party/qpid/core/install/bin")
	source "qpidd.o"

	@NoRuntime depends third_party.qpid.core
	depends embox.compat.posix.stubs
}

@Build(stage=2,script="true")
@BuildDepends(core)
@Cmd(name = "qpidd_hello",
	help = "simple qpid broker test",
	man = '''
		AUTHORS
			Alexander Kalmuk
	''')
module qpidd_hello {
	@Rule(script="$(MAIN_STRIPPING)")
	@AddPrefix("^BUILD/extbld/third_party/qpid/core/install/bin")
	source "strip.hello_world.o"

	@NoRuntime depends third_party.qpid.core
	depends embox.compat.posix.stubs
}
