working commit
This commit is contained in:
+120
-1
@@ -1,4 +1,4 @@
|
||||
AC_INIT([helmet],[0.0.1])
|
||||
AC_INIT([stvpn],[0.0.1])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PREFIX_DEFAULT(/usr/local)
|
||||
AC_CONFIG_HEADERS([defines.hpp])
|
||||
@@ -11,6 +11,125 @@ AC_PATH_PROGS([PROTOC],[protoc true])
|
||||
AC_PATH_PROGS([ASTYLE],[astyle true])
|
||||
|
||||
|
||||
AM_CONDITIONAL(SYSTEMD, false)
|
||||
if test -d /lib/systemd/system; then
|
||||
AM_CONDITIONAL(SYSTEMD, true)
|
||||
fi
|
||||
|
||||
|
||||
test "x$prefix" == "xNONE" && prefix=$ac_default_prefix
|
||||
test "x$libexecdir" == "xNONE" && libexecdir=${prefix}/lib
|
||||
|
||||
|
||||
dnl --------------------------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE([devel-mode],
|
||||
AS_HELP_STRING([--enable-devel-mode], [Enable developmend mode]))
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(srv_devel_mode, "false", [developmend mode])
|
||||
AC_SUBST(srv_devel_mode, "false")
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRCDIR=`pwd`
|
||||
enable_devel_mode=yes
|
||||
])
|
||||
|
||||
dnl --------------------------------------------------------------------------------------
|
||||
|
||||
SRV_CONFDIR="${prefix}/etc/${PACKAGE}"
|
||||
|
||||
AC_ARG_WITH(confdir,
|
||||
AS_HELP_STRING([--with-confdir=PATH],[set configuration dir to PATH (default: $SRV_CONFDIR)]),
|
||||
[ if test ! -z "$withval" ; then
|
||||
case $withval in
|
||||
/*)
|
||||
SRV_CONFDIR="$withval"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(You must specify an absolute path to --with-confdir=PATH)
|
||||
;;
|
||||
esac
|
||||
fi ])
|
||||
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
dnl SRV_CONFDIR="${SRCDIR}/etc/${PACKAGE}"
|
||||
dnl sysconfdir="${SRCDIR}/etc/${PACKAGE}"
|
||||
SRV_CONFDIR="${SRCDIR}"
|
||||
sysconfdir="${SRCDIR}"
|
||||
], [
|
||||
test "x$SRV_CONFDIR" == "x/usr/etc/${PACKAGE}" && SRV_CONFDIR="/etc/${PACKAGE}"
|
||||
test "x$prefix" == "x/usr" && sysconfdir="/etc"
|
||||
])
|
||||
|
||||
AC_DEFINE(SRV_CONFDIR, "$SRV_CONFDIR")
|
||||
AC_DEFINE_UNQUOTED(SRV_CONFDIR, "$SRV_CONFDIR", [location of configuration files for ${PACKAGE}])
|
||||
AC_SUBST(srv_confdir, "$SRV_CONFDIR")
|
||||
|
||||
AC_MSG_NOTICE(srv_confdir set as ${SRV_CONFDIR})
|
||||
|
||||
dnl --------------------------------------------------------------------------------------
|
||||
|
||||
SRV_LOGDIR="/var/log/${PACKAGE}"
|
||||
|
||||
AC_ARG_WITH(logdir,
|
||||
AS_HELP_STRING([--with-logdir=PATH],[set path for logdir (default: $SRV_LOGDIR)]),
|
||||
[ if test ! -z "$withval" ; then
|
||||
case $withval in
|
||||
/*)
|
||||
SRV_LOGDIR="$withval"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(You must specify an absolute path to --with-logdir=PATH)
|
||||
;;
|
||||
esac
|
||||
fi])
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRV_LOGDIR="${SRCDIR}/tmp/log"
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SRV_LOGDIR, "$SRV_LOGDIR", [location of ${PACKAGE} logdir])
|
||||
AC_SUBST(srv_logdir, "$SRV_LOGDIR")
|
||||
|
||||
AC_MSG_NOTICE(srv_logdir set as ${SRV_LOGDIR})
|
||||
|
||||
dnl --------------------------------------------------------------------------------------
|
||||
|
||||
SRV_RUNDIR="/var/run/${PACKAGE}"
|
||||
|
||||
AC_ARG_WITH(rundir,
|
||||
AS_HELP_STRING([--with-rundir=PATH],[set path for rundir (default: $SRV_RUNDIR)]),
|
||||
[ if test ! -z "$withval" ; then
|
||||
case $withval in
|
||||
/*)
|
||||
SRV_RUNDIR="$withval"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(You must specify an absolute path to --with-rundir=PATH)
|
||||
;;
|
||||
esac
|
||||
fi ])
|
||||
|
||||
AS_IF([test "x$enable_devel_mode" = "xyes"], [
|
||||
SRV_RUNDIR="${SRCDIR}/tmp/run"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(SRV_RUNDIR, "$SRV_RUNDIR", [location of rundir])
|
||||
AC_SUBST(srv_rundir, "$SRV_RUNDIR")
|
||||
|
||||
AC_MSG_NOTICE(srv_rundir set as ${SRV_RUNDIR})
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(SRV_SHAREDIR, "$SRV_SHAREDIR", [location of share dir])
|
||||
AC_SUBST(srv_sharedir, "$SRV_SHAREDIR")
|
||||
|
||||
AC_MSG_NOTICE(srv_sharedir set as ${SRV_SHAREDIR})
|
||||
|
||||
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user