diff options
author | Jussi Kukkonen <jku@goto.fi> | 2014-07-02 15:32:34 +0300 |
---|---|---|
committer | Alexander Tsoy <alexander@tsoy.me> | 2015-07-02 01:23:33 +0300 |
commit | e314fadc086e7d16a227af696965cbaba6f9194a (patch) | |
tree | c7db2fb0e44a49226d808d861968246cd79019a9 | |
parent | b7514080bbcd88724c8609a56c46ed97c1ae66e4 (diff) | |
download | dleyna-renderer-e314fadc086e7d16a227af696965cbaba6f9194a.tar.gz |
[m4] Don't use bash arrays in m4 macros
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-rw-r--r-- | m4/log.m4 | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -23,29 +23,21 @@ dnl AC_DEFUN([_DLEYNA_LOG_LEVEL_CHECK_VALUE], [ AS_CASE($1, - [[[1-6]]], [AS_IF([test ${log_array[[${log_level}]]} -ne 0], + [[[1-6]]], [AS_IF([test "x${log_unique}" = xyes], [ - AC_MSG_ERROR(["$1 should be set once"], 1) - ], - [test "x${log_single}" = xyes], - [ - AC_MSG_ERROR(["Unique value element already set"], 1) + AC_MSG_ERROR(["Log levels 0, 7 and 8 cannot be combined with other values"], 1) ]) + let log_level_count++ ], [0|7|8], [AS_IF([test ${log_level_count} -ne 0], [ - AC_MSG_ERROR(["$1 should be a unique value element"], 1) + AC_MSG_ERROR(["Log level $1 cannot be combined with other values"], 1) ]) - log_single=yes + log_unique=yes ], - [AC_MSG_ERROR(["$1 is not a valid value"], 1)] ) - - log_name=LOG_LEVEL_${log_level} - eval log_value=\$${log_name} - let "LOG_LEVEL |= ${log_value}" ] ) @@ -57,19 +49,18 @@ AC_DEFUN([DLEYNA_LOG_LEVEL_CHECK], IFS="," log_ok=yes - log_single=no + log_unique=no log_level_count=0 LOG_LEVEL=0 - log_array=(0 0 0 0 0 0 0 0 0) for log_level in $1 do IFS=${old_IFS} _DLEYNA_LOG_LEVEL_CHECK_VALUE([$log_level]) IFS="," - - let log_level_count++ - let log_array[[${log_level}]]++ + log_name=LOG_LEVEL_${log_level} + eval log_value=\$${log_name} + let "LOG_LEVEL |= ${log_value}" done IFS=${old_IFS} |