The 0.10.0-rc2 tar release builds fine on Debian Jessie if I run configure and make in the source root directory.
But if I build in a separate directory, I get a lot of SH_PATH redefinition warnings from differing config.h files and finally an error:
$ tar zxf lirc-0.10.0-rc2.tar.gz ; mkdir lirc-0.10.0-rc2/build ; cd lirc-0.10.0-rc2/build ; ../configure ; make
...
Making all in lib
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I../.. -Wall -Wp,-D_FORTIFY_SOURCE=2 -I../../include -g -O2 -I/usr/include/python3.4m -I/usr/include/x86_64-linux-gnu/python3.4m -MT config_file.lo -MD -MP -MF .deps/config_file.Tpo -c ../../lib/config_file.c -fPIC -DPIC -o .libs/config_file.o
In file included from ../../lib/lirc/curl_poll.h:35:0,
from ../../lib/lirc/driver.h:33,
from ../../lib/lirc/ir_remote.h:31,
from ../../lib/config_file.c:46:
../../lib/lirc/config.h:234:0: warning: "SH_PATH" redefined
#define SH_PATH "/usr/bin/sh"
^
In file included from ../../include/media/lirc.h:14:0,
from ../../lib/config_file.c:41:
./lirc/config.h:234:0: note: this is the location of the previous definition
#define SH_PATH "/bin/sh"
^
...
Making all in daemons
In file included from ../../lib/lirc/curl_poll.h:35:0,
from ../../lib/lirc_client.h:124,
from ../../daemons/lircrcd.cpp:37:
../../lib/lirc/config.h:234:0: warning: "SH_PATH" redefined
#define SH_PATH "/usr/bin/sh"
^
In file included from ../../daemons/lircrcd.cpp:12:0:
../config.h:234:0: note: this is the location of the previous definition
#define SH_PATH "/bin/sh"
^
libtool: link: g++ -g -O2 -o .libs/lircrcd lircrcd.o -lpthread ../lib/.libs/liblirc_client.so -ldl -ludev
In file included from ../../include/media/lirc.h:14:0,
from ../../lib/lirc_private.h:19,
from ../../daemons/lircd.cpp:70:
../../lib/lirc/config.h:234:0: warning: "SH_PATH" redefined
#define SH_PATH "/usr/bin/sh"
^
In file included from ../../daemons/lircd.cpp:30:0:
../config.h:234:0: note: this is the location of the previous definition
#define SH_PATH "/bin/sh"
^
In file included from ../../lib/lirc_private.h:22:0,
from ../../daemons/lircd.cpp:70:
../../lib/ir_remote_types.h:38:24: fatal error: linux/lirc.h: No such file or directory
#include <linux/lirc.h>
^
compilation terminated.
make[2]: *** [lircd.o] Error 1
Makefile:531: recipe for target 'lircd.o' failed
make[1]: *** [all-recursive] Error 1
Makefile:1039: recipe for target 'all-recursive' failed
make: *** [all] Error 2
Makefile:567: recipe for target 'all' failed
Trying to compile the git version in the source root results in an immediate error after make because of the lirc -> . symlink in lib:
$ git reset --hard lirc-0.10.0-rc2 ; git clean -dfx ; ./autogen.sh ; ./configure ; make
...
Making all in lib
cp: ‘../config.h’ and ‘lirc/config.h’ are the same file
Makefile:931: recipe for target 'lirc/config.h' failed
make[2]: *** [lirc/config.h] Error 1
Makefile:1029: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:556: recipe for target 'all' failed
make: *** [all] Error 2
Compiling git version in a separate directory fails as well, but with a different error as in the release tar:
$ git reset --hard lirc-0.10.0-rc2 ; git clean -dfx ; ./autogen.sh ; mkdir build; cd build; ../configure ; make
...
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I../.. -Wall -Wp,-D_FORTIFY_SOURCE=2 -I../../include -g -O2 -I/usr/include/python3.4m -I/usr/include/x86_64-linux-gnu/python3.4m -MT lirc_client.lo -MD -MP -MF .deps/lirc_client.Tpo -c ../../lib/lirc_client.c -fPIC -DPIC -o .libs/lirc_client.o
In file included from ../../lib/lirc_client.c:42:0:
../../lib/lirc_client.h:122:24: fatal error: lirc/paths.h: No such file or directory
#include "lirc/paths.h"
^
compilation terminated.
Makefile:610: recipe for target 'lirc_client.lo' failed
make[3]: *** [lirc_client.lo] Error 1
Makefile:486: recipe for target 'all' failed
make[2]: *** [all] Error 2
Makefile:1029: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:556: recipe for target 'all' failed
make: *** [all] Error 2
Ack, I can reproduce this. Will have a look Real Soon (tm)
Hm... this is actually a can of worms. Thanks for reporting this during the rc cycle!
Attaching a tentative patch. Could you please test it and report back?
Thanks a lot for the quick reply!
When applying the patch on top of the release-0.10 branch (HEAD 57d08c7) building in a subdir now works fine, but building in the source root still results in the immediate error.
I also tried applying the patch on top of the rc2 release tar, then run autogen.sh: building in the source root still works fine, but building in a subdir still results in warnings and a build error as before:
OK, that patch was tested on sid. I'll be back, nut later.
Sinces this turns out to be a Real Mess, I didn't bother bother to test a single patch but rather the 0.10.0 release branch. It now builds for me on jessie, with or without a separate build dir. Atttaching the three patches from rc2 involved
One gotcha is that the autotools used to generate the tarball are newer than jessie's stuff. This could be handled according to the messages, basically re-running aclocal and automake.
Another is that after patching (but before building) the two files config.h and lib/lirc/config.h needs to be removed. They should certainly not be part of tthe distribution tarball.
Last edit: Alec Leamas 2017-06-19
Thanks a lot lirc builds fine in the root and a separate dir with these patches on top of rc2 release tar, config.h files removed + aclocal + autoreconf calls.
Building from git in a separate dir works fine, too.
The only issue remaining is that I get an error building in git root dir:
Is this a problem of automake-1.14? I've only tested this on Debian Jessie so far, will do a test on Debian Stretch (automake-1.15) later.
I havn't tried this mysel. But before you do anything else, please apply all three patches which is the current release branch. And remove lib/config.h and lib/lirc/config.h, as stated in https://sourceforge.net/p/lirc/tickets/294/#60d2/b7aa
EDIT: And those patches are from the lirc-0.10.0-rc2 tag. The current state of the release-0.10 branch at upstream is a WIP, so please use the tag (+ patches).
Last edit: Alec Leamas 2017-06-20
OK, we need yet another patch from my secret patch cache to build also the git tree. Attaching. Build log:
I've re-tested with the lirc-0.10.0-rc2 tag plus the 3 patches on Debian Jessie and Stretch.
Compiling in the git root works fine if I remove the lib/config.h symlink. With this link removed compilation in a subdir still works as well.
The symlink was added with this commit - was it maybe included by mistake?
Edit: just saw you posted another patch, will try that now.
Last edit: Matthias Reichl 2017-06-20
With the 4 patches lirc now builds fine from git and the patched rc2 release tar, both in the source root and in a subdir (tested on Debian Jessie and Stretch).
Thanks a lot!
Again: thanks for reporting, not least for reporting in the rc cycle!
There will be a -rc3, with these fixes + a few more.
I can confirm that -rc3 fixes the issues, the ticket can be closed.
BTW: We've included 0.10.0-rc3 in the LibreELEC testbuilds, everything looking fine so far, thanks a lot for your awesome work!
Thansk for reporting and feedback! Closing.