From bd4418fdec36ac020ec9a0dee34dd4f52b910e6f Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 30 Apr 2023 18:07:40 -0500 Subject: [PATCH] Convert the tools dir makefile similarly to the topdir --- .gitignore | 2 +- configure.ac | 6 +++--- scripts/hack_fakeautoconf.sh | 6 +++--- tools/{Makefile.in => Makefile} | 4 +++- tools/config.mak.in | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) rename tools/{Makefile.in => Makefile} (95%) create mode 100644 tools/config.mak.in diff --git a/.gitignore b/.gitignore index cf9a09d..c51830a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ config.rpath config.status include/config.h include/config.h.in -tools/Makefile +tools/config.mak autom4te.cache edge example_edge_embed_quick_edge_init diff --git a/configure.ac b/configure.ac index 0b81865..fb37696 100644 --- a/configure.ac +++ b/configure.ac @@ -89,7 +89,7 @@ AS_IF([test "x$enable_pcap" != xno], [ AC_DEFINE([N2N_HAVE_PCAP], [1], [Have PCAP library]) N2N_LIBS_EXTRA="-lpcap ${N2N_LIBS_EXTRA}" - ADDITIONAL_TOOLS="$ADDITIONAL_TOOLS n2n-decode" + TOOLS_ADDITIONAL="$TOOLS_ADDITIONAL n2n-decode" # TODO # - pcap_set_immediate_mode has been available since libpcap 1.5 @@ -151,9 +151,9 @@ AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(N2N_VERSION) AC_SUBST(N2N_LIBS_EXTRA) -AC_SUBST(ADDITIONAL_TOOLS) +AC_SUBST(TOOLS_ADDITIONAL) AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_FILES(config.mak) -AC_CONFIG_FILES(tools/Makefile) +AC_CONFIG_FILES(tools/config.mak) AC_OUTPUT diff --git a/scripts/hack_fakeautoconf.sh b/scripts/hack_fakeautoconf.sh index 91e1ca4..4d06fe7 100755 --- a/scripts/hack_fakeautoconf.sh +++ b/scripts/hack_fakeautoconf.sh @@ -11,9 +11,9 @@ LDFLAGS=$LDFLAGS N2N_LIBS_EXTRA=$LDLIBS EOF -sed \ - -e "s%@ADDITIONAL_TOOLS@%%g" \ - < tools/Makefile.in > tools/Makefile +cat >tools/config.mak <include/config.h #define PACKAGE_VERSION "FIXME" diff --git a/tools/Makefile.in b/tools/Makefile similarity index 95% rename from tools/Makefile.in rename to tools/Makefile index a5860eb..683311e 100644 --- a/tools/Makefile.in +++ b/tools/Makefile @@ -2,6 +2,8 @@ # This is not a standalone makefile, it must be called from the toplevel # makefile to inherit the correct environment +include config.mak + DEBUG?=-g3 HEADERS=$(wildcard include/*.h) @@ -16,7 +18,7 @@ LDFLAGS+=-L.. N2N_LIB=../libn2n.a TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd -TOOLS+=@ADDITIONAL_TOOLS@ +TOOLS+=$(TOOLS_ADDITIONAL) TESTS=tests-compress tests-elliptic tests-hashing tests-transform TESTS+=tests-wire diff --git a/tools/config.mak.in b/tools/config.mak.in new file mode 100644 index 0000000..d396110 --- /dev/null +++ b/tools/config.mak.in @@ -0,0 +1,2 @@ + +TOOLS_ADDITIONAL=@TOOLS_ADDITIONAL@