0256807 Use strrchr only if the compiler supports __builtin_strrchr
204aade Use __builtin_strrchr to get file base name
aa0a554 Remove the use of config.h
8983bf8 Ignore test and benchmark programs
git-subtree-dir: lib/pinelog
git-subtree-split: 02568074170f0725196de4e52450db024cc39895
A missing comma at the end of the STRINGIFY line was causing builds with
clang to have segfaults with the default configuration. It turned out
that due to the missing comma, the N_("Unknown LED state %d") and
N_("off") parameters were getting merged into a single parameter by
clang, but interestingly, not by GCC.
As a result, when building with clang, the array is "on", "red",
"amber", "green" - note the missing "off" at the beginning of the array.
This causes clang generated builds to segfault when attemping to log a
trace message when configuring LED A (which defaults to green, and the
index of LIBX52_LED_STATE_GREEN exceeds the array bounds).
AC_CHECK_HEADERS and AC_SEARCH_LIBS do not abort when the header or
library respectively are not found. Since inih is a hard requirement,
make sure that the action-if-not-found fields call AC_MSG_ERROR.
Fixes#32
This change changes the parser element in the CFG macros to be a "type"
element instead. This is handled in the config parser source, where the
macro definition appends `_parser` to the type field. This allows us to
(in the future) add a `_dump` function to dump the configuration to a
file.
See issue #31. In systems with a newer version of libusb (1.0.24
onwards), GCC raises a warning that the packed attribute is unnecessary
for `libusb_control_setup`. This is not really a problem for libx52,
since it doesn't call libusb_control_setup directly, but since the
libx52 build framework treats all warnings as errors by default, it will
prevent the build from working.
This change removes the -Wpacked flag from AX_COMPILER_FLAGS, and this
should let the build pass without any issues.
Prior to this change, x52d could only run in the foreground, regardless
of the value of the foreground flag. This change adds the standard
double-fork routine to daemonize the program.
This change also adds a PID file argument to x52d, which is used to
ensure that only one instance of the x52d daemon is running at any time.
Prior to this change, the tests file contained every test that was in
the original script based test suite. However, we don't need to test
every single scenario within libx52, since those are already handled in
the libx52 specific tests. This also causes a slow compilation, since
the tests are written as a series of macros, and the result is a 2000+
line file before preprocessing.
This change removes some of the spurious test cases, and simply checks
that the parameters passed to the corresponding libx52 function are as
expected for a few test cases.