diff --git a/.github/scripts/install-dependencies-macos.sh b/.github/scripts/install-dependencies-macos.sh index b197265..5d8dcaa 100755 --- a/.github/scripts/install-dependencies-macos.sh +++ b/.github/scripts/install-dependencies-macos.sh @@ -1,9 +1,6 @@ #!/bin/bash -x # Install dependencies to build and test on Ubuntu runners brew install \ - autoconf \ - automake \ - libtool \ pkg-config \ python3 \ gettext \ diff --git a/.github/scripts/install-dependencies-ubuntu.sh b/.github/scripts/install-dependencies-ubuntu.sh index ad83cc9..1cec703 100755 --- a/.github/scripts/install-dependencies-ubuntu.sh +++ b/.github/scripts/install-dependencies-ubuntu.sh @@ -2,9 +2,6 @@ # Install dependencies to build and test on Ubuntu runners sudo apt-get update sudo apt-get install -y \ - autoconf \ - automake \ - libtool \ pkg-config \ python3 \ gettext \ @@ -17,7 +14,6 @@ sudo apt-get install -y \ libcmocka-dev \ faketime \ meson \ - ninja-build \ - libinih-dev + ninja-build exit 0 diff --git a/.gitignore b/.gitignore index 16f9b0a..8ddee05 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,13 @@ x52test* x52evtest* libx52/test_* libx52test* -libx52util/util_char_map.c +libx52util/char_map.c udev/*.rules +# Built artifacts / local installs named x52d*; daemon sources use short names. +# Keep tracked daemon files that still use the x52d prefix (headers, configs). x52d* !daemon/x52d*.* +!libx52/x52dcomm.h test-* libx52-*.tar.gz diff --git a/Doxyfile.in b/Doxyfile.in index b58e35c..6e036b2 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -988,7 +988,7 @@ FILE_PATTERNS = libx52.h \ libx52util.h \ vkm.h \ x52_cli.c \ - x52ctl.c \ + daemon_control.c \ x52dcomm.h \ *.dox @@ -1021,7 +1021,9 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = */libx52/libx52io.h \ + */libx52/libx52util.h \ + */libx52/x52dcomm.h # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/INSTALL.md b/INSTALL.md index 90b9a30..7deeb9c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -30,7 +30,7 @@ Build has been tested on the following operating systems (x86-64 only): | Platform | Install instructions | | -------- | -------------------- | | Ubuntu | `sudo apt-get install meson gettext libhidapi-dev libevdev-dev libusb-1.0-0-dev libinih-dev pkg-config python3 git` | -| MacOS + Homebrew | `brew install meson gettext hidapi libtool libusb pkg-config python3 git` | +| MacOS + Homebrew | `brew install meson gettext hidapi libusb pkg-config python3 git` | | Arch Linux | `pacman -S base-devel meson libusb hidapi libevdev libinih python git` | | Fedora | `sudo dnf install meson gettext-devel findutils hidapi-devel libusb-devel libevdev-devel inih-devel pkg-config python3 git` | @@ -47,13 +47,13 @@ Build has been tested on the following operating systems (x86-64 only): git clone https://github.com/nirenjan/libx52.git ``` -2. Run autogen.sh +2. Configure the build (from the repository root) ``` -cd ./libx52 +cd libx52 meson setup build -Dprefix=/usr ``` -3. Run the following commands: +3. Compile and install: ``` meson compile -C build && meson install -C build ``` diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 53f9e85..0000000 --- a/Makefile.am +++ /dev/null @@ -1,110 +0,0 @@ -# Top level Automake for libx52 -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -ACLOCAL_AMFLAGS = -I m4 - -# Build any support libraries first -SUBDIRS = subprojects - -if USE_NLS -SUBDIRS += po -endif - -####################################################################### -# Defaults -####################################################################### -bin_PROGRAMS = -check_PROGRAMS = -lib_LTLIBRARIES = -check_LTLIBRARIES = -pkgconfig_DATA = -TESTS = -EXTRA_DIST = -CLEANFILES = -BUILT_SOURCES = - -x52includedir = $(includedir)/libx52 -x52include_HEADERS = - -LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh - -######################################################################## -# Get build version -######################################################################## -BUILT_SOURCES += version-info.h -CLEANFILES += version-info.h - -version-info.h: ${top_srcdir}/version-info - CC=${CC} ${top_srcdir}/version-info ${top_srcdir} >$@ - -######################################################################## -# Include automake stubs -######################################################################## -include libx52/Makefile.am -include libx52util/Makefile.am -include libx52io/Makefile.am -include libusbx52/Makefile.am - -include cli/Makefile.am -include joytest/Makefile.am -include evtest/Makefile.am -include daemon/Makefile.am -include udev/Makefile.am - -include bugreport/Makefile.am -include docs/Makefile.am - -####################################################################### -# Doxygen support -####################################################################### -if HAVE_DOXYGEN -DXGEN = $(DXGEN_@AM_V@) -DXGEN_ = $(DXGEN_@AM_DEFAULT_V@) -DXGEN_0 = @printf " DXGEN $<\n"; - -SYSCONFDIR=@sysconfdir@ -LOCALSTATEDIR=@localstatedir@ -export SYSCONFDIR -export LOCALSTATEDIR -docs/.stamp: Doxyfile - $(DXGEN)$(DOXYGEN) $< - $(AM_V_at)touch $@ - -all-local: docs/.stamp -clean-local: - rm -rf $(top_builddir)/docs - -man1_MANS = docs/man/man1/x52cli.1 docs/man/man1/x52bugreport.1 -$(man1_MANS): docs/.stamp - -# Install Doxygen generated HTML documentation and manpages -install-data-local: - $(INSTALL) -d $(DESTDIR)$(docdir) - cp -R -P $(top_builddir)/docs/html $(DESTDIR)$(docdir) - -uninstall-local: - rm -rf $(DESTDIR)$(docdir) - -endif - -# Extra files that need to be in the distribution -EXTRA_DIST += \ - ABOUT-NLS \ - AUTHORS \ - ChangeLog.md \ - CONTRIBUTING.md \ - Doxyfile.in \ - DoxygenLayout.xml \ - INSTALL.md \ - LICENSE \ - README.md \ - config.rpath \ - version-info \ - Version \ - gettext.h \ - usb-ids.h \ - po/README.md - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index e10d140..0000000 --- a/autogen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -x - -autoreconf --install diff --git a/bugreport/Makefile.am b/bugreport/Makefile.am deleted file mode 100644 index e06c84d..0000000 --- a/bugreport/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Automake for libx52-bugreport -# -# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -bin_PROGRAMS += x52bugreport - -# Bug report program that reports the build and linked library versions -x52bugreport_SOURCES = bugreport/bugreport.c -x52bugreport_CFLAGS = \ - -I$(top_srcdir)/libx52io \ - @LIBUSB_CFLAGS@ \ - @HIDAPI_CFLAGS@ \ - $(WARN_CFLAGS) - -x52bugreport_LDFLAGS = \ - @LIBUSB_LIBS@ \ - @HIDAPI_LIBS@ \ - $(WARN_LDFLAGS) - -x52bugreport_LDADD = libx52io.la - -$(x52bugreport_OBJECTS): version-info.h - -EXTRA_DIST += bugreport/bugreport.dox diff --git a/bugreport/bugreport.c b/bugreport/bugreport.c index 3e1ce7a..230b672 100644 --- a/bugreport/bugreport.c +++ b/bugreport/bugreport.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -14,7 +14,7 @@ #include "libusb.h" #include "hidapi.h" -#include "libx52io.h" +#include #include "version-info.h" static void print_sysinfo(void) diff --git a/cli/Makefile.am b/cli/Makefile.am deleted file mode 100644 index 25df2f1..0000000 --- a/cli/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# Automake for x52cli -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -bin_PROGRAMS += x52cli - -# Command line utility that front ends the core library -x52cli_SOURCES = cli/x52_cli.c -x52cli_CFLAGS = -I $(top_srcdir)/libx52 $(WARN_CFLAGS) -x52cli_LDFLAGS = $(WARN_LDFLAGS) -x52cli_LDADD = libx52.la - -if HAVE_CMOCKA -TESTS += test-cli -check_PROGRAMS += test-cli - -test_cli_SOURCES = cli/x52_cli.c cli/test_x52_cli.c -test_cli_CFLAGS = @CMOCKA_CFLAGS@ -DX52_CLI_TESTING -I $(top_srcdir)/libx52 -test_cli_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS) - -# Add a dependency on test_x52_cli_tests.c -cli/test_x52_cli.c: cli/test_x52_cli_tests.c -endif - -EXTRA_DIST += cli/test_x52_cli_tests.c diff --git a/cli/test_x52_cli.c b/cli/test_x52_cli.c index 4aee744..cea227e 100644 --- a/cli/test_x52_cli.c +++ b/cli/test_x52_cli.c @@ -12,7 +12,7 @@ #include #include -#include "libx52.h" +#include extern int run_main(int argc, char **argv); diff --git a/cli/x52_cli.c b/cli/x52_cli.c index d44365a..66cc83c 100644 --- a/cli/x52_cli.c +++ b/cli/x52_cli.c @@ -150,7 +150,7 @@ possibly through \b sudo(8) */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include @@ -158,7 +158,7 @@ possibly through \b sudo(8) #include #include -#include "libx52.h" +#include struct string_map { const char *key; diff --git a/configure.ac b/configure.ac deleted file mode 100644 index c2d2ffc..0000000 --- a/configure.ac +++ /dev/null @@ -1,153 +0,0 @@ -# Autoconf settings for libx52 -# -# Copyright (C) 2012-2021 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -AC_INIT([libx52], [m4_esyscmd_s([cat ./Version])], [nirenjan@gmail.com]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) -AC_REQUIRE_AUX_FILE([tap-driver.sh]) -AC_PROG_CC -AC_PROG_CC_STDC -AC_PROG_AWK -AC_PROG_SED -AC_PROG_MKDIR_P -AM_PROG_AR -AM_PATH_PYTHON([3.5]) -LT_INIT -PKG_PROG_PKG_CONFIG -PKG_INSTALLDIR -AX_COMPILER_FLAGS -VISIBILITY_CFLAGS= -if test "x$GCC" = xyes; then - VISIBILITY_CFLAGS="-fvisibility=hidden" -fi -AC_SUBST([VISIBILITY_CFLAGS]) -AC_CANONICAL_HOST -AX_GCC_FUNC_ATTRIBUTE([constructor]) -AX_GCC_FUNC_ATTRIBUTE([destructor]) -AX_GCC_FUNC_ATTRIBUTE([format]) -AX_GCC_FUNC_ATTRIBUTE([noreturn]) -AC_C_TYPEOF - -AC_MSG_NOTICE([Detected host OS is ${host_os}]) -build_linux=no -# Detect target system -case "${host_os}" in - linux*) - build_linux=yes - ;; -esac -AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes"]) - -# Internationalization -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.19) -AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" == "xyes"]) - -# Check for libusb-1.0 -PKG_CHECK_MODULES([LIBUSB], [libusb-1.0]) -AC_SUBST([LIBUSB_PC], [libusb-1.0]) - -# systemd support -PKG_CHECK_MODULES([SYSTEMD], [systemd], [have_systemd=yes], [have_systemd=no]) -AC_ARG_ENABLE([systemd], - [AS_HELP_STRING([--disable-systemd], [Disable systemd support])] -) -AC_ARG_WITH([systemdsystemunitdir], - [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd unit files])], - [systemdsystemunitdir=$withval], - [systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)] -) -AC_SUBST([systemdsystemunitdir], [$systemdsystemunitdir]) -AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes" -a "x$enable_systemd" != "xno"]) -AM_COND_IF([HAVE_SYSTEMD],, - [ - AC_MSG_NOTICE([systemd not found or disabled. Enabling timestamps in logs]) - AX_APPEND_FLAG([-DPINELOG_SHOW_DATE=1], [PINELOG_CFLAGS]) - ] -) - -# evdev support -# This is only on Linux machines, so we need to set an automake conditional -PKG_CHECK_MODULES([EVDEV], [libevdev], [have_evdev=yes], [have_evdev=no]) -AM_CONDITIONAL([HAVE_EVDEV], [test "x$have_evdev" = "xyes"]) - -# Pinelog configuration -AX_APPEND_FLAG([-DPINELOG_SHOW_LEVEL=1], [PINELOG_CFLAGS]) -AX_APPEND_FLAG([-DPINELOG_SHOW_BACKTRACE=1], [PINELOG_CFLAGS]) -AX_APPEND_FLAG([-DPINELOG_BUFFER_SZ=1024], [PINELOG_CFLAGS]) -AC_SUBST([PINELOG_CFLAGS]) - -# Check for hidapi. This uses a different pkg-config file on Linux vs other -# hosts, so check accordingly -AM_COND_IF([LINUX], [hidapi_backend=hidapi-hidraw], [hidapi_backend=hidapi]) -PKG_CHECK_MODULES([HIDAPI], [${hidapi_backend}]) -AC_SUBST([HIDAPI_PC], [${hidapi_backend}]) - -# Check for inih library, this is now packaged with recent distros -PKG_CHECK_MODULES([INIH], [inih]) - -# Check for pthreads -ACX_PTHREAD - -# make distcheck doesn't work if some files are installed outside $prefix. -# Check for a prefix ending in /_inst, if this is found, we can assume this -# to be a make distcheck, and disable some of the installcheck stuff. -AS_CASE([$prefix], [*/_inst], - [AC_MSG_NOTICE([[Prefix ends in /_inst; this looks like a 'make distcheck']]) - is_make_distcheck=yes]) -AM_CONDITIONAL([IS_MAKE_DISTCHECK], [test "x$is_make_distcheck" = xyes]) -AC_MSG_CHECKING([final decision IS_MAKE_DISTCHECK (running "make distcheck"?)]) -AM_COND_IF([IS_MAKE_DISTCHECK], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -# udev support -PKG_CHECK_MODULES([UDEV], [udev], [have_udev=yes], [have_udev=no]) -AM_CONDITIONAL([HAVE_UDEV], [test "x$have_udev" = xyes]) -AC_ARG_WITH([udevrulesdir], - AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules]), - [udevrulesdir=$withval], - [udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)"/rules.d"]) -AC_SUBST([udevrulesdir], [$udevrulesdir]) - -AC_ARG_WITH([input-group], - AS_HELP_STRING([--with-input-group=GROUP], [Group allowed to access input devices]), - [input_group=$withval], - [input_group=plugdev]) -AC_SUBST([input_group], [$input_group]) - -# Doxygen Support -AC_CHECK_PROGS([DOXYGEN], [doxygen]) -AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) -AM_COND_IF([HAVE_DOXYGEN], - [AC_CONFIG_FILES([Doxyfile])], - [AC_MSG_WARN(["Doxygen not found; continuing without doxygen support"])]) - -# cmocka unit tests -PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1], [have_cmocka=yes], [have_cmocka=no]) -AM_CONDITIONAL([HAVE_CMOCKA], [test "x$have_cmocka" = xyes]) -AM_COND_IF([HAVE_CMOCKA], [], - [AC_MSG_WARN(["cmocka not found; disabling unit test build"])]) - -# Check for the presence of tm_gmtoff in struct tm. If we have this, then we -# can use it to determine the true GMT offset -AC_CHECK_MEMBERS([struct tm.tm_gmtoff],, - [AC_MSG_WARN(["Cannot find tm_gmtoff in struct tm, using slower method"])], - [#define _GNU_SOURCE - #include - ]) - -# Configuration headers -AC_CONFIG_HEADERS([config.h]) - -AC_CONFIG_FILES([ po/Makefile.in - Makefile - subprojects/Makefile - libx52/libx52.pc - libx52io/libx52io.pc - libx52util/libx52util.pc - subprojects/pinelog/Makefile - udev/60-saitek-x52-x52pro.rules -]) -AC_OUTPUT diff --git a/daemon/Makefile.am b/daemon/Makefile.am deleted file mode 100644 index 034c33a..0000000 --- a/daemon/Makefile.am +++ /dev/null @@ -1,146 +0,0 @@ -# Automake for x52d -# -# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 -bin_PROGRAMS += x52d x52ctl - -# Service daemon that manages the X52 device -x52d_SOURCES = \ - daemon/x52d_main.c \ - daemon/x52d_config_parser.c \ - daemon/x52d_config_dump.c \ - daemon/x52d_config.c \ - daemon/x52d_device.c \ - daemon/x52d_client.c \ - daemon/x52d_clock.c \ - daemon/x52d_mouse.c \ - daemon/x52d_notify.c \ - daemon/x52d_led.c \ - daemon/x52d_command.c \ - daemon/x52d_comm_internal.c \ - daemon/x52d_comm_client.c - -x52d_CFLAGS = \ - -I $(top_srcdir) \ - -I $(top_srcdir)/libx52io \ - -I $(top_srcdir)/libx52 \ - -I $(top_srcdir)/libx52util \ - -I $(top_srcdir)/subprojects/pinelog \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ - -DLOCALEDIR=\"$(localedir)\" \ - -DLOGDIR=\"$(localstatedir)/log\" \ - -DRUNDIR=\"$(localstatedir)/run\" \ - @INIH_CFLAGS@ @PTHREAD_CFLAGS@ $(WARN_CFLAGS) - -x52d_LDFLAGS = @INIH_LIBS@ @PTHREAD_LIBS@ $(WARN_LDFLAGS) -x52d_LDADD = \ - subprojects/pinelog/libpinelog.la \ - libx52.la \ - @LTLIBINTL@ - -if HAVE_EVDEV -x52d_SOURCES += \ - daemon/x52d_io.c \ - daemon/x52d_mouse_evdev.c - -x52d_CFLAGS += -DHAVE_EVDEV @EVDEV_CFLAGS@ -x52d_LDFLAGS += @EVDEV_LIBS@ -x52d_LDADD += libx52io.la -endif - -lib_LTLIBRARIES += libx52dcomm.la - -# Client library to communicate with X52 daemon -libx52dcomm_la_SOURCES = \ - daemon/x52d_comm_client.c \ - daemon/x52d_comm_internal.c -libx52dcomm_la_CFLAGS = \ - -I $(top_srcdir) \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ - -DLOCALEDIR=\"$(localedir)\" \ - -DLOGDIR=\"$(localstatedir)/log\" \ - -DRUNDIR=\"$(localstatedir)/run\" \ - $(VISIBILITY_CFLAGS) \ - $(WARN_CFLAGS) -libx52dcomm_la_LDFLAGS = \ - -export-symbols-regex '^x52d_(dial_command|dial_notify|format_command|send_command|recv_notification)$' \ - $(WARN_LDFLAGS) - -x52include_HEADERS += daemon/x52dcomm.h - -x52ctl_SOURCES = daemon/x52ctl.c -x52ctl_CFLAGS = \ - -I $(top_srcdir) \ - $(WARN_CFLAGS) -x52ctl_LDFLAGS = $(WARN_LDFLAGS) -x52ctl_LDADD = libx52dcomm.la @LTLIBINTL@ - -x52dconfdir = @sysconfdir@/x52d -x52dconf_DATA = daemon/x52d.conf - -install-exec-hook: - $(MKDIR_P) $(DESTDIR)$(localstatedir)/log - $(MKDIR_P) $(DESTDIR)$(localstatedir)/run - -EXTRA_DIST += \ - daemon/daemon.dox \ - daemon/protocol.dox \ - daemon/x52d.service.in \ - daemon/x52d_client.h \ - daemon/x52d_clock.h \ - daemon/x52d_config.def \ - daemon/x52d_config.h \ - daemon/x52d_const.h \ - daemon/x52d_device.h \ - daemon/x52d_io.h \ - daemon/x52d_mouse.h \ - daemon/x52d_notify.h \ - daemon/x52d_command.h \ - daemon/x52dcomm.h \ - daemon/x52dcomm-internal.h \ - daemon/x52d.conf - -# Test cases -EXTRA_DIST += \ - daemon/test_daemon_comm.py \ - daemon/tests/config/args.tc \ - daemon/tests/config/clock.tc \ - daemon/tests/config/led.tc \ - daemon/tests/config/mouse.tc \ - daemon/tests/logging/error.tc \ - daemon/tests/logging/global.tc \ - daemon/tests/logging/module.tc \ - daemon/tests/cli.tc - -TESTS += daemon/test_daemon_comm.py - -if HAVE_CMOCKA -check_PROGRAMS += x52d-mouse-test - -x52d_mouse_test_SOURCES = \ - daemon/x52d_mouse_test.c \ - daemon/x52d_mouse.c -x52d_mouse_test_CFLAGS = \ - -DLOCALEDIR='"$(localedir)"' \ - -I $(top_srcdir) \ - -I $(top_srcdir)/libx52 \ - -I $(top_srcdir)/libx52io \ - -I $(top_srcdir)/subprojects/pinelog \ - $(WARN_CFLAGS) @CMOCKA_CFLAGS@ -x52d_mouse_test_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS) -x52d_mouse_test_LDADD = \ - subprojects/pinelog/libpinelog.la \ - @LTLIBINTL@ - -TESTS += x52d-mouse-test -endif - -if HAVE_SYSTEMD -if !IS_MAKE_DISTCHECK -SED_ARGS = s,%bindir%,$(bindir),g -x52d.service: daemon/x52d.service.in - $(AM_V_GEN) $(SED) -e '$(SED_ARGS)' $< > $@ -systemdsystemunit_DATA = x52d.service -endif -endif diff --git a/daemon/x52d_client.c b/daemon/client.c similarity index 98% rename from daemon/x52d_client.c rename to daemon/client.c index 5ad3998..e10260c 100644 --- a/daemon/x52d_client.c +++ b/daemon/client.c @@ -12,8 +12,8 @@ #include #include "pinelog.h" -#include "x52d_client.h" -#include "x52dcomm-internal.h" +#include +#include void x52d_client_init(int client_fd[X52D_MAX_CLIENTS]) { diff --git a/daemon/x52d_client.h b/daemon/client.h similarity index 96% rename from daemon/x52d_client.h rename to daemon/client.h index 96b7b47..875dc5d 100644 --- a/daemon/x52d_client.h +++ b/daemon/client.h @@ -12,7 +12,7 @@ #include #include -#include "x52d_const.h" +#include #define MAX_CONN (X52D_MAX_CLIENTS + 1) diff --git a/daemon/x52d_clock.c b/daemon/clock.c similarity index 97% rename from daemon/x52d_clock.c rename to daemon/clock.c index 2bb68fb..a8d7f9c 100644 --- a/daemon/x52d_clock.c +++ b/daemon/clock.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -15,10 +15,10 @@ #define PINELOG_MODULE X52D_MOD_CLOCK #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_clock.h" -#include "x52d_const.h" -#include "x52d_device.h" +#include +#include +#include +#include static bool clock_enabled = false; static int clock_primary_is_local = false; diff --git a/daemon/x52d_clock.h b/daemon/clock.h similarity index 100% rename from daemon/x52d_clock.h rename to daemon/clock.h diff --git a/daemon/x52d_comm_client.c b/daemon/comm_client.c similarity index 97% rename from daemon/x52d_comm_client.c rename to daemon/comm_client.c index 0a40c18..38e7838 100644 --- a/daemon/x52d_comm_client.c +++ b/daemon/comm_client.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include @@ -15,8 +15,8 @@ #include #include -#include "x52dcomm.h" -#include "x52dcomm-internal.h" +#include +#include static int _setup_socket(struct sockaddr_un *remote, int len) { diff --git a/daemon/x52d_comm_internal.c b/daemon/comm_internal.c similarity index 96% rename from daemon/x52d_comm_internal.c rename to daemon/comm_internal.c index 6c06de4..1a4f25e 100644 --- a/daemon/x52d_comm_internal.c +++ b/daemon/comm_internal.c @@ -6,15 +6,15 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #include -#include "x52dcomm-internal.h" -#include "x52d_const.h" +#include +#include const char * x52d_command_sock_path(const char *sock_path) { diff --git a/daemon/x52d_command.c b/daemon/command.c similarity index 98% rename from daemon/x52d_command.c rename to daemon/command.c index af83641..79c555f 100644 --- a/daemon/x52d_command.c +++ b/daemon/command.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -21,11 +21,11 @@ #define PINELOG_MODULE X52D_MOD_COMMAND #include "pinelog.h" -#include "x52d_const.h" -#include "x52d_command.h" -#include "x52d_config.h" -#include "x52d_client.h" -#include "x52dcomm-internal.h" +#include +#include +#include +#include +#include static int client_fd[X52D_MAX_CLIENTS]; diff --git a/daemon/x52d_command.h b/daemon/command.h similarity index 100% rename from daemon/x52d_command.h rename to daemon/command.h diff --git a/daemon/x52d_config.c b/daemon/config.c similarity index 95% rename from daemon/x52d_config.c rename to daemon/config.c index a5bcff7..4d8fcdf 100644 --- a/daemon/x52d_config.c +++ b/daemon/config.c @@ -6,13 +6,13 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #define PINELOG_MODULE X52D_MOD_CONFIG #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" +#include +#include static struct x52d_config x52d_config; @@ -97,7 +97,7 @@ void x52d_config_apply_immediate(const char *section, const char *key) x52d_cfg_set_ ## c_sec ## _ ## c_key(x52d_config . name); \ } else -#include "x52d_config.def" +#include // Dummy to capture the trailing else // Wrap it in braces in case tracing has been disabled { PINELOG_TRACE("Ignoring apply_immediate(%s.%s)", section, key); } @@ -108,5 +108,5 @@ void x52d_config_apply(void) #define CFG(section, key, name, parser, def) \ PINELOG_TRACE("Calling configuration callback for " #section "." #key); \ x52d_cfg_set_ ## section ## _ ## key(x52d_config . name); - #include "x52d_config.def" + #include } diff --git a/daemon/x52d_config.def b/daemon/config.def similarity index 100% rename from daemon/x52d_config.def rename to daemon/config.def diff --git a/daemon/x52d_config.h b/daemon/config.h similarity index 99% rename from daemon/x52d_config.h rename to daemon/config.h index 930f16c..d6ba410 100644 --- a/daemon/x52d_config.h +++ b/daemon/config.h @@ -12,7 +12,7 @@ #include #include #include -#include "libx52.h" +#include /** * @brief Configuration structure diff --git a/daemon/x52d_config_dump.c b/daemon/config_dump.c similarity index 96% rename from daemon/x52d_config_dump.c rename to daemon/config_dump.c index ef68c83..4e053bf 100644 --- a/daemon/x52d_config_dump.c +++ b/daemon/config_dump.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -16,9 +16,9 @@ #define PINELOG_MODULE X52D_MOD_CONFIG #include "pinelog.h" -#include "libx52.h" -#include "x52d_config.h" -#include "x52d_const.h" +#include +#include +#include // Create a pointer "name" of type "type", which stores the value of the // corresponding element within the config struct. @@ -130,7 +130,7 @@ int x52d_config_save_file(struct x52d_config *cfg, const char *cfg_file) fprintf(cfg_fp, "%s = %s\n", #key, value); \ } \ } while (0); - #include "x52d_config.def" + #include exit_dump: free(current_section); @@ -145,7 +145,7 @@ const char *x52d_config_get_param(struct x52d_config *cfg, const char *section, return type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \ } \ } while (0); - #include "x52d_config.def" + #include return NULL; } diff --git a/daemon/x52d_config_parser.c b/daemon/config_parser.c similarity index 98% rename from daemon/x52d_config_parser.c rename to daemon/config_parser.c index 1afdf1d..52776b5 100644 --- a/daemon/x52d_config_parser.c +++ b/daemon/config_parser.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -17,8 +17,8 @@ #define PINELOG_MODULE X52D_MOD_CONFIG #include "ini.h" #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" +#include +#include /* Parser function typedef */ typedef int (*parser_fn)(struct x52d_config *, size_t, const char *); @@ -142,7 +142,7 @@ static const struct config_map { parser_fn parser; size_t offset; } config_map[] = { - #include "x52d_config.def" + #include // Terminating entry {NULL, NULL, NULL, 0} @@ -195,7 +195,7 @@ int x52d_config_set_defaults(struct x52d_config *cfg) { if (rc != 0) { \ return rc; \ } - #include "x52d_config.def" + #include return 0; } diff --git a/daemon/x52d_const.h b/daemon/constants.h similarity index 100% rename from daemon/x52d_const.h rename to daemon/constants.h diff --git a/daemon/x52ctl.c b/daemon/daemon_control.c similarity index 98% rename from daemon/x52ctl.c rename to daemon/daemon_control.c index a948752..3f9606b 100644 --- a/daemon/x52ctl.c +++ b/daemon/daemon_control.c @@ -40,7 +40,7 @@ string "quit", or terminates input by using Ctrl+D. default socket. */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -48,8 +48,8 @@ string "quit", or terminates input by using Ctrl+D. #include #include -#include "x52d_const.h" -#include "x52dcomm.h" +#include +#include #define APP_NAME "x52ctl" #if HAVE_FUNC_ATTRIBUTE_NORETURN diff --git a/daemon/x52d_device.c b/daemon/device.c similarity index 96% rename from daemon/x52d_device.c rename to daemon/device.c index 7347abb..78f22db 100644 --- a/daemon/x52d_device.c +++ b/daemon/device.c @@ -6,17 +6,17 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #define PINELOG_MODULE X52D_MOD_DEVICE -#include "x52d_const.h" -#include "x52d_config.h" -#include "x52d_device.h" -#include "x52d_notify.h" -#include "libx52.h" +#include +#include +#include +#include +#include #include "pinelog.h" static libx52_device *x52_dev; diff --git a/daemon/x52d_device.h b/daemon/device.h similarity index 97% rename from daemon/x52d_device.h rename to daemon/device.h index e7f024c..f3907cd 100644 --- a/daemon/x52d_device.h +++ b/daemon/device.h @@ -9,7 +9,7 @@ #ifndef X52D_DEVICE_H #define X52D_DEVICE_H -#include "libx52.h" +#include void x52d_dev_init(void); void x52d_dev_exit(void); diff --git a/daemon/x52d_io.c b/daemon/io.c similarity index 95% rename from daemon/x52d_io.c rename to daemon/io.c index b23c866..a331f84 100644 --- a/daemon/x52d_io.c +++ b/daemon/io.c @@ -6,16 +6,16 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include -#include "x52d_const.h" -#include "x52d_config.h" -#include "x52d_io.h" -#include "x52d_mouse.h" -#include "libx52io.h" +#include +#include +#include +#include +#include #define PINELOG_MODULE X52D_MOD_IO #include "pinelog.h" diff --git a/daemon/x52d_io.h b/daemon/io.h similarity index 100% rename from daemon/x52d_io.h rename to daemon/io.h diff --git a/daemon/x52d_led.c b/daemon/led.c similarity index 94% rename from daemon/x52d_led.c rename to daemon/led.c index 4e1c848..59feec0 100644 --- a/daemon/x52d_led.c +++ b/daemon/led.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -15,9 +15,9 @@ #define PINELOG_MODULE X52D_MOD_LED #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" -#include "x52d_device.h" +#include +#include +#include #define SET_LED_STATE(led, state) \ PINELOG_TRACE("Setting LED %s state to %s (%d)", \ diff --git a/daemon/x52d_main.c b/daemon/main.c similarity index 96% rename from daemon/x52d_main.c rename to daemon/main.c index 64867e9..7330b98 100644 --- a/daemon/x52d_main.c +++ b/daemon/main.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -17,16 +17,16 @@ #include #include -#include "x52d_clock.h" -#include "x52d_const.h" -#include "x52d_config.h" -#include "x52d_device.h" -#include "x52d_io.h" -#include "x52d_mouse.h" -#include "x52d_command.h" -#include "x52d_notify.h" -#include "x52dcomm-internal.h" -#include "x52dcomm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "pinelog.h" static volatile int flag_quit; diff --git a/daemon/meson.build b/daemon/meson.build index ae8ac36..c0ad8cf 100644 --- a/daemon/meson.build +++ b/daemon/meson.build @@ -1,41 +1,47 @@ -# x52d +# x52d (dep_config_h: Meson build-config.h; private API is daemon/config.h) libx52dcomm_version = '1.0.0' libx52dcomm_sources = [ - 'x52d_comm_client.c', - 'x52d_comm_internal.c' + 'comm_client.c', + 'comm_internal.c' ] install_headers('x52dcomm.h', subdir: meson.project_name()) lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources, - dependencies: [dep_intl], + dependencies: [dep_intl, dep_config_h], version: libx52dcomm_version, c_args: sym_hidden_cargs, install: true, include_directories: includes) +pkgconfig.generate(lib_libx52dcomm, + name: 'x52dcomm', + description: 'Client library for communicating with the x52d X52 daemon.', + version: libx52dcomm_version, +) + x52d_sources = [ - 'x52d_main.c', - 'x52d_config_parser.c', - 'x52d_config_dump.c', - 'x52d_config.c', - 'x52d_device.c', - 'x52d_client.c', - 'x52d_clock.c', - 'x52d_mouse.c', - 'x52d_notify.c', - 'x52d_led.c', - 'x52d_command.c', - 'x52d_io.c', - 'x52d_mouse_handler.c', + 'main.c', + 'config_parser.c', + 'config_dump.c', + 'config.c', + 'device.c', + 'client.c', + 'clock.c', + 'mouse.c', + 'notify.c', + 'led.c', + 'command.c', + 'io.c', + 'mouse_handler.c', ] dep_threads = dependency('threads') # Comm sources are compiled into x52d (same as Autotools); libx52dcomm is only for x52ctl. x52d_linkwith = [lib_libx52, lib_vkm, lib_libx52io] -x52d_deps = [dep_pinelog, dep_inih, dep_threads, dep_math, dep_intl] +x52d_deps = [dep_pinelog, dep_inih, dep_threads, dep_math, dep_intl, dep_config_h] x52d_cflags = [] exe_x52d = executable('x52d', x52d_sources + libx52dcomm_sources, @@ -45,9 +51,9 @@ exe_x52d = executable('x52d', x52d_sources + libx52dcomm_sources, dependencies: x52d_deps, link_with: x52d_linkwith) -exe_x52ctl = executable('x52ctl', 'x52ctl.c', +exe_x52ctl = executable('x52ctl', 'daemon_control.c', install: true, - dependencies: [dep_intl], + dependencies: [dep_intl, dep_config_h], include_directories: includes, link_with: lib_libx52dcomm) @@ -57,10 +63,10 @@ install_data('x52d.conf', test('daemon-communication', files('test_daemon_comm.py')[0], depends: [exe_x52d, exe_x52ctl], protocol: 'tap') -x52d_mouse_test_sources = ['x52d_mouse_test.c', 'x52d_mouse.c'] +x52d_mouse_test_sources = ['mouse_test.c', 'mouse.c'] x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources, include_directories: includes, - dependencies: [dep_pinelog, dep_cmocka, dep_intl, dep_math]) + dependencies: [dep_pinelog, dep_cmocka, dep_intl, dep_math, dep_config_h]) test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap') diff --git a/daemon/x52d_mouse.c b/daemon/mouse.c similarity index 97% rename from daemon/x52d_mouse.c rename to daemon/mouse.c index 3dd0628..8db4d3a 100644 --- a/daemon/x52d_mouse.c +++ b/daemon/mouse.c @@ -6,16 +6,16 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #define PINELOG_MODULE X52D_MOD_MOUSE #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" -#include "x52d_mouse.h" +#include +#include +#include // Mouse speed is the delay in microseconds between subsequent mouse reports #define DEFAULT_MOUSE_DELAY 70000 diff --git a/daemon/x52d_mouse.h b/daemon/mouse.h similarity index 95% rename from daemon/x52d_mouse.h rename to daemon/mouse.h index d0f733c..e9025c7 100644 --- a/daemon/x52d_mouse.h +++ b/daemon/mouse.h @@ -10,7 +10,7 @@ #define X52D_MOUSE_H #include -#include "libx52io.h" +#include extern volatile bool mouse_isometric_mode; extern volatile int mouse_scroll_dir; diff --git a/daemon/x52d_mouse_handler.c b/daemon/mouse_handler.c similarity index 98% rename from daemon/x52d_mouse_handler.c rename to daemon/mouse_handler.c index b91c6ce..6c5c2ff 100644 --- a/daemon/x52d_mouse_handler.c +++ b/daemon/mouse_handler.c @@ -6,21 +6,21 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #include #include -#include "libx52io.h" -#include "vkm.h" +#include +#include #define PINELOG_MODULE X52D_MOD_MOUSE #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" -#include "x52d_mouse.h" +#include +#include +#include static pthread_t mouse_thr; static bool mouse_thr_enabled = false; diff --git a/daemon/x52d_mouse_test.c b/daemon/mouse_test.c similarity index 94% rename from daemon/x52d_mouse_test.c rename to daemon/mouse_test.c index 71c031c..6cbe407 100644 --- a/daemon/x52d_mouse_test.c +++ b/daemon/mouse_test.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -15,9 +15,9 @@ #define PINELOG_MODULE X52D_MOD_MOUSE #include "pinelog.h" -#include "x52d_config.h" -#include "x52d_const.h" -#include "x52d_mouse.h" +#include +#include +#include /* Stub for handler */ void x52d_mouse_thread_control(bool enabled) @@ -44,7 +44,7 @@ static void test_mouse_thread_disabled(void **state) x52d_cfg_set_Mouse_Enabled(false); } -/* The following tests are dependent on the values in x52d_mouse.c */ +/* The following tests are dependent on the values in mouse.c */ static void test_mouse_speed_negative(void **state) { (void)state; diff --git a/daemon/x52d_notify.c b/daemon/notify.c similarity index 97% rename from daemon/x52d_notify.c rename to daemon/notify.c index 4853bd8..8f74e9d 100644 --- a/daemon/x52d_notify.c +++ b/daemon/notify.c @@ -13,11 +13,11 @@ #define PINELOG_MODULE X52D_MOD_NOTIFY #include "pinelog.h" -#include "x52d_const.h" -#include "x52d_notify.h" -#include "x52d_client.h" -#include "x52dcomm.h" -#include "x52dcomm-internal.h" +#include +#include +#include +#include +#include static pthread_t notify_thr; static pthread_t notify_listen; diff --git a/daemon/x52d_notify.h b/daemon/notify.h similarity index 100% rename from daemon/x52d_notify.h rename to daemon/notify.h diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index baf0162..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Automake for documentation -# -# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -EXTRA_DIST += \ - docs/main.dox \ - docs/caveats.dox \ - docs/integration.dox diff --git a/docs/design/libusbx52.md b/docs/design/libusbx52.md index 3dc56ce..1cef19a 100644 --- a/docs/design/libusbx52.md +++ b/docs/design/libusbx52.md @@ -13,10 +13,9 @@ up the list of devices manually and simulate various scenarios. # Design Overview -Unfortunately, the automake infrastructure does not support the use of -LD_PRELOAD because it is deemed "non-portable" in the automake sense. As a -result, this is now up to a test runner application to implement a method to -control the data passed between two processes. +The build system does not wire up `LD_PRELOAD` for this library: using it is +left to the test runner, which must arrange for the stub to be preloaded and +control the data passed between processes. # Data Structures diff --git a/docs/integration.dox b/docs/integration.dox index 53ace1c..4b29ba4 100644 --- a/docs/integration.dox +++ b/docs/integration.dox @@ -11,7 +11,7 @@ to a supported joystick. This function must be called after \ref libx52_init Example Initialization/Deinitialization Code @code{.c} -#include +#include libx52_device* init_libx52(void) { diff --git a/docs/main.dox b/docs/main.dox index fd2a4e4..9729476 100644 --- a/docs/main.dox +++ b/docs/main.dox @@ -45,10 +45,10 @@ with your application. See the documentation for the following files for a complete list of all functions. -- libx52.h -- libx52io.h -- libx52util.h -- vkm.h -- x52dcomm.h +- libx52/libx52.h +- libx52/libx52io.h +- libx52/libx52util.h +- vkm/vkm.h +- libx52/x52dcomm.h */ diff --git a/evtest/Makefile.am b/evtest/Makefile.am deleted file mode 100644 index c5722d2..0000000 --- a/evtest/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# Automake for x52evtest -# -# Copyright (C) 2012-2020 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -bin_PROGRAMS += x52evtest - -# Event test utility that works similarly to the Linux evtest -x52evtest_SOURCES = evtest/ev_test.c -x52evtest_CFLAGS = -I $(top_srcdir)/libx52io -I $(top_srcdir) -DLOCALEDIR=\"$(localedir)\" $(WARN_CFLAGS) -x52evtest_LDFLAGS = $(WARN_LDFLAGS) -x52evtest_LDADD = libx52io.la diff --git a/evtest/ev_test.c b/evtest/ev_test.c index 76fb607..45962ff 100644 --- a/evtest/ev_test.c +++ b/evtest/ev_test.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -17,7 +17,7 @@ #include #include -#include "libx52io.h" +#include #include "gettext.h" /* diff --git a/joytest/Makefile.am b/joytest/Makefile.am deleted file mode 100644 index cf87f71..0000000 --- a/joytest/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# Automake for x52test -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -bin_PROGRAMS += x52test - -# Test utility that exercises all the library functions -x52test_SOURCES = \ - joytest/x52_test.c \ - joytest/x52_test_mfd.c \ - joytest/x52_test_led.c \ - joytest/x52_test_clock.c -x52test_CFLAGS = -I $(top_srcdir)/libx52 -I $(top_srcdir) -DLOCALEDIR=\"$(localedir)\" $(WARN_CFLAGS) -x52test_LDFLAGS = $(WARN_LDFLAGS) -x52test_LDADD = libx52.la - -# Extra files that need to be in the distribution -EXTRA_DIST += joytest/x52_test_common.h diff --git a/joytest/x52_test.c b/joytest/x52_test.c index 1a8507a..3c06522 100644 --- a/joytest/x52_test.c +++ b/joytest/x52_test.c @@ -7,7 +7,7 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include @@ -15,7 +15,7 @@ #include #include -#include "libx52.h" +#include #include "x52_test_common.h" libx52_device *dev; int test_exit; diff --git a/joytest/x52_test_clock.c b/joytest/x52_test_clock.c index c0371e7..1eedbde 100644 --- a/joytest/x52_test_clock.c +++ b/joytest/x52_test_clock.c @@ -7,13 +7,13 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include #include -#include "libx52.h" +#include #include "x52_test_common.h" int test_clock(void) diff --git a/joytest/x52_test_common.h b/joytest/x52_test_common.h index d72f3fb..9096364 100644 --- a/joytest/x52_test_common.h +++ b/joytest/x52_test_common.h @@ -9,10 +9,10 @@ #ifndef X52_TEST_COMMON_H #define X52_TEST_COMMON_H -#include "config.h" +#include "build-config.h" #include #include -#include "libx52.h" +#include #include "gettext.h" extern libx52_device *dev; diff --git a/joytest/x52_test_led.c b/joytest/x52_test_led.c index 9bd28af..330ebd8 100644 --- a/joytest/x52_test_led.c +++ b/joytest/x52_test_led.c @@ -7,12 +7,12 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include -#include "libx52.h" +#include #include "x52_test_common.h" #define TEST_LED(name, state) do { \ diff --git a/joytest/x52_test_mfd.c b/joytest/x52_test_mfd.c index dc68736..a62c13b 100644 --- a/joytest/x52_test_mfd.c +++ b/joytest/x52_test_mfd.c @@ -7,12 +7,12 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include -#include "libx52.h" +#include #include "x52_test_common.h" #define TEST_BRIGHTNESS(mfd, value) TEST(brightness, mfd, value) diff --git a/kernel_module/README.md b/kernel_module/README.md index e09bc4a..9d452ed 100644 --- a/kernel_module/README.md +++ b/kernel_module/README.md @@ -18,8 +18,7 @@ and therefore, do not require this driver. # Building -This directory is deliberately not integrated with the top level Autotools -based build framework. +This directory is deliberately not integrated with the top-level Meson build. Install the Linux headers for the currently running kernel. On Ubuntu, this can be done by running `sudo apt-get install -y linux-headers-$(uname -r)`. diff --git a/libusbx52/Makefile.am b/libusbx52/Makefile.am deleted file mode 100644 index 1f82b6f..0000000 --- a/libusbx52/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Automake for libusbx52 and associated utilities -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -# libusb stub library for use by test programs -check_LTLIBRARIES += libusbx52.la - -libusbx52_la_SOURCES = libusbx52/usb_x52_stub.c libusbx52/fopen_env.c -libusbx52_la_CFLAGS = -I $(top_srcdir)/libusbx52 @LIBUSB_CFLAGS@ $(WARN_CFLAGS) -libusbx52_la_LDFLAGS = -rpath /nowhere -module $(WARN_LDFLAGS) - -# Utility programs for use by tests -check_PROGRAMS += x52test_create_device_list x52test_log_actions - -x52test_create_device_list_SOURCES = libusbx52/util/create_device_list.c $(libusbx52_la_SOURCES) -x52test_create_device_list_CFLAGS = $(libusbx52_la_CFLAGS) -x52test_create_device_list_LDFLAGS = $(WARN_LDFLAGS) - -x52test_log_actions_SOURCES = libusbx52/util/log_actions.c $(libusbx52_la_SOURCES) -x52test_log_actions_CFLAGS = -I $(top_srcdir)/libx52 $(libusbx52_la_CFLAGS) -x52test_log_actions_LDFLAGS = $(WARN_LDFLAGS) - -EXTRA_DIST += libusbx52/README.md libusbx52/libusbx52.h diff --git a/libusbx52/usb_x52_stub.c b/libusbx52/usb_x52_stub.c index e7e688b..59bed06 100644 --- a/libusbx52/usb_x52_stub.c +++ b/libusbx52/usb_x52_stub.c @@ -7,7 +7,7 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include diff --git a/libusbx52/util/log_actions.c b/libusbx52/util/log_actions.c index 44e43ac..0d9e6bc 100644 --- a/libusbx52/util/log_actions.c +++ b/libusbx52/util/log_actions.c @@ -15,7 +15,7 @@ #include #include #include "libusbx52.h" -#include "x52_commands.h" +#include "commands.h" libusb_context *global_context; diff --git a/libx52/Makefile.am b/libx52/Makefile.am deleted file mode 100644 index 1b8cbe8..0000000 --- a/libx52/Makefile.am +++ /dev/null @@ -1,74 +0,0 @@ -# Automake for libx52 -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -lib_LTLIBRARIES += libx52.la - -# Core libx52 library -# This library handles the USB communication between the host and the X52 -# Libtool Version Info -# See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -libx52_v_CUR=6 -libx52_v_AGE=4 -libx52_v_REV=2 -libx52_la_SOURCES = \ - libx52/x52_control.c \ - libx52/x52_core.c \ - libx52/x52_date_time.c \ - libx52/x52_mfd_led.c \ - libx52/x52_strerror.c \ - libx52/x52_stringify.c -libx52_la_CFLAGS = \ - @LIBUSB_CFLAGS@ \ - -DLOCALEDIR=\"$(localedir)\" \ - -I $(top_srcdir) \ - $(VISIBILITY_CFLAGS) \ - $(WARN_CFLAGS) -libx52_la_LDFLAGS = \ - -export-symbols-regex '^libx52_' \ - -version-info $(libx52_v_CUR):$(libx52_v_REV):$(libx52_v_AGE) @LIBUSB_LIBS@ \ - $(WARN_LDFLAGS) -libx52_la_LIBADD = @LTLIBINTL@ - -# Header files that need to be copied -x52include_HEADERS += libx52/libx52.h - -# pkg-config files -pkgconfig_DATA += libx52/libx52.pc - -if HAVE_CMOCKA -TESTS += libx52test libx52-string-test -check_PROGRAMS += libx52test libx52-string-test - -nodist_libx52test_SOURCES = libx52/test_libx52.c -libx52test_SOURCES = $(libx52_la_SOURCES) -libx52test_CFLAGS = @CMOCKA_CFLAGS@ @LIBUSB_CFLAGS@ -DLOCALEDIR='"$(localedir)"' -I $(top_srcdir) -I $(top_srcdir)/libx52 -libx52test_CFLAGS += -Dlibusb_control_transfer=__wrap_libusb_control_transfer -libx52test_LDFLAGS = @CMOCKA_LIBS@ @LIBUSB_LIBS@ -libx52test_LDADD = libx52.la - -CLEANFILES += libx52/test_libx52.c -test_libx52_c_DEPENDS = \ - $(srcdir)/libx52/x52_test_gen.py \ - $(srcdir)/libx52/x52_tests.json - -libx52/test_libx52.c: $(test_libx52_c_DEPENDS) - $(AM_V_GEN) $(PYTHON) $(test_libx52_c_DEPENDS) > $@ - -libx52_string_test_SOURCES = \ - libx52/test_strings.c \ - libx52/x52_stringify.c \ - libx52/x52_strerror.c -libx52_string_test_CFLAGS = @CMOCKA_CFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/libx52 -libx52_string_test_LDFLAGS = @CMOCKA_LIBS@ -libx52_string_test_LDADD = libx52.la -endif - -# Extra files that need to be in the distribution -EXTRA_DIST += \ - libx52/libx52.h libx52/x52_commands.h libx52/x52_common.h libx52/README.md - -# Add test files to the distribution -EXTRA_DIST += libx52/x52_test_gen.py libx52/x52_tests.json diff --git a/libx52/x52_commands.h b/libx52/commands.h similarity index 100% rename from libx52/x52_commands.h rename to libx52/commands.h diff --git a/libx52/x52_common.h b/libx52/common.h similarity index 99% rename from libx52/x52_common.h rename to libx52/common.h index b40f449..918f002 100644 --- a/libx52/x52_common.h +++ b/libx52/common.h @@ -12,7 +12,7 @@ #include #include #include -#include "libx52.h" +#include /* * The X52 MFD supports the following: diff --git a/libx52/x52_control.c b/libx52/control.c similarity index 99% rename from libx52/x52_control.c rename to libx52/control.c index 5c85f6e..cd9a427 100644 --- a/libx52/x52_control.c +++ b/libx52/control.c @@ -6,16 +6,16 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #include #include -#include "libx52.h" -#include "x52_commands.h" -#include "x52_common.h" +#include +#include "commands.h" +#include "common.h" /* Translate a libusb error to a libx52 error */ int _x52_translate_libusb_error(enum libusb_error errcode) diff --git a/libx52/x52_core.c b/libx52/core.c similarity index 98% rename from libx52/x52_core.c rename to libx52/core.c index c6f84d8..cd61c06 100644 --- a/libx52/x52_core.c +++ b/libx52/core.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include @@ -14,9 +14,9 @@ #include #include "usb-ids.h" -#include "libx52.h" -#include "x52_commands.h" -#include "x52_common.h" +#include +#include "commands.h" +#include "common.h" #include "gettext.h" /* Check if the USB device is supported by this library */ diff --git a/libx52/x52_date_time.c b/libx52/date_time.c similarity index 98% rename from libx52/x52_date_time.c rename to libx52/date_time.c index abb40a6..fee1de6 100644 --- a/libx52/x52_date_time.c +++ b/libx52/date_time.c @@ -7,16 +7,16 @@ */ #define _GNU_SOURCE -#include "config.h" +#include "build-config.h" #include #include #include #include #include -#include "libx52.h" -#include "x52_commands.h" -#include "x52_common.h" +#include +#include "commands.h" +#include "common.h" #if !HAVE_STRUCT_TM_TM_GMTOFF /* Slow method to compute GMT offset */ diff --git a/libx52/libx52.pc.in b/libx52/libx52.pc.in deleted file mode 100644 index fd787f9..0000000 --- a/libx52/libx52.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libx52 -Description: Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality. -Version: 2.4.0 -Libs: -L${libdir} -lx52 -Cflags: -I${includedir}/libx52 -Requires.private: @LIBUSB_PC@ diff --git a/libx52/libx52io.h b/libx52/libx52io.h new file mode 120000 index 0000000..55b8da8 --- /dev/null +++ b/libx52/libx52io.h @@ -0,0 +1 @@ +../libx52io/libx52io.h \ No newline at end of file diff --git a/libx52/libx52util.h b/libx52/libx52util.h new file mode 120000 index 0000000..f841f6d --- /dev/null +++ b/libx52/libx52util.h @@ -0,0 +1 @@ +../libx52util/libx52util.h \ No newline at end of file diff --git a/libx52/meson.build b/libx52/meson.build index d90f83a..f11cd56 100644 --- a/libx52/meson.build +++ b/libx52/meson.build @@ -1,12 +1,12 @@ libx52_version = '2.4.2' libx52_files = files( - 'x52_control.c', - 'x52_core.c', - 'x52_date_time.c', - 'x52_mfd_led.c', - 'x52_strerror.c', - 'x52_stringify.c', + 'control.c', + 'core.c', + 'date_time.c', + 'mfd_led.c', + 'strerror.c', + 'stringify.c', ) lib_libx52 = library('x52', libx52_files, @@ -20,14 +20,13 @@ install_headers('libx52.h', subdir: meson.project_name()) pkgconfig.generate(lib_libx52, name: 'libx52', description: 'Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality.', - subdirs: meson.project_name(), version: libx52_version) # Unit tests for libx52 libx52_string_test = executable('libx52-string-test', 'test_strings.c', - 'x52_stringify.c', - 'x52_strerror.c', + 'stringify.c', + 'strerror.c', build_by_default: false, dependencies: [dep_cmocka, dep_intl], link_with: [lib_libx52], diff --git a/libx52/x52_mfd_led.c b/libx52/mfd_led.c similarity index 99% rename from libx52/x52_mfd_led.c rename to libx52/mfd_led.c index 80d5cbd..82ed197 100644 --- a/libx52/x52_mfd_led.c +++ b/libx52/mfd_led.c @@ -6,14 +6,14 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include #include #include -#include "x52_common.h" +#include "common.h" int libx52_set_text(libx52_device *x52, uint8_t line, const char *text, uint8_t length) { diff --git a/libx52/x52_strerror.c b/libx52/strerror.c similarity index 97% rename from libx52/x52_strerror.c rename to libx52/strerror.c index 3f48d5f..1c16681 100644 --- a/libx52/x52_strerror.c +++ b/libx52/strerror.c @@ -6,10 +6,10 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include -#include "libx52.h" +#include #include "gettext.h" #define N_(str) gettext_noop(str) diff --git a/libx52/x52_stringify.c b/libx52/stringify.c similarity index 97% rename from libx52/x52_stringify.c rename to libx52/stringify.c index 6470bfa..5bbff8b 100644 --- a/libx52/x52_stringify.c +++ b/libx52/stringify.c @@ -6,10 +6,10 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include -#include "libx52.h" +#include #include "gettext.h" #define N_(str) gettext_noop(str) diff --git a/libx52/test_strings.c b/libx52/test_strings.c index 7635f20..c15ef76 100644 --- a/libx52/test_strings.c +++ b/libx52/test_strings.c @@ -13,7 +13,7 @@ #include #include -#include "libx52.h" +#include #define TEST_STRINGIFY(name) do { \ char expected[256]; \ diff --git a/libx52/x52_test_gen.py b/libx52/x52_test_gen.py index 5a44eb5..61f0062 100755 --- a/libx52/x52_test_gen.py +++ b/libx52/x52_test_gen.py @@ -18,7 +18,7 @@ _TEST_FILE_HEADER = """/* #include #include -#include "x52_common.h" +#include "common.h" static int group_setup(void **state) { diff --git a/libx52/x52dcomm.h b/libx52/x52dcomm.h new file mode 120000 index 0000000..ba01270 --- /dev/null +++ b/libx52/x52dcomm.h @@ -0,0 +1 @@ +../daemon/x52dcomm.h \ No newline at end of file diff --git a/libx52io/Makefile.am b/libx52io/Makefile.am deleted file mode 100644 index 0ff382a..0000000 --- a/libx52io/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -# Automake for libx52io -# -# Copyright (C) 2012-2020 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -lib_LTLIBRARIES += libx52io.la - -# X52 IO library -# This library handles the HID parsing of the X52 USB reports -# Libtool Version Info -# See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -libx52io_v_CUR=1 -libx52io_v_AGE=0 -libx52io_v_REV=0 -libx52io_la_SOURCES = \ - libx52io/io_core.c \ - libx52io/io_axis.c \ - libx52io/io_parser.c \ - libx52io/io_strings.c \ - libx52io/io_device.c -libx52io_la_CFLAGS = @HIDAPI_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" -I $(top_srcdir) $(VISIBILITY_CFLAGS) $(WARN_CFLAGS) -libx52io_la_LDFLAGS = \ - -export-symbols-regex '^libx52io_' \ - -version-info $(libx52io_v_CUR):$(libx52io_v_REV):$(libx52io_v_AGE) @HIDAPI_LIBS@ \ - $(WARN_LDFLAGS) -libx52io_la_LIBADD = @LTLIBINTL@ - -# Header files that need to be copied -x52include_HEADERS += libx52io/libx52io.h - -# pkg-config files -pkgconfig_DATA += libx52io/libx52io.pc - -if HAVE_CMOCKA -TESTS += test-axis test-parser -check_PROGRAMS += test-axis test-parser - -test_axis_SOURCES = libx52io/test_axis.c $(libx52io_la_SOURCES) -test_axis_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS) -test_axis_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS) -test_axis_LDADD = @LTLIBINTL@ - -test_parser_SOURCES = libx52io/test_parser.c $(libx52io_la_SOURCES) -test_parser_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS) -test_parser_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS) -test_parser_LDADD = @LTLIBINTL@ - -# Add a dependency on test_parser_tests.c -libx52io/test_parser.c: libx52io/test_parser_tests.c -endif - -# Extra files that need to be in the distribution -EXTRA_DIST += \ - libx52io/libx52io.h \ - libx52io/io_common.h \ - libx52io/test_parser_tests.c diff --git a/libx52io/io_axis.c b/libx52io/axis.c similarity index 98% rename from libx52io/io_axis.c rename to libx52io/axis.c index b54a5da..d19eab4 100644 --- a/libx52io/io_axis.c +++ b/libx52io/axis.c @@ -7,7 +7,7 @@ */ #include -#include "io_common.h" +#include "common.h" #include "usb-ids.h" static const int32_t axis_min[] = { diff --git a/libx52io/io_common.h b/libx52io/common.h similarity index 97% rename from libx52io/io_common.h rename to libx52io/common.h index d46ad77..03b4dae 100644 --- a/libx52io/io_common.h +++ b/libx52io/common.h @@ -10,7 +10,7 @@ #define IO_COMMON_H #include -#include "libx52io.h" +#include #include "hidapi.h" // Function handler for parsing reports diff --git a/libx52io/io_core.c b/libx52io/core.c similarity index 97% rename from libx52io/io_core.c rename to libx52io/core.c index 81f3ebe..33cf8ab 100644 --- a/libx52io/io_core.c +++ b/libx52io/core.c @@ -6,10 +6,10 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include -#include "io_common.h" +#include "common.h" #include "usb-ids.h" #include "gettext.h" diff --git a/libx52io/io_device.c b/libx52io/device.c similarity index 98% rename from libx52io/io_device.c rename to libx52io/device.c index 4ba4c2d..5da4bd7 100644 --- a/libx52io/io_device.c +++ b/libx52io/device.c @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include -#include "io_common.h" +#include "common.h" static char * _save_string(wchar_t *wcs) { diff --git a/libx52io/libx52io.pc.in b/libx52io/libx52io.pc.in deleted file mode 100644 index 1e07269..0000000 --- a/libx52io/libx52io.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libx52io -Description: Linux/Unix library to read and parse X52 input -Version: 1.0.0 -Libs: -L${libdir} -lx52io -Cflags: -I${includedir}/libx52 -Requires.private: @HIDAPI_PC@ diff --git a/libx52io/meson.build b/libx52io/meson.build index 0b08377..80d5195 100644 --- a/libx52io/meson.build +++ b/libx52io/meson.build @@ -1,11 +1,11 @@ libx52io_version = '1.1.0' libx52io_files = files( - 'io_core.c', - 'io_axis.c', - 'io_parser.c', - 'io_strings.c', - 'io_device.c', + 'core.c', + 'axis.c', + 'parser.c', + 'strings.c', + 'device.c', ) lib_libx52io = library('x52io', libx52io_files, @@ -19,7 +19,6 @@ install_headers('libx52io.h', subdir: meson.project_name()) pkgconfig.generate(lib_libx52io, name: 'libx52io', description: 'Linux/Unix library to read and parse X52 input', - subdirs: meson.project_name(), version: libx52io_version, ) diff --git a/libx52io/io_parser.c b/libx52io/parser.c similarity index 99% rename from libx52io/io_parser.c rename to libx52io/parser.c index c1291ca..5af993c 100644 --- a/libx52io/io_parser.c +++ b/libx52io/parser.c @@ -7,7 +7,7 @@ */ #include -#include "io_common.h" +#include "common.h" #include "usb-ids.h" static void map_hat(uint8_t hat, libx52io_report *report) diff --git a/libx52io/io_strings.c b/libx52io/strings.c similarity index 99% rename from libx52io/io_strings.c rename to libx52io/strings.c index 3ae3d04..cbd58a5 100644 --- a/libx52io/io_strings.c +++ b/libx52io/strings.c @@ -6,10 +6,10 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include -#include "libx52io.h" +#include #include "gettext.h" /* The strings corresponding to the axis and button enumerations are diff --git a/libx52io/test_axis.c b/libx52io/test_axis.c index 3dc3998..98ad535 100644 --- a/libx52io/test_axis.c +++ b/libx52io/test_axis.c @@ -11,7 +11,7 @@ #include #include -#include "io_common.h" +#include "common.h" #include "usb-ids.h" static int group_setup(void **state) diff --git a/libx52io/test_io_strings.c b/libx52io/test_io_strings.c index 128b1af..7fd7a52 100644 --- a/libx52io/test_io_strings.c +++ b/libx52io/test_io_strings.c @@ -11,7 +11,7 @@ #include #include -#include "libx52io.h" +#include static void lower_ascii_only(char *dst, const char *src) { diff --git a/libx52io/test_parser.c b/libx52io/test_parser.c index 0e804a4..8c9a17a 100644 --- a/libx52io/test_parser.c +++ b/libx52io/test_parser.c @@ -12,7 +12,7 @@ #include #include -#include "io_common.h" +#include "common.h" #include "usb-ids.h" static int group_setup(void **state) diff --git a/libx52util/Makefile.am b/libx52util/Makefile.am deleted file mode 100644 index d47533e..0000000 --- a/libx52util/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# Automake for libx52util -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -lib_LTLIBRARIES += libx52util.la - -# libx52 utility library -# This library provides extra utilities for ease of use -nodist_libx52util_la_SOURCES = libx52util/util_char_map.c -libx52util_la_SOURCES = libx52util/x52_char_map_lookup.c -libx52util_la_CFLAGS = -I $(top_srcdir)/libx52util $(VISIBILITY_CFLAGS) $(WARN_CFLAGS) -libx52util_la_LDFLAGS = \ - -export-symbols-regex '^libx52util_' \ - -version-info 1:1:0 \ - $(WARN_LDFLAGS) - -# Header files that need to be copied -x52include_HEADERS += libx52util/libx52util.h - -# pkg-config files -pkgconfig_DATA += libx52util/libx52util.pc - -# Autogenerated file that needs to be cleaned up -char_map_TARGETS = \ - libx52util/util_char_map.c \ - libx52util/x52_char_map.bin - -CLEANFILES += $(char_map_TARGETS) - -char_map_DEPENDS = \ - $(srcdir)/libx52util/x52_char_map_gen.py \ - $(srcdir)/libx52util/x52_char_map.cfg - -$(char_map_TARGETS): $(char_map_DEPENDS) - $(AM_V_GEN) $(PYTHON) $(char_map_DEPENDS) $(char_map_TARGETS) - -TESTS += libx52util/test-runner.sh - -check_PROGRAMS += libx52util-bmp-test -libx52util_bmp_test_SOURCES = libx52util/x52_char_map_test.c -libx52util_bmp_test_CFLAGS = -I $(top_srcdir)/libx52util -libx52util_bmp_test_LDADD = libx52util.la - -# Extra files that need to be in the distribution -EXTRA_DIST += libx52util/x52_char_map.cfg \ - libx52util/x52_char_map.h \ - libx52util/x52_char_map_gen.py - diff --git a/libx52util/x52_char_map.h b/libx52util/char_map.h similarity index 78% rename from libx52util/x52_char_map.h rename to libx52util/char_map.h index 3abe175..dd9405f 100644 --- a/libx52util/x52_char_map.h +++ b/libx52util/char_map.h @@ -6,8 +6,8 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#ifndef X52_CHAR_MAP_H -#define X52_CHAR_MAP_H +#ifndef CHAR_MAP_H +#define CHAR_MAP_H #include #include @@ -15,4 +15,4 @@ extern const uint16_t *root_table[256]; extern const uint8_t *sequence_table[]; -#endif /* !defined X52_CHAR_MAP_H */ +#endif /* !defined CHAR_MAP_H */ diff --git a/libx52util/x52_char_map_lookup.c b/libx52util/char_map_lookup.c similarity index 98% rename from libx52util/x52_char_map_lookup.c rename to libx52util/char_map_lookup.c index 1217577..a486f4d 100644 --- a/libx52util/x52_char_map_lookup.c +++ b/libx52util/char_map_lookup.c @@ -9,13 +9,13 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include #include -#include "libx52util.h" -#include "x52_char_map.h" +#include +#include "char_map.h" /** * @brief Converts a UTF8 stream to a uint32_t diff --git a/libx52util/x52_char_map_test.c b/libx52util/char_map_test.c similarity index 99% rename from libx52util/x52_char_map_test.c rename to libx52util/char_map_test.c index 97fc2e1..40b0264 100644 --- a/libx52util/x52_char_map_test.c +++ b/libx52util/char_map_test.c @@ -16,7 +16,7 @@ #include #include -#include "libx52util.h" +#include // Fix this if we ever hit longer sequences #define RECORD_SIZE 8 diff --git a/libx52util/libx52util.pc.in b/libx52util/libx52util.pc.in deleted file mode 100644 index 7a7967c..0000000 --- a/libx52util/libx52util.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libx52util -Description: Extra utility functions to manage X52 extended functionality -Version: 1.0.0 -Libs: -L${libdir} -lx52util -Cflags: -I${includedir}/libx52 diff --git a/libx52util/meson.build b/libx52util/meson.build index 075f8f6..6367781 100644 --- a/libx52util/meson.build +++ b/libx52util/meson.build @@ -7,9 +7,9 @@ util_char_map = custom_target('util-char-map', depend_files: ['x52_char_map_gen.py', 'x52_char_map.cfg'], command: [python, gen_script, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'], input: 'x52_char_map.cfg', - output: ['util_char_map.c', 'x52_char_map.bin']) + output: ['char_map.c', 'char_map.bin']) -lib_libx52util = library('x52util', util_char_map, 'x52_char_map_lookup.c', +lib_libx52util = library('x52util', util_char_map, 'char_map_lookup.c', install: true, version: libx52util_version, c_args: sym_hidden_cargs, @@ -20,13 +20,12 @@ install_headers('libx52util.h', subdir: meson.project_name()) pkgconfig.generate(lib_libx52util, name: 'libx52util', description: 'Extra utility functions to manage X52 extended functionality', - subdirs: meson.project_name(), version: libx52util_version, ) libx52util_bmp_test = executable( 'libx52util-bmp-test', - 'x52_char_map_test.c', + 'char_map_test.c', build_by_default: false, include_directories: [includes, lib_libx52util.private_dir_include()], link_with: [lib_libx52util] diff --git a/libx52util/test-runner.sh b/libx52util/test-runner.sh index 226e7d5..3ac0b04 100755 --- a/libx52util/test-runner.sh +++ b/libx52util/test-runner.sh @@ -1,7 +1,7 @@ #!/bin/sh TEST_RUNNER="./libx52util-bmp-test" -TEST_BIN="./libx52util/x52_char_map.bin" +TEST_BIN="./libx52util/char_map.bin" if [ -e "${TEST_RUNNER}" ] && [ -e "${TEST_BIN}" ]; then diff --git a/meson.build b/meson.build index 7124f00..5be1135 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,7 @@ pyversion = python.language_version().split('.') assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5') ####################################################################### -# config.h +# build-config.h (Meson configuration; template is config.h.meson) ####################################################################### compiler = meson.get_compiler('c') sym_hidden_cargs = [] @@ -59,10 +59,12 @@ cdata.set10('HAVE_STRUCT_TM_TM_GMTOFF', config_h = configure_file( input: 'config.h.meson', - output: 'config.h', + output: 'build-config.h', configuration: cdata ) +dep_config_h = declare_dependency(sources: config_h) + ####################################################################### # Internationalization ####################################################################### @@ -101,11 +103,14 @@ dep_math = compiler.find_library('m', required: false) ####################################################################### # pinelog -pinelog_options = [] +pinelog_options = [ + # Keep directory prefix in __FILE__ for logs (e.g. libx52/core.c vs libx52io/core.c). + 'strip-file-path=false', +] if dep_systemd.found() and not get_option('systemd-logs').disabled() # If systemd logs is enabled or auto, and systemd is found, then hide # the timestamps in log messages - pinelog_options = ['show-date=false'] + pinelog_options += ['show-date=false'] endif sub_pinelog = subproject('pinelog', required: true, @@ -120,7 +125,7 @@ dep_inih = dependency('inih') # Shared libraries and programs ####################################################################### # Includes -includes = include_directories('.', 'libx52', 'libx52io', 'libx52util', 'vkm') +includes = include_directories('.') subdir('libx52') subdir('libx52io') diff --git a/po/POTFILES.in b/po/POTFILES.in index 39b9cc0..e49abed 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,10 +1,10 @@ # List of source files which contain translatable strings. -libx52/x52_strerror.c -libx52/x52_stringify.c +libx52/strerror.c +libx52/stringify.c -libx52io/io_strings.c +libx52io/strings.c -vkm/vkm_common.c +vkm/common.c evtest/ev_test.c @@ -14,16 +14,16 @@ joytest/x52_test_common.h joytest/x52_test_led.c joytest/x52_test_mfd.c -daemon/x52d_main.c -daemon/x52d_client.c -daemon/x52d_clock.c -daemon/x52d_command.c -daemon/x52d_config.c -daemon/x52d_config_dump.c -daemon/x52d_config_parser.c -daemon/x52d_device.c -daemon/x52d_io.c -daemon/x52d_mouse.c -daemon/x52d_mouse_handler.c -daemon/x52d_notify.c -daemon/x52ctl.c +daemon/client.c +daemon/clock.c +daemon/command.c +daemon/config.c +daemon/config_dump.c +daemon/config_parser.c +daemon/daemon_control.c +daemon/device.c +daemon/io.c +daemon/main.c +daemon/mouse.c +daemon/mouse_handler.c +daemon/notify.c diff --git a/po/README.md b/po/README.md index 6a3171e..86835c0 100644 --- a/po/README.md +++ b/po/README.md @@ -22,10 +22,11 @@ Once you add new strings to be translated, update `po/POTFILES.in` to include any new files that have to be translated. The file path is relative to the root of the project. -The next step is to rebuild the translation template `libx52.pot`. To do -this, run `make -C po update-po` from your build directory (where you ran -`configure`). This also updates any translation files (with `.po` extension) to -include the new source strings. +The next step is to rebuild the translation template `libx52.pot`. From the +repository root, run `meson compile -C build libx52-update-po` (adjust `build` +to your build directory), or `ninja -C build libx52-update-po`. This also +updates any translation files (with `.po` extension) to include the new source +strings. # Adding new languages (translators) diff --git a/po/libx52.pot b/po/libx52.pot index 605130f..79678f0 100644 --- a/po/libx52.pot +++ b/po/libx52.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libx52 0.3.3\n" "Report-Msgid-Bugs-To: https://github.com/nirenjan/libx52/issues\n" -"POT-Creation-Date: 2026-04-03 18:06-0700\n" +"POT-Creation-Date: 2026-04-03 23:44-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,247 +17,247 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: libx52/x52_strerror.c:23 libx52io/io_strings.c:196 vkm/vkm_common.c:25 +#: libx52/strerror.c:23 libx52io/strings.c:196 vkm/common.c:25 msgid "Success" msgstr "" -#: libx52/x52_strerror.c:24 libx52io/io_strings.c:197 +#: libx52/strerror.c:24 libx52io/strings.c:197 msgid "Initialization failure" msgstr "" -#: libx52/x52_strerror.c:25 +#: libx52/strerror.c:25 msgid "Insufficient memory" msgstr "" -#: libx52/x52_strerror.c:26 vkm/vkm_common.c:29 +#: libx52/strerror.c:26 vkm/common.c:29 msgid "Invalid parameter" msgstr "" -#: libx52/x52_strerror.c:27 +#: libx52/strerror.c:27 msgid "Operation not supported" msgstr "" -#: libx52/x52_strerror.c:28 +#: libx52/strerror.c:28 msgid "Try again" msgstr "" -#: libx52/x52_strerror.c:29 +#: libx52/strerror.c:29 msgid "Input parameter out of range" msgstr "" -#: libx52/x52_strerror.c:30 +#: libx52/strerror.c:30 msgid "USB transaction failure" msgstr "" -#: libx52/x52_strerror.c:31 +#: libx52/strerror.c:31 msgid "USB input/output error" msgstr "" -#: libx52/x52_strerror.c:32 +#: libx52/strerror.c:32 msgid "Access denied" msgstr "" -#: libx52/x52_strerror.c:33 +#: libx52/strerror.c:33 msgid "No such device" msgstr "" -#: libx52/x52_strerror.c:34 +#: libx52/strerror.c:34 msgid "Entity not found" msgstr "" -#: libx52/x52_strerror.c:35 +#: libx52/strerror.c:35 msgid "Resource busy" msgstr "" -#: libx52/x52_strerror.c:36 +#: libx52/strerror.c:36 msgid "Operation timeout" msgstr "" -#: libx52/x52_strerror.c:37 +#: libx52/strerror.c:37 msgid "Overflow" msgstr "" -#: libx52/x52_strerror.c:38 +#: libx52/strerror.c:38 msgid "Pipe error" msgstr "" -#: libx52/x52_strerror.c:39 +#: libx52/strerror.c:39 msgid "System call interrupted" msgstr "" -#: libx52/x52_strerror.c:66 libx52io/io_strings.c:220 vkm/vkm_common.c:52 +#: libx52/strerror.c:66 libx52io/strings.c:220 vkm/common.c:52 #, c-format msgid "Unknown error %d" msgstr "" -#: libx52/x52_stringify.c:29 +#: libx52/stringify.c:29 #, c-format msgid "Unknown clock ID %d" msgstr "" -#: libx52/x52_stringify.c:30 +#: libx52/stringify.c:30 msgid "primary" msgstr "" -#: libx52/x52_stringify.c:31 +#: libx52/stringify.c:31 msgid "secondary" msgstr "" -#: libx52/x52_stringify.c:32 +#: libx52/stringify.c:32 msgid "tertiary" msgstr "" -#: libx52/x52_stringify.c:35 +#: libx52/stringify.c:35 #, c-format msgid "Unknown clock format %d" msgstr "" -#: libx52/x52_stringify.c:36 +#: libx52/stringify.c:36 msgid "12 hour" msgstr "" -#: libx52/x52_stringify.c:37 +#: libx52/stringify.c:37 msgid "24 hour" msgstr "" -#: libx52/x52_stringify.c:40 +#: libx52/stringify.c:40 #, c-format msgid "Unknown date format %d" msgstr "" -#: libx52/x52_stringify.c:41 +#: libx52/stringify.c:41 msgid "DD-MM-YY" msgstr "" -#: libx52/x52_stringify.c:42 +#: libx52/stringify.c:42 msgid "MM-DD-YY" msgstr "" -#: libx52/x52_stringify.c:43 +#: libx52/stringify.c:43 msgid "YY-MM-DD" msgstr "" -#: libx52/x52_stringify.c:46 +#: libx52/stringify.c:46 #, c-format msgid "Unknown LED state %d" msgstr "" -#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:29 daemon/x52d_mouse.c:55 -#: daemon/x52d_mouse.c:95 daemon/x52d_mouse.c:107 +#: libx52/stringify.c:47 daemon/clock.c:29 daemon/mouse.c:55 daemon/mouse.c:95 +#: daemon/mouse.c:107 msgid "off" msgstr "" -#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:29 daemon/x52d_mouse.c:55 -#: daemon/x52d_mouse.c:95 daemon/x52d_mouse.c:107 +#: libx52/stringify.c:48 daemon/clock.c:29 daemon/mouse.c:55 daemon/mouse.c:95 +#: daemon/mouse.c:107 msgid "on" msgstr "" -#: libx52/x52_stringify.c:49 +#: libx52/stringify.c:49 msgid "red" msgstr "" -#: libx52/x52_stringify.c:50 +#: libx52/stringify.c:50 msgid "amber" msgstr "" -#: libx52/x52_stringify.c:51 +#: libx52/stringify.c:51 msgid "green" msgstr "" -#: libx52/x52_stringify.c:60 +#: libx52/stringify.c:60 msgid "Fire" msgstr "" -#: libx52/x52_stringify.c:63 +#: libx52/stringify.c:63 msgid "A" msgstr "" -#: libx52/x52_stringify.c:66 +#: libx52/stringify.c:66 msgid "B" msgstr "" -#: libx52/x52_stringify.c:69 +#: libx52/stringify.c:69 msgid "D" msgstr "" -#: libx52/x52_stringify.c:72 +#: libx52/stringify.c:72 msgid "E" msgstr "" -#: libx52/x52_stringify.c:75 +#: libx52/stringify.c:75 msgid "T1" msgstr "" -#: libx52/x52_stringify.c:78 +#: libx52/stringify.c:78 msgid "T2" msgstr "" -#: libx52/x52_stringify.c:81 +#: libx52/stringify.c:81 msgid "T3" msgstr "" -#: libx52/x52_stringify.c:84 +#: libx52/stringify.c:84 msgid "POV" msgstr "" -#: libx52/x52_stringify.c:87 +#: libx52/stringify.c:87 msgid "Clutch" msgstr "" -#: libx52/x52_stringify.c:90 +#: libx52/stringify.c:90 msgid "Throttle" msgstr "" -#: libx52/x52_stringify.c:93 +#: libx52/stringify.c:93 #, c-format msgid "Unknown LED ID %d" msgstr "" -#: libx52io/io_strings.c:198 +#: libx52io/strings.c:198 msgid "No device" msgstr "" -#: libx52io/io_strings.c:199 +#: libx52io/strings.c:199 msgid "Invalid arguments" msgstr "" -#: libx52io/io_strings.c:200 +#: libx52io/strings.c:200 msgid "Connection failure" msgstr "" -#: libx52io/io_strings.c:201 +#: libx52io/strings.c:201 msgid "I/O error" msgstr "" -#: libx52io/io_strings.c:202 +#: libx52io/strings.c:202 msgid "Read timeout" msgstr "" -#: vkm/vkm_common.c:26 +#: vkm/common.c:26 msgid "Unknown error" msgstr "" -#: vkm/vkm_common.c:27 +#: vkm/common.c:27 msgid "Not ready" msgstr "" -#: vkm/vkm_common.c:28 +#: vkm/common.c:28 msgid "Out of memory" msgstr "" -#: vkm/vkm_common.c:30 +#: vkm/common.c:30 msgid "Not supported" msgstr "" -#: vkm/vkm_common.c:31 +#: vkm/common.c:31 msgid "Virtual device failure" msgstr "" -#: vkm/vkm_common.c:32 +#: vkm/common.c:32 msgid "Unable to write event" msgstr "" -#: vkm/vkm_common.c:33 +#: vkm/common.c:33 msgid "No state change" msgstr "" @@ -521,17 +521,270 @@ msgstr "" msgid "OK" msgstr "" -#: daemon/x52d_main.c:67 +#: daemon/client.c:37 +#, c-format +msgid "Error accepting client connection on socket fd %d: %s" +msgstr "" + +#: daemon/client.c:43 +#, c-format +msgid "Error marking client fd %d as nonblocking: %s" +msgstr "" + +#: daemon/client.c:97 +#, c-format +msgid "Error when polling socket: FD %d, error %d, len %lu" +msgstr "" + +#: daemon/client.c:127 +#, c-format +msgid "Error %d when polling %d descriptors: %s" +msgstr "" + +#: daemon/client.c:130 +msgid "Timed out when polling" +msgstr "" + +#: daemon/clock.c:28 +#, c-format +msgid "Setting clock enable to %s" +msgstr "" + +#: daemon/clock.c:35 daemon/clock.c:119 +#, c-format +msgid "Setting %s clock timezone to %s" +msgstr "" + +#: daemon/clock.c:37 +msgid "local" +msgstr "" + +#: daemon/clock.c:37 +msgid "UTC" +msgstr "" + +#: daemon/clock.c:55 +msgid "Unable to allocate memory for timezone. Falling back to UTC" +msgstr "" + +#: daemon/clock.c:65 +msgid "Unable to backup timezone environment. Falling back to UTC" +msgstr "" + +#: daemon/clock.c:138 +#, c-format +msgid "Setting %s clock format to %s" +msgstr "" + +#: daemon/clock.c:162 +#, c-format +msgid "Setting date format to %s" +msgstr "" + +#: daemon/clock.c:174 +msgid "Starting X52 clock manager thread" +msgstr "" + +#: daemon/clock.c:185 +#, c-format +msgid "Error %d retrieving current time: %s" +msgstr "" + +#: daemon/clock.c:206 +#, c-format +msgid "Error %d initializing clock thread: %s" +msgstr "" + +#: daemon/clock.c:213 +msgid "Shutting down X52 clock manager thread" +msgstr "" + +#: daemon/command.c:379 +#, c-format +msgid "Error reading from client %d: %s" +msgstr "" + +#: daemon/command.c:390 +#, c-format +msgid "Short write to client %d; expected %d bytes, wrote %d bytes" +msgstr "" + +#: daemon/command.c:415 +#, c-format +msgid "Error %d during command loop: %s" +msgstr "" + +#: daemon/command.c:442 +#, c-format +msgid "Error creating command socket: %s" +msgstr "" + +#: daemon/command.c:450 +#, c-format +msgid "Error marking command socket as nonblocking: %s" +msgstr "" + +#: daemon/command.c:456 +#, c-format +msgid "Error listening on command socket: %s" +msgstr "" + +#: daemon/command.c:460 +msgid "Starting command processing thread" +msgstr "" + +#: daemon/command.c:478 +msgid "Shutting down command processing thread" +msgstr "" + +#: daemon/config.c:29 +#, c-format +msgid "Error %d setting configuration defaults: %s" +msgstr "" + +#: daemon/config.c:56 +#, c-format +msgid "Error %d saving configuration file: %s" +msgstr "" + +#: daemon/config_dump.c:108 +#, c-format +msgid "Unable to save config file %s - code %d: %s" +msgstr "" + +#: daemon/config_dump.c:126 +#, c-format +msgid "Failed to dump %s.%s to config file %s" +msgstr "" + +#: daemon/config_parser.c:172 +#, c-format +msgid "Ignoring unknown key '%s.%s'" +msgstr "" + +#: daemon/config_parser.c:213 +#, c-format +msgid "Failed processing configuration file %s - code %d" +msgstr "" + +#: daemon/config_parser.c:243 +msgid "Failed to allocate memory for override structure" +msgstr "" + +#: daemon/config_parser.c:252 +msgid "Failed to allocate memory for override string" +msgstr "" + +#: daemon/config_parser.c:263 +#, c-format +msgid "No section found in override string '%s'" +msgstr "" + +#: daemon/config_parser.c:277 +#, c-format +msgid "No key found in override string '%s'" +msgstr "" + +#: daemon/config_parser.c:288 +#, c-format +msgid "No value found in override string '%s'" +msgstr "" + +#: daemon/config_parser.c:339 +#, c-format +msgid "Error processing override '%s.%s=%s'" +msgstr "" + +#: daemon/daemon_control.c:60 +#, c-format +msgid "Usage: %s [-i] [-s socket-path] [command]\n" +msgstr "" + +#: daemon/daemon_control.c:73 +#, c-format +msgid "Argument length too long\n" +msgstr "" + +#: daemon/daemon_control.c:180 +#, c-format +msgid "Running in interactive mode, ignoring extra arguments\n" +msgstr "" + +#: daemon/device.c:37 +msgid "Starting X52 device manager thread" +msgstr "" + +#: daemon/device.c:44 +#, c-format +msgid "Error %d connecting to device: %s" +msgstr "" + +#: daemon/device.c:53 +msgid "Device connected, writing configuration" +msgstr "" + +#: daemon/device.c:76 +msgid "Initializing libx52" +msgstr "" + +#: daemon/device.c:80 +#, c-format +msgid "Failure %d initializing libx52: %s" +msgstr "" + +#: daemon/device.c:91 +msgid "Shutting down X52 device manager thread" +msgstr "" + +#: daemon/device.c:104 +#, c-format +msgid "Error %d when updating X52 parameter: %s" +msgstr "" + +#: daemon/device.c:180 +#, c-format +msgid "Error %d when updating X52 device: %s" +msgstr "" + +#: daemon/io.c:43 +msgid "Starting X52 I/O thread" +msgstr "" + +#: daemon/io.c:65 +#, c-format +msgid "Error %d opening X52 I/O device: %s" +msgstr "" + +#: daemon/io.c:76 +#, c-format +msgid "Error %d reading from X52 I/O device: %s" +msgstr "" + +#: daemon/io.c:103 +#, c-format +msgid "Error %d initializing X52 I/O library: %s" +msgstr "" + +#: daemon/io.c:109 +#, c-format +msgid "Error %d initializing I/O driver thread: %s" +msgstr "" + +#: daemon/io.c:116 +msgid "Shutting down X52 I/O driver thread" +msgstr "" + +#: daemon/main.c:67 #, c-format msgid "Error %d setting log file: %s\n" msgstr "" -#: daemon/x52d_main.c:83 +#: daemon/main.c:83 #, c-format msgid "Error %d installing handler for signal %d: %s" msgstr "" -#: daemon/x52d_main.c:94 +#: daemon/main.c:94 #, c-format msgid "" "Usage: %s [-f] [-v] [-q]\n" @@ -541,487 +794,234 @@ msgid "" "\t[-b notify-socket-path]\n" msgstr "" -#: daemon/x52d_main.c:129 +#: daemon/main.c:129 #, c-format msgid "Daemon is already running as PID %u" msgstr "" -#: daemon/x52d_main.c:271 +#: daemon/main.c:271 #, c-format msgid "Unable to parse configuration override '%s'\n" msgstr "" -#: daemon/x52d_main.c:303 +#: daemon/main.c:303 #, c-format msgid "Foreground = %s" msgstr "" -#: daemon/x52d_main.c:303 daemon/x52d_main.c:304 +#: daemon/main.c:303 daemon/main.c:304 msgid "true" msgstr "" -#: daemon/x52d_main.c:303 daemon/x52d_main.c:304 +#: daemon/main.c:303 daemon/main.c:304 msgid "false" msgstr "" -#: daemon/x52d_main.c:304 +#: daemon/main.c:304 #, c-format msgid "Quiet = %s" msgstr "" -#: daemon/x52d_main.c:305 +#: daemon/main.c:305 #, c-format msgid "Verbosity = %d" msgstr "" -#: daemon/x52d_main.c:306 +#: daemon/main.c:306 #, c-format msgid "Log file = %s" msgstr "" -#: daemon/x52d_main.c:307 +#: daemon/main.c:307 #, c-format msgid "Config file = %s" msgstr "" -#: daemon/x52d_main.c:308 +#: daemon/main.c:308 #, c-format msgid "PID file = %s" msgstr "" -#: daemon/x52d_main.c:309 +#: daemon/main.c:309 #, c-format msgid "Command socket = %s" msgstr "" -#: daemon/x52d_main.c:310 +#: daemon/main.c:310 #, c-format msgid "Notify socket = %s" msgstr "" -#: daemon/x52d_main.c:321 +#: daemon/main.c:321 #, c-format msgid "Error %d blocking signals on child threads: %s" msgstr "" -#: daemon/x52d_main.c:338 +#: daemon/main.c:338 #, c-format msgid "Error %d unblocking signals on child threads: %s" msgstr "" -#: daemon/x52d_main.c:351 +#: daemon/main.c:351 msgid "Reloading X52 configuration" msgstr "" -#: daemon/x52d_main.c:358 +#: daemon/main.c:358 msgid "Saving X52 configuration to disk" msgstr "" -#: daemon/x52d_main.c:364 +#: daemon/main.c:364 #, c-format msgid "Received termination signal %s" msgstr "" -#: daemon/x52d_main.c:379 +#: daemon/main.c:379 msgid "Shutting down X52 daemon" msgstr "" -#: daemon/x52d_client.c:37 -#, c-format -msgid "Error accepting client connection on socket fd %d: %s" -msgstr "" - -#: daemon/x52d_client.c:43 -#, c-format -msgid "Error marking client fd %d as nonblocking: %s" -msgstr "" - -#: daemon/x52d_client.c:97 -#, c-format -msgid "Error when polling socket: FD %d, error %d, len %lu" -msgstr "" - -#: daemon/x52d_client.c:127 -#, c-format -msgid "Error %d when polling %d descriptors: %s" -msgstr "" - -#: daemon/x52d_client.c:130 -msgid "Timed out when polling" -msgstr "" - -#: daemon/x52d_clock.c:28 -#, c-format -msgid "Setting clock enable to %s" -msgstr "" - -#: daemon/x52d_clock.c:35 daemon/x52d_clock.c:119 -#, c-format -msgid "Setting %s clock timezone to %s" -msgstr "" - -#: daemon/x52d_clock.c:37 -msgid "local" -msgstr "" - -#: daemon/x52d_clock.c:37 -msgid "UTC" -msgstr "" - -#: daemon/x52d_clock.c:55 -msgid "Unable to allocate memory for timezone. Falling back to UTC" -msgstr "" - -#: daemon/x52d_clock.c:65 -msgid "Unable to backup timezone environment. Falling back to UTC" -msgstr "" - -#: daemon/x52d_clock.c:138 -#, c-format -msgid "Setting %s clock format to %s" -msgstr "" - -#: daemon/x52d_clock.c:162 -#, c-format -msgid "Setting date format to %s" -msgstr "" - -#: daemon/x52d_clock.c:174 -msgid "Starting X52 clock manager thread" -msgstr "" - -#: daemon/x52d_clock.c:185 -#, c-format -msgid "Error %d retrieving current time: %s" -msgstr "" - -#: daemon/x52d_clock.c:206 -#, c-format -msgid "Error %d initializing clock thread: %s" -msgstr "" - -#: daemon/x52d_clock.c:213 -msgid "Shutting down X52 clock manager thread" -msgstr "" - -#: daemon/x52d_command.c:379 -#, c-format -msgid "Error reading from client %d: %s" -msgstr "" - -#: daemon/x52d_command.c:390 -#, c-format -msgid "Short write to client %d; expected %d bytes, wrote %d bytes" -msgstr "" - -#: daemon/x52d_command.c:415 -#, c-format -msgid "Error %d during command loop: %s" -msgstr "" - -#: daemon/x52d_command.c:442 -#, c-format -msgid "Error creating command socket: %s" -msgstr "" - -#: daemon/x52d_command.c:450 -#, c-format -msgid "Error marking command socket as nonblocking: %s" -msgstr "" - -#: daemon/x52d_command.c:456 -#, c-format -msgid "Error listening on command socket: %s" -msgstr "" - -#: daemon/x52d_command.c:460 -msgid "Starting command processing thread" -msgstr "" - -#: daemon/x52d_command.c:478 -msgid "Shutting down command processing thread" -msgstr "" - -#: daemon/x52d_config.c:29 -#, c-format -msgid "Error %d setting configuration defaults: %s" -msgstr "" - -#: daemon/x52d_config.c:56 -#, c-format -msgid "Error %d saving configuration file: %s" -msgstr "" - -#: daemon/x52d_config_dump.c:108 -#, c-format -msgid "Unable to save config file %s - code %d: %s" -msgstr "" - -#: daemon/x52d_config_dump.c:126 -#, c-format -msgid "Failed to dump %s.%s to config file %s" -msgstr "" - -#: daemon/x52d_config_parser.c:172 -#, c-format -msgid "Ignoring unknown key '%s.%s'" -msgstr "" - -#: daemon/x52d_config_parser.c:213 -#, c-format -msgid "Failed processing configuration file %s - code %d" -msgstr "" - -#: daemon/x52d_config_parser.c:243 -msgid "Failed to allocate memory for override structure" -msgstr "" - -#: daemon/x52d_config_parser.c:252 -msgid "Failed to allocate memory for override string" -msgstr "" - -#: daemon/x52d_config_parser.c:263 -#, c-format -msgid "No section found in override string '%s'" -msgstr "" - -#: daemon/x52d_config_parser.c:277 -#, c-format -msgid "No key found in override string '%s'" -msgstr "" - -#: daemon/x52d_config_parser.c:288 -#, c-format -msgid "No value found in override string '%s'" -msgstr "" - -#: daemon/x52d_config_parser.c:339 -#, c-format -msgid "Error processing override '%s.%s=%s'" -msgstr "" - -#: daemon/x52d_device.c:37 -msgid "Starting X52 device manager thread" -msgstr "" - -#: daemon/x52d_device.c:44 -#, c-format -msgid "Error %d connecting to device: %s" -msgstr "" - -#: daemon/x52d_device.c:53 -msgid "Device connected, writing configuration" -msgstr "" - -#: daemon/x52d_device.c:76 -msgid "Initializing libx52" -msgstr "" - -#: daemon/x52d_device.c:80 -#, c-format -msgid "Failure %d initializing libx52: %s" -msgstr "" - -#: daemon/x52d_device.c:91 -msgid "Shutting down X52 device manager thread" -msgstr "" - -#: daemon/x52d_device.c:104 -#, c-format -msgid "Error %d when updating X52 parameter: %s" -msgstr "" - -#: daemon/x52d_device.c:180 -#, c-format -msgid "Error %d when updating X52 device: %s" -msgstr "" - -#: daemon/x52d_io.c:43 -msgid "Starting X52 I/O thread" -msgstr "" - -#: daemon/x52d_io.c:65 -#, c-format -msgid "Error %d opening X52 I/O device: %s" -msgstr "" - -#: daemon/x52d_io.c:76 -#, c-format -msgid "Error %d reading from X52 I/O device: %s" -msgstr "" - -#: daemon/x52d_io.c:103 -#, c-format -msgid "Error %d initializing X52 I/O library: %s" -msgstr "" - -#: daemon/x52d_io.c:109 -#, c-format -msgid "Error %d initializing I/O driver thread: %s" -msgstr "" - -#: daemon/x52d_io.c:116 -msgid "Shutting down X52 I/O driver thread" -msgstr "" - -#: daemon/x52d_mouse.c:38 daemon/x52d_mouse.c:44 +#: daemon/mouse.c:38 daemon/mouse.c:44 #, c-format msgid "Clamping %s value %d to range [%d..%d]" msgstr "" -#: daemon/x52d_mouse.c:54 +#: daemon/mouse.c:54 #, c-format msgid "Setting mouse enable to %s" msgstr "" -#: daemon/x52d_mouse.c:71 +#: daemon/mouse.c:71 msgid "" "Config option 'mouse.speed' is DEPRECATED. Please use 'mouse.sensitivity' " "instead" msgstr "" -#: daemon/x52d_mouse.c:86 +#: daemon/mouse.c:86 #, c-format msgid "Migrating legacy mouse speed '%d' to sensitivity '%d' (percentage)" msgstr "" -#: daemon/x52d_mouse.c:88 +#: daemon/mouse.c:88 msgid "speed -> sensitivity" msgstr "" -#: daemon/x52d_mouse.c:94 +#: daemon/mouse.c:94 #, c-format msgid "Setting mouse reverse scroll to %s" msgstr "" -#: daemon/x52d_mouse.c:106 +#: daemon/mouse.c:106 #, c-format msgid "Setting mouse isometric mode to %s" msgstr "" -#: daemon/x52d_mouse.c:113 +#: daemon/mouse.c:113 msgid "sensitivity" msgstr "" -#: daemon/x52d_mouse.c:116 +#: daemon/mouse.c:116 #, c-format msgid "Setting mouse sensitivity to %d%%" msgstr "" -#: daemon/x52d_mouse.c:123 +#: daemon/mouse.c:123 msgid "curve factor" msgstr "" -#: daemon/x52d_mouse.c:124 +#: daemon/mouse.c:124 #, c-format msgid "Setting mouse curve factor to %d" msgstr "" -#: daemon/x52d_mouse.c:130 +#: daemon/mouse.c:130 msgid "deadzone factor" msgstr "" -#: daemon/x52d_mouse.c:131 +#: daemon/mouse.c:131 #, c-format msgid "Setting mouse deadzone to %d" msgstr "" -#: daemon/x52d_mouse_handler.c:44 +#: daemon/mouse_handler.c:44 #, c-format msgid "Error %d writing mouse button event (button %d, state %d)" msgstr "" -#: daemon/x52d_mouse_handler.c:82 +#: daemon/mouse_handler.c:82 #, c-format msgid "Error writing mouse wheel event %d" msgstr "" -#: daemon/x52d_mouse_handler.c:185 +#: daemon/mouse_handler.c:185 #, c-format msgid "Error %d writing mouse axis event (dx %d, dy %d)" msgstr "" -#: daemon/x52d_mouse_handler.c:197 +#: daemon/mouse_handler.c:197 msgid "Error writing mouse sync event" msgstr "" -#: daemon/x52d_mouse_handler.c:216 +#: daemon/mouse_handler.c:216 msgid "Starting X52 virtual mouse driver thread" msgstr "" -#: daemon/x52d_mouse_handler.c:235 +#: daemon/mouse_handler.c:235 #, c-format msgid "Error %d initializing mouse thread: %s" msgstr "" -#: daemon/x52d_mouse_handler.c:242 +#: daemon/mouse_handler.c:242 msgid "Shutting down X52 virtual mouse driver thread" msgstr "" -#: daemon/x52d_mouse_handler.c:249 +#: daemon/mouse_handler.c:249 msgid "Virtual mouse not created. Ignoring thread state change" msgstr "" -#: daemon/x52d_mouse_handler.c:301 daemon/x52d_mouse_handler.c:309 +#: daemon/mouse_handler.c:301 daemon/mouse_handler.c:309 #, c-format msgid "Error %d creating X52 virtual mouse" msgstr "" -#: daemon/x52d_notify.c:46 +#: daemon/notify.c:46 #, c-format msgid "Error creating notification socket: %s" msgstr "" -#: daemon/x52d_notify.c:51 +#: daemon/notify.c:51 #, c-format msgid "Error marking notification socket as nonblocking: %s" msgstr "" -#: daemon/x52d_notify.c:56 +#: daemon/notify.c:56 #, c-format msgid "Error listening on notification socket: %s" msgstr "" -#: daemon/x52d_notify.c:65 +#: daemon/notify.c:65 msgid "Error setting up notification socket" msgstr "" -#: daemon/x52d_notify.c:81 daemon/x52d_notify.c:91 +#: daemon/notify.c:81 daemon/notify.c:91 #, c-format msgid "Error %d reading from pipe: %s" msgstr "" -#: daemon/x52d_notify.c:128 +#: daemon/notify.c:128 #, c-format msgid "Error %d writing notification pipe: %s" msgstr "" -#: daemon/x52d_notify.c:174 +#: daemon/notify.c:174 #, c-format msgid "Error %d creating notification pipe: %s" msgstr "" -#: daemon/x52d_notify.c:183 +#: daemon/notify.c:183 #, c-format msgid "Error %d initializing notify thread: %s" msgstr "" -#: daemon/x52d_notify.c:189 +#: daemon/notify.c:189 #, c-format msgid "Error %d initializing notify listener: %s" msgstr "" - -#: daemon/x52ctl.c:60 -#, c-format -msgid "Usage: %s [-i] [-s socket-path] [command]\n" -msgstr "" - -#: daemon/x52ctl.c:73 -#, c-format -msgid "Argument length too long\n" -msgstr "" - -#: daemon/x52ctl.c:180 -#, c-format -msgid "Running in interactive mode, ignoring extra arguments\n" -msgstr "" diff --git a/po/xx_PL.po b/po/xx_PL.po index 4e1cae5..420fcd0 100644 --- a/po/xx_PL.po +++ b/po/xx_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: libx52 0.2.3\n" "Report-Msgid-Bugs-To: https://github.com/nirenjan/libx52/issues\n" -"POT-Creation-Date: 2026-04-03 18:06-0700\n" +"POT-Creation-Date: 2026-04-03 23:44-0700\n" "PO-Revision-Date: 2026-04-01 20:50-0700\n" "Last-Translator: Nirenjan Krishnan \n" "Language-Team: Dummy Language for testing i18n\n" @@ -17,247 +17,247 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.4.2\n" -#: libx52/x52_strerror.c:23 libx52io/io_strings.c:196 vkm/vkm_common.c:25 +#: libx52/strerror.c:23 libx52io/strings.c:196 vkm/common.c:25 msgid "Success" msgstr "Uccesssay" -#: libx52/x52_strerror.c:24 libx52io/io_strings.c:197 +#: libx52/strerror.c:24 libx52io/strings.c:197 msgid "Initialization failure" msgstr "Initializationay ailurefay" -#: libx52/x52_strerror.c:25 +#: libx52/strerror.c:25 msgid "Insufficient memory" msgstr "Insufficientay emorymay" -#: libx52/x52_strerror.c:26 vkm/vkm_common.c:29 +#: libx52/strerror.c:26 vkm/common.c:29 msgid "Invalid parameter" msgstr "Invaliday arameterpay" -#: libx52/x52_strerror.c:27 +#: libx52/strerror.c:27 msgid "Operation not supported" msgstr "Operationay otnay upportedsay" -#: libx52/x52_strerror.c:28 +#: libx52/strerror.c:28 msgid "Try again" msgstr "Ytray againay" -#: libx52/x52_strerror.c:29 +#: libx52/strerror.c:29 msgid "Input parameter out of range" msgstr "Inputay arameterpay outay ofay angeray" -#: libx52/x52_strerror.c:30 +#: libx52/strerror.c:30 msgid "USB transaction failure" msgstr "USBay ansactiontray ailurefay" -#: libx52/x52_strerror.c:31 +#: libx52/strerror.c:31 msgid "USB input/output error" msgstr "USBay inputay/outputay erroray" -#: libx52/x52_strerror.c:32 +#: libx52/strerror.c:32 msgid "Access denied" msgstr "Accessay eniedday" -#: libx52/x52_strerror.c:33 +#: libx52/strerror.c:33 msgid "No such device" msgstr "Onay uchsay eviceday" -#: libx52/x52_strerror.c:34 +#: libx52/strerror.c:34 msgid "Entity not found" msgstr "Entityay otnay oundfay" -#: libx52/x52_strerror.c:35 +#: libx52/strerror.c:35 msgid "Resource busy" msgstr "Esourceray usybay" -#: libx52/x52_strerror.c:36 +#: libx52/strerror.c:36 msgid "Operation timeout" msgstr "Operationay imeouttay" -#: libx52/x52_strerror.c:37 +#: libx52/strerror.c:37 msgid "Overflow" msgstr "Overfloway" -#: libx52/x52_strerror.c:38 +#: libx52/strerror.c:38 msgid "Pipe error" msgstr "Ipepay erroray" -#: libx52/x52_strerror.c:39 +#: libx52/strerror.c:39 msgid "System call interrupted" msgstr "Ystemsay allcay interrupteday" -#: libx52/x52_strerror.c:66 libx52io/io_strings.c:220 vkm/vkm_common.c:52 +#: libx52/strerror.c:66 libx52io/strings.c:220 vkm/common.c:52 #, c-format msgid "Unknown error %d" msgstr "Unknownay erroray %d" -#: libx52/x52_stringify.c:29 +#: libx52/stringify.c:29 #, c-format msgid "Unknown clock ID %d" msgstr "Unknownay ockclay IDay %d" -#: libx52/x52_stringify.c:30 +#: libx52/stringify.c:30 msgid "primary" msgstr "imarypray" -#: libx52/x52_stringify.c:31 +#: libx52/stringify.c:31 msgid "secondary" msgstr "econdarysay" -#: libx52/x52_stringify.c:32 +#: libx52/stringify.c:32 msgid "tertiary" msgstr "ertiarytay" -#: libx52/x52_stringify.c:35 +#: libx52/stringify.c:35 #, c-format msgid "Unknown clock format %d" msgstr "Unknownay ockclay ormatfay %d" -#: libx52/x52_stringify.c:36 +#: libx52/stringify.c:36 msgid "12 hour" msgstr "12 ourhay" -#: libx52/x52_stringify.c:37 +#: libx52/stringify.c:37 msgid "24 hour" msgstr "24 ourhay" -#: libx52/x52_stringify.c:40 +#: libx52/stringify.c:40 #, c-format msgid "Unknown date format %d" msgstr "Unknownay ateday ormatfay %d" -#: libx52/x52_stringify.c:41 +#: libx52/stringify.c:41 msgid "DD-MM-YY" msgstr "DDay-MMay-YYay" -#: libx52/x52_stringify.c:42 +#: libx52/stringify.c:42 msgid "MM-DD-YY" msgstr "MMay-DDay-YYay" -#: libx52/x52_stringify.c:43 +#: libx52/stringify.c:43 msgid "YY-MM-DD" msgstr "YYay-MMay-DDay" -#: libx52/x52_stringify.c:46 +#: libx52/stringify.c:46 #, c-format msgid "Unknown LED state %d" msgstr "Unknownay EDLay atestay %d" -#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:29 daemon/x52d_mouse.c:55 -#: daemon/x52d_mouse.c:95 daemon/x52d_mouse.c:107 +#: libx52/stringify.c:47 daemon/clock.c:29 daemon/mouse.c:55 daemon/mouse.c:95 +#: daemon/mouse.c:107 msgid "off" msgstr "offay" -#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:29 daemon/x52d_mouse.c:55 -#: daemon/x52d_mouse.c:95 daemon/x52d_mouse.c:107 +#: libx52/stringify.c:48 daemon/clock.c:29 daemon/mouse.c:55 daemon/mouse.c:95 +#: daemon/mouse.c:107 msgid "on" msgstr "onay" -#: libx52/x52_stringify.c:49 +#: libx52/stringify.c:49 msgid "red" msgstr "edray" -#: libx52/x52_stringify.c:50 +#: libx52/stringify.c:50 msgid "amber" msgstr "amberay" -#: libx52/x52_stringify.c:51 +#: libx52/stringify.c:51 msgid "green" msgstr "eengray" -#: libx52/x52_stringify.c:60 +#: libx52/stringify.c:60 msgid "Fire" msgstr "Irefay" -#: libx52/x52_stringify.c:63 +#: libx52/stringify.c:63 msgid "A" msgstr "Ay" -#: libx52/x52_stringify.c:66 +#: libx52/stringify.c:66 msgid "B" msgstr "Bay" -#: libx52/x52_stringify.c:69 +#: libx52/stringify.c:69 msgid "D" msgstr "Day" -#: libx52/x52_stringify.c:72 +#: libx52/stringify.c:72 msgid "E" msgstr "Eay" -#: libx52/x52_stringify.c:75 +#: libx52/stringify.c:75 msgid "T1" msgstr "Tay1" -#: libx52/x52_stringify.c:78 +#: libx52/stringify.c:78 msgid "T2" msgstr "Tay2" -#: libx52/x52_stringify.c:81 +#: libx52/stringify.c:81 msgid "T3" msgstr "Tay3" -#: libx52/x52_stringify.c:84 +#: libx52/stringify.c:84 msgid "POV" msgstr "OVPay" -#: libx52/x52_stringify.c:87 +#: libx52/stringify.c:87 msgid "Clutch" msgstr "Utchclay" -#: libx52/x52_stringify.c:90 +#: libx52/stringify.c:90 msgid "Throttle" msgstr "Ottlethray" -#: libx52/x52_stringify.c:93 +#: libx52/stringify.c:93 #, c-format msgid "Unknown LED ID %d" msgstr "Unknownay EDLay IDay %d" -#: libx52io/io_strings.c:198 +#: libx52io/strings.c:198 msgid "No device" msgstr "Onay eviceday" -#: libx52io/io_strings.c:199 +#: libx52io/strings.c:199 msgid "Invalid arguments" msgstr "Invaliday argumentsay" -#: libx52io/io_strings.c:200 +#: libx52io/strings.c:200 msgid "Connection failure" msgstr "Onnectioncay ailurefay" -#: libx52io/io_strings.c:201 +#: libx52io/strings.c:201 msgid "I/O error" msgstr "I/O erroray" -#: libx52io/io_strings.c:202 +#: libx52io/strings.c:202 msgid "Read timeout" msgstr "Eadray imeouttay" -#: vkm/vkm_common.c:26 +#: vkm/common.c:26 msgid "Unknown error" msgstr "Unknownay erroray" -#: vkm/vkm_common.c:27 +#: vkm/common.c:27 msgid "Not ready" msgstr "Otnay eadyray" -#: vkm/vkm_common.c:28 +#: vkm/common.c:28 msgid "Out of memory" msgstr "Outay ofay emorymay" -#: vkm/vkm_common.c:30 +#: vkm/common.c:30 msgid "Not supported" msgstr "Otnay upportedsay" -#: vkm/vkm_common.c:31 +#: vkm/common.c:31 msgid "Virtual device failure" msgstr "Irtualvay eviceday ailurefay" -#: vkm/vkm_common.c:32 +#: vkm/common.c:32 msgid "Unable to write event" msgstr "Unableay otay itewray eventay" -#: vkm/vkm_common.c:33 +#: vkm/common.c:33 msgid "No state change" msgstr "Onay atestay angechay" @@ -564,17 +564,274 @@ msgstr "Estingtay aracterchay 0x%02x..." msgid "OK" msgstr "OKay" -#: daemon/x52d_main.c:67 +#: daemon/client.c:37 +#, c-format +msgid "Error accepting client connection on socket fd %d: %s" +msgstr "Erroray acceptingay ientclay onnectioncay onay ocketsay fday %d: %s" + +#: daemon/client.c:43 +#, c-format +msgid "Error marking client fd %d as nonblocking: %s" +msgstr "Erroray arkingmay ientclay fday %d asay onblockingnay: %s" + +#: daemon/client.c:97 +#, c-format +msgid "Error when polling socket: FD %d, error %d, len %lu" +msgstr "Erroray enwhay ollingpay ocketsay: FDay %d, erroray %d, enlay %lu" + +#: daemon/client.c:127 +#, c-format +msgid "Error %d when polling %d descriptors: %s" +msgstr "Erroray %d enwhay ollingpay %d escriptorsday: %s" + +#: daemon/client.c:130 +msgid "Timed out when polling" +msgstr "Imedtay outay enwhay ollingpay" + +#: daemon/clock.c:28 +#, c-format +msgid "Setting clock enable to %s" +msgstr "Ettingsay ockclay enableay otay %s" + +#: daemon/clock.c:35 daemon/clock.c:119 +#, c-format +msgid "Setting %s clock timezone to %s" +msgstr "Ettingsay %s ockclay imezonetay otay %s" + +#: daemon/clock.c:37 +msgid "local" +msgstr "ocallay" + +#: daemon/clock.c:37 +msgid "UTC" +msgstr "UTCay" + +#: daemon/clock.c:55 +msgid "Unable to allocate memory for timezone. Falling back to UTC" +msgstr "" +"Unableay otay allocateay emorymay orfay imezonetay. Allingfay ackbay otay " +"UTCay" + +#: daemon/clock.c:65 +msgid "Unable to backup timezone environment. Falling back to UTC" +msgstr "" +"Unableay otay ackupbay imezonetay environmentay. Allingfay ackbay otay UTCay" + +#: daemon/clock.c:138 +#, c-format +msgid "Setting %s clock format to %s" +msgstr "Ettingsay %s ockclay ormatfay otay %s" + +#: daemon/clock.c:162 +#, c-format +msgid "Setting date format to %s" +msgstr "Ettingsay ateday ormatfay otay %s" + +#: daemon/clock.c:174 +msgid "Starting X52 clock manager thread" +msgstr "Artingstay X52 ockclay anagermay eadthray" + +#: daemon/clock.c:185 +#, c-format +msgid "Error %d retrieving current time: %s" +msgstr "Erroray %d etrievingray urrentcay imetay: %s" + +#: daemon/clock.c:206 +#, c-format +msgid "Error %d initializing clock thread: %s" +msgstr "Erroray %d initializingay ockclay eadthray: %s" + +#: daemon/clock.c:213 +msgid "Shutting down X52 clock manager thread" +msgstr "Uttingshay ownday X52 ockclay anagermay eadthray" + +#: daemon/command.c:379 +#, c-format +msgid "Error reading from client %d: %s" +msgstr "Erroray eadingray omfray ientclay %d: %s" + +#: daemon/command.c:390 +#, c-format +msgid "Short write to client %d; expected %d bytes, wrote %d bytes" +msgstr "" +"Ortshay itewray otay ientclay %d; expecteday %d ytesbay, otewray %d ytesbay" + +#: daemon/command.c:415 +#, c-format +msgid "Error %d during command loop: %s" +msgstr "Erroray %d uringday ommandcay ooplay: %s" + +#: daemon/command.c:442 +#, c-format +msgid "Error creating command socket: %s" +msgstr "Erroray eatingcray ommandcay ocketsay: %s" + +#: daemon/command.c:450 +#, c-format +msgid "Error marking command socket as nonblocking: %s" +msgstr "Erroray arkingmay ommandcay ocketsay asay onblockingnay: %s" + +#: daemon/command.c:456 +#, c-format +msgid "Error listening on command socket: %s" +msgstr "Erroray isteninglay onay ommandcay ocketsay: %s" + +#: daemon/command.c:460 +msgid "Starting command processing thread" +msgstr "Artingstay ommandcay ocessingpray eadthray" + +#: daemon/command.c:478 +msgid "Shutting down command processing thread" +msgstr "Uttingshay ownday ommandcay ocessingpray eadthray" + +#: daemon/config.c:29 +#, c-format +msgid "Error %d setting configuration defaults: %s" +msgstr "Erroray %d ettingsay onfigurationcay efaultsday: %s" + +#: daemon/config.c:56 +#, c-format +msgid "Error %d saving configuration file: %s" +msgstr "Erroray %d avingsay onfigurationcay ilefay: %s" + +#: daemon/config_dump.c:108 +#, c-format +msgid "Unable to save config file %s - code %d: %s" +msgstr "Unableay otay avesay onfigcay ilefay %s - odecay %d: %s" + +#: daemon/config_dump.c:126 +#, c-format +msgid "Failed to dump %s.%s to config file %s" +msgstr "Ailedfay otay umpday %s.%s otay onfigcay ilefay %s" + +#: daemon/config_parser.c:172 +#, c-format +msgid "Ignoring unknown key '%s.%s'" +msgstr "Ignoringay unknownay eykay '%s.%s'" + +#: daemon/config_parser.c:213 +#, c-format +msgid "Failed processing configuration file %s - code %d" +msgstr "Ailedfay ocessingpray onfigurationcay ilefay %s - odecay %d" + +#: daemon/config_parser.c:243 +msgid "Failed to allocate memory for override structure" +msgstr "Ailedfay otay allocateay emorymay orfay overrideay ucturestray" + +#: daemon/config_parser.c:252 +msgid "Failed to allocate memory for override string" +msgstr "Ailedfay otay allocateay emorymay orfay overrideay ingstray" + +#: daemon/config_parser.c:263 +#, c-format +msgid "No section found in override string '%s'" +msgstr "Onay ectionsay oundfay inay overrideay ingstray '%s'" + +#: daemon/config_parser.c:277 +#, c-format +msgid "No key found in override string '%s'" +msgstr "Onay eykay oundfay inay overrideay ingstray '%s'" + +#: daemon/config_parser.c:288 +#, c-format +msgid "No value found in override string '%s'" +msgstr "Onay aluevay oundfay inay overrideay ingstray '%s'" + +#: daemon/config_parser.c:339 +#, c-format +msgid "Error processing override '%s.%s=%s'" +msgstr "Erroray ocessingpray overriday '%s.%s=%s'" + +#: daemon/daemon_control.c:60 +#, c-format +msgid "Usage: %s [-i] [-s socket-path] [command]\n" +msgstr "Usageay: %s [-i] [-s ocketsay-athpay] [ommandcay]\n" + +#: daemon/daemon_control.c:73 +#, c-format +msgid "Argument length too long\n" +msgstr "Argumentay engthlay ootay onglay\n" + +#: daemon/daemon_control.c:180 +#, c-format +msgid "Running in interactive mode, ignoring extra arguments\n" +msgstr "Unningray inay interactiveay odemay, ignoringay extraay argumentsay\n" + +#: daemon/device.c:37 +msgid "Starting X52 device manager thread" +msgstr "Artingstay X52 eviceday anagermay eadthray" + +#: daemon/device.c:44 +#, c-format +msgid "Error %d connecting to device: %s" +msgstr "Erroray %d onnectingcay otay eviceday: %s" + +#: daemon/device.c:53 +msgid "Device connected, writing configuration" +msgstr "Eviceday onnectedcay, itingwray onfigurationcay" + +#: daemon/device.c:76 +msgid "Initializing libx52" +msgstr "Initializingay libx52" + +#: daemon/device.c:80 +#, c-format +msgid "Failure %d initializing libx52: %s" +msgstr "Ailurefay %d initializeay libx52: %s" + +#: daemon/device.c:91 +msgid "Shutting down X52 device manager thread" +msgstr "Uttingshay ownday X52 eviceday anagermay eadthray" + +#: daemon/device.c:104 +#, c-format +msgid "Error %d when updating X52 parameter: %s" +msgstr "Erroray %d enwhay updatingay X52 arameterpay: %s" + +#: daemon/device.c:180 +#, c-format +msgid "Error %d when updating X52 device: %s" +msgstr "Erroray %d enwhay updatingay X52 eviceday: %s" + +#: daemon/io.c:43 +msgid "Starting X52 I/O thread" +msgstr "Artingstay X52 I/O eadthray" + +#: daemon/io.c:65 +#, c-format +msgid "Error %d opening X52 I/O device: %s" +msgstr "Erroray %d openingay X52 I/O eviceday: %s" + +#: daemon/io.c:76 +#, c-format +msgid "Error %d reading from X52 I/O device: %s" +msgstr "Erroray %d eadingray omfray X52 I/O eviceday: %s" + +#: daemon/io.c:103 +#, c-format +msgid "Error %d initializing X52 I/O library: %s" +msgstr "Erroray %d initializingay X52 ibrarylay: %s" + +#: daemon/io.c:109 +#, c-format +msgid "Error %d initializing I/O driver thread: %s" +msgstr "Erroray %d initializingay I/O iverdray eadthray: %s" + +#: daemon/io.c:116 +msgid "Shutting down X52 I/O driver thread" +msgstr "Uttingshay ownday X52 I/O iverdray eadthray" + +#: daemon/main.c:67 #, c-format msgid "Error %d setting log file: %s\n" msgstr "Erroray %d ettingsay oglay ilefay: %s\n" -#: daemon/x52d_main.c:83 +#: daemon/main.c:83 #, c-format msgid "Error %d installing handler for signal %d: %s" msgstr "Erroray %d installingay andlerhay orfay ignalsay %d: %s" -#: daemon/x52d_main.c:94 +#: daemon/main.c:94 #, c-format msgid "" "Usage: %s [-f] [-v] [-q]\n" @@ -590,344 +847,102 @@ msgstr "" "\t[-b otifynay-ocketsay-athpay]\n" "\n" -#: daemon/x52d_main.c:129 +#: daemon/main.c:129 #, c-format msgid "Daemon is already running as PID %u" msgstr "Aemonday isay alreadyay unningray asay IDPay %u" -#: daemon/x52d_main.c:271 +#: daemon/main.c:271 #, c-format msgid "Unable to parse configuration override '%s'\n" msgstr "Unableay otay arsepay onfigurationcay overrideay '%s'\n" -#: daemon/x52d_main.c:303 +#: daemon/main.c:303 #, c-format msgid "Foreground = %s" msgstr "Oregroundfay = %s" -#: daemon/x52d_main.c:303 daemon/x52d_main.c:304 +#: daemon/main.c:303 daemon/main.c:304 msgid "true" msgstr "uetray" -#: daemon/x52d_main.c:303 daemon/x52d_main.c:304 +#: daemon/main.c:303 daemon/main.c:304 msgid "false" msgstr "alsefay" -#: daemon/x52d_main.c:304 +#: daemon/main.c:304 #, c-format msgid "Quiet = %s" msgstr "Uietqay = %s" -#: daemon/x52d_main.c:305 +#: daemon/main.c:305 #, c-format msgid "Verbosity = %d" msgstr "Erbosityvay = %d" -#: daemon/x52d_main.c:306 +#: daemon/main.c:306 #, c-format msgid "Log file = %s" msgstr "Oglay ilefay = %s" -#: daemon/x52d_main.c:307 +#: daemon/main.c:307 #, c-format msgid "Config file = %s" msgstr "Onfigcay ilefay = %s" -#: daemon/x52d_main.c:308 +#: daemon/main.c:308 #, c-format msgid "PID file = %s" msgstr "IDPay ilefay = %s" -#: daemon/x52d_main.c:309 +#: daemon/main.c:309 #, c-format msgid "Command socket = %s" msgstr "Ommandcay ocketsay = %s" -#: daemon/x52d_main.c:310 +#: daemon/main.c:310 #, c-format msgid "Notify socket = %s" msgstr "Otifynay ocketsay = %s" -#: daemon/x52d_main.c:321 +#: daemon/main.c:321 #, c-format msgid "Error %d blocking signals on child threads: %s" msgstr "Erroray %d ockingblay ignalssay onay ildchay eadsthray: %s" -#: daemon/x52d_main.c:338 +#: daemon/main.c:338 #, c-format msgid "Error %d unblocking signals on child threads: %s" msgstr "Erroray %d unblockingay ignalssay onay ildchay eadsthray: %s" -#: daemon/x52d_main.c:351 +#: daemon/main.c:351 msgid "Reloading X52 configuration" msgstr "Eloadingray X52 onfigurationcay" -#: daemon/x52d_main.c:358 +#: daemon/main.c:358 msgid "Saving X52 configuration to disk" msgstr "Avingsay X52 onfigurationcay otay iskday" -#: daemon/x52d_main.c:364 +#: daemon/main.c:364 #, c-format msgid "Received termination signal %s" msgstr "Eceivedray erminationtay ignalsay %s" -#: daemon/x52d_main.c:379 +#: daemon/main.c:379 msgid "Shutting down X52 daemon" msgstr "Uttingshay ownday X52 aemonday" -#: daemon/x52d_client.c:37 -#, c-format -msgid "Error accepting client connection on socket fd %d: %s" -msgstr "Erroray acceptingay ientclay onnectioncay onay ocketsay fday %d: %s" - -#: daemon/x52d_client.c:43 -#, c-format -msgid "Error marking client fd %d as nonblocking: %s" -msgstr "Erroray arkingmay ientclay fday %d asay onblockingnay: %s" - -#: daemon/x52d_client.c:97 -#, c-format -msgid "Error when polling socket: FD %d, error %d, len %lu" -msgstr "Erroray enwhay ollingpay ocketsay: FDay %d, erroray %d, enlay %lu" - -#: daemon/x52d_client.c:127 -#, c-format -msgid "Error %d when polling %d descriptors: %s" -msgstr "Erroray %d enwhay ollingpay %d escriptorsday: %s" - -#: daemon/x52d_client.c:130 -msgid "Timed out when polling" -msgstr "Imedtay outay enwhay ollingpay" - -#: daemon/x52d_clock.c:28 -#, c-format -msgid "Setting clock enable to %s" -msgstr "Ettingsay ockclay enableay otay %s" - -#: daemon/x52d_clock.c:35 daemon/x52d_clock.c:119 -#, c-format -msgid "Setting %s clock timezone to %s" -msgstr "Ettingsay %s ockclay imezonetay otay %s" - -#: daemon/x52d_clock.c:37 -msgid "local" -msgstr "ocallay" - -#: daemon/x52d_clock.c:37 -msgid "UTC" -msgstr "UTCay" - -#: daemon/x52d_clock.c:55 -msgid "Unable to allocate memory for timezone. Falling back to UTC" -msgstr "" -"Unableay otay allocateay emorymay orfay imezonetay. Allingfay ackbay otay " -"UTCay" - -#: daemon/x52d_clock.c:65 -msgid "Unable to backup timezone environment. Falling back to UTC" -msgstr "" -"Unableay otay ackupbay imezonetay environmentay. Allingfay ackbay otay UTCay" - -#: daemon/x52d_clock.c:138 -#, c-format -msgid "Setting %s clock format to %s" -msgstr "Ettingsay %s ockclay ormatfay otay %s" - -#: daemon/x52d_clock.c:162 -#, c-format -msgid "Setting date format to %s" -msgstr "Ettingsay ateday ormatfay otay %s" - -#: daemon/x52d_clock.c:174 -msgid "Starting X52 clock manager thread" -msgstr "Artingstay X52 ockclay anagermay eadthray" - -#: daemon/x52d_clock.c:185 -#, c-format -msgid "Error %d retrieving current time: %s" -msgstr "Erroray %d etrievingray urrentcay imetay: %s" - -#: daemon/x52d_clock.c:206 -#, c-format -msgid "Error %d initializing clock thread: %s" -msgstr "Erroray %d initializingay ockclay eadthray: %s" - -#: daemon/x52d_clock.c:213 -msgid "Shutting down X52 clock manager thread" -msgstr "Uttingshay ownday X52 ockclay anagermay eadthray" - -#: daemon/x52d_command.c:379 -#, c-format -msgid "Error reading from client %d: %s" -msgstr "Erroray eadingray omfray ientclay %d: %s" - -#: daemon/x52d_command.c:390 -#, c-format -msgid "Short write to client %d; expected %d bytes, wrote %d bytes" -msgstr "" -"Ortshay itewray otay ientclay %d; expecteday %d ytesbay, otewray %d ytesbay" - -#: daemon/x52d_command.c:415 -#, c-format -msgid "Error %d during command loop: %s" -msgstr "Erroray %d uringday ommandcay ooplay: %s" - -#: daemon/x52d_command.c:442 -#, c-format -msgid "Error creating command socket: %s" -msgstr "Erroray eatingcray ommandcay ocketsay: %s" - -#: daemon/x52d_command.c:450 -#, c-format -msgid "Error marking command socket as nonblocking: %s" -msgstr "Erroray arkingmay ommandcay ocketsay asay onblockingnay: %s" - -#: daemon/x52d_command.c:456 -#, c-format -msgid "Error listening on command socket: %s" -msgstr "Erroray isteninglay onay ommandcay ocketsay: %s" - -#: daemon/x52d_command.c:460 -msgid "Starting command processing thread" -msgstr "Artingstay ommandcay ocessingpray eadthray" - -#: daemon/x52d_command.c:478 -msgid "Shutting down command processing thread" -msgstr "Uttingshay ownday ommandcay ocessingpray eadthray" - -#: daemon/x52d_config.c:29 -#, c-format -msgid "Error %d setting configuration defaults: %s" -msgstr "Erroray %d ettingsay onfigurationcay efaultsday: %s" - -#: daemon/x52d_config.c:56 -#, c-format -msgid "Error %d saving configuration file: %s" -msgstr "Erroray %d avingsay onfigurationcay ilefay: %s" - -#: daemon/x52d_config_dump.c:108 -#, c-format -msgid "Unable to save config file %s - code %d: %s" -msgstr "Unableay otay avesay onfigcay ilefay %s - odecay %d: %s" - -#: daemon/x52d_config_dump.c:126 -#, c-format -msgid "Failed to dump %s.%s to config file %s" -msgstr "Ailedfay otay umpday %s.%s otay onfigcay ilefay %s" - -#: daemon/x52d_config_parser.c:172 -#, c-format -msgid "Ignoring unknown key '%s.%s'" -msgstr "Ignoringay unknownay eykay '%s.%s'" - -#: daemon/x52d_config_parser.c:213 -#, c-format -msgid "Failed processing configuration file %s - code %d" -msgstr "Ailedfay ocessingpray onfigurationcay ilefay %s - odecay %d" - -#: daemon/x52d_config_parser.c:243 -msgid "Failed to allocate memory for override structure" -msgstr "Ailedfay otay allocateay emorymay orfay overrideay ucturestray" - -#: daemon/x52d_config_parser.c:252 -msgid "Failed to allocate memory for override string" -msgstr "Ailedfay otay allocateay emorymay orfay overrideay ingstray" - -#: daemon/x52d_config_parser.c:263 -#, c-format -msgid "No section found in override string '%s'" -msgstr "Onay ectionsay oundfay inay overrideay ingstray '%s'" - -#: daemon/x52d_config_parser.c:277 -#, c-format -msgid "No key found in override string '%s'" -msgstr "Onay eykay oundfay inay overrideay ingstray '%s'" - -#: daemon/x52d_config_parser.c:288 -#, c-format -msgid "No value found in override string '%s'" -msgstr "Onay aluevay oundfay inay overrideay ingstray '%s'" - -#: daemon/x52d_config_parser.c:339 -#, c-format -msgid "Error processing override '%s.%s=%s'" -msgstr "Erroray ocessingpray overriday '%s.%s=%s'" - -#: daemon/x52d_device.c:37 -msgid "Starting X52 device manager thread" -msgstr "Artingstay X52 eviceday anagermay eadthray" - -#: daemon/x52d_device.c:44 -#, c-format -msgid "Error %d connecting to device: %s" -msgstr "Erroray %d onnectingcay otay eviceday: %s" - -#: daemon/x52d_device.c:53 -msgid "Device connected, writing configuration" -msgstr "Eviceday onnectedcay, itingwray onfigurationcay" - -#: daemon/x52d_device.c:76 -msgid "Initializing libx52" -msgstr "Initializingay libx52" - -#: daemon/x52d_device.c:80 -#, c-format -msgid "Failure %d initializing libx52: %s" -msgstr "Ailurefay %d initializeay libx52: %s" - -#: daemon/x52d_device.c:91 -msgid "Shutting down X52 device manager thread" -msgstr "Uttingshay ownday X52 eviceday anagermay eadthray" - -#: daemon/x52d_device.c:104 -#, c-format -msgid "Error %d when updating X52 parameter: %s" -msgstr "Erroray %d enwhay updatingay X52 arameterpay: %s" - -#: daemon/x52d_device.c:180 -#, c-format -msgid "Error %d when updating X52 device: %s" -msgstr "Erroray %d enwhay updatingay X52 eviceday: %s" - -#: daemon/x52d_io.c:43 -msgid "Starting X52 I/O thread" -msgstr "Artingstay X52 I/O eadthray" - -#: daemon/x52d_io.c:65 -#, c-format -msgid "Error %d opening X52 I/O device: %s" -msgstr "Erroray %d openingay X52 I/O eviceday: %s" - -#: daemon/x52d_io.c:76 -#, c-format -msgid "Error %d reading from X52 I/O device: %s" -msgstr "Erroray %d eadingray omfray X52 I/O eviceday: %s" - -#: daemon/x52d_io.c:103 -#, c-format -msgid "Error %d initializing X52 I/O library: %s" -msgstr "Erroray %d initializingay X52 ibrarylay: %s" - -#: daemon/x52d_io.c:109 -#, c-format -msgid "Error %d initializing I/O driver thread: %s" -msgstr "Erroray %d initializingay I/O iverdray eadthray: %s" - -#: daemon/x52d_io.c:116 -msgid "Shutting down X52 I/O driver thread" -msgstr "Uttingshay ownday X52 I/O iverdray eadthray" - -#: daemon/x52d_mouse.c:38 daemon/x52d_mouse.c:44 +#: daemon/mouse.c:38 daemon/mouse.c:44 #, c-format msgid "Clamping %s value %d to range [%d..%d]" msgstr "Ampingclay %s aluevay %d otay angeray [%d..%d]" -#: daemon/x52d_mouse.c:54 +#: daemon/mouse.c:54 #, c-format msgid "Setting mouse enable to %s" msgstr "Ettingsay ousemay enableay otay %s" -#: daemon/x52d_mouse.c:71 +#: daemon/mouse.c:71 msgid "" "Config option 'mouse.speed' is DEPRECATED. Please use 'mouse.sensitivity' " "instead" @@ -935,155 +950,140 @@ msgstr "" "Onfigcay optionay 'mouse.speed' isay EPRECATEDDAY. Easeplay useay 'mouse." "sensitivity' insteaday" -#: daemon/x52d_mouse.c:86 +#: daemon/mouse.c:86 #, c-format msgid "Migrating legacy mouse speed '%d' to sensitivity '%d' (percentage)" msgstr "" "Igratingmay egacylay ousemay eedspay '%d' otay ensitivitysay " "'%d' (ercentagepay)" -#: daemon/x52d_mouse.c:88 +#: daemon/mouse.c:88 msgid "speed -> sensitivity" msgstr "eedspay -> ensitivitysay" -#: daemon/x52d_mouse.c:94 +#: daemon/mouse.c:94 #, c-format msgid "Setting mouse reverse scroll to %s" msgstr "Ettingsay ousemay everseray ollscray otay %s" -#: daemon/x52d_mouse.c:106 +#: daemon/mouse.c:106 #, c-format msgid "Setting mouse isometric mode to %s" msgstr "Ettingsay ousemay isometricay odemay otay %s" -#: daemon/x52d_mouse.c:113 +#: daemon/mouse.c:113 msgid "sensitivity" msgstr "ensitivitysay" -#: daemon/x52d_mouse.c:116 +#: daemon/mouse.c:116 #, c-format msgid "Setting mouse sensitivity to %d%%" msgstr "Ettingsay ousemay ensitivitysay otay %d" -#: daemon/x52d_mouse.c:123 +#: daemon/mouse.c:123 msgid "curve factor" msgstr "urvecay actorfay" -#: daemon/x52d_mouse.c:124 +#: daemon/mouse.c:124 #, c-format msgid "Setting mouse curve factor to %d" msgstr "Ettingsay ousemay urvecay actorfay otay %d" -#: daemon/x52d_mouse.c:130 +#: daemon/mouse.c:130 msgid "deadzone factor" msgstr "eadzoneday actorfay" -#: daemon/x52d_mouse.c:131 +#: daemon/mouse.c:131 #, c-format msgid "Setting mouse deadzone to %d" msgstr "Ettingsay ousemay eadzoneday otay %d" -#: daemon/x52d_mouse_handler.c:44 +#: daemon/mouse_handler.c:44 #, c-format msgid "Error %d writing mouse button event (button %d, state %d)" msgstr "" "Erroray %d itingwray ousemay uttonbay eventay (uttonbay %d, atestay %d)" -#: daemon/x52d_mouse_handler.c:82 +#: daemon/mouse_handler.c:82 #, c-format msgid "Error writing mouse wheel event %d" msgstr "Erroray itingwray ousemay eelwhay eventay %d" -#: daemon/x52d_mouse_handler.c:185 +#: daemon/mouse_handler.c:185 #, c-format msgid "Error %d writing mouse axis event (dx %d, dy %d)" msgstr "Erroray %d itingwray ousemay axisay eventay (xday %d, yday %d)" -#: daemon/x52d_mouse_handler.c:197 +#: daemon/mouse_handler.c:197 msgid "Error writing mouse sync event" msgstr "Erroray itingwray ousemay yncsay eventay" -#: daemon/x52d_mouse_handler.c:216 +#: daemon/mouse_handler.c:216 msgid "Starting X52 virtual mouse driver thread" msgstr "Artingstay X52 irtualvay ousemay iverdray eadthray" -#: daemon/x52d_mouse_handler.c:235 +#: daemon/mouse_handler.c:235 #, c-format msgid "Error %d initializing mouse thread: %s" msgstr "Erroray %d initializingay ousemay eadthray: %s" -#: daemon/x52d_mouse_handler.c:242 +#: daemon/mouse_handler.c:242 msgid "Shutting down X52 virtual mouse driver thread" msgstr "Uttingshay ownday X52 irtualvay ousemay iverdray eadthray" -#: daemon/x52d_mouse_handler.c:249 +#: daemon/mouse_handler.c:249 msgid "Virtual mouse not created. Ignoring thread state change" msgstr "Irtualvay ousemay otnay eatedcray. Ignoringa eadthray atestay angechay" -#: daemon/x52d_mouse_handler.c:301 daemon/x52d_mouse_handler.c:309 +#: daemon/mouse_handler.c:301 daemon/mouse_handler.c:309 #, c-format msgid "Error %d creating X52 virtual mouse" msgstr "Erroray %d eatingcray X52 irtualvay ousemay" -#: daemon/x52d_notify.c:46 +#: daemon/notify.c:46 #, c-format msgid "Error creating notification socket: %s" msgstr "Erroray eatingcray otificationnay ocketsay: %s" -#: daemon/x52d_notify.c:51 +#: daemon/notify.c:51 #, c-format msgid "Error marking notification socket as nonblocking: %s" msgstr "Erroray arkingmay otificationnay ocketsay asay onblockingnay: %s" -#: daemon/x52d_notify.c:56 +#: daemon/notify.c:56 #, c-format msgid "Error listening on notification socket: %s" msgstr "Erroray isteninglay onay otificationnay ocketsay: %s" -#: daemon/x52d_notify.c:65 +#: daemon/notify.c:65 msgid "Error setting up notification socket" msgstr "Erroray ettingsay upay otificationnay ocketsay: %s" -#: daemon/x52d_notify.c:81 daemon/x52d_notify.c:91 +#: daemon/notify.c:81 daemon/notify.c:91 #, c-format msgid "Error %d reading from pipe: %s" msgstr "Erroray eadingray omfray ipepay %d: %s" -#: daemon/x52d_notify.c:128 +#: daemon/notify.c:128 #, c-format msgid "Error %d writing notification pipe: %s" msgstr "Erroray %d itingwray otificationnay ipepay: %s" -#: daemon/x52d_notify.c:174 +#: daemon/notify.c:174 #, c-format msgid "Error %d creating notification pipe: %s" msgstr "Erroray %d eatingcray otificationnay ipepay: %s" -#: daemon/x52d_notify.c:183 +#: daemon/notify.c:183 #, c-format msgid "Error %d initializing notify thread: %s" msgstr "Erroray %d initializingay otifynay eadthray: %s" -#: daemon/x52d_notify.c:189 +#: daemon/notify.c:189 #, c-format msgid "Error %d initializing notify listener: %s" msgstr "Erroray %d initializingay otifynay istenerlay: %s" -#: daemon/x52ctl.c:60 -#, c-format -msgid "Usage: %s [-i] [-s socket-path] [command]\n" -msgstr "Usageay: %s [-i] [-s ocketsay-athpay] [ommandcay]\n" - -#: daemon/x52ctl.c:73 -#, c-format -msgid "Argument length too long\n" -msgstr "Argumentay engthlay ootay onglay\n" - -#: daemon/x52ctl.c:180 -#, c-format -msgid "Running in interactive mode, ignoring extra arguments\n" -msgstr "Unningray inay interactiveay odemay, ignoringay extraay argumentsay\n" - #, c-format #~ msgid "Ignoring mouse speed %d outside supported range (0-%d)" #~ msgstr "Ignoringay ousemay eedspay %d outsideay upportedsay angeray (0-%d)" diff --git a/subprojects/Makefile.am b/subprojects/Makefile.am deleted file mode 100644 index e067e74..0000000 --- a/subprojects/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# Top-level automake for libx52 and associated libraries -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -SUBDIRS = pinelog - diff --git a/subprojects/pinelog/Makefile.am b/subprojects/pinelog/Makefile.am deleted file mode 100644 index b48f9ae..0000000 --- a/subprojects/pinelog/Makefile.am +++ /dev/null @@ -1,231 +0,0 @@ -# Top level Automake for pinelog -# -# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: MIT - -ACLOCAL_AMFLAGS = -I m4 - -# Extra files that need to be in the distribution -EXTRA_DIST = \ - LICENSE \ - README.md \ - pinelog.h - -noinst_LTLIBRARIES = libpinelog.la - -# pinelog logging library -libpinelog_la_SOURCES = pinelog.c -libpinelog_la_CFLAGS = @PINELOG_CFLAGS@ $(WARN_CFLAGS) -I $(top_builddir) -libpinelog_la_LDFLAGS = $(WARN_LDFLAGS) - -test_SRCFILES = test_pinelog.c $(libpinelog_la_SOURCES) -bench_SRCFILES = bench_pinelog.c $(libpinelog_la_SOURCES) -test_CFLAGS = \ - -DPINELOG_FATAL_STR='"F"' \ - -DPINELOG_ERROR_STR='"E"' \ - -DPINELOG_WARNING_STR='"W"' \ - -DPINELOG_INFO_STR='"I"' \ - -DPINELOG_DEBUG_STR='"D"' \ - -DPINELOG_TRACE_STR='"T"' \ - -DPINELOG_DEFAULT_LEVEL=PINELOG_LVL_TRACE \ - -DPINELOG_DEFAULT_STREAM=stderr \ - -DPINELOG_TEST -I $(top_builddir) - -LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh --comments -TESTS = \ - fp_test_ts_lvl_tr \ - fp_test_ts_lvl_notr \ - fp_test_ts_nolvl_tr \ - fp_test_ts_nolvl_notr \ - fp_test_nots_lvl_tr \ - fp_test_nots_lvl_notr \ - fp_test_nots_nolvl_tr \ - fp_test_nots_nolvl_notr \ - fp_bench_ts_lvl_tr \ - fp_bench_ts_lvl_notr \ - fp_bench_ts_nolvl_tr \ - fp_bench_ts_nolvl_notr \ - fp_bench_nots_lvl_tr \ - fp_bench_nots_lvl_notr \ - fp_bench_nots_nolvl_tr \ - fp_bench_nots_nolvl_notr \ - str_test_ts_lvl_tr \ - str_test_ts_lvl_notr \ - str_test_ts_nolvl_tr \ - str_test_ts_nolvl_notr \ - str_test_nots_lvl_tr \ - str_test_nots_lvl_notr \ - str_test_nots_nolvl_tr \ - str_test_nots_nolvl_notr \ - str_bench_ts_lvl_tr \ - str_bench_ts_lvl_notr \ - str_bench_ts_nolvl_tr \ - str_bench_ts_nolvl_notr \ - str_bench_nots_lvl_tr \ - str_bench_nots_lvl_notr \ - str_bench_nots_nolvl_tr \ - str_bench_nots_nolvl_notr - -check_PROGRAMS = $(TESTS) -fp_test_ts_lvl_tr_SOURCES = $(test_SRCFILES) -fp_test_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -fp_test_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_ts_lvl_notr_SOURCES = $(test_SRCFILES) -fp_test_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -fp_test_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_ts_nolvl_tr_SOURCES = $(test_SRCFILES) -fp_test_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -fp_test_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_ts_nolvl_notr_SOURCES = $(test_SRCFILES) -fp_test_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -fp_test_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_nots_lvl_tr_SOURCES = $(test_SRCFILES) -fp_test_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -fp_test_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_nots_lvl_notr_SOURCES = $(test_SRCFILES) -fp_test_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -fp_test_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_nots_nolvl_tr_SOURCES = $(test_SRCFILES) -fp_test_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -fp_test_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_test_nots_nolvl_notr_SOURCES = $(test_SRCFILES) -fp_test_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -fp_test_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_ts_lvl_tr_SOURCES = $(bench_SRCFILES) -fp_bench_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -fp_bench_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_ts_lvl_notr_SOURCES = $(bench_SRCFILES) -fp_bench_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -fp_bench_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_ts_nolvl_tr_SOURCES = $(bench_SRCFILES) -fp_bench_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -fp_bench_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_ts_nolvl_notr_SOURCES = $(bench_SRCFILES) -fp_bench_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -fp_bench_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_nots_lvl_tr_SOURCES = $(bench_SRCFILES) -fp_bench_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -fp_bench_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_nots_lvl_notr_SOURCES = $(bench_SRCFILES) -fp_bench_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -fp_bench_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_nots_nolvl_tr_SOURCES = $(bench_SRCFILES) -fp_bench_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -fp_bench_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -fp_bench_nots_nolvl_notr_SOURCES = $(bench_SRCFILES) -fp_bench_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -fp_bench_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -test_CFLAGS += -DPINELOG_BUFFER_SZ=4096 -str_test_ts_lvl_tr_SOURCES = $(test_SRCFILES) -str_test_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -str_test_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_ts_lvl_notr_SOURCES = $(test_SRCFILES) -str_test_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -str_test_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_ts_nolvl_tr_SOURCES = $(test_SRCFILES) -str_test_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -str_test_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_ts_nolvl_notr_SOURCES = $(test_SRCFILES) -str_test_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -str_test_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_nots_lvl_tr_SOURCES = $(test_SRCFILES) -str_test_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -str_test_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_nots_lvl_notr_SOURCES = $(test_SRCFILES) -str_test_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -str_test_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_nots_nolvl_tr_SOURCES = $(test_SRCFILES) -str_test_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -str_test_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_test_nots_nolvl_notr_SOURCES = $(test_SRCFILES) -str_test_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -str_test_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_ts_lvl_tr_SOURCES = $(bench_SRCFILES) -str_bench_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -str_bench_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_ts_lvl_notr_SOURCES = $(bench_SRCFILES) -str_bench_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -str_bench_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_ts_nolvl_tr_SOURCES = $(bench_SRCFILES) -str_bench_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -str_bench_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_ts_nolvl_notr_SOURCES = $(bench_SRCFILES) -str_bench_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -str_bench_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_nots_lvl_tr_SOURCES = $(bench_SRCFILES) -str_bench_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1 -str_bench_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_nots_lvl_notr_SOURCES = $(bench_SRCFILES) -str_bench_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0 -str_bench_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_nots_nolvl_tr_SOURCES = $(bench_SRCFILES) -str_bench_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1 -str_bench_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS) - -str_bench_nots_nolvl_notr_SOURCES = $(bench_SRCFILES) -str_bench_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \ - -DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0 -str_bench_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS) - diff --git a/subprojects/pinelog/README.md b/subprojects/pinelog/README.md index 1f7e26f..0e8112e 100644 --- a/subprojects/pinelog/README.md +++ b/subprojects/pinelog/README.md @@ -97,9 +97,17 @@ default to `0` (disabled). Set the flag to `1` to enable it. * `PINELOG_SHOW_BACKTRACE` - Display the file and line where the message is logged. +* `PINELOG_STRIP_FILE_PATH` - If `1` (default), the file in the log line is only + the basename. If `0`, the compiler’s `__FILE__` is used instead, which usually + keeps a path prefix (for example `libx52/core.c` vs `libx52io/core.c`). + Set these flags by using the `-D` compiler argument, .e.g. `-DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_DATE=1` +When using Meson, the pinelog option `strip-file-path` sets +`-DPINELOG_STRIP_FILE_PATH` for the library and for dependents via +`declare_dependency(compile_args: ...)`. + ### Level strings The application can control the level strings displayed by means of preprocessor diff --git a/subprojects/pinelog/autogen.sh b/subprojects/pinelog/autogen.sh deleted file mode 100755 index e10d140..0000000 --- a/subprojects/pinelog/autogen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -x - -autoreconf --install diff --git a/subprojects/pinelog/configure.ac b/subprojects/pinelog/configure.ac deleted file mode 100644 index da779cf..0000000 --- a/subprojects/pinelog/configure.ac +++ /dev/null @@ -1,23 +0,0 @@ -# Autoconf settings for pinelog -# -# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: MIT - -AC_INIT([pinelog], [1.0.0], [nirenjan@nirenjan.org]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) -AC_REQUIRE_AUX_FILE([tap-driver.sh]) -AC_PROG_CC -AC_PROG_CC_STDC -AC_PROG_AWK -AM_PROG_AR -LT_INIT -PKG_PROG_PKG_CONFIG -PKG_INSTALLDIR -AX_COMPILER_FLAGS - -AC_SUBST([PINELOG_CFLAGS]) - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/subprojects/pinelog/m4/ax_append_compile_flags.m4 b/subprojects/pinelog/m4/ax_append_compile_flags.m4 deleted file mode 100644 index 9c85635..0000000 --- a/subprojects/pinelog/m4/ax_append_compile_flags.m4 +++ /dev/null @@ -1,46 +0,0 @@ -# ============================================================================ -# https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# For every FLAG1, FLAG2 it is checked whether the compiler works with the -# flag. If it does, the flag is added FLAGS-VARIABLE -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. During the check the flag is always added to the -# current language's flags. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: This macro depends on the AX_APPEND_FLAG and -# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with -# AX_APPEND_LINK_FLAGS. -# -# LICENSE -# -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 7 - -AC_DEFUN([AX_APPEND_COMPILE_FLAGS], -[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) -AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) -for flag in $1; do - AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) -done -])dnl AX_APPEND_COMPILE_FLAGS diff --git a/subprojects/pinelog/m4/ax_append_flag.m4 b/subprojects/pinelog/m4/ax_append_flag.m4 deleted file mode 100644 index dd6d8b6..0000000 --- a/subprojects/pinelog/m4/ax_append_flag.m4 +++ /dev/null @@ -1,50 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) -# -# DESCRIPTION -# -# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space -# added in between. -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains -# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly -# FLAG. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AC_DEFUN([AX_APPEND_FLAG], -[dnl -AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF -AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) -AS_VAR_SET_IF(FLAGS,[ - AS_CASE([" AS_VAR_GET(FLAGS) "], - [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], - [ - AS_VAR_APPEND(FLAGS,[" $1"]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) - ], - [ - AS_VAR_SET(FLAGS,[$1]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) -AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_APPEND_FLAG diff --git a/subprojects/pinelog/m4/ax_append_link_flags.m4 b/subprojects/pinelog/m4/ax_append_link_flags.m4 deleted file mode 100644 index 99b9fa5..0000000 --- a/subprojects/pinelog/m4/ax_append_link_flags.m4 +++ /dev/null @@ -1,44 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# For every FLAG1, FLAG2 it is checked whether the linker works with the -# flag. If it does, the flag is added FLAGS-VARIABLE -# -# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is -# used. During the check the flag is always added to the linker's flags. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. -# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. -# -# LICENSE -# -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 7 - -AC_DEFUN([AX_APPEND_LINK_FLAGS], -[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) -AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) -for flag in $1; do - AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4]) -done -])dnl AX_APPEND_LINK_FLAGS diff --git a/subprojects/pinelog/m4/ax_check_compile_flag.m4 b/subprojects/pinelog/m4/ax_check_compile_flag.m4 deleted file mode 100644 index bd753b3..0000000 --- a/subprojects/pinelog/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/subprojects/pinelog/m4/ax_check_link_flag.m4 b/subprojects/pinelog/m4/ax_check_link_flag.m4 deleted file mode 100644 index 03a30ce..0000000 --- a/subprojects/pinelog/m4/ax_check_link_flag.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the linker or gives an error. -# (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_LINK_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_LINK_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $4 $1" - AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - LDFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_LINK_FLAGS diff --git a/subprojects/pinelog/m4/ax_compiler_flags.m4 b/subprojects/pinelog/m4/ax_compiler_flags.m4 deleted file mode 100644 index ddb0456..0000000 --- a/subprojects/pinelog/m4/ax_compiler_flags.m4 +++ /dev/null @@ -1,158 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPILER_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [IS-RELEASE], [EXTRA-BASE-CFLAGS], [EXTRA-YES-CFLAGS], [UNUSED], [UNUSED], [UNUSED], [EXTRA-BASE-LDFLAGS], [EXTRA-YES-LDFLAGS], [UNUSED], [UNUSED], [UNUSED]) -# -# DESCRIPTION -# -# Check for the presence of an --enable-compile-warnings option to -# configure, defaulting to "error" in normal operation, or "yes" if -# IS-RELEASE is equal to "yes". Return the value in the variable -# $ax_enable_compile_warnings. -# -# Depending on the value of --enable-compile-warnings, different compiler -# warnings are checked to see if they work with the current compiler and, -# if so, are appended to CFLAGS-VARIABLE and LDFLAGS-VARIABLE. This -# allows a consistent set of baseline compiler warnings to be used across -# a code base, irrespective of any warnings enabled locally by individual -# developers. By standardising the warnings used by all developers of a -# project, the project can commit to a zero-warnings policy, using -Werror -# to prevent compilation if new warnings are introduced. This makes -# catching bugs which are flagged by warnings a lot easier. -# -# By providing a consistent --enable-compile-warnings argument across all -# projects using this macro, continuous integration systems can easily be -# configured the same for all projects. Automated systems or build -# systems aimed at beginners may want to pass the --disable-Werror -# argument to unconditionally prevent warnings being fatal. -# -# --enable-compile-warnings can take the values: -# -# * no: Base compiler warnings only; not even -Wall. -# * yes: The above, plus a broad range of useful warnings. -# * error: The above, plus -Werror so that all warnings are fatal. -# Use --disable-Werror to override this and disable fatal -# warnings. -# -# The set of base and enabled flags can be augmented using the -# EXTRA-*-CFLAGS and EXTRA-*-LDFLAGS variables, which are tested and -# appended to the output variable if --enable-compile-warnings is not -# "no". Flags should not be disabled using these arguments, as the entire -# point of AX_COMPILER_FLAGS is to enforce a consistent set of useful -# compiler warnings on code, using warnings which have been chosen for low -# false positive rates. If a compiler emits false positives for a -# warning, a #pragma should be used in the code to disable the warning -# locally. See: -# -# https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas -# -# The EXTRA-* variables should only be used to supply extra warning flags, -# and not general purpose compiler flags, as they are controlled by -# configure options such as --disable-Werror. -# -# IS-RELEASE can be used to disable -Werror when making a release, which -# is useful for those hairy moments when you just want to get the release -# done as quickly as possible. Set it to "yes" to disable -Werror. By -# default, it uses the value of $ax_is_release, so if you are using the -# AX_IS_RELEASE macro, there is no need to pass this parameter. For -# example: -# -# AX_IS_RELEASE([git-directory]) -# AX_COMPILER_FLAGS() -# -# CFLAGS-VARIABLE defaults to WARN_CFLAGS, and LDFLAGS-VARIABLE defaults -# to WARN_LDFLAGS. Both variables are AC_SUBST-ed by this macro, but must -# be manually added to the CFLAGS and LDFLAGS variables for each target in -# the code base. -# -# If C++ language support is enabled with AC_PROG_CXX, which must occur -# before this macro in configure.ac, warning flags for the C++ compiler -# are AC_SUBST-ed as WARN_CXXFLAGS, and must be manually added to the -# CXXFLAGS variables for each target in the code base. EXTRA-*-CFLAGS can -# be used to augment the base and enabled flags. -# -# Warning flags for g-ir-scanner (from GObject Introspection) are -# AC_SUBST-ed as WARN_SCANNERFLAGS. This variable must be manually added -# to the SCANNERFLAGS variable for each GIR target in the code base. If -# extra g-ir-scanner flags need to be enabled, the AX_COMPILER_FLAGS_GIR -# macro must be invoked manually. -# -# AX_COMPILER_FLAGS may add support for other tools in future, in addition -# to the compiler and linker. No extra EXTRA-* variables will be added -# for those tools, and all extra support will still use the single -# --enable-compile-warnings configure option. For finer grained control -# over the flags for individual tools, use AX_COMPILER_FLAGS_CFLAGS, -# AX_COMPILER_FLAGS_LDFLAGS and AX_COMPILER_FLAGS_* for new tools. -# -# The UNUSED variables date from a previous version of this macro, and are -# automatically appended to the preceding non-UNUSED variable. They should -# be left empty in new uses of the macro. -# -# LICENSE -# -# Copyright (c) 2014, 2015 Philip Withnall -# Copyright (c) 2015 David King -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 14 - -# _AX_COMPILER_FLAGS_LANG([LANGNAME]) -m4_defun([_AX_COMPILER_FLAGS_LANG], -[m4_ifdef([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [], - [m4_define([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [])dnl - AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_]$1[FLAGS])])dnl -]) - -AC_DEFUN([AX_COMPILER_FLAGS],[ - # C support is enabled by default. - _AX_COMPILER_FLAGS_LANG([C]) - # Only enable C++ support if AC_PROG_CXX is called. The redefinition of - # AC_PROG_CXX is so that a fatal error is emitted if this macro is called - # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be - # checked. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AX_COMPILER_FLAGS_LANG([CXX])], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AX_COMPILER_FLAGS_LANG([CXX])])]) - AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS]) - - # Default value for IS-RELEASE is $ax_is_release - ax_compiler_flags_is_release=m4_tolower(m4_normalize(ifelse([$3],, - [$ax_is_release], - [$3]))) - - AC_ARG_ENABLE([compile-warnings], - AS_HELP_STRING([--enable-compile-warnings=@<:@no/yes/error@:>@], - [Enable compiler warnings and errors]),, - [AS_IF([test "$ax_compiler_flags_is_release" = "yes"], - [enable_compile_warnings="yes"], - [enable_compile_warnings="error"])]) - AC_ARG_ENABLE([Werror], - AS_HELP_STRING([--disable-Werror], - [Unconditionally make all compiler warnings non-fatal]),, - [enable_Werror=maybe]) - - # Return the user's chosen warning level - AS_IF([test "$enable_Werror" = "no" -a \ - "$enable_compile_warnings" = "error"],[ - enable_compile_warnings="yes" - ]) - - ax_enable_compile_warnings=$enable_compile_warnings - - AX_COMPILER_FLAGS_CFLAGS([$1],[$ax_compiler_flags_is_release], - [$4],[$5 $6 $7 $8]) - m4_ifdef([_AX_COMPILER_FLAGS_LANG_CXX_enabled], - [AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS], - [$ax_compiler_flags_is_release], - [$4],[$5 $6 $7 $8])]) - AX_COMPILER_FLAGS_LDFLAGS([$2],[$ax_compiler_flags_is_release], - [$9],[$10 $11 $12 $13]) - AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$ax_compiler_flags_is_release]) -])dnl AX_COMPILER_FLAGS diff --git a/subprojects/pinelog/m4/ax_compiler_flags_cflags.m4 b/subprojects/pinelog/m4/ax_compiler_flags_cflags.m4 deleted file mode 100644 index 916f918..0000000 --- a/subprojects/pinelog/m4/ax_compiler_flags_cflags.m4 +++ /dev/null @@ -1,161 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cflags.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_COMPILER_FLAGS_CFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) -# -# DESCRIPTION -# -# Add warning flags for the C compiler to VARIABLE, which defaults to -# WARN_CFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be -# manually added to the CFLAGS variable for each target in the code base. -# -# This macro depends on the environment set up by AX_COMPILER_FLAGS. -# Specifically, it uses the value of $ax_enable_compile_warnings to decide -# which flags to enable. -# -# LICENSE -# -# Copyright (c) 2014, 2015 Philip Withnall -# Copyright (c) 2017, 2018 Reini Urban -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 17 - -AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ - AC_REQUIRE([AC_PROG_SED]) - AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS]) - AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) - AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) - - # Variable names - m4_define([ax_warn_cflags_variable], - [m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))]) - - AC_LANG_PUSH([C]) - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - [#ifndef __cplusplus - #error "no C++" - #endif]])], - [ax_compiler_cxx=yes;], - [ax_compiler_cxx=no;]) - - # Always pass -Werror=unknown-warning-option to get Clang to fail on bad - # flags, otherwise they are always appended to the warn_cflags variable, and - # Clang warns on them for every compilation unit. - # If this is passed to GCC, it will explode, so the flag must be enabled - # conditionally. - AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ - ax_compiler_flags_test="-Werror=unknown-warning-option" - ],[ - ax_compiler_flags_test="" - ]) - - # Check that -Wno-suggest-attribute=format is supported - AX_CHECK_COMPILE_FLAG([-Wno-suggest-attribute=format],[ - ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" - ],[ - ax_compiler_no_suggest_attribute_flags="" - ]) - - # Base flags - AX_APPEND_COMPILE_FLAGS([ dnl - -fno-strict-aliasing dnl - $3 dnl - ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) - - AS_IF([test "$ax_enable_compile_warnings" != "no"],[ - if test "$ax_compiler_cxx" = "no" ; then - # C-only flags. Warn in C++ - AX_APPEND_COMPILE_FLAGS([ dnl - -Wnested-externs dnl - -Wmissing-prototypes dnl - -Wstrict-prototypes dnl - -Wdeclaration-after-statement dnl - -Wimplicit-function-declaration dnl - -Wold-style-definition dnl - -Wjump-misses-init dnl - ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) - fi - - # "yes" flags - AX_APPEND_COMPILE_FLAGS([ dnl - -Wall dnl - -Wextra dnl - -Wundef dnl - -Wwrite-strings dnl - -Wpointer-arith dnl - -Wmissing-declarations dnl - -Wredundant-decls dnl - -Wno-unused-parameter dnl - -Wno-missing-field-initializers dnl - -Wformat=2 dnl - -Wcast-align dnl - -Wformat-nonliteral dnl - -Wformat-security dnl - -Wsign-compare dnl - -Wstrict-aliasing dnl - -Wshadow dnl - -Winline dnl - -Wpacked dnl - -Wmissing-format-attribute dnl - -Wmissing-noreturn dnl - -Winit-self dnl - -Wredundant-decls dnl - -Wmissing-include-dirs dnl - -Wunused-but-set-variable dnl - -Warray-bounds dnl - -Wreturn-type dnl - -Wswitch-enum dnl - -Wswitch-default dnl - -Wduplicated-cond dnl - -Wduplicated-branches dnl - -Wlogical-op dnl - -Wrestrict dnl - -Wnull-dereference dnl - -Wdouble-promotion dnl - $4 dnl - $5 dnl - $6 dnl - $7 dnl - ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) - ]) - AS_IF([test "$ax_enable_compile_warnings" = "error"],[ - # "error" flags; -Werror has to be appended unconditionally because - # it's not possible to test for - # - # suggest-attribute=format is disabled because it gives too many false - # positives - AX_APPEND_FLAG([-Werror],ax_warn_cflags_variable) - - AX_APPEND_COMPILE_FLAGS([ dnl - [$ax_compiler_no_suggest_attribute_flags] dnl - ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) - ]) - - # In the flags below, when disabling specific flags, always add *both* - # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) - # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, - # which effectively turns that flag back on again as an error. - for flag in $ax_warn_cflags_variable; do - AS_CASE([$flag], - [-Wno-*=*],[], - [-Wno-*],[ - AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')], - ax_warn_cflags_variable, - [$ax_compiler_flags_test]) - ]) - done - - AC_LANG_POP([C]) - - # Substitute the variables - AC_SUBST(ax_warn_cflags_variable) -])dnl AX_COMPILER_FLAGS diff --git a/subprojects/pinelog/m4/ax_compiler_flags_gir.m4 b/subprojects/pinelog/m4/ax_compiler_flags_gir.m4 deleted file mode 100644 index 5b4924a..0000000 --- a/subprojects/pinelog/m4/ax_compiler_flags_gir.m4 +++ /dev/null @@ -1,60 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) -# -# DESCRIPTION -# -# Add warning flags for the g-ir-scanner (from GObject Introspection) to -# VARIABLE, which defaults to WARN_SCANNERFLAGS. VARIABLE is AC_SUBST-ed -# by this macro, but must be manually added to the SCANNERFLAGS variable -# for each GIR target in the code base. -# -# This macro depends on the environment set up by AX_COMPILER_FLAGS. -# Specifically, it uses the value of $ax_enable_compile_warnings to decide -# which flags to enable. -# -# LICENSE -# -# Copyright (c) 2015 Philip Withnall -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_COMPILER_FLAGS_GIR],[ - AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) - - # Variable names - m4_define([ax_warn_scannerflags_variable], - [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))]) - - # Base flags - AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable) - - AS_IF([test "$ax_enable_compile_warnings" != "no"],[ - # "yes" flags - AX_APPEND_FLAG([ dnl - --warn-all dnl - $4 dnl - $5 dnl - $6 dnl - $7 dnl - ],ax_warn_scannerflags_variable) - ]) - AS_IF([test "$ax_enable_compile_warnings" = "error"],[ - # "error" flags - AX_APPEND_FLAG([ dnl - --warn-error dnl - ],ax_warn_scannerflags_variable) - ]) - - # Substitute the variables - AC_SUBST(ax_warn_scannerflags_variable) -])dnl AX_COMPILER_FLAGS diff --git a/subprojects/pinelog/m4/ax_compiler_flags_ldflags.m4 b/subprojects/pinelog/m4/ax_compiler_flags_ldflags.m4 deleted file mode 100644 index 976d119..0000000 --- a/subprojects/pinelog/m4/ax_compiler_flags_ldflags.m4 +++ /dev/null @@ -1,111 +0,0 @@ -# ============================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_ldflags.html -# ============================================================================== -# -# SYNOPSIS -# -# AX_COMPILER_FLAGS_LDFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) -# -# DESCRIPTION -# -# Add warning flags for the linker to VARIABLE, which defaults to -# WARN_LDFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be -# manually added to the LDFLAGS variable for each target in the code base. -# -# This macro depends on the environment set up by AX_COMPILER_FLAGS. -# Specifically, it uses the value of $ax_enable_compile_warnings to decide -# which flags to enable. -# -# LICENSE -# -# Copyright (c) 2014, 2015 Philip Withnall -# Copyright (c) 2017, 2018 Reini Urban -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 9 - -AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[ - AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS]) - AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) - AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) - AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) - - # Variable names - m4_define([ax_warn_ldflags_variable], - [m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))]) - - # Always pass -Werror=unknown-warning-option to get Clang to fail on bad - # flags, otherwise they are always appended to the warn_ldflags variable, - # and Clang warns on them for every compilation unit. - # If this is passed to GCC, it will explode, so the flag must be enabled - # conditionally. - AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ - ax_compiler_flags_test="-Werror=unknown-warning-option" - ],[ - ax_compiler_flags_test="" - ]) - - AX_CHECK_LINK_FLAG([-Wl,--as-needed], [ - AX_APPEND_LINK_FLAGS([-Wl,--as-needed], - [AM_LDFLAGS],[$ax_compiler_flags_test]) - ]) - AX_CHECK_LINK_FLAG([-Wl,-z,relro], [ - AX_APPEND_LINK_FLAGS([-Wl,-z,relro], - [AM_LDFLAGS],[$ax_compiler_flags_test]) - ]) - AX_CHECK_LINK_FLAG([-Wl,-z,now], [ - AX_APPEND_LINK_FLAGS([-Wl,-z,now], - [AM_LDFLAGS],[$ax_compiler_flags_test]) - ]) - AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [ - AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack], - [AM_LDFLAGS],[$ax_compiler_flags_test]) - ]) - # textonly, retpolineplt not yet - - # macOS and cygwin linker do not have --as-needed - AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [ - ax_compiler_flags_as_needed_option="-Wl,--no-as-needed" - ], [ - ax_compiler_flags_as_needed_option="" - ]) - - # macOS linker speaks with a different accent - ax_compiler_flags_fatal_warnings_option="" - AX_CHECK_LINK_FLAG([-Wl,--fatal-warnings], [ - ax_compiler_flags_fatal_warnings_option="-Wl,--fatal-warnings" - ]) - AX_CHECK_LINK_FLAG([-Wl,-fatal_warnings], [ - ax_compiler_flags_fatal_warnings_option="-Wl,-fatal_warnings" - ]) - - # Base flags - AX_APPEND_LINK_FLAGS([ dnl - $ax_compiler_flags_as_needed_option dnl - $3 dnl - ],ax_warn_ldflags_variable,[$ax_compiler_flags_test]) - - AS_IF([test "$ax_enable_compile_warnings" != "no"],[ - # "yes" flags - AX_APPEND_LINK_FLAGS([$4 $5 $6 $7], - ax_warn_ldflags_variable, - [$ax_compiler_flags_test]) - ]) - AS_IF([test "$ax_enable_compile_warnings" = "error"],[ - # "error" flags; -Werror has to be appended unconditionally because - # it's not possible to test for - # - # suggest-attribute=format is disabled because it gives too many false - # positives - AX_APPEND_LINK_FLAGS([ dnl - $ax_compiler_flags_fatal_warnings_option dnl - ],ax_warn_ldflags_variable,[$ax_compiler_flags_test]) - ]) - - # Substitute the variables - AC_SUBST(ax_warn_ldflags_variable) -])dnl AX_COMPILER_FLAGS diff --git a/subprojects/pinelog/m4/ax_gcc_func_attribute.m4 b/subprojects/pinelog/m4/ax_gcc_func_attribute.m4 deleted file mode 100644 index fa4e089..0000000 --- a/subprojects/pinelog/m4/ax_gcc_func_attribute.m4 +++ /dev/null @@ -1,242 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) -# -# DESCRIPTION -# -# This macro checks if the compiler supports one of GCC's function -# attributes; many other compilers also provide function attributes with -# the same syntax. Compiler warnings are used to detect supported -# attributes as unsupported ones are ignored by default so quieting -# warnings when using this macro will yield false positives. -# -# The ATTRIBUTE parameter holds the name of the attribute to be checked. -# -# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. -# -# The macro caches its result in the ax_cv_have_func_attribute_ -# variable. -# -# The macro currently supports the following function attributes: -# -# alias -# aligned -# alloc_size -# always_inline -# artificial -# cold -# const -# constructor -# constructor_priority for constructor attribute with priority -# deprecated -# destructor -# dllexport -# dllimport -# error -# externally_visible -# fallthrough -# flatten -# format -# format_arg -# gnu_format -# gnu_inline -# hot -# ifunc -# leaf -# malloc -# noclone -# noinline -# nonnull -# noreturn -# nothrow -# optimize -# pure -# sentinel -# sentinel_position -# unused -# used -# visibility -# warning -# warn_unused_result -# weak -# weakref -# -# Unsupported function attributes will be tested with a prototype -# returning an int and not accepting any arguments and the result of the -# check might be wrong or meaningless so use with care. -# -# LICENSE -# -# Copyright (c) 2013 Gabriele Svelto -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 13 - -AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ - AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) - - AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - m4_case([$1], - [alias], [ - int foo( void ) { return 0; } - int bar( void ) __attribute__(($1("foo"))); - ], - [aligned], [ - int foo( void ) __attribute__(($1(32))); - ], - [alloc_size], [ - void *foo(int a) __attribute__(($1(1))); - ], - [always_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [artificial], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [cold], [ - int foo( void ) __attribute__(($1)); - ], - [const], [ - int foo( void ) __attribute__(($1)); - ], - [constructor_priority], [ - int foo( void ) __attribute__((__constructor__(65535/2))); - ], - [constructor], [ - int foo( void ) __attribute__(($1)); - ], - [deprecated], [ - int foo( void ) __attribute__(($1(""))); - ], - [destructor], [ - int foo( void ) __attribute__(($1)); - ], - [dllexport], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [dllimport], [ - int foo( void ) __attribute__(($1)); - ], - [error], [ - int foo( void ) __attribute__(($1(""))); - ], - [externally_visible], [ - int foo( void ) __attribute__(($1)); - ], - [fallthrough], [ - void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; - ], - [flatten], [ - int foo( void ) __attribute__(($1)); - ], - [format], [ - int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); - ], - [gnu_format], [ - int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); - ], - [format_arg], [ - char *foo(const char *p) __attribute__(($1(1))); - ], - [gnu_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [hot], [ - int foo( void ) __attribute__(($1)); - ], - [ifunc], [ - int my_foo( void ) { return 0; } - static int (*resolve_foo(void))(void) { return my_foo; } - int foo( void ) __attribute__(($1("resolve_foo"))); - ], - [leaf], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [malloc], [ - void *foo( void ) __attribute__(($1)); - ], - [noclone], [ - int foo( void ) __attribute__(($1)); - ], - [noinline], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [nonnull], [ - int foo(char *p) __attribute__(($1(1))); - ], - [noreturn], [ - void foo( void ) __attribute__(($1)); - ], - [nothrow], [ - int foo( void ) __attribute__(($1)); - ], - [optimize], [ - __attribute__(($1(3))) int foo( void ) { return 0; } - ], - [pure], [ - int foo( void ) __attribute__(($1)); - ], - [sentinel], [ - int foo(void *p, ...) __attribute__(($1)); - ], - [sentinel_position], [ - int foo(void *p, ...) __attribute__(($1(1))); - ], - [returns_nonnull], [ - void *foo( void ) __attribute__(($1)); - ], - [unused], [ - int foo( void ) __attribute__(($1)); - ], - [used], [ - int foo( void ) __attribute__(($1)); - ], - [visibility], [ - int foo_def( void ) __attribute__(($1("default"))); - int foo_hid( void ) __attribute__(($1("hidden"))); - int foo_int( void ) __attribute__(($1("internal"))); - int foo_pro( void ) __attribute__(($1("protected"))); - ], - [warning], [ - int foo( void ) __attribute__(($1(""))); - ], - [warn_unused_result], [ - int foo( void ) __attribute__(($1)); - ], - [weak], [ - int foo( void ) __attribute__(($1)); - ], - [weakref], [ - static int foo( void ) { return 0; } - static int bar( void ) __attribute__(($1("foo"))); - ], - [ - m4_warn([syntax], [Unsupported attribute $1, the test may fail]) - int foo( void ) __attribute__(($1)); - ] - )], []) - ], - dnl GCC doesn't exit with an error if an unknown attribute is - dnl provided but only outputs a warning, so accept the attribute - dnl only if no warning were issued. - [AS_IF([grep -- -Wattributes conftest.err], - [AS_VAR_SET([ac_var], [no])], - [AS_VAR_SET([ac_var], [yes])])], - [AS_VAR_SET([ac_var], [no])]) - ]) - - AS_IF([test yes = AS_VAR_GET([ac_var])], - [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, - [Define to 1 if the system has the `$1' function attribute])], []) - - AS_VAR_POPDEF([ac_var]) -]) diff --git a/subprojects/pinelog/m4/ax_require_defined.m4 b/subprojects/pinelog/m4/ax_require_defined.m4 deleted file mode 100644 index 17c3eab..0000000 --- a/subprojects/pinelog/m4/ax_require_defined.m4 +++ /dev/null @@ -1,37 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_REQUIRE_DEFINED(MACRO) -# -# DESCRIPTION -# -# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have -# been defined and thus are available for use. This avoids random issues -# where a macro isn't expanded. Instead the configure script emits a -# non-fatal: -# -# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found -# -# It's like AC_REQUIRE except it doesn't expand the required macro. -# -# Here's an example: -# -# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) -# -# LICENSE -# -# Copyright (c) 2014 Mike Frysinger -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AC_DEFUN([AX_REQUIRE_DEFINED], [dnl - m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) -])dnl AX_REQUIRE_DEFINED diff --git a/subprojects/pinelog/meson.build b/subprojects/pinelog/meson.build index 5ff0142..c31bb59 100644 --- a/subprojects/pinelog/meson.build +++ b/subprojects/pinelog/meson.build @@ -1,10 +1,13 @@ project('pinelog', 'C', default_options: ['show-date=true', 'show-level=true', 'show-backtrace=true']) +pinelog_path_arg = '-DPINELOG_STRIP_FILE_PATH=@0@'.format(get_option('strip-file-path').to_int()) + pinelog_cflags = [ '-DPINELOG_SHOW_DATE=@0@'.format(get_option('show-date').to_int()), '-DPINELOG_SHOW_LEVEL=@0@'.format(get_option('show-level').to_int()), '-DPINELOG_SHOW_BACKTRACE=@0@'.format(get_option('show-backtrace').to_int()), + pinelog_path_arg, ] libpinelog = static_library('pinelog', 'pinelog.c', c_args: pinelog_cflags) @@ -12,7 +15,8 @@ libpinelog = static_library('pinelog', 'pinelog.c', c_args: pinelog_cflags) libpinelog_inc = include_directories('.') libpinelog_dep = declare_dependency( include_directories: libpinelog_inc, - link_with: libpinelog + link_with: libpinelog, + compile_args: [pinelog_path_arg], ) prog_class = ['bench', 'test'] @@ -44,7 +48,8 @@ foreach date_arg: [0, 1] '-DPINELOG_DEFAULT_LEVEL=PINELOG_LVL_TRACE', '-DPINELOG_DEFAULT_STREAM=stderr', '-DPINELOG_TEST', - date_def, level_def, backtrace_def + date_def, level_def, backtrace_def, + pinelog_path_arg, ] test_name = test_name_template.format( date_name, level_name, backtrace_name) diff --git a/subprojects/pinelog/meson_options.txt b/subprojects/pinelog/meson_options.txt index 20273c6..381de8d 100644 --- a/subprojects/pinelog/meson_options.txt +++ b/subprojects/pinelog/meson_options.txt @@ -6,3 +6,6 @@ option('show-level', type: 'boolean', option('show-backtrace', type: 'boolean', description: 'Show backtrace information in log message') + +option('strip-file-path', type: 'boolean', value: true, + description: 'If true, log location shows only the source basename; if false, use the compiler __FILE__ (path prefix helps when many units share a name, e.g. core.c)') diff --git a/subprojects/pinelog/pinelog.h b/subprojects/pinelog/pinelog.h index 61de8e0..06bb6fe 100644 --- a/subprojects/pinelog/pinelog.h +++ b/subprojects/pinelog/pinelog.h @@ -180,10 +180,16 @@ void pinelog_log_message(int module, int level, const char *file, int line, cons #define pinelog_exit exit #endif -// Base filename -#if defined __has_builtin -# if __has_builtin(__builtin_strrchr) -# define PINELOG_FILE __builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__ +/* When 1 (default), only the basename is shown (e.g. core.c). Set to 0 to use the + * compiler's __FILE__ (often a relative path like libx52/core.c vs libx52io/core.c). */ +#ifndef PINELOG_STRIP_FILE_PATH +# define PINELOG_STRIP_FILE_PATH 1 +#endif +#if PINELOG_STRIP_FILE_PATH +# if defined __has_builtin +# if __has_builtin(__builtin_strrchr) +# define PINELOG_FILE __builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__ +# endif # endif #endif #ifndef PINELOG_FILE diff --git a/subprojects/pinelog/test_pinelog.c b/subprojects/pinelog/test_pinelog.c index a34d9a1..7279e6c 100644 --- a/subprojects/pinelog/test_pinelog.c +++ b/subprojects/pinelog/test_pinelog.c @@ -103,22 +103,23 @@ static int test_setup(int module, int level, int filter, const char *file, int l } if (PINELOG_SHOW_BACKTRACE) { - char * basename = NULL; - #if defined __has_builtin - #if __has_builtin(__builtin_strrchr) - basename = strrchr(file, '/'); - #endif - #endif - - if (basename != NULL) { - basename++; - } else { - // Override the const - basename = (char *)file; + /* Match pinelog.h PINELOG_FILE (basename only when strip + __builtin_strrchr). */ + const char *display_file = file; +#if PINELOG_STRIP_FILE_PATH +# if defined __has_builtin +# if __has_builtin(__builtin_strrchr) + { + const char *slash = strrchr(file, '/'); + if (slash != NULL) { + display_file = slash + 1; + } } +# endif +# endif +#endif expected_len += snprintf(&expected_output[expected_len], sizeof(expected_output) - expected_len, - "%s:%d ", basename, line); + "%s:%d ", display_file, line); } if (module >= 0) { diff --git a/sys/gettext.h b/sys/gettext.h index e499680..3dde533 100644 --- a/sys/gettext.h +++ b/sys/gettext.h @@ -22,7 +22,7 @@ #define ENABLE_NLS 0 #endif -/* NLS can be disabled through the configure --disable-nls option. */ +/* NLS can be disabled at build time (e.g. Meson option -Dnls=disabled). */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ diff --git a/udev/Makefile.am b/udev/Makefile.am deleted file mode 100644 index f2cf713..0000000 --- a/udev/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# udev rules installation -# -# Copyright (C) 2020 Nirenjan Krishnan (nirenjan@nirenjan.org) -# -# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 - -EXTRA_DIST += udev/60-saitek-x52-x52pro.rules - -if HAVE_UDEV - -# udev rules need to go to (typically) /lib/udev/rules.d. This location is only -# writable by root, and if we're running make distcheck, we're most likely not -# running as root. Therefore, disable this if we're running make distcheck -if !IS_MAKE_DISTCHECK -udevrules_DATA = udev/60-saitek-x52-x52pro.rules - -# Update udev only if being installed by root -install-data-hook: - $(AM_V_at)if [ "$$(id -u)" = "0" ]; then \ - echo "Installing udev rules" && \ - udevadm control --reload-rules && \ - udevadm trigger --subsystem-match=usb --attr-match=idVendor=06a3 --action=add \ - ;fi ; true -endif - -endif diff --git a/vkm/vkm_common.c b/vkm/common.c similarity index 98% rename from vkm/vkm_common.c rename to vkm/common.c index 5abbbca..f72f614 100644 --- a/vkm/vkm_common.c +++ b/vkm/common.c @@ -6,7 +6,7 @@ * SPDX-LicenseIdentifier: GPL-2.0-only WITH Classpath-exception-2.0 */ -#include "config.h" +#include "build-config.h" #include #include diff --git a/vkm/vkm_linux_evdev.c b/vkm/linux_evdev.c similarity index 99% rename from vkm/vkm_linux_evdev.c rename to vkm/linux_evdev.c index cb37c92..6c73ef8 100644 --- a/vkm/vkm_linux_evdev.c +++ b/vkm/linux_evdev.c @@ -25,7 +25,7 @@ static const int vkm_key_to_evdev[VKM_KEY_MAX] = { #if defined(__GNUC__) || defined(__clang__) [0 ...(VKM_KEY_MAX - 1)] = -1, #else -#error "vkm_linux_evdev.c requires GCC or Clang (sparse vkm_key_to_evdev initializer)" +#error "linux_evdev.c requires GCC or Clang (sparse vkm_key_to_evdev initializer)" #endif [VKM_KEY_NONE] = -1, diff --git a/vkm/vkm_linux_evdev_test.c b/vkm/linux_evdev_test.c similarity index 99% rename from vkm/vkm_linux_evdev_test.c rename to vkm/linux_evdev_test.c index 7f2371b..0c196af 100644 --- a/vkm/vkm_linux_evdev_test.c +++ b/vkm/linux_evdev_test.c @@ -163,7 +163,7 @@ static void expect_enable_mouse_events(bool hi_res, bool horiz) #undef EXPECT_KEY_CODE } -/** Same order as \c enable_keyboard_events() in \c vkm_linux_evdev.c (skip unmapped indices). */ +/** Same order as \c enable_keyboard_events() in \c linux_evdev.c (skip unmapped indices). */ static const unsigned int expect_kb_codes[] = { KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, diff --git a/vkm/meson.build b/vkm/meson.build index da1ba20..ee5623d 100644 --- a/vkm/meson.build +++ b/vkm/meson.build @@ -1,18 +1,18 @@ vkm_version = '0.1.0' vkm_files = files( - 'vkm_common.c' + 'common.c' ) vkm_stub_files = files( - 'vkm_stub.c' + 'stub.c' ) if host_machine.system() == 'linux' vkm_dep = dep_evdev if dep_evdev.found() vkm_platform_files = files( - 'vkm_linux_evdev.c' + 'linux_evdev.c' ) else vkm_platform_files = vkm_stub_files @@ -31,7 +31,7 @@ lib_vkm = library('vkm', vkm_files + vkm_platform_files, vkm_strerror_test = executable('vkm-strerror-test', 'test_strerror.c', - 'vkm_common.c', + 'common.c', build_by_default: false, dependencies: [dep_cmocka, dep_intl], include_directories: [includes], @@ -43,9 +43,9 @@ if host_machine.system() == 'linux' and dep_evdev.found() dep_evdev_headers = dep_evdev.partial_dependency(compile_args: true, link_args: false) vkm_linux_evdev_test = executable('vkm_linux_evdev_test', files( - 'vkm_linux_evdev_test.c', - 'vkm_linux_evdev.c', - 'vkm_common.c', + 'linux_evdev_test.c', + 'linux_evdev.c', + 'common.c', ), include_directories: [includes], dependencies: [dep_cmocka, dep_evdev_headers, dep_intl], @@ -56,6 +56,5 @@ endif install_headers('vkm.h', subdir: 'vkm') pkgconfig.generate(lib_vkm, name: 'vkm', - description: 'Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality.', - subdirs: meson.project_name(), + description: 'Virtual keyboard/mouse interface library for injecting events into the host OS.', version: vkm_version) diff --git a/vkm/vkm_stub.c b/vkm/stub.c similarity index 99% rename from vkm/vkm_stub.c rename to vkm/stub.c index 2b65775..e7fe1c8 100644 --- a/vkm/vkm_stub.c +++ b/vkm/stub.c @@ -9,7 +9,7 @@ #include #include -#include "vkm.h" +#include struct vkm_context { bool started; diff --git a/vkm/test_strerror.c b/vkm/test_strerror.c index 946fe7c..a204b7b 100644 --- a/vkm/test_strerror.c +++ b/vkm/test_strerror.c @@ -13,7 +13,7 @@ #include #include -#include "vkm.h" +#include static void test_strerror(void **state) { diff --git a/vkm/vkm-internal.h b/vkm/vkm-internal.h index b93acae..a7441f1 100644 --- a/vkm/vkm-internal.h +++ b/vkm/vkm-internal.h @@ -7,7 +7,7 @@ */ #include -#include "vkm.h" +#include #ifndef VKM_INTERNAL_H #define VKM_INTERNAL_H