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 <errno.h>
#include <string.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 #ifdef ANDROID
#define DEFAULT_INSTANCE_PATH "/data/data/org.servalproject/var/serval-node" #define DEFAULT_INSTANCE_PATH "/data/data/org.servalproject/var/serval-node"
#else #else
#define DEFAULT_INSTANCE_PATH "/var/serval-node" #define DEFAULT_INSTANCE_PATH "/var/serval-node"
#endif #endif
#endif
/* Handy statement for forming a path to an instance file in a char buffer whose declaration /* 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 * 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]) popdef([AC_MSG_ERROR])
fi 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 dnl XXX Isn't this pointless? we are always linked against libc
AC_CHECK_LIB(c,srandomdev) AC_CHECK_LIB(c,srandomdev)