Ticket #100 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

service-type-database does not build when srcdir != builddir

Reported by: tedp Owned by: lennart
Milestone: Avahi 0.6.17 Component: build-system
Keywords: Cc:

Description

The service-types.db file does not build when Avahi is being built outside the srcdir. The cause is this fragment from Makefile.am:

service-types.db: service-types build-db
    $(PYTHON) build-db $(srcdir)/$< $@

What happens is that the service-types dependency is resolved to the source directory because of the VPATH in the Makefile, then the build rule prepends the same path again, so you end up with something like:

/usr/bin/python build-db /build/avahi/service-type-database//build/avahi/service-type-database/service-types service-types.db
Traceback (most recent call last):
  File "build-db", line 36, in ?
    for ln in file(infn, "r"):
IOError: [Errno 2] No such file or directory: '/build/avahi/service-type-database//build/avahi/service-type-database/service-types'

There is another problem that even if this command fails, the service-types.db is created (but effectively empty), so next time make runs, it sees that the file exists and continues to build, even though the service-types.db file is not right.

Here's a suggested fix for Makefile.am:

service-types.db: service-types build-db
    $(PYTHON) build-db $< $@.coming
    mv $@.coming $@

Attachments

avahi-service_type_db-build.patch Download (0.7 KB) - added by tedp 6 years ago.

Change History

Changed 6 years ago by tedp

Changed 6 years ago by lennart

  • status changed from new to closed
  • resolution set to fixed

(In [1380]) fix build of the service-type-database if srcdir != builddir (Closes #100)

Changed 6 years ago by lennart

  • milestone set to Avahi 0.6.17
Note: See TracTickets for help on using tickets.