2 # Copyright (C) 2004-2012 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 <http://www.gnu.org/licenses/>.
17 # Test _PYTHON with conditionals.
22 cat >>configure.ac <<'EOF'
24 AM_CONDITIONAL([ONE], [test "x$one" = x1])
28 cat > Makefile.am <<'END'
33 yourdir=$(prefix)/your
38 echo 'def one(): return 1' >$@
40 echo 'def two(): return 1' >$@
45 test -f $(distdir)/one.py
46 test -f $(distdir)/two.py
51 $AUTOMAKE --add-missing
57 cwd=$(pwd) || fatal_ "getting current working directory"
59 ../configure --prefix="$cwd/$inst" one=0
61 test -f "$inst/your/two.py"
62 test -f "$inst/your/two.pyc"
63 test -f "$inst/your/two.pyo"
64 test ! -f "$inst/my/one.py"
65 test ! -f "$inst/my/one.pyc"
66 test ! -f "$inst/my/one.pyo"
68 test ! -f "$inst/your/two.py"
69 test ! -f "$inst/your/two.pyc"
70 test ! -f "$inst/your/two.pyo"
72 ../configure --prefix=$cwd/"$inst" one=1
74 test ! -f "$inst/your/two.py"
75 test ! -f "$inst/your/two.pyc"
76 test ! -f "$inst/your/two.pyo"
77 test -f "$inst/my/one.py"
78 test -f "$inst/my/one.pyc"
79 test -f "$inst/my/one.pyo"
81 test ! -f "$inst/my/one.py"
82 test ! -f "$inst/my/one.pyc"
83 test ! -f "$inst/my/one.pyo"