2 # Copyright (C) 2008-2017 Free Software Foundation, Inc.
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)
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.
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/>.
21 cat >> configure.ac
<< 'END'
23 AM_PROG_VALAC
([1.2.3])
27 cat > Makefile.am
<< 'END'
29 case '$(VALAC)' in */bin
/valac
) exit 0;; *) exit 1;; esac
31 test x
'$(VALAC)' = x
'valac'
35 cat > bin
/valac
<< 'END'
37 if test "x$1" = x--version
; then
38 echo "${vala_version-1.2.3}"
44 cat > bin
/valac.old
<< 'END'
46 if test "x$1" = x--version
; then
51 chmod +x bin
/valac.old
53 PATH
=$
(pwd)/bin
$PATH_SEPARATOR$PATH; export PATH
55 # Avoid interferences from the environment.
56 unset VALAC vala_version
62 st
=0; .
/configure
2>stderr || st
=$?
64 grep 'WARNING.*vala' stderr
&& exit 1
68 st
=0; vala_version
=99.9 .
/configure
2>stderr || st
=$?
70 grep 'WARNING.*vala' stderr
&& exit 1
74 st
=0; vala_version
=0.1.2 .
/configure
2>stderr || st
=$?
77 grep '^configure: WARNING: no proper vala compiler found' stderr
80 st
=0; .
/configure VALAC
="$(pwd)/bin/valac.old" 2>stderr || st
=$?
82 test $st -eq 0 ||
exit 1
83 grep '^configure: WARNING: no proper vala compiler found' stderr
86 sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac
>t
88 rm -rf autom4te
*.cache
92 st
=0; .
/configure
2>stderr || st
=$?
94 grep 'WARNING.*vala' stderr
&& exit 1
100 st
=0; vala_version
=0.1.2 .
/configure
2>stderr || st
=$?
102 grep 'WARNING.*vala' stderr
&& exit 1
109 st
=0; .
/configure VALAC
="$(pwd)/bin/valac.old" 2>stderr || st
=$?
111 grep 'WARNING.*vala' stderr
&& exit 1