Mikhael Goikhman wrote:
aclocal.m4 is generated from acinclude.m4 by aclocal that's from automake
(before this generated file is used by autoconf to generate ./configure).

  Excellent.  Thank you for that information.

  Okay, I've applied a fairly ugly patch to acinclude.m4.
It tears apart the AC_ACVERSION macro into the major and
minor number [string]s, and then if the minor number is
13, defines m4_substr and m4_len.  It works for me, and
I've tested that the macro leaves m4_* unset when I
hand-feed it a 2.51 instead of AC_ACVERSION.

  Unfortunately, m4 only knows about strings.  So, do
do a <= 2.13, I'd have to use syscmd() and sysval().
I could do that, but I wasn't sure it was worth the
effort.  But, I don't know what versions of autoconf
are likely to be in use.

  Let me know if anything like this would be acceptable.

  Thanks...

                       - Chris
Index: acinclude.m4
===================================================================
RCS file: /home/cvs/fvwm/fvwm/acinclude.m4,v
retrieving revision 1.49
diff -u -u -r1.49 acinclude.m4
--- acinclude.m4        8 Jul 2004 10:08:09 -0000       1.49
+++ acinclude.m4        1 Sep 2004 17:50:11 -0000
@@ -103,6 +103,17 @@
 fi
 ])
 
+dnl Versions of autoconf 2.13 and older don't have m4_substr and m4_len
+dnl built into them.  So, check the version of autoconf we're running,
+dnl and if it's 2.13, substitude alternative definitions for them.
+define([SEGMENT1],[substr([$1],0,ifelse(index([$1],.),-1,len([$1]),index([$1],.)))])dnl
+define([SEGMENT2],[ifelse( index([$1],.), -1, [], SEGMENT1(substr([$1], 
incr(index([$1],.)))))])dnl
+
+define([AC_ACVERSION_MAJOR],[SEGMENT1(AC_ACVERSION)])dnl
+define([AC_ACVERSION_MINOR],[SEGMENT2(AC_ACVERSION)])dnl
+ifelse(AC_ACVERSION_MINOR,13,
+[define([m4_substr],[substr([$1],[$2])])dnl
+define([m4_len],[len([$1])])dnl])dnl
 
 dnl Configure-time switch with default
 dnl

Reply via email to