]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: use `cc -E` instead of `cpp` to build atom list
authorVincent Bernat <vincent@bernat.ch>
Fri, 11 Mar 2022 21:17:26 +0000 (22:17 +0100)
committerVincent Bernat <vincent@bernat.ch>
Fri, 11 Mar 2022 21:17:26 +0000 (22:17 +0100)
For some reason, with OpenBSD, `cpp` only half expand the macros when
invoked as `cpp`, but it works just fine with `clang -E`.

src/lib/Makefile.am

index f98103929eda24011f697506742d9748a16f5e48..8763b4fd3f633c32cc9ae731bbbbff2e8fad1908 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)(for f in $(ATOM_FILES:%=$(srcdir)/%); do \
-               $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+               $(CC) -E $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
                $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $$f; done | \
                $(SED) -n 's+^void init_atom_builder_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
                sort | \
@@ -32,7 +32,7 @@ atom-glue.c: $(ATOM_FILES) Makefile
                               for (atom in atoms) { print " init_atom_builder_"atom"();" } \
                               print "}"; }' && \
                for f in $(ATOM_FILES:%=$(srcdir)/%); do \
-               $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+               $(CC) -E $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
                $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $$f; done | \
                $(SED) -n 's+^void init_atom_map_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
                sort -n | \