fi
includes/mconfig.h: mconfig-gen
- ./mconfig-gen SBINDIR=$(SBINDIR) SYSCONTROLSOCKET=$(SYSCONTROLSOCKET) > includes/mconfig.h
+ ./mconfig-gen SBINDIR=$(SBINDIR) SYSCONTROLSOCKET=$(SYSCONTROLSOCKET) \
+ $(if $(USE_UTMPX),USE_UTMPX=$(USE_UTMPX),) > includes/mconfig.h
mconfig-gen: mconfig-gen.cc ../mconfig
$(CXX) $(CXXOPTS) -o mconfig-gen mconfig-gen.cc $(LDFLAGS)
using namespace std;
cout << "// This file is auto-generated by mconfig-gen.cc." << endl;
- cout << "constexpr static char SYSCONTROLSOCKET[] = " << stringify(vars["SYSCONTROLSOCKET"]) << ";" << endl;
- cout << "constexpr static char SBINDIR[] = " << stringify(vars["SBINDIR"]) << ";" << endl;
+ cout << "\n// Defines\n";
+ if (vars.find("USE_UTMPX") != vars.end()) {
+ cout << "#define USE_UTMPX " << vars["USE_UTMPX"] << "\n";
+ }
+ cout << "\n// Constants\n";
+ cout << "constexpr static char SYSCONTROLSOCKET[] = " << stringify(vars["SYSCONTROLSOCKET"]) << ";\n";
+ cout << "constexpr static char SBINDIR[] = " << stringify(vars["SBINDIR"]) << ";\n";
return 0;
}