static void gen_default_if_none(const EntryList &, std::ostream&);
static void gen_default_postscriptum(const EntryList &, std::ostream&);
static bool isDefined(const std::string &name);
+static const char *available_if(const std::string &name);
static void
checkDepend(const std::string &directive, const char *name, const TypeList &types, const EntryList &entries)
{
fout << "static void" << std::endl <<
"defaults_if_none(void)" << std::endl <<
- "{" << std::endl;
+ "{" << std::endl <<
+ " cfg_filename = \"Default Configuration (if absent)\";" << std::endl <<
+ " config_lineno = 0;" << std::endl;
for (EntryList::const_iterator entry = head.begin(); entry != head.end(); ++entry) {
assert(entry->name.size());
fout << "#endif" << std::endl;
}
- fout << "}" << std::endl << std::endl;
+ fout << " cfg_filename = NULL;" << std::endl <<
+ "}" << std::endl << std::endl;
}
/// append configuration options specified by POSTSCRIPTUM lines
{
fout << "static void" << std::endl <<
"defaults_postscriptum(void)" << std::endl <<
- "{" << std::endl;
+ "{" << std::endl <<
+ " cfg_filename = \"Default Configuration (postscriptum)\";" << std::endl <<
+ " config_lineno = 0;" << std::endl;
for (EntryList::const_iterator entry = head.begin(); entry != head.end(); ++entry) {
assert(entry->name.size());
fout << "#endif" << std::endl;
}
- fout << "}" << std::endl << std::endl;
+ fout << " cfg_filename = NULL;" << std::endl <<
+ "}" << std::endl << std::endl;
}
void
Entry::genParseAlias(const std::string &aName, std::ostream &fout) const
{
fout << " if (!strcmp(token, \"" << aName << "\")) {" << std::endl;
+ if (ifdef.size())
+ fout << "#if " << ifdef << std::endl;
fout << " ";
if (type.compare("obsolete") == 0) {
fout << "debugs(0, DBG_CRITICAL, \"ERROR: Directive '" << aName << "' is obsolete.\");\n";
fout << "parse_" << type << "(&" << loc << (array_flag ? "[0]" : "") << ");";
}
fout << std::endl;
+ if (ifdef.size()) {
+ fout <<
+ "#else" << std::endl <<
+ " debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), \"ERROR: '" << name << "' requires " << available_if(ifdef) << "\");" << std::endl <<
+ "#endif" << std::endl;
+ }
fout << " return 1;" << std::endl;
fout << " };" << std::endl;
}
if (name.compare("comment") == 0)
return;
- if (ifdef.size())
- fout << "#if " << ifdef << std::endl;
-
// Once for the current directive name
genParseAlias(name, fout);
for (EntryAliasList::const_iterator a = alias.begin(); a != alias.end(); ++a) {
genParseAlias(*a, fout);
}
-
- if (ifdef.size())
- fout << "#endif\n";
}
static void
define["ICAP_CLIENT"]="--enable-icap-client"
define["SQUID_SNMP"]="--enable-snmp"
define["USE_ADAPTATION"]="--enable-ecap or --enable-icap-client"
+ define["USE_AUTH"]="--enable-auth"
define["USE_CACHE_DIGESTS"]="--enable-cache-digests"
define["USE_DNSHELPER"]="--disable-internal-dns"
define["!USE_DNSHELPER"]="--enable-internal-dns"
define["USE_IDENT"]="--enable-ident-lookups"
define["USE_LOADABLE_MODULES"]="--enable-loadable-modules"
define["USE_SQUID_ESI"]="--enable-esi"
+ define["USE_SQUID_EUI"]="--enable-eui"
+ define["USE_SSL_CRTD"]="--enable-ssl-crtd"
define["USE_SSL"]="--enable-ssl"
define["USE_UNLINKD"]="--enable-unlinkd"
define["USE_WCCP"]="--enable-wccp"
}
/^IFDEF:/ {
if (define[$2] != "")
- DEFINE=define[$2] " option"
- else
+ DEFINE=define[$2]
+ else
DEFINE="-D" $2 " define"
print "{\"" $2 "\", \"" DEFINE "\", "
print "#if " $2