From 992af50956257d2cd62f8bc8a91dd30704842094 Mon Sep 17 00:00:00 2001 From: Giacomo Bagnoli Date: Thu, 18 Mar 2010 21:47:28 +0100 Subject: Added conditional src files to avoid compiling json parsing if configured with --without-json. Added configure script support for deaclaring verbosity level (using an ENV var LOGLEVEL) --- TODO | 6 +++--- configure.ac | 12 +++++++++++- src/Makefile.am | 5 ++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index aabb50c..eeb1797 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,5 @@ -* build system: add log-level switch -* build system: compile rtapp_config.{h,c} files only if --with-json is true. +* build system: add log-level switch (done) +* build system: compile rtapp_config.{h,c} files only if --with-json is true. (done) * rt-app : add support for shared resources (both in app and in config) - - done in config, missing in app. + - done in config, missing in app. (done both, to be tested) diff --git a/configure.ac b/configure.ac index e448e02..1f8ef99 100644 --- a/configure.ac +++ b/configure.ac @@ -50,12 +50,22 @@ AS_IF([test "x$with_json" != "xno"], [AC_SUBST([LIBJSON], ["-ljson"]) AC_DEFINE([JSON], [1], [Define if you have libjson]) ], - [AC_MSG_FAILURE([libyaml test failed (use --without-json to disable)])], + [AC_MSG_FAILURE([libjson test failed (use --without-json to disable or install json-c)])], [-ljson] ) ] ) +AM_CONDITIONAL([AMJSON], [ test x$with_json != xno]) + +AC_ARG_VAR([LOGLVL], [verbosity level, from 0 to 100. 100 is very verbose]) + +if test -z "${LOGLVL}";then + AC_DEFINE([LOG_LEVEL], [50], [Define log message verbosity]) +else + AC_DEFINE_UNQUOTED([LOG_LEVEL], [${LOGLVL}]) +fi + AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_FILES([Makefile src/Makefile libdl/Makefile README INSTALL USAGE COPYING]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 9499b41..1674a10 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,9 @@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I$(srcdir)/../libdl/ bin_PROGRAMS = rt-app -rt_app_SOURCES= rt-app_types.h rt-app_args.h rt-app_utils.h rt-app_utils.c rt-app_args.c rt-app.h rt-app.c rt-app_parse_config.h rt-app_parse_config.c +rt_app_SOURCES= rt-app_types.h rt-app_args.h rt-app_utils.h rt-app_utils.c rt-app_args.c rt-app.h rt-app.c +if AMJSON +rt_app_SOURCES += rt-app_parse_config.h rt-app_parse_config.c +endif rt_app_LDADD = $(QRESLIB) ../libdl/libdl.a $(LIBJSON) -- cgit v1.2.3