enable overriding default instance path at configure time.

This commit is contained in:
gardners 2012-12-04 11:23:03 +10:30
parent a433f06530
commit 6179240874
2 changed files with 11 additions and 0 deletions

8
conf.h
View File

@ -23,11 +23,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <errno.h>
#include <string.h>
/*
DEFAULT_INSTANCE_PATH can be set via the configure option
--enable-instance-path=<path>
*/
#ifdef INSTANCE_PATH
#define DEFAULT_INSTANCE_PATH INSTANCE_PATH
#else
#ifdef ANDROID
#define DEFAULT_INSTANCE_PATH "/data/data/org.servalproject/var/serval-node"
#else
#define DEFAULT_INSTANCE_PATH "/var/serval-node"
#endif
#endif
/* Handy statement for forming a path to an instance file in a char buffer whose declaration
* is in scope (so that sizeof(buf) will work). Evaluates to true if the pathname fitted into

View File

@ -60,6 +60,9 @@ if test -n "$JAVAC"; then
popdef([AC_MSG_ERROR])
fi
AC_ARG_ENABLE(instance-path,"Set default instance path for servald",
CPPFLAGS="$CPPFLAGS -DINSTANCE_PATH=\\\"$enableval\\\"")
dnl XXX Isn't this pointless? we are always linked against libc
AC_CHECK_LIB(c,srandomdev)