-# Generate the ext_l10n.h
-echo -n "Generate the ext_l10n file..."
-rm -f src/ext_l10n.h
-# first the ui file(s)
-grep -i -E "submenu|item|optitem" < lib/ui/default.ui | cut -d '"' -f 2 | awk '{printf "_(\"%s\");\n", $0}' > src/ext_l10n.h
-# then the layout files
-cat lib/layouts/*.layout lib/layouts/*.inc | grep -i -E "[ ]*style .+$" | cut -d ' ' -f 2 | sort | uniq | awk '{printf "_(\"%s\");\n", $0}' >> src/ext_l10n.h
-echo "done."
+test "$autoversion" != "" && {
+ echo "Using $autoversion"
+} || {
+ echo "LyX requires autoconf >= 2.52"
+ exit 1
+}
+
+case $autoversion in
+ *' '2.5[2-9]|*' '2.60[ab]|*' '2.6[0-2])
+ ;;
+ *)
+ echo "This autoconf version is not supported by LyX."
+ echo "LyX only supports autoconf 2.52-2.61."
+ exit 1
+ ;;
+esac
+
+# Delete old cache directories.
+# automake will stop if their contents was created by an earlier version.
+rm -rf autom4te.cache
+
+# Update the gettext files
+echo "Copying gettext code... "
+if ( autopoint --version ) < /dev/null > /dev/null 2>&1; then
+ autopoint --force >/dev/null
+else
+ echo "autopoint not found -- aborting"
+ exit 1
+fi