Skip to content

Commit

Permalink
Add support for sysconfdir for default config place
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Oct 27, 2018
1 parent 9d0b6c2 commit 1a36f06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,19 @@ AS_IF([test "x$disable_stats" = xyes],
[AC_DEFINE([HAVE_STATS], [1], [Define to 1 if stats is not disabled])])
AC_MSG_RESULT($disable_stats)

AC_ARG_ENABLE([packaging],
[AS_HELP_STRING(
[--enable-packaging],
[apply packaging standards])
],
[enable_packaging=yes],
[enable_packaging=no])
AS_IF(
[test "x$enable_packaging" = xyes],
[AC_DEFINE([PACKAGING], [1], [Define to 1 if packaging is enabled])],
[])
AC_MSG_RESULT($enable_packaging)

# Untar the yaml-0.1.4 in contrib/ before config.status is rerun
AC_CONFIG_COMMANDS_PRE([tar xvfz contrib/yaml-0.1.4.tar.gz -C contrib])

Expand All @@ -206,7 +219,7 @@ AC_CONFIG_FILES([Makefile
src/Makefile
src/hashkit/Makefile
src/proto/Makefile
src/entropy/Makefile
src/entropy/Makefile
src/seedsprovider/Makefile
src/event/Makefile
src/tools/Makefile])
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AM_CPPFLAGS =
if !OS_SOLARIS
AM_CPPFLAGS += -D_GNU_SOURCE
endif
AM_CPPFLAGS += -DSYSCONFDIR="\"$(sysconfdir)\""
AM_CPPFLAGS += -I $(top_srcdir)/src/hashkit
AM_CPPFLAGS += -I $(top_srcdir)/src/proto
AM_CPPFLAGS += -I $(top_srcdir)/src/event
Expand Down
4 changes: 4 additions & 0 deletions src/dynomite.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
#include "dyn_core.h"
#include "dyn_signal.h"

#if !defined(PACKAGING)
#define DN_CONF_PATH "conf/dynomite.yml"
#else
#define DN_CONF_PATH SYSCONFDIR "/dynomite.yml"
#endif

#define DN_LOG_DEFAULT LOG_NOTICE
#define DN_LOG_MIN LOG_EMERG
Expand Down

0 comments on commit 1a36f06

Please sign in to comment.