Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: zsh and autoconf-2.50



Clint Adams wrote:

BTW anybody else working on 2.50? Else I hope to produce new configure.ac
next week. I cannot promise to resolve this issue with current configure.in
though (unless it happens as a side effect).


If you remove the hunk beginning with

dnl The standard config.status is missing some essential features.
dnl So add them now.  See the comment at the end of Src/mkmakemod.sh.

config.status will be happier.  I haven't looked into why.




"Curiouser and curiouser!" cried Alice.

Anyway - 2.50 generates totally different config.status and our modification breaks it. Moreover, as Akim said, 2.50 does not need this mod anymore. But what's worse - mkmakemod.sh relies on our mod so if we just leave it out it does not work any more :-) It does not work anyway because check for dynamic build does not work with 2.50 ...

Here is patch that

- checks for autoconf version. It thinks that anything <= 2.13 needs our hack, anything over - does not. It breaks with beta autoconf versions like 2.49f. It smells.

- adds a string to config.status and lets mkmakemod.sh grep for it to decide when to use this hack.

- adds check for 2.50-like subst's (t check for dynamic build).

This is intended for 4.0.x only, and just to allow some poor soul to compile off CVS when we advice it without much fuss. And to allow me to build both 4.0.x and HEAD without maintaining two autoconf versions. :-) This is an absolute hack. Should I commit it?

-andrej

P.S. I just built freshly checked out 4.0 branch in sepearate build directory with these mods.

P.P.S. 2.50 seems to not use cache by default - you need explicit option --cache-file (or --config-cache to default to config.cache). One more change in Makefiles.
Index: aczsh.m4
===================================================================
RCS file: /cvsroot/zsh/zsh/aczsh.m4,v
retrieving revision 1.10
diff -u -r1.10 aczsh.m4
--- aczsh.m4	2001/04/23 19:59:03	1.10
+++ aczsh.m4	2001/06/01 22:24:35
@@ -683,3 +683,21 @@
 	then LIBS="$4"
 	else LIBS="$enable_libs"
 	fi)])
+
+dnl These macros are copied over from autoconf-2.13
+dnl They for not work with beta versions and are intended
+dnl only to allow use of autoconf-2.50 for a transition time
+
+AC_DEFUN(zsh_ACVERSION_SPLIT, [translit($1, ., [, ])])
+
+AC_DEFUN(zsh_ACVERSION_CANON, [$1, $2, ifelse([$3], , 0, [$3])])
+
+AC_DEFUN(__zsh_CHECK_ACVERSION,
+  [ifelse(builtin([eval],
+  [$3 + $2 * 1000 + $1 * 1000000 <= $6 + $5 * 1000 + $4 * 1000000]), 1, [$7], [$8])])
+   
+AC_DEFUN(zsh_CHECK_ACVERSION,
+  [__zsh_CHECK_ACVERSION(zsh_ACVERSION_CANON(zsh_ACVERSION_SPLIT(AC_ACVERSION)),
+                                zsh_ACVERSION_CANON(zsh_ACVERSION_SPLIT($1)),
+				[$2],
+				[$3])])
Index: configure.in
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.in,v
retrieving revision 1.60
diff -u -r1.60 configure.in
--- configure.in	2001/06/01 14:40:39	1.60
+++ configure.in	2001/06/01 22:24:36
@@ -1909,12 +1909,18 @@
 
 dnl The standard config.status is missing some essential features.
 dnl So add them now.  See the comment at the end of Src/mkmakemod.sh.
-[rm -f $CONFIG_STATUS.old
+dnl Starting from 2.50 Autoconf no more needs it and this modification
+dnl results in broken config.status so check for version. We check only
+dnl for officially released versions.
+zsh_CHECK_ACVERSION([2.13],
+[
+rm -f $CONFIG_STATUS.old
 cp $CONFIG_STATUS $CONFIG_STATUS.old
-sed '1,$s@^\( *ac_file_inputs=\).*$@\1`echo $ac_file_in | sed -e "s%^%:%" -e "s%:\\([^!]\\)% $ac_given_srcdir/\\1%g" -e "s%:!% %"`@' \
+sed '1,$s@^\( *ac_file_inputs=\).*$@\1`echo $ac_file_in | sed -e "s%^%:%" -e "s%:\\([[^!]]\\)% $ac_given_srcdir/\\1%g" -e "s%:!% %"`@' \
  $CONFIG_STATUS.old >$CONFIG_STATUS
+echo '# Hack for autoconf 2.13' >>$CONFIG_STATUS
  chmod +x $CONFIG_STATUS
- rm -f $CONFIG_STATUS.old]
+ rm -f $CONFIG_STATUS.old])
 
 test "$real_no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
Index: Src/mkmakemod.sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v
retrieving revision 1.11
diff -u -r1.11 mkmakemod.sh
--- Src/mkmakemod.sh	2001/05/20 10:59:28	1.11
+++ Src/mkmakemod.sh	2001/06/01 22:24:38
@@ -111,7 +111,9 @@
     sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
     module_list="${bin_mods}${dyn_mods}"
 
-    if grep '%@D@%D%' config.status >/dev/null; then
+    # check both 2.13 and 2.50 syntax
+    if grep '%@D@%D%' config.status >/dev/null ||
+       grep ',@D@,D,' config.status >/dev/null; then
 	is_dynamic=true
     else
 	is_dynamic=false
@@ -463,7 +465,12 @@
 
 fi
 
-if $second_stage; then
+if $second_stage ; then
+    if grep 'Hack for autoconf 2.13' ./config.status > /dev/null 2>&1 ; then
+        bang=\!
+    else
+	bang=
+    fi
 
     trap "rm -f $the_subdir/${the_makefile}" 1 2 15
 
@@ -472,7 +479,7 @@
     # tree, this is a problem.  zsh's configure script edits config.status,
     # adding the feature that an input filename starting with "!" has the
     # "!" removed and is not mangled further.
-    CONFIG_FILES=$the_subdir/${the_makefile}:\!$the_subdir/${the_makefile}.in CONFIG_HEADERS= ${CONFIG_SHELL-/bin/sh} ./config.status
+    CONFIG_FILES=$the_subdir/${the_makefile}:$bang$the_subdir/${the_makefile}.in CONFIG_HEADERS= ${CONFIG_SHELL-/bin/sh} ./config.status
 
 fi
 


Messages sorted by: Reverse Date, Date, Thread, Author