Print a warning if --enable-run-from-source is missing

If znc was compiled with "--disable-run-from-source" it will check if a file
called "znc-uninstalled.pc" exists in the directory the znc binary is in. If
there is such a file, it will print a warning that "--enable-run-from-source" is
most likely missing.

Idea partly by SilverLeo, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2001 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-05-20 20:24:30 +00:00
parent 703a5e879f
commit 4c3900f7a1
+7
View File
@@ -185,6 +185,13 @@ int main(int argc, char** argv) {
return 0;
}
#ifndef RUN_FROM_SOURCE
if (CFile::Exists(pZNC->GetCurPath() + "/znc-uninstalled.pc")) {
CUtils::PrintError("It looks like you are running znc without installing it first.");
CUtils::PrintError("Recompile with --enable-run-from-source if you intend to do that.");
}
#endif
if (isRoot()) {
CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");