Skip to content

Commit

Permalink
Merge pull request ddclient#771 from rhansen/build
Browse files Browse the repository at this point in the history
Build system improvements
  • Loading branch information
rhansen authored Dec 19, 2024
2 parents b200e0c + a12398c commit af4ea14
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 680 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ release
/Makefile.in
/aclocal.m4
/autom4te.cache/
/build-aux/config.guess
/build-aux/config.sub
/build-aux/install-sh
/build-aux/missing
/build-aux/tap-driver.sh
/config.log
/config.status
/configure
Expand Down
23 changes: 9 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I build-aux/m4
EXTRA_DIST = \
CONTRIBUTING.md \
COPYING \
Expand All @@ -16,27 +16,22 @@ EXTRA_DIST = \
sample-get-ip-from-fritzbox
CLEANFILES =

# Command that replaces substitution variables with their values.
subst = sed \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e '1 s|^\#\!.*perl$$|\#\!$(PERL)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@runstatedir[@]|$(runstatedir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@CURL[@]|$(CURL)|g'

# Files that will be generated by passing their *.in file through
# $(subst).
subst_files = ddclient ddclient.conf

EXTRA_DIST += $(subst_files:=.in)
CLEANFILES += $(subst_files)

$(subst_files): Makefile
rm -f '$@' '$@'.tmp
in='$@'.in; \
test -f "$${in}" || in='$(srcdir)/'$${in}; \
$(subst) "$${in}" >'$@'.tmp && \
sed \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e '1 s|^#\!.*perl$$|#\!$(PERL)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@runstatedir[@]|$(runstatedir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@CURL[@]|$(CURL)|g' \
"$${in}" >'$@'.tmp && \
{ ! test -x "$${in}" || chmod +x '$@'.tmp; }
mv '$@'.tmp '$@'

Expand Down
26 changes: 12 additions & 14 deletions autogen
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ fatal() { error "$@"; exit 1; }
try() { "$@" || fatal "'$@' failed"; }

try cd "${0%/*}"
try mkdir -p m4 build-aux
# aclocal complains if a directory passed to AC_CONFIG_MACRO_DIR doesn't exist.
try mkdir -p build-aux/m4
# autoreconf's '--force' option doesn't affect any of the files installed by the '--install' option.
# Remove the files to truly force them to be updated.
try rm -f \
aclocal.m4 \
build-aux/config.guess \
build-aux/config.sub \
build-aux/install-sh \
build-aux/missing \
build-aux/tap-driver.sh \
;
try autoreconf -fviW all

# Ignore changes to build-aux/tap-driver, but only if we're in a clone
# of the ddclient Git repository. Once CentOS 6 and RHEL 6 reach
# end-of-life we can delete build-aux/tap-driver.sh and this block of
# code. (tap-driver.sh is checked in to this Git repository only
# because we want to support all currently maintained CentOS and RHEL
# releases, and CentoOS 6 and RHEL 6 ship with Automake 1.11 which
# does not come with tap-driver.sh.)
command -v git >/dev/null || exit 0
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0
cdup=$(try git rev-parse --show-cdup) || exit 1
[ -z "${cdup}" ] || exit 0
try git update-index --assume-unchanged -- build-aux/tap-driver.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit af4ea14

Please sign in to comment.