commit 9590ecb003cf59d297892fb21ef67e653ade7c2e from: Thomas Adam date: Sat Feb 25 12:36:27 2023 UTC portable: template: use Makefile.common libbsd-overlay needs to be declared properly with the correct AM_CFLAGS, but this only happens via a common Makefile.common.in template which gets filled out at ./configure time. This properly ensures libbsd compat libraries, such as getprogname() are correctly found on the system. commit - 20c2019fa7a71a1430ca455d4c0350ba61ad472c commit + 9590ecb003cf59d297892fb21ef67e653ade7c2e blob - 149154cf25f714ed73475c0efb0f743378e7360f blob + 7c23955b9a3e23efe81424364607161b84b487c8 --- template/Makefile.am +++ template/Makefile.am @@ -1,5 +1,7 @@ noinst_PROGRAMS = template +include $(top_builddir)/Makefile.common + template_SOURCES = template.c \ parse.y blob - 7f25534ea982b7f593cd0ebbad332cba913405e9 blob + 2970357a4c1e353d359696deeb168b0f20d39dad --- template/configure.ac +++ template/configure.ac @@ -45,5 +45,14 @@ AC_CHECK_DECL([TAILQ_REMOVE], [], [AC_MSG_ERROR("*** sys/queue.h is missing key defines ***")], [#include ]) -AC_CONFIG_FILES([Makefile]) +AC_SUBST(AM_CPPFLAGS) +CPPFLAGS="$SAVED_CPPFLAGS" +AC_SUBST(AM_CFLAGS) +CFLAGS="$SAVED_CFLAGS" +AC_SUBST(AM_LDFLAGS) +LDFLAGS="$SAVED_LDFLAGS" + +AC_CONFIG_FILES([Makefile + Makefile.common:Makefile.common.in + ]) AC_OUTPUT blob - /dev/null blob + faae4d33f3e61bf3912e84f333ebd530d26a4b96 (mode 644) --- /dev/null +++ template/Makefile.common.in @@ -0,0 +1,21 @@ +AM_CFLAGS += \ + @AM_CFLAGS@ \ + -Wunused-variable \ + -Wwrite-strings +# Ideally, we should be enabling further flags, but this requires upstream +# changes. Leaving these here for now. +# +# -g -Wall -Wno-long-long -W -Wformat=2 -Wmissing-prototypes \ +# -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings \ +# -Wshadow -Wpointer-arith -Wno-sign-compare -Wundef \ +# -Wbad-function-cast -Winline -Wcast-align \ +# -Wdeclaration-after-statement -Wno-pointer-sign \ +# -Wno-attributes -Wno-unused-result + +AM_CPPFLAGS += \ + @AM_CPPFLAGS@ \ + -DGOT_VERSION=@VERSION@ \ + -DGOT_VERSION_NUMBER=@VERSION@ \ + -DGOT_LIBEXECDIR="$(libexecdir)" \ + -I$(top_srcdir)/template \ + -I.