diff --git a/configure.in b/configure.in index 7fa64b39..287341d3 100644 --- a/configure.in +++ b/configure.in @@ -10,6 +10,10 @@ AC_CANONICAL_SYSTEM dnl Init pkg-config PKG_PROG_PKG_CONFIG() +dnl Specify default instance path +AC_ARG_VAR([INSTANCE_PATH], [default instance path for servald]) +AS_IF([test "x$INSTANCE_PATH" != x], [AC_DEFINE_UNQUOTED([INSTANCE_PATH], ["$INSTANCE_PATH"], [default instance path])]) + dnl VoIP test app AC_ARG_ENABLE(voiptest, AS_HELP_STRING([--enable-voiptest], [Require VoIP test program (default: only build if dependencies are present)]) @@ -23,7 +27,7 @@ AS_IF([test "x$enable_voiptest" != "xno"], [ PKG_CHECK_MODULES([SRC], [samplerate],,[have_voip=0]) PKG_CHECK_MODULES([SPANDSP], [spandsp],,[have_voip=0]) AC_CHECK_HEADER([codec2.h],, [have_voip=0]) - AC_CHECK_LIB([codec2], [codec2_create], [AC_SUBST(CODEC2_LIBS, -lcodec2)], [have_voip=0]) + AC_CHECK_LIB([codec2], [codec2_create], [AC_SUBST([CODEC2_LIBS], -lcodec2)], [have_voip=0]) ]) AS_IF([test "x$enable_voiptest" = "xyes" -a "x$have_voip" != "x1" ], [ AC_MSG_ERROR([Missing VoIP dependencies]) @@ -60,9 +64,6 @@ 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) diff --git a/doc/Servald-Configuration.md b/doc/Servald-Configuration.md index 44e20de1..290ef282 100644 --- a/doc/Servald-Configuration.md +++ b/doc/Servald-Configuration.md @@ -47,8 +47,8 @@ by the `SERVALINSTANCE_PATH` environment variable. If this is not set, then **servald** uses a built-in default path which depends on its build-time option and target platform: -* as specified by the `./configure --enable-instance-path=PATH` option when - **servald** was built from source +* as specified by the `./configure INSTANCE_PATH=` option when **servald** + was built from source * on Android `/data/data/org.servalproject/var/serval-node` * on other platforms `/var/serval-node` diff --git a/serval.h b/serval.h index 8613482e..190ca2b1 100644 --- a/serval.h +++ b/serval.h @@ -196,7 +196,9 @@ int strn_to_sid_t(sid_t *sid, const char *hex, const char **endp); #define alloca_tohex_sas(sas) alloca_tohex((sas), SAS_SIZE) /* - * INSTANCE_PATH can be set via the ./configure option --enable-instance-path= + * INSTANCE_PATH can be set on the ./configure command line, eg: + * + * ./configure INSTANCE_PATH=/var/local/serval/node */ #ifdef INSTANCE_PATH #define DEFAULT_INSTANCE_PATH INSTANCE_PATH