bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] gnulib-tool change for Autoconf 2.60 and onceonly


From: Bruno Haible
Subject: Re: [bug-gnulib] gnulib-tool change for Autoconf 2.60 and onceonly
Date: Thu, 20 Jul 2006 16:49:01 +0200
User-agent: KMail/1.9.1

Paul Eggert wrote on 2006-07-09:
> While bootstrapping Bison I noticed that gnulib-tool assumes Autoconf
> versions 2.57 through 2.59.  But Bison assumes 2.60.  On the theory
> that gnulib-tool should assume the latest stable version, and you
> can copy onceonly by hand if you want an earlier one

This theory can damage acceptance of gnulib. Instead, I'm asking to leave
people some choice, in order to leave them the freedom to decide _when_ they
want to upgrade to a newer autoconf.

> I installed this:
> 
> 2006-07-08  Paul Eggert  <address@hidden>
> 
>       * gnulib-tool (func_get_filelist): Don't echo m4/onceonly_2_57.m4,
>       for the benefit of people using Autoconf 2.60.  If you want to
>       support older Autoconf versions you can copy m4/onceonly_2_57.m4
>       (or m4/onceonly.m4, if pre-2.57) manually.

I don't like this to be unconditional. So I added a --assume-autoconf
command line options. You can use --assume-autoconf=2.60; 2.59 is the
default for now.


2006-07-20  Bruno Haible  <address@hidden>

        * gnulib-tool: Recognize new option --assume-autoconf.
        (autoconf_minversion): New variable.
        (func_get_filelist): Use it to decide whether to add onceonly_2_57.m4.

*** gnulib-tool 20 Jul 2006 14:22:07 -0000      1.118
--- gnulib-tool 20 Jul 2006 14:50:34 -0000
***************
*** 101,106 ****
--- 101,108 ----
        --extract-tests-module       report the unit test module, if it exists
  
  Options:
+       --assume-autoconf=VERSION
+                             Assume a given autoconf version (or newer).
        --avoid=MODULE        Avoid including the given MODULE. Useful if you
                              have code that provides equivalent functionality.
                              This option can be repeated.
***************
*** 247,252 ****
--- 249,256 ----
  # - avoidlist       list of modules to avoid, from --avoid
  # - lgpl            true if --lgpl was given, blank otherwise
  # - libtool         true if --libtool was given, blank otherwise
+ # - macro_prefix    from --macro-prefix
+ # - autoconf_minversion  minimum supported autoconf version
  # - do_changelog    false if --no-changelog was given, : otherwise
  # - doit            : if actions shall be executed, false if only to be 
printed
  {
***************
*** 264,269 ****
--- 268,274 ----
    lgpl=
    libtool=
    macro_prefix=
+   autoconf_minversion=
    do_changelog=:
    doit=:
    symbolic=
***************
*** 397,402 ****
--- 402,417 ----
        --macro-prefix=* )
          macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'`
          shift ;;
+       --assume-autoconf )
+         shift
+         if test $# = 0; then
+           func_fatal_error "missing argument for --assume-autoconf"
+         fi
+         autoconf_minversion="$1"
+         shift ;;
+       --assume-autoconf=* )
+         autoconf_minversion=`echo "X$1" | sed -e 's/^X--assume-autoconf=//'`
+         shift ;;
        --no-changelog | --no-changelo | --no-changel | --no-change | 
--no-chang | --no-chan | --no-cha | --no-ch | --no-c )
          do_changelog=false
          shift ;;
***************
*** 436,442 ****
      if test -n "$supplied_libname" || test -n "$sourcebase" || test -n 
"$m4base" \
         || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \
         || test -n "$inctests" || test -n "$avoidlist" || test -n "$lgpl" \
!        || test -n "$macro_prefix"; then
        echo "gnulib-tool: invalid options for 'update' mode" 1>&2
        echo "Try 'gnulib-tool --help' for more information." 1>&2
        echo "If you really want to modify the gnulib configuration of your 
project," 1>&2
--- 451,457 ----
      if test -n "$supplied_libname" || test -n "$sourcebase" || test -n 
"$m4base" \
         || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \
         || test -n "$inctests" || test -n "$avoidlist" || test -n "$lgpl" \
!        || test -n "$macro_prefix" || test -n "$autoconf_minversion"; then
        echo "gnulib-tool: invalid options for 'update' mode" 1>&2
        echo "Try 'gnulib-tool --help' for more information." 1>&2
        echo "If you really want to modify the gnulib configuration of your 
project," 1>&2
***************
*** 446,451 ****
--- 461,472 ----
      do_changelog=false
    fi
  
