Handle compile time environment better.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>