2 # Copyright (C) 2008-2024 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}"
40 if test "x$1" = x--api-version
; then
41 echo "${vala_version-1.2.3}"
47 cat > bin
/valac.old
<< 'END'
49 if test "x$1" = x--version
; then
52 if test "x$1" = x--api-version
; then
57 chmod +x bin
/valac.old
59 PATH
=$
(pwd)/bin
$PATH_SEPARATOR$PATH; export PATH
61 # Avoid interferences from the environment.
62 unset VALAC vala_version
68 st
=0; .
/configure
2>stderr || st
=$?
70 grep 'WARNING.*vala' stderr
&& exit 1
74 st
=0; vala_version
=99.9 .
/configure
2>stderr || st
=$?
76 grep 'WARNING.*vala' stderr
&& exit 1
80 st
=0; vala_version
=0.1.2 .
/configure
2>stderr || st
=$?
83 grep '^configure: WARNING: Vala compiler not found or too old' stderr
86 st
=0; .
/configure VALAC
="$(pwd)/bin/valac.old" 2>stderr || st
=$?
88 test $st -eq 0 ||
exit 1
89 grep '^configure: WARNING: Vala compiler not found or too old' stderr
92 sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac
>t
94 rm -rf autom4te
*.cache
98 st
=0; .
/configure
2>stderr || st
=$?
100 grep 'WARNING.*vala' stderr
&& exit 1
106 st
=0; vala_version
=0.1.2 .
/configure
2>stderr || st
=$?
108 grep 'WARNING.*vala' stderr
&& exit 1
115 st
=0; .
/configure VALAC
="$(pwd)/bin/valac.old" 2>stderr || st
=$?
117 grep 'WARNING.*vala' stderr
&& exit 1