+# SYNOPSIS
+#
+# AMANDA_INIT_VERSION
+#
+# DESCRIPTION
+#
+# Create a macro, AMANDA_F_VERSION using only m4 which can expand
+# legally before AC_INIT. AC_INIT requires the version to be a
+# string not a shell variable. Include FULL_VERSION if it exists, otherwise
+# use VERSION. -I dirs are searched for FULL_VERSION and VERSION.
+#
+AC_DEFUN([AMANDA_INIT_VERSION],
+[
+ m4_syscmd([test -f FULL_VERSION])
+ m4_if(m4_sysval, [0],
+ [
+ m4_define([AMANDA_F_VERSION], m4_chomp(m4_include([FULL_VERSION])))
+ ],
+ [
+ m4_define([AMANDA_F_VERSION], m4_chomp(m4_include([VERSION])))
+
+ ])
+ VERSION=AMANDA_F_VERSION
+])
+