coverage: tests AM_MISSING_PROG usage
[platform/upstream/automake.git] / t / objcxx-basic.sh
1 #! /bin/sh
2 # Copyright (C) 2012 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 # Basic tests on the Objective C++ support that don't actually
15 # require an Objective-C++ compiler.
16 # See also sister test 'objc-basic.sh'.
17
18 . ./defs || Exit 1
19
20 cat > Makefile.am <<'END'
21 bin_PROGRAMS = hello
22 hello_SOURCES = hello.mm
23 END
24
25 $ACLOCAL
26 AUTOMAKE_fails
27 grep "'OBJCXX'.* undefined" stderr
28 grep "add .*'AC_PROG_OBJCXX'" stderr
29
30 rm -rf autom4te*.cache
31
32 cat >> configure.ac <<'END'
33 dnl Support for Object C++ was introduced only in Autoconf 2.65.
34 AC_PREREQ([2.65])
35 AC_PROG_OBJCXX
36 END
37
38 if $ACLOCAL; then
39   : We have a modern enough autoconf, go ahead.
40 elif test $? -eq 63; then
41   skip_ "Object C++ support requires Autoconf 2.65 or later"
42 else
43   Exit 1 # Some other aclocal failure.
44 fi
45
46 $AUTOMAKE
47 $EGREP '^\.SUFFIXES:.* \.mm( |$)' Makefile.in
48
49 :