diff --git a/Makefile.am b/Makefile.am
index 4527dd124401f18297b0f6b745143bcbe35bce4f..1c2d2c190910254e8a9b311752e611a8aacb448e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,6 +122,10 @@ check-changes:
 		$(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes/*; \
 		fi
 
+.PHONY: update-versions
+update-versions:
+	$(PERL) $(top_builddir)/scripts/maint/updateVersions.pl
+
 version:
 	@echo "Tor @VERSION@"
 	@if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
diff --git a/configure.ac b/configure.ac
index 3ba686802a7284e0d433cdd1858d17f7c7bb99d2..4905e69cb51ecc9d541c31120efebfeeb237e5cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1664,6 +1664,7 @@ AC_CONFIG_FILES([
         src/config/torrc.sample
         src/config/torrc.minimal
         scripts/maint/checkOptionDocs.pl
+        scripts/maint/updateVersions.pl
 ])
 
 if test x$asciidoc = xtrue && test "$ASCIIDOC" = "none" ; then
diff --git a/scripts/maint/updateVersions.pl b/scripts/maint/updateVersions.pl.in
similarity index 87%
rename from scripts/maint/updateVersions.pl
rename to scripts/maint/updateVersions.pl.in
index 15c83b80a726db5d1040f16902e61a993fba8951..65c51a1f2df849274b338594c2bd0a8b33f7b770 100755
--- a/scripts/maint/updateVersions.pl
+++ b/scripts/maint/updateVersions.pl.in
@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-$CONFIGURE_IN = './configure.ac';
-$ORCONFIG_H = './src/win32/orconfig.h';
-$TOR_NSI = './contrib/win32build/tor-mingw.nsi.in';
+$CONFIGURE_IN = '@abs_top_srcdir@/configure.ac';
+$ORCONFIG_H = '@abs_top_srcdir@/src/win32/orconfig.h';
+$TOR_NSI = '@abs_top_srcdir@/contrib/win32build/tor-mingw.nsi.in';
 
 $quiet = 1;