[PATCH libevdev] build: set aux-dir

David Herrmann dh.herrmann at gmail.com
Mon Nov 4 23:12:02 PST 2013


Hi Gaetan

On Tue, Nov 5, 2013 at 12:18 AM, Gaetan Nadon <memsize at videotron.ca> wrote:
> On 13-11-04 04:49 PM, Peter Hutterer wrote:
>> libevdev uses the source twice, once for the library and then again for the
>> tests. I did this instead of using the .la file because when a test fails it
>> is a matter of minutes to run it in gdb and figure out the exact cause. with
>> the .la file I have to run gdb through libtool, which doesn't like
>> re-compilations, etc. if you can figure out a way to statically compile the
>> sources in through a .a file and avoid the whole libtool mess I'd be quite
>
> I don't see that as a problem. It's done in synaptics as well. Maybe
> there is a confusion in terms, I was on the lookout  for per-target
> cflags where the same code is built twice in the same directory and has
> a prefix for the object code.
>
> Unfortunate, but I can't reproduce the problem David is having. In any
> case the module really needs AC_CONFIG_SRCDIR. Make distcheck may get
> confused as it does not know where the src is. Building from an
> out-of-source tree makes it easier to debug than building with distcheck.

I sent a separate patch for SRCDIR. It didn't fix the "missing" issue.
I need AUX_DIR for that. So maybe we can apply both patches? My other
issue is unrelated to that, anyway.

So, regarding subdir-objects. I currently get the following warning
when running ./autogen.sh:
  test/Makefile.am:6: warning: source file
'$(top_srcdir)/libevdev/libevdev.c' is in a subdirectory,
  test/Makefile.am:6: but option 'subdir-objects' is disabled
  automake: warning: possible forward-incompatibility.
  automake: At least a source file is in a subdirectory, but the
'subdir-objects'
  automake: automake option hasn't been enabled.  For now, the
corresponding output
  automake: object file(s) will be placed in the top-level directory.  However,
  automake: this behaviour will change in future Automake versions: they will
  automake: unconditionally cause object files to be placed in the
same subdirectory
  automake: of the corresponding sources.
  automake: You are advised to start using 'subdir-objects' option
throughout your
  automake: project, to avoid future incompatibilities.
  test/Makefile.am:6: warning: source file
'$(top_srcdir)/libevdev/libevdev-names.c' is in a subdirectory,
  test/Makefile.am:6: but option 'subdir-objects' is disabled
  test/Makefile.am:6: warning: source file
'$(top_srcdir)/libevdev/libevdev-uinput.c' is in a subdirectory,
  test/Makefile.am:6: but option 'subdir-objects' is disabled
I think this warning only occurs with autoconf-2.69 (or some other
rather new version). It basically tells us that subdir-objects will
become the default in some newer autoconf version. So I thought why
not try setting it and see whether our build would break. That's what
I did (adding subdir-objects, git clean, ./autogen.sh).

Running autogen.sh no longer produces the warnings above, however,
running "make" now fails with:
  make --no-print-directory all-recursive
  Making all in doc
  find: `html': No such file or directory
  doxygen libevdev.doxygen
  Making all in libevdev
  /usr/bin/python ./make-event-names.py --output=c
../include/linux/input.h  > event-names.h
  make  all-am
    CC       libevdev-uinput.lo
    CC       libevdev.lo
    CC       libevdev-names.lo
    CCLD     libevdev.la
  Making all in tools
    CC       libevdev-events.o
    CCLD     libevdev-events
  Making all in test
  Makefile:636: ../libevdev/.deps/libevdev-names.Po: No such file or directory
  Makefile:637: ../libevdev/.deps/libevdev-uinput.Po: No such file or directory
  Makefile:638: ../libevdev/.deps/libevdev.Po: No such file or directory
  make[2]: *** No rule to make target '../libevdev/.deps/libevdev.Po'.  Stop.
  Makefile:470: recipe for target 'all-recursive' failed
  make[1]: *** [all-recursive] Error 1
  Makefile:378: recipe for target 'all' failed
  make: *** [all] Error 2

What I also noticed is that there's a direction called:
  ./test/$(top_srcdir)/libevdev/.deps/
which contains exactly the files mentioned above (note: it's really
called "$(top_srcdir)"). Ugh.. Seems like there is some missing
variable-expansion. So I replaced "$(top_srcdir)" in test/Makefile.am
in "libevdev_sources" with ".." (automake automatically prepends
$(srcdir) to SOURCES I think). Then "git clean" ./autogen.sh and
retry.

Ahhh, finally, libevdev builds correctly. The libevdev sources are
built twice, once for ./libevdev/ and once for ./test/. Due to
"subdir-objects" both are placed in ./libevdev/. Objects of
test-sources are placed in ./test/. (even VPATH/out-of-tree builds
work fine!).

However, "make distcheck" fails, or more precise, running "make
distclean" fails. Log is appended below, but I think the reason is,
"make distcheck" in ./libevdev/ runs "rm -rf ./.deps" as shown in the
log below. After that, "make distcheck" is called in ./test/ which
then fails to find the ".Po" dependencies.

Suggestions? We could simply ignore "subdir-objects" and wait for it
to maybe never become the default.
But note that *imho* a single global Makefile.am would solve this
issue, as "make distcheck" wouldn't remove .deps before cleaning all
the sub-rules. We couldn't run in this issue, where a ".deps" source
is shared between two SUBDIRs.

Thanks
David

$ make distclean
Making distclean in doc
rm -rf .libs _libs
rm -rf html
rm -f *.lo
test -z "libevdev.doxygen" || rm -f libevdev.doxygen
test . = "." || test -z "" || rm -f
rm -f Makefile
Making distclean in libevdev
test -z "event-names.h" || rm -f event-names.h
test -z "libevdev.la" || rm -f libevdev.la
rm -f ./so_locations
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
Making distclean in tools
rm -rf .libs _libs
 rm -f libevdev-events
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
Making distclean in test
Makefile:628: ../libevdev/.deps/libevdev-names.Po: No such file or directory
Makefile:629: ../libevdev/.deps/libevdev-uinput.Po: No such file or directory
Makefile:630: ../libevdev/.deps/libevdev.Po: No such file or directory
make[1]: *** No rule to make target '../libevdev/.deps/libevdev.Po'.  Stop.
Makefile:470: recipe for target 'distclean-recursive' failed
make: *** [distclean-recursive] Error 1


More information about the Input-tools mailing list