]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: fix build issue introduced in previous commit
authorVincent Bernat <vincent@bernat.im>
Mon, 13 Jun 2016 07:54:57 +0000 (09:54 +0200)
committerVincent Bernat <vincent@bernat.im>
Mon, 13 Jun 2016 07:54:57 +0000 (09:54 +0200)
$^ was used for a reason: automake would fix the paths used in
dependencies using VPATH or something similar. For some reason, this
even break with GNU make when not using OOT build. Long story short, we
use a pattern substitution to ensure that the atom files are looked up
in the correct directory.

This use of substitutions is mandated by POSIX (the 2013 version I
think). See:
 http://austingroupbugs.net/view.php?id=519

It is however believed that most make implementation had support for
this since a long time.

src/lib/Makefile.am

index 4648893b8b0dd8c3b7898f2731e607ba5f6827f4..250e32a769242eb5b0e9645332b6085e7b22b90f 100644 (file)
@@ -21,7 +21,7 @@ liblldpctl_la_LIBADD  = $(top_builddir)/src/libcommon-daemon-lib.la libfixedpoin
 
 atom-glue.c: $(ATOM_FILES) Makefile
        $(AM_V_GEN)($(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-               $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ATOM_FILES) | \
+               $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ATOM_FILES:%=$(srcdir)/%) | \
                $(SED) -n 's+^void init_atom_builder_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
                sort | \
                $(AWK) '{ atoms[$$2] = 1 } \
@@ -31,7 +31,7 @@ atom-glue.c: $(ATOM_FILES) Makefile
                               for (atom in atoms) { print " init_atom_builder_"atom"();" } \
                               print "}"; }' && \
                $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-               $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ATOM_FILES) | \
+               $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ATOM_FILES:%=$(srcdir)/%) | \
                $(SED) -n 's+^void init_atom_map_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
                sort -n | \
                $(AWK) '{ atoms[$$2] = 1 } \