Support relocated install with VOLK_PREFIX env var
authorJosh Blum <josh@joshknows.com>
Thu, 6 Oct 2016 22:06:09 +0000 (15:06 -0700)
committerA. Maitland Bottoms <bottoms@debian.org>
Sun, 4 Feb 2018 18:12:21 +0000 (18:12 +0000)
Some packaging systems such as snaps will install
the volk library to a dynamically chosen location.
The install script can set an evironment variable
so that the library reports the correct prefix.

Gbp-Pq: Name 0013-Support-relocated-install-with-VOLK_PREFIX-env-var.patch

lib/constants.c.in

index 3839f537a4ead1d56e2eba1c8d1c9a4f34963622..a81c7cbdae8ae942352172aca5c176917e947bd4 100644 (file)
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <volk/constants.h>
 
 char*
 volk_prefix()
 {
+  const char *prefix = getenv("VOLK_PREFIX");
+  if (prefix != NULL) return (char *)prefix;
   return "@prefix@";
 }