-case $autoversion in
- *2.13)
- cp config/acconfig.h .
- cp config/configure.in .
- rm -f configure.ac
- cp config/relyx_configure.in lib/reLyX/configure.in
- rm -f lib/reLyX/configure.ac
- ;;
- *2.5[23])
- rm -f acconfig.h
- rm -f configure.in
- cp config/configure.ac .
- rm -f lib/reLyX/configure.in
- cp config/relyx_configure.ac lib/reLyX/configure.ac
+# Discover what version of automake we are using.
+automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
+
+test "$automake_version" != "" && {
+ echo "Using $automake_version"
+} || {
+ echo "LyX requires automake >= 1.14"
+ exit 1
+}
+
+case $automake_version in
+ *' '1.1[45]*)