2 # Copyright (C) 2011-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/>.
17 # Test an example from the manual about the 'amhello' package:
18 # cross-compiling a package from Linux/Unix to MinGW.
20 am_create_testdir
=empty
21 required
=i586-mingw32msvc-gcc
24 cp "$am_docdir"/amhello-1.0.
tar.gz . \
25 || fatal_
"cannot get amhello tarball"
28 build
=$
("$am_scriptdir"/config.guess
) && test -n "$build" \
29 || fatal_
"cannot guess build platform"
30 case $build in *mingw
*) skip_
"build system is MinGW too";; esac
32 gzip -dc amhello-1.0.
tar.gz |
tar xf
-
35 .
/configure
--build "$build" --host "$host" > stdout \
36 ||
{ cat stdout
; exit 1; }
38 grep '^checking for i586-mingw32msvc-strip\.\.\.' stdout
39 grep '^checking for i586-mingw32msvc-gcc\.\.\.' stdout
40 grep '^checking for suffix of executables\.\.\. \.exe *$' stdout
41 grep '^checking for suffix of object files\.\.\. o *$' stdout
42 grep '^checking whether i586-mingw32msvc-gcc accepts -g\.\.\. yes' stdout
47 file hello.exe
> whatis
49 $EGREP 'DOS|Win' whatis
50 grep 'executable' whatis
51 grep 'ELF' whatis && exit 1