From 2a64d539fd1b5dfe4c5dbb658c1a8c2abbc33913 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 11 Mar 2022 22:17:26 +0100 Subject: [PATCH] build: use `cc -E` instead of `cpp` to build atom list 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f9810392..8763b4fd 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -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 | \ -- 2.39.2