From d2b4d1ea5657c5a07b44fef9b2ebbbae576fbc1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 2 Mar 2016 19:04:35 +0000 Subject: [PATCH] orcc: check version of liborc to make sure the right lib is being used Interesting compilation failures might otherwise ensue. --- tools/orcc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/orcc.c b/tools/orcc.c index b2d4201..5e940fc 100644 --- a/tools/orcc.c +++ b/tools/orcc.c @@ -90,6 +90,7 @@ void help (void) int main (int argc, char *argv[]) { + const char *orc_version; char *code; int n; int i; @@ -102,6 +103,16 @@ main (int argc, char *argv[]) orc_init (); + orc_version = orc_version_string (); + if (strcmp (orc_version, VERSION) != 0) { + fprintf (stderr, "WARNING: unexpected liborc library version %s is being " + "picked up by %s, which is version %s. This might be because orc was " + "installed from source and is also installed via packages, and liborc " + "from the wrong prefix is used. Check your system setup.\n", + orc_version, argv[0], VERSION); + exit(1); + } + for(i=1;i