[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12-80-g
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12-80-g1e85264 |
Date: |
Fri, 04 May 2012 15:51:07 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=1e8526488f16c127e89ccd8be0df1bd33076c351
The branch, master has been updated
via 1e8526488f16c127e89ccd8be0df1bd33076c351 (commit)
via 33f4f7d391152e679232479a7dec4cc2cb90a12f (commit)
via 8450f187c9b6d99374fddd49e976356ab0f26efb (commit)
via 75b91149b81b38570282008c926eba9eb99b6a29 (commit)
via 679d8a844e727e456ed51606ad98bee5de84aa5c (commit)
via 49aa6e01579f0f7be8099f14e40d97379c327141 (commit)
via 3434a6495151f3eaa3570fbbb40c873554c0fe4e (commit)
via 8e6c0c51ff8c58bb2baf784c5c1dda723c90b897 (commit)
via fe2037a22449e700c506e37a59af9c1f4bdfd1b3 (commit)
via 23197cff2c48bdf0b84e91edfb9b9607a76d6ecc (commit)
via 6542254a9fbd32495f02317c3c84d406567a596f (commit)
via 401d4119f9854b7fc2965d9b31872348deea9316 (commit)
via 8becdd30e4923df4eca086a5447cf5ed3351cb4e (commit)
via df306b52cbab029d1c54ac9724bae07428e21bff (commit)
from a1241883c9a783077cf51b6fc2f8b7dd4c2c900f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1e8526488f16c127e89ccd8be0df1bd33076c351
Merge: a124188 33f4f7d
Author: Stefano Lattarini <address@hidden>
Date: Fri May 4 17:46:51 2012 +0200
Merge branch 'maint'
* maint:
tests: avoid spurious failure on missing Obj C/C++ compiler
objc, objc++: test support for compilation flags
objc, objc++: add stress test
objc, objc++: test automatic dependency tracking
objc: reorganize basic tests
objc++, objc: add first semantic tests
objc++: add first basic test
news: announce initial support for Objective C++
objc++: test support for '.mm' suffix in _SOURCES entries
objc++: add documentation
objc++: initial support for Objective C++
-----------------------------------------------------------------------
Summary of changes:
NEWS | 5 +
automake.in | 29 ++++-
doc/automake.texi | 57 +++++++-
lib/Automake/Variable.pm | 2 +
m4/depend.m4 | 5 +-
m4/init.m4 | 9 +-
t/ext.sh | 10 +-
t/list-of-tests.mk | 11 +-
t/nodep2.sh | 8 +-
t/{objc2.sh => objc-basic.sh} | 27 ++--
t/{check7.sh => objc-deps.sh} | 60 ++++----
t/objc-flags.sh | 62 ++++++++
t/objc-megademo.sh | 347 +++++++++++++++++++++++++++++++++++++++++
t/objc-minidemo.sh | 76 +++++++++
t/objc.sh | 36 -----
t/objcxx-basic.sh | 49 ++++++
t/objcxx-deps.sh | 81 ++++++++++
t/objcxx-flags.sh | 72 +++++++++
t/objcxx-minidemo.sh | 77 +++++++++
19 files changed, 936 insertions(+), 87 deletions(-)
rename t/{objc2.sh => objc-basic.sh} (58%)
copy t/{check7.sh => objc-deps.sh} (50%)
create mode 100755 t/objc-flags.sh
create mode 100755 t/objc-megademo.sh
create mode 100755 t/objc-minidemo.sh
delete mode 100755 t/objc.sh
create mode 100755 t/objcxx-basic.sh
create mode 100755 t/objcxx-deps.sh
create mode 100755 t/objcxx-flags.sh
create mode 100755 t/objcxx-minidemo.sh
diff --git a/NEWS b/NEWS
index 8e2ee31..2bbf126 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,11 @@ New in 1.12.1:
search path are looked up is probably going to be changed in the
next Automake release (1.13).
+* New supported languages:
+
+ - Support for Objective C++ has been added; it should work similarly to
+ the support for Objective C.
+
* Deprecated obsolescent features:
- Support for the "Cygnus-style" trees (enabled by the 'cygnus' option) is
diff --git a/automake.in b/automake.in
index 72ca956..9c632e2 100644
--- a/automake.in
+++ b/automake.in
@@ -759,6 +759,24 @@ register_language ('name' => 'objc',
'pure' => 1,
'extensions' => ['.m']);
+# Objective C++.
+register_language ('name' => 'objcxx',
+ 'Name' => 'Objective C++',
+ 'config_vars' => ['OBJCXX'],
+ 'linker' => 'OBJCXXLINK',
+ 'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
+ 'autodep' => 'OBJCXX',
+ 'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'],
+ 'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES)
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
+ 'ccer' => 'OBJCXX',
+ 'compiler' => 'OBJCXXCOMPILE',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
+ 'lder' => 'OBJCXXLD',
+ 'ld' => '$(OBJCXX)',
+ 'pure' => 1,
+ 'extensions' => ['.mm']);
+
# Unified Parallel C.
register_language ('name' => 'upc',
'Name' => 'Unified Parallel C',
@@ -5725,6 +5743,12 @@ sub lang_objc_rewrite
return &lang_sub_obj;
}
+# Rewrite a single Objective C++ file.
+sub lang_objcxx_rewrite
+{
+ return &lang_sub_obj;
+}
+
# Rewrite a single Unified Parallel C file.
sub lang_upc_rewrite
{
@@ -5989,7 +6013,7 @@ sub resolve_linker
{
my (%linkers) = @_;
- foreach my $l (qw(GCJLINK CXXLINK F77LINK FCLINK OBJCLINK UPCLINK))
+ foreach my $l (qw(GCJLINK OBJCXXLINK CXXLINK F77LINK FCLINK OBJCLINK
UPCLINK))
{
return $l if defined $linkers{$l};
}
@@ -6177,13 +6201,14 @@ sub make_conditional_string ($$)
my %_am_macro_for_cond =
(
AMDEP => "one of the compiler tests\n"
- . " AC_PROG_CC, AC_PROG_CXX, AC_PROG_CXX, AC_PROG_OBJC,\n"
+ . " AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,\n"
. " AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC",
am__fastdepCC => 'AC_PROG_CC',
am__fastdepCCAS => 'AM_PROG_AS',
am__fastdepCXX => 'AC_PROG_CXX',
am__fastdepGCJ => 'AM_PROG_GCJ',
am__fastdepOBJC => 'AC_PROG_OBJC',
+ am__fastdepOBJCXX => 'AC_PROG_OBJCXX',
am__fastdepUPC => 'AM_PROG_UPC'
);
diff --git a/doc/automake.texi b/doc/automake.texi
index 59c039d..e655b4e 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -218,6 +218,7 @@ Building Programs and Libraries
* Yacc and Lex:: Yacc and Lex support
* C++ Support:: Compiling C++ sources
* Objective C Support:: Compiling Objective C sources
+* Objective C++ Support:: Compiling Objective C++ sources
* Unified Parallel C Support:: Compiling Unified Parallel C sources
* Assembly Support:: Compiling assembly sources
* Fortran 77 Support:: Compiling Fortran 77 sources
@@ -3008,6 +3009,10 @@ Programs, , Particular Program Checks, autoconf, The
Autoconf Manual}.
This is required if any Objective C source is included. @xref{Particular
Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
address@hidden AC_PROG_OBJCXX
+This is required if any Objective C++ source is included. @xref{Particular
+Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
+
@item AC_PROG_F77
This is required if any Fortran 77 source is included. @xref{Particular
Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
@@ -4590,6 +4595,7 @@ to build programs and libraries.
* Yacc and Lex:: Yacc and Lex support
* C++ Support:: Compiling C++ sources
* Objective C Support:: Compiling Objective C sources
+* Objective C++ Support:: Compiling Objective C++ sources
* Unified Parallel C Support:: Compiling Unified Parallel C sources
* Assembly Support:: Compiling assembly sources
* Fortran 77 Support:: Compiling Fortran 77 sources
@@ -5706,6 +5712,7 @@ they apply.
@itemx maude_GCJFLAGS
@itemx maude_LFLAGS
@itemx maude_OBJCFLAGS
address@hidden maude_OBJCXXFLAGS
@itemx maude_RFLAGS
@itemx maude_UPCFLAGS
@itemx maude_YFLAGS
@@ -5723,6 +5730,7 @@ Automake. These @dfn{per-target compilation flags} are
@samp{_GCJFLAGS},
@samp{_LFLAGS},
@samp{_OBJCFLAGS},
address@hidden,
@samp{_RFLAGS},
@samp{_UPCFLAGS}, and
@samp{_YFLAGS}.
@@ -6299,6 +6307,41 @@ The command used to actually link an Objective C program.
@end vtable
address@hidden Objective C++ Support
address@hidden Objective C++ Support
+
address@hidden Objective C++ support
address@hidden Support for Objective C++
+
+Automake includes some support for Objective C++.
+
+Any package including Objective C++ code must define the output variable
address@hidden in @file{configure.ac}; the simplest way to do this is to use
+the @code{AC_PROG_OBJCXX} macro (@pxref{Particular Programs, , Particular
+Program Checks, autoconf, The Autoconf Manual}).
+
+A few additional variables are defined when an Objective C++ source file
+is seen:
+
address@hidden @code
address@hidden OBJCXX
+The name of the Objective C++ compiler.
+
address@hidden OBJCXXFLAGS
+Any flags to pass to the Objective C++ compiler.
+
address@hidden AM_OBJCXXFLAGS
+The maintainer's variant of @code{OBJCXXFLAGS}.
+
address@hidden OBJCXXCOMPILE
+The command used to actually compile an Objective C++ source file. The
+file name is appended to form the complete command line.
+
address@hidden OBJCXXLINK
+The command used to actually link an Objective C++ program.
address@hidden vtable
+
+
@node Unified Parallel C Support
@section Unified Parallel C Support
@@ -6564,6 +6607,9 @@ parentheses are the variables containing the link
command.)
@vindex GCJLINK
Native Java (@code{GCJLINK})
@item
address@hidden OBJCXXLINK
+Objective C++ (@code{OBJCXXLINK})
address@hidden
@vindex CXXLINK
C++ (@code{CXXLINK})
@item
@@ -6773,7 +6819,9 @@ source file.
@section Support for Other Languages
Automake currently only includes full support for C, C++ (@pxref{C++
-Support}), Objective C (@pxref{Objective C Support}), Fortran 77
+Support}), Objective C (@pxref{Objective C Support}),
+Objective C++ (@pxref{Objective C++ Support}),
+Fortran 77
(@pxref{Fortran 77 Support}), Fortran 9x (@pxref{Fortran 9x Support}),
and Java (@pxref{Java Support with gcj}). There is only rudimentary
support for other languages, support for which will be improved based
@@ -12013,6 +12061,7 @@ flags, not appended.
@cindex @code{AM_LFLAGS} and @code{LFLAGS}
@cindex @code{AM_LIBTOOLFLAGS} and @code{LIBTOOLFLAGS}
@cindex @code{AM_OBJCFLAGS} and @code{OBJCFLAGS}
address@hidden @code{AM_OBJCXXFLAGS} and @code{OBJXXCFLAGS}
@cindex @code{AM_RFLAGS} and @code{RFLAGS}
@cindex @code{AM_UPCFLAGS} and @code{UPCFLAGS}
@cindex @code{AM_YFLAGS} and @code{YFLAGS}
@@ -12027,6 +12076,7 @@ flags, not appended.
@cindex @code{LFLAGS} and @code{AM_LFLAGS}
@cindex @code{LIBTOOLFLAGS} and @code{AM_LIBTOOLFLAGS}
@cindex @code{OBJCFLAGS} and @code{AM_OBJCFLAGS}
address@hidden @code{OBJCXXFLAGS} and @code{AM_OBJCXXFLAGS}
@cindex @code{RFLAGS} and @code{AM_RFLAGS}
@cindex @code{UPCFLAGS} and @code{AM_UPCFLAGS}
@cindex @code{YFLAGS} and @code{AM_YFLAGS}
@@ -12036,8 +12086,8 @@ mostly discuss @code{CPPFLAGS} in our examples, but
actually the
answer holds for all the compile flags used in Automake:
@code{CCASFLAGS}, @code{CFLAGS}, @code{CPPFLAGS}, @code{CXXFLAGS},
@code{FCFLAGS}, @code{FFLAGS}, @code{GCJFLAGS}, @code{LDFLAGS},
address@hidden, @code{LIBTOOLFLAGS}, @code{OBJCFLAGS}, @code{RFLAGS},
address@hidden, and @code{YFLAGS}.
address@hidden, @code{LIBTOOLFLAGS}, @code{OBJCFLAGS}, @code{OBJCXXFLAGS},
address@hidden, @code{UPCFLAGS}, and @code{YFLAGS}.
@code{CPPFLAGS}, @code{AM_CPPFLAGS}, and @code{mumble_CPPFLAGS} are
three variables that can be used to pass flags to the C preprocessor
@@ -12943,6 +12993,7 @@ suite failures, please attach the
@file{tests/test-suite.log} file.
@c LocalWords: subsubsection OBJEXT esac lib LTLIBRARIES liblob LIBADD AR ar
@c LocalWords: ARFLAGS cru ing maude libgettext lo LTLIBOBJS rpath SGI PRE yy
@c LocalWords: libmaude CCLD CXXFLAGS FFLAGS LFLAGS OBJCFLAGS RFLAGS DEFS cc
address@hidden LocalWords: OBJCXXFLAGS
@c LocalWords: SHORTNAME vtable srcdir nostdinc basename yxx cxx ll lxx gdb
@c LocalWords: lexers yymaxdepth maxdepth yyparse yylex yyerror yylval lval
@c LocalWords: yychar yydebug yypact yyr yydef def yychk chk yypgo pgo yyact
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 4d346f0..d4d230f 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -185,6 +185,8 @@ my %_ac_macro_for_var =
FCFLAGS => 'AC_PROG_FC',
OBJC => 'AC_PROG_OBJC',
OBJCFLAGS => 'AC_PROG_OBJC',
+ OBJCXX => 'AC_PROG_OBJCXX',
+ OBJCXXFLAGS => 'AC_PROG_OBJCXX',
RANLIB => 'AC_PROG_RANLIB',
UPC => 'AM_PROG_UPC',
UPCFLAGS => 'AM_PROG_UPC',
diff --git a/m4/depend.m4 b/m4/depend.m4
index 8d7adf6..cee3199 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
+# serial 17
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -17,7 +17,7 @@
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -33,6 +33,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
diff --git a/m4/init.m4 b/m4/init.m4
index 9731527..9db4eea 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -6,7 +6,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 18
+# serial 19
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -100,6 +100,13 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+dnl Support for Objective C++ was only introduced in Autoconf 2.65,
+dnl but we still cater to Autoconf 2.62.
+m4_ifdef([AC_PROG_OBJCXX],
+[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [define([AC_PROG_OBJCXX],
+
defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
diff --git a/t/ext.sh b/t/ext.sh
index dd92e85..c62dbd3 100755
--- a/t/ext.sh
+++ b/t/ext.sh
@@ -22,18 +22,24 @@ cat >> configure.ac << 'END'
AC_PROG_F77
AC_PROG_FC
AC_PROG_OBJC
+# FIXME: this is to cater to older autoconf; remove this once we
+# FIXME: automake requires Autoconf 2.65 or later.
+m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [
+ AC_SUBST([OBJCXX], [whocares])
+ AM_CONDITIONAL([am__fastdepOBJCXX], [whocares])
+])
AM_PROG_UPC
END
cat > Makefile.am << 'END'
bin_PROGRAMS = foo
-foo_SOURCES = 1.f 2.for 3.f90 4.f95 5.F 6.F90 7.F95 8.r 9.m 10.upc
+foo_SOURCES = 1.f 2.for 3.f90 4.f95 5.F 6.F90 7.F95 8.r 9.m 10.mm 11.upc
END
$ACLOCAL
$AUTOMAKE
-for ext in f for f90 f95 F F90 F95 r m upc
+for ext in f for f90 f95 F F90 F95 r m mm upc
do
# Some versions of the BSD shell wrongly exit when 'set -e' is active
# if the last command within a compound statement fails and is guarded
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 3ff1c2c..ecb5bf2 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -694,8 +694,15 @@ t/nolink.sh \
t/nostdinc.sh \
t/notrans.sh \
t/number.sh \
-t/objc.sh \
-t/objc2.sh \
+t/objc-basic.sh \
+t/objc-minidemo.sh \
+t/objc-flags.sh \
+t/objc-deps.sh \
+t/objcxx-basic.sh \
+t/objcxx-minidemo.sh \
+t/objcxx-flags.sh \
+t/objcxx-deps.sh \
+t/objc-megademo.sh \
t/objext-pr10128.sh \
t/oldvars.sh \
t/order.sh \
diff --git a/t/nodep2.sh b/t/nodep2.sh
index edf0fa9..cc80058 100755
--- a/t/nodep2.sh
+++ b/t/nodep2.sh
@@ -20,7 +20,7 @@
cat > Makefile.am << 'END'
bin_PROGRAMS = foo
-foo_SOURCES = a.c b.cpp c.m d.S e.java f.upc
+foo_SOURCES = a.c b.cpp c.m cxx.mm d.S e.java f.upc
END
cat > configure.ac << 'END'
@@ -30,6 +30,12 @@ AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_OBJC
+# FIXME: this is to cater to older autoconf; remove this once we
+# FIXME: automake requires Autoconf 2.65 or later.
+m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [
+ AC_SUBST([OBJCXX], [whocares])
+ AM_CONDITIONAL([am__fastdepOBJCXX], [whocares])
+])
AM_PROG_AS
AM_PROG_GCJ
AM_PROG_UPC
diff --git a/t/objc2.sh b/t/objc-basic.sh
similarity index 58%
rename from t/objc2.sh
rename to t/objc-basic.sh
index 290bf26..f608fbc 100755
--- a/t/objc2.sh
+++ b/t/objc-basic.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2012 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -10,22 +10,29 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test that Automake suggests using AC_PROG_OBJC if Objective C sources
-# are used.
+# Basic tests on the Objective C support that don't actually
+# require an Objective-C compiler.
+# See also sister test 'objcxx-basic.sh'.
. ./defs || Exit 1
-echo AC_PROG_CC >>configure.ac
-
-cat >Makefile.am <<'END'
+cat > Makefile.am <<'END'
bin_PROGRAMS = hello
hello_SOURCES = hello.m
END
$ACLOCAL
AUTOMAKE_fails
-grep AC_PROG_OBJC stderr
+grep "'OBJC'.* undefined" stderr
+grep "add .*'AC_PROG_OBJC'" stderr
+
+rm -rf autom4te*.cache
+
+echo AC_PROG_OBJC >> configure.ac
+
+$ACLOCAL
+$AUTOMAKE
+$EGREP '^\.SUFFIXES:.* \.m( |$)' Makefile.in
+
+:
diff --git a/t/check7.sh b/t/objc-deps.sh
similarity index 50%
copy from t/check7.sh
copy to t/objc-deps.sh
index 574569b..a2e4212 100755
--- a/t/check7.sh
+++ b/t/objc-deps.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# Copyright (C) 2012 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,54 +14,58 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check EXEEXT extension for XFAIL_TESTS.
+# Automatic dependency tracking for Objective C.
+# See also sister test 'objcxx-deps.sh'.
-required=cc
. ./defs || Exit 1
cat >> configure.ac << 'END'
-AC_PROG_CC
+AC_PROG_OBJC
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TESTS = $(XFAIL_TESTS)
-XFAIL_TESTS = a b c d
-check_PROGRAMS = a c d
-check_SCRIPTS = b
-EXTRA_DIST = $(check_SCRIPTS)
+bin_PROGRAMS = foo
+foo_SOURCES = bar.m baz.h baz2.h
+END
-.PHONY: print-xfail-tests
-print-xfail-tests:
- @echo BEG: $(XFAIL_TESTS) :END
+cat > baz.h << 'END'
+#include <stdio.h>
+#include <stdlib.h>
+#include "baz2.h"
END
-cat > b <<'END'
-#! /bin/sh
-exit 1
+cat > baz2.h << 'END'
+#define MSG "Hello, World"
END
-chmod a+x b
-cat > a.c <<'END'
-#include <stdlib.h>
+cat > bar.m << 'END'
+/* The use of #import makes this valid Object C but invalid C. */
+#import "baz.h"
int main (void)
{
- return EXIT_FAILURE;
+ fprintf (stdout, "%s\n", MSG);
+ return EXIT_SUCCESS;
}
END
-cp a.c c.c
-cp a.c d.c
-
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE --add-missing
-./configure
-$MAKE check
-EXEEXT=.bin $MAKE -e print-xfail-tests >stdout || { cat stdout; Exit 1; }
-cat stdout
-$FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
+./configure --enable-dependency-tracking
+$MAKE
+cross_compiling || (./foo | $FGREP 'Hello, World') || Exit 1
+$sleep
+: > old
+echo '#define MSG "Howdy, Earth"' > baz2.h
+$MAKE
+if test -f foo; then
+ is_newest foo old
+else
+ is_newest foo.exe old
+fi
+cross_compiling || (./foo | $FGREP 'Howdy, Earth') || Exit 1
$MAKE distcheck
diff --git a/t/objc-flags.sh b/t/objc-flags.sh
new file mode 100755
index 0000000..6c2b1e6
--- /dev/null
+++ b/t/objc-flags.sh
@@ -0,0 +1,62 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test Objective C compilation flags.
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_PROG_OBJC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AM_DEFAULT_SOURCE_EXT = .m
+bin_PROGRAMS = foo2 foo4
+AM_OBJCFLAGS = -DVALUE=2 -DERROR=1
+foo4_OBJCFLAGS = -DVALUE=4 -DERROR=1
+END
+
+for i in 2 4; do
+ unindent > foo$i.m << END
+ /* Let's make this file valid Objective C but invalid C. */
+ #import <stdlib.h>
+ @interface Who_Cares { } @end
+ #ifdef ERROR
+ # error "macro ERROR is defined for foo.m"
+ #else
+ # if VALUE == $i
+ int main (void) { exit (0); }
+ # else
+ # error "VALUE is != $i in foo.m"
+ # endif
+ #endif
+END
+done
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+$FGREP OBJCFLAGS Makefile.in # For debugging.
+grep '\$(OBJCFLAGS).*\$(AM_OBJCFLAGS)' Makefile.in && Exit 1
+grep '\$(OBJCFLAGS).*\$(foo.*_OBJCFLAGS)' Makefile.in && Exit 1
+grep '\$(foo.*_OBJCFLAGS).*\$(AM_OBJCFLAGS)' Makefile.in && Exit 1
+
+./configure OBJCFLAGS=-UERROR
+$MAKE
+
+:
diff --git a/t/objc-megademo.sh b/t/objc-megademo.sh
new file mode 100755
index 0000000..bad2aee
--- /dev/null
+++ b/t/objc-megademo.sh
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Stress test on Objective C/C++.
+
+required=libtoolize
+. ./defs || Exit 1
+
+## Autotools Input Files.
+
+cat > configure.ac << 'END'
+AC_INIT([play], [1.3], address@hidden)
+
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_CONFIG_SRCDIR([play.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE
+
+AM_PROG_AR
+LT_INIT
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_OBJC
+AC_PROG_OBJCXX
+
+AC_LANG_PUSH([Objective C])
+AC_CACHE_CHECK(
+ [whether the Objective C compiler really works],
+ [my_cv_objc_works],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#import <stdio.h>]],
+ [[printf ("foo\n");]])],
+ [my_cv_objc_works=yes],
+ [my_cv_objc_works=no])])
+AC_LANG_POP([Objective C])
+
+AC_LANG_PUSH([Objective C++])
+AC_CACHE_CHECK(
+ [whether the Objective C++ compiler really works],
+ [my_cv_objcxx_works],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#import <iostream>]],
+ [[std::cout << "foo" << "\n";]])],
+ [my_cv_objcxx_works=yes],
+ [my_cv_objcxx_works=no])])
+AC_LANG_POP([Objective C++])
+
+if test $my_cv_objc_works != yes; then
+ AC_MSG_ERROR([couldn't find a working Objective C compiler], [77])
+fi
+
+if test $my_cv_objcxx_works != yes; then
+ AC_MSG_ERROR([couldn't find a working Objective C++ compiler], [77])
+fi
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = play
+play_SOURCES = play.h play.c playxx.cxx playo.m playoxx.mm
+play_LDADD = libfoo.la
+play_LDFLAGS = -lobjc
+lib_LTLIBRARIES = libfoo.la
+libfoo_la_SOURCES = foo.h foo.c fooxx.cxx fooo.m foooxx.mm
+END
+
+## Run Autotools.
+
+libtoolize
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+$AUTOHEADER
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+## Program Sources.
+
+cat > play.h << 'END'
+#ifndef PLAY_H
+#define PLAY_H
+
+#include "foo.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void hello_cxx (void);
+void hello_objc (void);
+void hello_objcxx (void);
+
+#ifdef __OBJC__
address@hidden Hello_ObjC
+{ }
++ (void)display;
address@hidden
+#endif /* __OBJC__ */
+
+#ifdef __cplusplus
+}
+
+class Hello_CXX
+{
+ public:
+ Hello_CXX() { }
+ virtual ~Hello_CXX () { }
+ void hello_cxx ();
+};
+
+#ifdef __OBJC__
address@hidden Hello_ObjCXX
+{ }
++ (void)display;
address@hidden
+
+class Hello_OBJCXX
+{
+ public:
+ Hello_OBJCXX () { }
+ virtual ~Hello_OBJCXX () { }
+ void hello_objcxx();
+};
+#endif /* __OBJC__ */
+
+#endif /* __cplusplus */
+
+#endif /* PLAY_H */
+END
+
+cat > play.c << 'END'
+#include "play.h"
+int main (void)
+{
+ printf ("[Hello C,");
+ world_c ();
+ hello_cxx ();
+ hello_objc ();
+ hello_objcxx ();
+ return 0;
+}
+END
+
+cat > playxx.cxx << 'END'
+#include "play.h"
+
+void hello_cxx(void)
+{
+ Hello_CXX *hello = new Hello_CXX;
+ hello->hello_cxx();
+}
+
+void Hello_CXX::hello_cxx()
+{
+ std::cout << "[Hello C++,";
+ World_CXX *world = new World_CXX;
+ world->world_cxx();
+}
+END
+
+cat > playo.m << 'END'
+#import "play.h"
+
+void hello_objc (void)
+{
+ [Hello_ObjC display];
+}
+
address@hidden Hello_ObjC
++ (void)display
+{
+ printf ("[Hello ObjC,");
+ [World_ObjC display];
+}
address@hidden
+END
+
+cat > playoxx.mm << 'END'
+#import "play.h"
+
+// Calling: C -> C++ -> ObjC
+
+void hello_objcxx (void)
+{
+ Hello_OBJCXX *hello = new Hello_OBJCXX;
+ hello->hello_objcxx ();
+}
+
+void Hello_OBJCXX::hello_objcxx ()
+{
+ [Hello_ObjCXX display];
+}
+
address@hidden Hello_ObjCXX
++ (void)display
+{
+ std::cout << "[Hello ObjC++,";
+ [World_ObjCXX display];
+}
address@hidden
+END
+
+## Library Sources.
+
+cat > foo.h << 'END'
+#ifndef FOO_H
+#define FOO_H
+
+#ifdef __cplusplus
+#include <iostream>
+extern "C" {
+#else
+#include <stdio.h>
+#endif
+
+void world_c (void);
+
+#ifdef __OBJC__
address@hidden World_ObjC
+{ }
++ (void)display;
address@hidden
+#endif /* __OBJC__ */
+
+#ifdef __cplusplus
+}
+
+class World_CXX
+{
+ public:
+ World_CXX() { }
+ virtual ~World_CXX () { }
+ void world_cxx ();
+};
+
+#ifdef __OBJC__
+class World_OBJCXX
+{
+ public:
+ World_OBJCXX () { }
+ virtual ~World_OBJCXX () { }
+ void world_objcxx ();
+};
+
address@hidden World_ObjCXX
+{ }
++ (void)display;
address@hidden
+#endif /* __OBJC__ */
+
+#endif /* __cplusplus */
+
+#endif /* FOO_H */
+END
+
+cat > foo.c << 'END'
+#include "foo.h"
+
+void world_c (void)
+{
+ printf (" world C]\n");
+}
+END
+
+cat > fooxx.cxx << 'END'
+#include "foo.h"
+
+void World_CXX::world_cxx ()
+{
+ std::cout << " world C++]" << "\n";
+}
+END
+
+cat > fooo.m << 'END'
+#import "foo.h"
+
address@hidden World_ObjC
++ (void)display
+{
+ printf (" world ObjC]\n");
+}
address@hidden
+END
+
+cat > foooxx.mm << 'END'
+#import "foo.h"
+
+// Calling: ObjC -> C++
+
address@hidden World_ObjCXX
++ (void)display
+{
+ World_OBJCXX *world = new World_OBJCXX;
+ world->world_objcxx ();
+}
address@hidden
+
+void World_OBJCXX::world_objcxx ()
+{
+ std::cout << " world ObjC++]" << "\n";
+}
+END
+
+## Configure and build.
+
+./configure
+$MAKE
+
+if cross_compiling; then :; else
+ unindent > exp << 'END'
+ [Hello C, world C]
+ [Hello C++, world C++]
+ [Hello ObjC, world ObjC]
+ [Hello ObjC++, world ObjC++]
+END
+ ./play > got || { cat got; Exit 1; }
+ cat exp
+ cat got
+ diff exp got
+fi
+
+$MAKE distcheck
+
+:
diff --git a/t/objc-minidemo.sh b/t/objc-minidemo.sh
new file mode 100755
index 0000000..acd7e19
--- /dev/null
+++ b/t/objc-minidemo.sh
@@ -0,0 +1,76 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Dummy demo package using Objective C and doing distcheck.
+# See also sister test 'objcxx-minidemo.sh'.
+
+required=native
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_PROG_OBJC
+AC_CONFIG_HEADERS([config.h])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AM_DEFAULT_SOURCE_EXT = .m
+bin_PROGRAMS = ok
+noinst_PROGRAMS = ko
+TESTS = $(bin_PROGRAMS) $(XFAIL_TESTS)
+XFAIL_TESTS = $(noinst_PROGRAMS)
+END
+
+cat > ok.m << 'END'
+/* The use of #import makes this valid Object C but invalid C. */
+#import <stdio.h>
+#import <config.h>
+int main (void)
+{
+ printf ("Success (%s)\n", PACKAGE_STRING);
+ return 0;
+}
+END
+
+cat > ko.m << 'END'
+/* The use of #import makes this valid Object C but invalid C. */
+#import <stdio.h>
+int main (void)
+{
+ printf("Failure\n");
+ return 1;
+}
+END
+
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+
+$ACLOCAL
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/t/objc.sh b/t/objc.sh
deleted file mode 100755
index f56c76d..0000000
--- a/t/objc.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test that '.m' extension works.
-# From Ralf Corsepius (for C++).
-
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_OBJC
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = hello
-hello_SOURCES = hello.m
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-grep '^\.SUFFIXES:.*\.m' Makefile.in
-
-:
diff --git a/t/objcxx-basic.sh b/t/objcxx-basic.sh
new file mode 100755
index 0000000..be2cdf7
--- /dev/null
+++ b/t/objcxx-basic.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# Basic tests on the Objective C++ support that don't actually
+# require an Objective-C++ compiler.
+# See also sister test 'objc-basic.sh'.
+
+. ./defs || Exit 1
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.mm
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep "'OBJCXX'.* undefined" stderr
+grep "add .*'AC_PROG_OBJCXX'" stderr
+
+rm -rf autom4te*.cache
+
+cat >> configure.ac <<'END'
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_PROG_OBJCXX
+END
+
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+
+$AUTOMAKE
+$EGREP '^\.SUFFIXES:.* \.mm( |$)' Makefile.in
+
+:
diff --git a/t/objcxx-deps.sh b/t/objcxx-deps.sh
new file mode 100755
index 0000000..24665cc
--- /dev/null
+++ b/t/objcxx-deps.sh
@@ -0,0 +1,81 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Automatic dependency tracking for Objective C++.
+# See also sister test 'objc-deps.sh'.
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_PROG_OBJCXX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = bar.mm baz.h++ baz2.hh
+END
+
+cat > baz.h++ << 'END'
+#include <iostream>
+using namespace std;
+#include "baz2.hh"
+END
+
+cat > baz2.hh << 'END'
+#define MSG "Hello, World"
+END
+
+cat > bar.mm << 'END'
+/* The use of #import makes this valid Object C++ but invalid C++. */
+#import "baz.h++"
+int main (void)
+{
+ cout << MSG << "\n";
+ return 0;
+}
+END
+
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure --enable-dependency-tracking
+$MAKE
+cross_compiling || (./foo | $FGREP 'Hello, World') || Exit 1
+
+$sleep
+: > old
+echo '#define MSG "Howdy, Earth"' > baz2.hh
+$MAKE
+if test -f foo; then
+ is_newest foo old
+else
+ is_newest foo.exe old
+fi
+cross_compiling || (./foo | $FGREP 'Howdy, Earth') || Exit 1
+
+$MAKE distcheck
+
+:
diff --git a/t/objcxx-flags.sh b/t/objcxx-flags.sh
new file mode 100755
index 0000000..aea7e19
--- /dev/null
+++ b/t/objcxx-flags.sh
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test Objective C++ compilation flags.
+# See also sister test 'objc-flags.sh'.
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_PROG_OBJCXX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AM_DEFAULT_SOURCE_EXT = .mm
+bin_PROGRAMS = foo2 foo4
+AM_OBJCXXFLAGS = -DVALUE=2 -DERROR=1
+foo4_OBJCXXFLAGS = -DVALUE=4 -DERROR=1
+END
+
+for i in 2 4; do
+ unindent > foo$i.mm << END
+ /* Let's make this file valid Objective C but invalid C. */
+ #import <stdlib.h>
+ @interface Who_Cares { } @end
+ #ifdef ERROR
+ # error "macro ERROR is defined for foo.mm"
+ #else
+ # if VALUE == $i
+ int main (void) { exit (0); }
+ # else
+ # error "VALUE is != $i in foo.mm"
+ # endif
+ #endif
+END
+done
+
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+
+$AUTOCONF
+$AUTOMAKE -a
+
+$FGREP OBJCXXFLAGS Makefile.in # For debugging.
+grep '\$(OBJCXXFLAGS).*\$(AM_OBJCXXFLAGS)' Makefile.in && Exit 1
+grep '\$(OBJCXXFLAGS).*\$(foo.*_OBJCXXFLAGS)' Makefile.in && Exit 1
+grep '\$(foo.*_OBJCXXFLAGS).*\$(AM_OBJCXXFLAGS)' Makefile.in && Exit 1
+
+./configure OBJCXXFLAGS=-UERROR
+$MAKE
+
+:
diff --git a/t/objcxx-minidemo.sh b/t/objcxx-minidemo.sh
new file mode 100755
index 0000000..fe93ea6
--- /dev/null
+++ b/t/objcxx-minidemo.sh
@@ -0,0 +1,77 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Dummy demo package using Objective C++ and doing distcheck.
+# See also sister test 'objc-minidemo.sh'.
+
+required=native
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_PROG_OBJCXX
+AC_CONFIG_HEADERS([config.h])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AM_DEFAULT_SOURCE_EXT = .mm
+bin_PROGRAMS = ok
+noinst_PROGRAMS = ko
+TESTS = $(bin_PROGRAMS) $(XFAIL_TESTS)
+XFAIL_TESTS = $(noinst_PROGRAMS)
+END
+
+cat > ok.mm << 'END'
+/* The use of #import makes this valid Object C++ but invalid C++. */
+#import <iostream>
+#import <config.h>
+using namespace std;
+int main (void)
+{
+ cout << "Success (" << PACKAGE_STRING << ")\n";
+ return 0;
+}
+END
+
+cat > ko.mm << 'END'
+/* The use of #import makes this valid Object C++ but invalid C++. */
+#import <cstdio>
+int main (void)
+{
+ printf("Failure\n");
+ return 1;
+}
+END
+
+if $ACLOCAL; then
+ : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+ skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+ Exit 1 # Some other aclocal failure.
+fi
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12-80-g1e85264,
Stefano Lattarini <=