Commit a9dd7fff authored by Aurelio Colosimo's avatar Aurelio Colosimo

WRMODE option can be set at compile time

The WRMODE option in Makefile acts as the -g option (run as slave only):
WRMODE=master -> auto detect, becomes master if no announce is received
WRMODE=slave  -> never go to master mode, listens for announce and becomes slave
parent 6f7e1189
......@@ -36,6 +36,13 @@ ifdef PROTO_EXT
include proto-ext-$(PROTO_EXT)/Makefile
endif
WRMODE = slave
ifeq ($(WRMODE), master)
CFLAGS += -DPPSI_MASTER
else
CFLAGS += -DPPSI_SLAVE
endif
# Include arch code, the default is hosted GNU/Linux stuff
# we need this -I so <arch/arch.h> can be found
ARCH ?= gnu-linux
......
......@@ -55,6 +55,10 @@ int main(int argc, char **argv)
OPTS(ppi)->iface_name = ifname;
#ifdef PPSI_SLAVE
OPTS(ppi)->slave_only = 1;
#endif
if (pp_parse_cmdline(ppi, argc, argv) != 0)
return -1;
......
......@@ -53,6 +53,10 @@ void ppsi_main(void)
}
pp_open_instance(ppi, 0 /* no opts */);
#ifdef PPSI_SLAVE
OPTS(ppi)->slave_only = 1;
#endif
spec_main_loop(ppi);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment