bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: move to build-aux broke CVS m4


From: Gary V. Vaughan
Subject: [bug-gnulib] Re: move to build-aux broke CVS m4
Date: Fri, 08 Apr 2005 19:17:56 +0100
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Hi Eric,

Eric Blake wrote:
> gnulib-tool --import, when parsing modules/gettext, adds
> build-aux/config.rpath to the file list.  But for projects that don't yet
> have a build-aux directory, such as a fresh checkout of CVS m4, this breaks:
> 
> cp: cannot create regular file `./build-aux/config.rpath': No such file or
> directory
> 
> We need some way to make gnulib-tool respect the spelling of the target
> project's AC_CONFIG_AUX_DIR.

Here is an excerpt of CVS HEAD libtoolize that does exactly that (func
definitions should be obvious by their name, and $SED is substituted by
libtool's configure according to the findings of AC_PROG_SED):

    configure_ac=configure.in

    test -f configure.ac && configure_ac=configure.ac
    test -f "$configure_ac" \
        || func_fatal_help "\`$configure_ac' does not exist"

    # ---------------------------------------------------- #
    # Probe macro usage in configure.ac and/or aclocal.m4. #
    # ---------------------------------------------------- #

    my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
        /AC_CONFIG_AUX_DIR[[^_]]/  {
            s,^.*AC_CONFIG_AUX_DIR([[[  ]*\([^])]]*\).*$,auxdir=\1,; p;
        };
        /AC_CONFIG_MACRO_DIR/   {
            s,^.*AC_CONFIG_MACRO_DIR([[[        ]*\([^])]]*\).*$,m4dir=\1,; p;
        };
        /A[[CM]]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
        /LT_INIT/            { s,^.*$,seen_libtool=:,; p; };
        /LTDL_INIT/          { s,^.*$,seen_ltdl=:,; p; };
        /LT_WITH_LTDL/       { s,^.*$,seen_ltdl=:,; p; };
        /AC_LIB_LTDL/        { s,^.*$,seen_ltdl=:,; p; };
        /AC_WITH_LTDL/       { s,^.*$,seen_ltdl=:,; p; };
        d;'
    eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`


    # ---------------- #
    # Validate auxdir. #
    # ---------------- #

    if test -n "$auxdir"; then
      # If $configure_ac contains AC_CONFIG_AUX_DIR, check that it was
      # not given in terms of a shell variable!
      case "$auxdir" in
      *\$*)
        func_fatal_error "can not handle variables in AC_CONFIG_AUX_DIR"
        ;;
      *);;
      esac
    else
      # Try to discover auxdir the same way it is discovered by configure.
      # Note that we default to the current directory.
      for dir in . .. ../..; do
        if test -f "$dir/install-sh"; then
          auxdir=$dir
          break
        elif test -f "$dir/install.sh"; then
          auxdir="$dir"
          break
        fi
      done
    fi

    # Just use the current directory if all else fails.
    test -n "$auxdir" || auxdir=.

Hope that helps!

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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