From 6179240874e742c0093852d1b0e72fb292b10c8e Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 4 Dec 2012 11:23:03 +1030 Subject: [PATCH] enable overriding default instance path at configure time. --- conf.h | 8 ++++++++ configure.in | 3 +++ 2 files changed, 11 insertions(+) diff --git a/conf.h b/conf.h index 06100913..6f074567 100644 --- a/conf.h +++ b/conf.h @@ -23,11 +23,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include +/* + DEFAULT_INSTANCE_PATH can be set via the configure option + --enable-instance-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 diff --git a/configure.in b/configure.in index 5fc656ec..e41e32db 100644 --- a/configure.in +++ b/configure.in @@ -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)