summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Bagnoli <g.bagnoli@asidev.com>2010-03-18 21:47:28 +0100
committerGiacomo Bagnoli <g.bagnoli@asidev.com>2010-03-18 21:47:28 +0100
commit992af50956257d2cd62f8bc8a91dd30704842094 (patch)
treed53b9ac124cb541608efb99943705a40938e8d29
parent84dbe9b95e71a8940b1142c5008d39766b3f27ce (diff)
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)
-rw-r--r--TODO6
-rw-r--r--configure.ac12
-rw-r--r--src/Makefile.am5
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)