+   DEFAULT_AUTOCONF_MINVERSION="2.59"
+   case "$autoconf_minversion" in
+     1.* | 2.[0-4]* | 2.5[0-8]*)
+       func_fatal_error "minimum supported autoconf version is 2.59" ;;
+   esac
+ 
    # Remove trailing slashes from the directory names. This is necessary for
    # m4base (to avoid an error in func_import) and optional for the others.
    sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
***************
*** 565,572 ****
  func_get_filelist ()
  {
    sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
!   #echo m4/onceonly.m4
!   #echo m4/onceonly_2_57.m4
  }
  
  # func_get_dependencies module
--- 586,597 ----
  func_get_filelist ()
  {
    sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
!   case "$autoconf_minversion" in
!     2.59)
!       #echo m4/onceonly.m4
!       echo m4/onceonly_2_57.m4
!       ;;
!   esac
  }
  
  # func_get_dependencies module
***************
*** 902,907 ****
--- 927,933 ----
  # - libtool         true if libtool will be used, blank otherwise
  # - guessed_libtool true if the configure.ac file uses libtool, blank 
otherwise
  # - macro_prefix    prefix of gl_EARLY, gl_INIT macros to use
+ # - autoconf_minversion  minimum supported autoconf version
  # - doit            : if actions shall be executed, false if only to be 
printed
  # - symbolic        true if files should be symlinked, copied otherwise
  func_import ()
***************
*** 917,922 ****
--- 943,949 ----
    cached_lgpl=
    cached_libtool=
    cached_macro_prefix=
+   cached_autoconf_minversion=
    cached_files=
    if test -f "$destdir"/$m4base/gnulib-cache.m4; then
      my_sed_traces='
***************
*** 952,957 ****
--- 979,987 ----
        }
        /gl_MACRO_PREFIX(/ {
          s,^.*gl_MACRO_PREFIX([[ ]*\([^])]*\).*$,cached_macro_prefix="\1",p
+       }
+       /gl_AUTOCONF_MINVERSION(/ {
+         s,^.*gl_AUTOCONF_MINVERSION([[ 
]*\([^])]*\).*$,cached_autoconf_minversion="\1",p
        }'
      eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-cache.m4`
      if test -f "$destdir"/$m4base/gnulib-comp.m4; then
***************
*** 1034,1039 ****
--- 1064,1076 ----
        func_fatal_error "missing --macro-prefix option"
      fi
    fi
+   # The autoconf_minversion defaults to the cached one.
+   if test -z "$autoconf_minversion"; then
+     autoconf_minversion="$cached_autoconf_minversion"
+     if test -z "$autoconf_minversion"; then
+       autoconf_minversion="$DEFAULT_AUTOCONF_MINVERSION"
+     fi
+   fi
  
    # Canonicalize the list of specified modules.
    specified_modules=`for m in $specified_modules; do echo $m; done | LC_ALL=C 
sort | LC_ALL=C uniq`
***************
*** 1278,1283 ****
--- 1315,1321 ----
      actioncmd="$actioncmd --libtool"
    fi
    actioncmd="$actioncmd --macro-prefix=$macro_prefix"
+   actioncmd="$actioncmd --assume-autoconf=$autoconf_minversion"
    actioncmd="$actioncmd `echo $specified_modules`"
  
    # Create lib/Makefile.am.
***************
*** 1331,1336 ****
--- 1369,1375 ----
      test -z "$lgpl" || echo "gl_LGPL"
      test -z "$libtool" || echo "gl_LIBTOOL"
      echo "gl_MACRO_PREFIX([$macro_prefix])"
+     echo "gl_AUTOCONF_MINVERSION([$autoconf_minversion])"
    ) > "$tmpfile"
    if test -f "$destdir"/$m4base/gnulib-cache.m4; then
      if cmp "$destdir"/$m4base/gnulib-cache.m4 "$tmpfile" > /dev/null; then
***************
*** 1909,1914 ****
--- 1948,1954 ----
          test -n "$docbase" || docbase="doc"
          test -n "$testsbase" || testsbase="tests"
          test -n "$macro_prefix" || macro_prefix="gl"
+         test -n "$autoconf_minversion" || 
autoconf_minversion="$DEFAULT_AUTOCONF_MINVERSION"
        fi
        func_import "$*"
      else
***************
*** 1949,1954 ****
--- 1989,1995 ----
          test -n "$docbase" || docbase="doc"
          test -n "$testsbase" || testsbase="tests"
          test -n "$macro_prefix" || macro_prefix="gl"
+         test -n "$autoconf_version" || 
autoconf_version="$DEFAULT_AUTOCONF_MINVERSION"
          func_import "$*"
        else
          if test $m4dirs_count = 1; then




reply via email to

[Prev in Thread] Current Thread [Next in Thread]