[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared library location
From: |
Bruno Haible |
Subject: |
Re: Shared library location |
Date: |
Thu, 11 Jun 2009 13:37:55 +0200 |
User-agent: |
KMail/1.9.9 |
Russell Shaw asked:
> What "make" variable can i utilize that has a value
> dependent on whether the package is installed or not?
If you need this distinction only in the tests, you can use the
Makefile.am variable TESTS_ENVIRONMENT to set an environment variable.
Like this: In tests/Makefile.am
TESTS_ENVIRONMENT = MY_LIB_DIR=\"$(top_builddir)/src/libdir\"
and in your code:
my_lib_dir = getenv ("MY_LIB_DIR");
if (my_lib_dir == NULL || my_lib_dir[0] == '\0')
my_lib_dir = LIBDIR;
If your program is also being used uninstalled, other than for the tests,
a wrapper script, like Ralf Wildenhues suggested, is the easiest solution.
Bruno