From 4c3900f7a1f29e327b5362bd1c03891b94f8cd22 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 20 May 2010 20:24:30 +0000 Subject: [PATCH] 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 --- main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.cpp b/main.cpp index 2a88fffa..c3754201 100644 --- a/main.cpp +++ b/main.cpp @@ -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!");