"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/vala-configure.sh" (19 Nov 2020, 2755 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "vala-configure.sh": 1.16.2_vs_1.16.3.

    1 #! /bin/sh
    2 # Copyright (C) 2008-2020 Free Software Foundation, Inc.
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2, or (at your option)
    7 # any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License
   15 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 # Test AM_PROG_VALAC.
   18 
   19 . test-init.sh
   20 
   21 cat >> configure.ac << 'END'
   22 AC_PROG_CC
   23 AM_PROG_VALAC([1.2.3])
   24 AC_OUTPUT
   25 END
   26 
   27 cat > Makefile.am << 'END'
   28 has-valac:
   29     case '$(VALAC)' in */bin/valac) exit 0;; *) exit 1;; esac
   30 no-valac:
   31     test x'$(VALAC)' = x'valac'
   32 END
   33 
   34 mkdir bin
   35 cat > bin/valac << 'END'
   36 #! /bin/sh
   37 if test "x$1" = x--version; then
   38   echo "${vala_version-1.2.3}"
   39 fi
   40 if test "x$1" = x--api-version; then
   41   echo "${vala_version-1.2.3}"
   42 fi
   43 exit 0
   44 END
   45 chmod +x bin/valac
   46 
   47 cat > bin/valac.old << 'END'
   48 #! /bin/sh
   49 if test "x$1" = x--version; then
   50   echo 0.1
   51 fi
   52 if test "x$1" = x--api-version; then
   53   echo 0.1
   54 fi
   55 exit 0
   56 END
   57 chmod +x bin/valac.old
   58 
   59 PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
   60 
   61 # Avoid interferences from the environment.
   62 unset VALAC vala_version
   63 
   64 $ACLOCAL
   65 $AUTOMAKE -a
   66 $AUTOCONF
   67 
   68 st=0; ./configure 2>stderr || st=$?
   69 cat stderr >&2
   70 grep 'WARNING.*vala' stderr && exit 1
   71 test $st -eq 0
   72 $MAKE has-valac
   73 
   74 st=0; vala_version=99.9 ./configure 2>stderr || st=$?
   75 cat stderr >&2
   76 grep 'WARNING.*vala' stderr && exit 1
   77 test $st -eq 0
   78 $MAKE has-valac
   79 
   80 st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
   81 cat stderr >&2
   82 test $st -eq 0
   83 grep '^configure: WARNING: Vala compiler not found or too old' stderr
   84 $MAKE no-valac
   85 
   86 st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
   87 cat stderr >&2
   88 test $st -eq 0 || exit 1
   89 grep '^configure: WARNING: Vala compiler not found or too old' stderr
   90 $MAKE no-valac
   91 
   92 sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac >t
   93 mv -f t configure.ac
   94 rm -rf autom4te*.cache
   95 $ACLOCAL
   96 $AUTOCONF
   97 
   98 st=0; ./configure 2>stderr || st=$?
   99 cat stderr >&2
  100 grep 'WARNING.*vala' stderr && exit 1
  101 test -f ok
  102 test ! -e ko
  103 $MAKE has-valac
  104 rm -f ok ko
  105 
  106 st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
  107 cat stderr >&2
  108 grep 'WARNING.*vala' stderr && exit 1
  109 test $st -eq 0
  110 test ! -e ok
  111 test -f ko
  112 $MAKE no-valac
  113 rm -f ok ko
  114 
  115 st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
  116 cat stderr >&2
  117 grep 'WARNING.*vala' stderr && exit 1
  118 test $st -eq 0
  119 test ! -e ok
  120 test -f ko
  121 $MAKE no-valac
  122 rm -f ok ko
  123 
  124 :