From f4596b1a7ae20f3d65b96c6fdcc812d04417c36b Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 21 Nov 2009 13:56:13 +1300 Subject: [PATCH] Author: Henrik Nordstrom Style Makefile.am to use variable expansion instead of @ AUTOMAKEVAR @AUTOMAKEVAR@ is troublesome when used in \ constructs as it may expand to empty and the last line in a \ construct must not be empty or some make versions will fail. thankfully automake adds all variables for us, so using is preferred. Also: * Cleanup our big sed rule to avoid automake collisions * Odd REPL_POLICIES comment reference in repl/Makefile.am --- scripts/srcformat.sh | 10 +++++++++- src/Makefile.am | 42 ++++++++++++++++++++---------------------- src/repl/Makefile.am | 2 +- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/scripts/srcformat.sh b/scripts/srcformat.sh index 659c8a4c5d..ae031c65f6 100755 --- a/scripts/srcformat.sh +++ b/scripts/srcformat.sh @@ -36,8 +36,16 @@ for FILENAME in `ls -1`; do else rm $FILENAME.astylebak fi - continue; + continue fi + ;; + + Makefile.am) + + perl -i -p -e 's/@([A-Z0-9_]+)@/\$($1)/g' <${FILENAME} >${FILENAME}.styled + mv ${FILENAME}.styled ${FILENAME} + ;; + esac if test -d $FILENAME ; then diff --git a/src/Makefile.am b/src/Makefile.am index 8e792992dc..e5de0d1fb3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,8 +40,6 @@ if USE_ADAPTATION SUBDIRS += adaptation endif -ADAPTATION_LIBS = @ADAPTATION_LIBS@ - if USE_ESI SUBDIRS += esi ESI_LOCAL_LIBS = \ @@ -764,26 +762,26 @@ cf_gen_defines.h: $(srcdir)/cf_gen_defines $(srcdir)/cf.data.pre ## depend on the Makefile. cf.data: cf.data.pre Makefile sed "\ - s%@DEFAULT_HTTP_PORT@%$(DEFAULT_HTTP_PORT)%g;\ - s%@DEFAULT_ICP_PORT@%$(DEFAULT_ICP_PORT)%g;\ - s%@DEFAULT_CACHE_EFFECTIVE_USER@%${CACHE_EFFECTIVE_USER}%g;\ - s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ - s%@DEFAULT_DNSSERVER@%$(DEFAULT_DNSSERVER)%g;\ - s%@DEFAULT_UNLINKD@%$(DEFAULT_UNLINKD)%g;\ - s%@DEFAULT_PINGER@%$(DEFAULT_PINGER)%g;\ - s%@DEFAULT_DISKD@%$(DEFAULT_DISKD)%g;\ - s%@DEFAULT_CACHE_LOG@%$(DEFAULT_CACHE_LOG)%g;\ - s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g;\ - s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\ - s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\ - s%@DEFAULT_NETDB_FILE@%$(DEFAULT_NETDB_FILE)%g;\ - s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g;\ - s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\ - s%@DEFAULT_CONFIG_DIR@%$(DEFAULT_CONFIG_DIR)%g;\ - s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;\ - s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g;\ - s%@IPV6_ONLY_SETTING@%$(SET_IPV6_SETTINGS)%g;\ - s%@SQUID@%SQUID\ $(VERSION)%g;"\ + s%[@]DEFAULT_HTTP_PORT[@]%$(DEFAULT_HTTP_PORT)%g;\ + s%[@]DEFAULT_ICP_PORT[@]%$(DEFAULT_ICP_PORT)%g;\ + s%[@]DEFAULT_CACHE_EFFECTIVE_USER[@]%${CACHE_EFFECTIVE_USER}%g;\ + s%[@]DEFAULT_MIME_TABLE[@]%$(DEFAULT_MIME_TABLE)%g;\ + s%[@]DEFAULT_DNSSERVER[@]%$(DEFAULT_DNSSERVER)%g;\ + s%[@]DEFAULT_UNLINKD[@]%$(DEFAULT_UNLINKD)%g;\ + s%[@]DEFAULT_PINGER[@]%$(DEFAULT_PINGER)%g;\ + s%[@]DEFAULT_DISKD[@]%$(DEFAULT_DISKD)%g;\ + s%[@]DEFAULT_CACHE_LOG[@]%$(DEFAULT_CACHE_LOG)%g;\ + s%[@]DEFAULT_ACCESS_LOG[@]%$(DEFAULT_ACCESS_LOG)%g;\ + s%[@]DEFAULT_STORE_LOG[@]%$(DEFAULT_STORE_LOG)%g;\ + s%[@]DEFAULT_PID_FILE[@]%$(DEFAULT_PID_FILE)%g;\ + s%[@]DEFAULT_NETDB_FILE[@]%$(DEFAULT_NETDB_FILE)%g;\ + s%[@]DEFAULT_SWAP_DIR[@]%$(DEFAULT_SWAP_DIR)%g;\ + s%[@]DEFAULT_ICON_DIR[@]%$(DEFAULT_ICON_DIR)%g;\ + s%[@]DEFAULT_CONFIG_DIR[@]%$(DEFAULT_CONFIG_DIR)%g;\ + s%[@]DEFAULT_PREFIX[@]%$(DEFAULT_PREFIX)%g;\ + s%[@]DEFAULT_HOSTS[@]%$(DEFAULT_HOSTS)%g;\ + s%[@]IPV6_ONLY_SETTING[@]%$(SET_IPV6_SETTINGS)%g;\ + s%[@]SQUID[@]%SQUID\ $(VERSION)%g;"\ < $(srcdir)/cf.data.pre >$@ repl_modules.cc: repl_modules.sh Makefile diff --git a/src/repl/Makefile.am b/src/repl/Makefile.am index 9aa0342bc5..9fe09a5692 100644 --- a/src/repl/Makefile.am +++ b/src/repl/Makefile.am @@ -10,7 +10,7 @@ INCLUDES += -I$(srcdir) AUTOMAKE_OPTIONS = subdir-objects -# No recursion is needed for the subdirs, we build from here. // @REPL_POLICIES@ +# No recursion is needed for the subdirs, we build from here. EXTRA_LIBRARIES = liblru.a libheap.a noinst_LIBRARIES = @REPL_LIBS@ -- 2.47.3