About this chapter

This chapter describes how to build and install LIRC. Note that LIRC is packaged for all major linux distributions. If you just want to use lirc, you should be able to install it like any other package. This way, you don't have to look at the dependencies, build and installation description found here.

The ./configure script is the ultimate source as to what libraries and tools LIRC requires. The list here is not complete in any way, being focused on things to install before building.


Dependencies

Mandatory dependencies

There are a few mandatory dependencies, all of which packaged on most (all?) Linux distributions.

Optional dependencies

If these are missing, ./configure can cope with it and still build LIRC in a more or less limited way.


Kernel

As of 0.9.0+, lirc uses the kernel modules from the kernel. Some of these are formerly lirc modules which are now part of the kernel. Thus, building lirc does not involve building any kernel modules (as it used to).

Some of the former lirc modules are part of the official kernel and should be available on any reasonably updated system. However, some are in the staging area; if they are part of your kernel depends on the distro you use (unless of course if you compile your own kernel).

There are example and test kernel modules in the drivers/ directory. None of these are required for regular LIRC use, but they are supposed to be helpful while testing or writing drivers.


Compile and Install

Since 0.9.1+ , lirc loads drivers dynamically. This means that that the build system is redesigned to always build all drivers. The former setup.sh script is dropped in favor of a standard ./configure, make, make install sequence.

When building directly from git, a first required step to create ./configure and some other files is

           ./autogen.sh

Whether using git sources or just using a distributed tarball, the next steps are the canonical

            ./configure
            make
            sudo make install

Notes:


Checking the build

Since the dynamic drivers are not linked during the build, it's recommended to check that the expected drivers are built and can be loaded using

             cd tools; ./lirc-lsplugins -U ../plugins/.libs

Is some cases, lirc-lsplugins will crash on missing libraries e. g., liblirc.so.0. If so, you need to add the path where lirc installs it's libraries (by default, /usr/local/lib) to the runtime linker path. Refer to generic ld.so(1) documentation.

With working paths lirc-lsplugins will create a list of all drivers available, and also possible link errors not revealed during the build. lirc-lsplugins has a -h option providing help, and nroff -man ../doc/man/lirc-lsplugins.1 | more provides more complete info.

The test/ directory contains some (but too few) unit tests. Compiling these requires the cppunit library from https://www.freedesktop.org/wiki/Software/cppunit. cppunit is packaged in most linux distribtutions. With this in place, do:

         $ cd test
         $ make
         $ ./run-tests
     

From 0.10.0, the python-pkg has some traditional unittests. These tests requires the socat and expect packages, both of which packaged for major linux distributions. The python version needs to be 3.5+. To invoke:

          $ cd python-pkg/tests
          $ python3 -m unittest discover
     

Configuration

Formerly, lirc was configured during build where the setup.sh script was used to select driver, configuration file, etc. Also, there was little support for starting and running the services from boot. From 0.9.1+ the configuration is instead done after the build. The configuration steps for the main lircd program involves:

This is described in the configuration guide.


Uninstall


Updating from older versions

The NEWS file describes the changes since last version. Normally, upgrading from a previous version should not be too painful. However, if you have to update a really old version it's probably better to make a fresh install.