Edit

kc3-lang/automake/bootstrap

Branch :

  • Show log

    Commit

  • Author : Paul Eggert
    Date : 2017-09-16 13:03:36
    Hash : 199e7a44
    Message : Prefer https: URLs In Gnulib, Emacs, etc. we are changing ftp: and http: URLs to use https:, to discourage man-in-the-middle attacks when downloading software. The attached patch propagates these changes upstream to Automake. This patch does not affect files that Automake is downstream of, which I'll patch separately. Althouth the resources are not secret, plain HTTP is vulnerable to malicious routers that tamper with responses from GNU servers, and this sort of thing is all too common when people in some other countries browse US-based websites. See, for example: Aceto G, Botta A, Pescapé A, Awan MF, Ahmad T, Qaisar S. Analyzing internet censorship in Pakistan. RTSI 2016. https://dx.doi.org/10.1109/RTSI.2016.7740626 HTTPS is not a complete solution here, but it can be a significant help. The GNU project regularly serves up code to users, so we should take some care here.

  • bootstrap
  • #! /bin/sh
    
    # This script helps bootstrap automake, when checked out from git.
    #
    # Copyright (C) 2002-2017 Free Software Foundation, Inc.
    # Originally written by Pavel Roskin <proski@gnu.org> September 2002.
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2, or (at your option)
    # any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program.  If not, see <https://www.gnu.org/licenses/>.
    
    # Since Automake uses itself in its build process, we can't simply run
    # 'autoreconf -i' which would require Automake to already be
    # installed.
    
    # Don't ignore failures.
    set -e
    
    # Set program basename.
    me=`echo "$0" | sed 's,^.*/,,'`
    
    # Let user choose which version of autoconf, autom4te and perl to use.
    : ${AUTOCONF=autoconf}
    export AUTOCONF  # might be used by aclocal and/or automake
    : ${AUTOM4TE=autom4te}
    export AUTOM4TE  # ditto
    : ${PERL=perl}
    
    # Variables to substitute.
    VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
    APIVERSION=`sed -n 's/^APIVERSION=//p' configure.ac`
    PACKAGE=automake
    datadir=.
    # This should be automatically updated by the 'update-copyright'
    # rule of our Makefile.
    RELEASE_YEAR=2017
    
    # Sanity checks.
    if test -z "$VERSION"; then
      echo "$me: cannot find VERSION" >&2
      exit 1
    fi
    
    if test -z "$APIVERSION"; then
      echo "$me: cannot find APIVERSION" >&2
      exit 1
    fi
    
    # Make a dummy versioned directory for aclocal.
    rm -rf aclocal-$APIVERSION
    mkdir aclocal-$APIVERSION
    if test -d automake-$APIVERSION; then
      find automake-$APIVERSION -exec chmod u+wx '{}' ';'
    fi
    rm -rf automake-$APIVERSION
    # Can't use "ln -s lib automake-$APIVERSION", that might not work
    # properly on MinGW/MSYS.
    mkdir automake-$APIVERSION
    cp -rf lib/* automake-$APIVERSION
    
    dosubst ()
    {
      rm -f $2
      in=`echo $1 | sed 's,^.*/,,'`
      sed -e "s%@APIVERSION@%$APIVERSION%g" \
          -e "s%@PACKAGE@%$PACKAGE%g" \
          -e "s%@PERL@%$PERL%g" \
          -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
          -e "s%@VERSION@%$VERSION%g" \
          -e "s%@datadir@%$datadir%g" \
          -e "s%@RELEASE_YEAR@%$RELEASE_YEAR%g" \
          -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
          $1 > $2
      chmod a-w $2
    }
    
    # Create temporary replacement for lib/Automake/Config.pm.
    dosubst automake-$APIVERSION/Automake/Config.in \
            automake-$APIVERSION/Automake/Config.pm
    
    # Overwrite amversion.m4.
    dosubst m4/amversion.in m4/amversion.m4
    
    # Create temporary replacement for aclocal and automake.
    dosubst bin/aclocal.in bin/aclocal.tmp
    dosubst bin/automake.in bin/automake.tmp
    
    # Create required makefile snippets.
    $PERL ./gen-testsuite-part > t/testsuite-part.tmp
    chmod a-w t/testsuite-part.tmp
    mv -f t/testsuite-part.tmp t/testsuite-part.am
    
    # Run the autotools.  Bail out if any warning is triggered.
    # Use '-I' here so that our own *.m4 files in m4/ gets included,
    # not copied, in aclocal.m4.
    $PERL ./bin/aclocal.tmp -Wall -Werror -I m4 \
                            --automake-acdir=m4 --system-acdir=m4/acdir
    $AUTOCONF -Wall -Werror
    $PERL ./bin/automake.tmp -Wall -Werror
    
    # Remove temporary files and directories.
    rm -rf aclocal-$APIVERSION automake-$APIVERSION
    rm -f bin/aclocal.tmp bin/automake.tmp