On Thu, 26 Apr 2012, Stefano Lattarini wrote:
On 04/26/2012 01:56 PM, Peter Breitenlohner wrote:
but could also apply them to the current git version and send you these.
Please do. If they are not-invasive, they could appear in 1.12.1.
Hi Stefano,
attached are six patches. The first four are against the current git:
0001-Support-for-Objective-C.patch - the code
0002-Support-for-Objective-C.patch - the manual
0003-Support-for-Objective-C.patch - modified tests
0004-Support-for-Objective-C.patch - announcement
I may, however, have problem to modernize the test cases.
If you experience problems, just prod us on the list; I'd be very happy to
help with this.
The last two patches are old and contain complete old-style test cases:
xxxx-Support-for-Objective-C.patch - two new ObjC++ specific tests (from 2009)
0003-A-complete-demo-package-using-ObjC-and-distcheck.patch - an additional
test from 2009 (Ralf Wildenhues had asked for such a complete package).
Thanks, and sorry for the confusion,
No problem.
Regards
Peter Breitenlohner <p...@mppmu.mpg.de>
From 3f7c44e5ed1534f8ab0c20918728572c36bea4fa Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Thu, 26 Apr 2012 15:01:23 +0200
Subject: [PATCH 1/4] Support for Objective C++
* automake.in: Register new language.
(lang_objcxx_rewrite): New subroutine.
(resolve_linker): Add OBJCXXLINK.
(%_am_macro_for_cond): Add am__fastdepOBJCXX and AC_PROG_OBJCXX.
(%-ac_macro_for_var): Add OBJCXX and OBJCXXFLAGS.
* m4/depend.m4 (_AM_DEPENDENCIES): Add OBJCXX.
* m4/init.m4 (AM_INIT_AUTOMAKE): Add AC_PROG_OBJCXX hook.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
automake.in | 29 +++++++++++++++++++++++++++--
lib/Automake/Variable.pm | 2 ++
m4/depend.m4 | 5 +++--
m4/init.m4 | 6 +++++-
4 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/automake.in b/automake.in
index 43a7ba6..c8c5b01 100644
--- a/automake.in
+++ b/automake.in
@@ -760,6 +760,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',
@@ -5793,6 +5811,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
{
@@ -6057,7 +6081,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};
}
@@ -6245,13 +6269,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/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 6a69244..0d5f29f 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,10 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES(OBJCXX)],
+ [define([AC_PROG_OBJCXX],
+ defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES(OBJCXX)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
--
1.7.3.1
From f76669bb57ae747da20b6550e68519224aa3d988 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Thu, 26 Apr 2012 15:03:02 +0200
Subject: [PATCH 2/4] Support for Objective C++
* doc/automake.texi (Objective C++ Support): New node.
(How the Linker is Chosen, Support for Other Languages): Adjust.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
doc/automake.texi | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/doc/automake.texi b/doc/automake.texi
index c21a5b7..bf705d7 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -220,6 +220,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
@@ -3027,6 +3028,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}.
+@item 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}.
@@ -4670,6 +4675,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
@@ -5787,6 +5793,7 @@ they apply.
@itemx maude_GCJFLAGS
@itemx maude_LFLAGS
@itemx maude_OBJCFLAGS
+@itemx maude_OBJCXXFLAGS
@itemx maude_RFLAGS
@itemx maude_UPCFLAGS
@itemx maude_YFLAGS
@@ -5804,6 +5811,7 @@ Automake. These @dfn{per-target compilation flags} are
@samp{_GCJFLAGS},
@samp{_LFLAGS},
@samp{_OBJCFLAGS},
+@samp{_OBJCXXFLAGS},
@samp{_RFLAGS},
@samp{_UPCFLAGS}, and
@samp{_YFLAGS}.
@@ -6380,6 +6388,41 @@ The command used to actually link an Objective C program.
@end vtable
+@node Objective C++ Support
+@section Objective C++ Support
+
+@cindex Objective C++ support
+@cindex Support for Objective C++
+
+Automake includes some support for Objective C++.
+
+Any package including Objective C++ code must define the output variable
+@code{OBJCXX} 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:
+
+@vtable @code
+@item OBJCXX
+The name of the Objective C++ compiler.
+
+@item OBJCXXFLAGS
+Any flags to pass to the Objective C++ compiler.
+
+@item AM_OBJCXXFLAGS
+The maintainer's variant of @code{OBJCXXFLAGS}.
+
+@item OBJCXXCOMPILE
+The command used to actually compile an Objective C++ source file. The
+file name is appended to form the complete command line.
+
+@item OBJCXXLINK
+The command used to actually link an Objective C++ program.
+@end vtable
+
+
@node Unified Parallel C Support
@section Unified Parallel C Support
@@ -6645,6 +6688,9 @@ parentheses are the variables containing the link
command.)
@vindex GCJLINK
Native Java (@code{GCJLINK})
@item
+@vindex OBJCXXLINK
+Objective C++ (@code{OBJCXXLINK})
+@item
@vindex CXXLINK
C++ (@code{CXXLINK})
@item
@@ -6854,7 +6900,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
@@ -12194,6 +12242,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}
+@cindex @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}
@@ -12208,6 +12257,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}
+@cindex @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}
@@ -12217,8 +12267,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},
-@code{LFLAGS}, @code{LIBTOOLFLAGS}, @code{OBJCFLAGS}, @code{RFLAGS},
-@code{UPCFLAGS}, and @code{YFLAGS}.
+@code{LFLAGS}, @code{LIBTOOLFLAGS}, @code{OBJCFLAGS}, @code{OBJCXXFLAGS},
+@code{RFLAGS}, @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
@@ -13124,6 +13174,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
+@c 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
--
1.7.3.1
From ac81e2a9bbdbc875aae0f8bb64d59175af647477 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Thu, 26 Apr 2012 15:12:39 +0200
Subject: [PATCH 3/4] Support for Objective C++
Adapt existing tests.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
t/ext.sh | 5 +++--
t/nodep2.sh | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/t/ext.sh b/t/ext.sh
index dd92e85..08643ac 100755
--- a/t/ext.sh
+++ b/t/ext.sh
@@ -22,18 +22,19 @@ cat >> configure.ac << 'END'
AC_PROG_F77
AC_PROG_FC
AC_PROG_OBJC
+AC_PROG_OBJCXX
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/nodep2.sh b/t/nodep2.sh
index edf0fa9..45e7d5c 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,7 @@ AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_OBJC
+AC_PROG_OBJCXX
AM_PROG_AS
AM_PROG_GCJ
AM_PROG_UPC
--
1.7.3.1
From 9323834bdff630bc858b50d1ed3f45734e6e0d06 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Thu, 26 Apr 2012 15:14:04 +0200
Subject: [PATCH 4/4] Support for Objective C++
* NEWS: Announce.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
NEWS | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/NEWS b/NEWS
index 4e49512..9822de2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+New in 1.12.1:
+
+* Languages changes:
+
+ - New support for Objective C++:
+ - A new section of the manual documents the support.
+
New in 1.12:
* WARNING: Future backward-incompatibilities!
--
1.7.3.1
From 71ce4de9db36dc8974a6982ce6d1f2245e8ccdf7 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Tue, 24 Nov 2009 12:03:29 +0100
Subject: [PATCH 2/2] Support for Objective C++
* tests/ext.test, tests/nodep2.test: Add Objective C++.
* tests/objcxx.test, tests.objcxx2.test: New tests.
* tests/Makefile.am: Adjust.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
tests/Makefile.am | 2 +
tests/objcxx.test | 34 +++++++++++++++++++++++++
tests/objcxx2.test | 33 ++++++++++++++++++++++++
12 files changed, 181 insertions(+), 16 deletions(-)
create mode 100755 tests/objcxx.test
create mode 100755 tests/objcxx2.test
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8936ff1..49708c8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -485,6 +485,8 @@ notrans.test \
number.test \
objc.test \
objc2.test \
+objcxx.test \
+objcxx2.test \
obsolete.test \
order.test \
outdir.test \
diff --git a/tests/objcxx.test b/tests/objcxx.test
new file mode 100755
index 0000000..2dafeb5
--- /dev/null
+++ b/tests/objcxx.test
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 2009 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 `.mm' extension works.
+# From Ralf Corsepius (for C++).
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_OBJCXX
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.mm
+END
+
+$ACLOCAL || Exit 1
+$AUTOMAKE || Exit 1
+
+grep '^\.SUFFIXES:.*\.mm' Makefile.in
diff --git a/tests/objcxx2.test b/tests/objcxx2.test
new file mode 100755
index 0000000..558db21
--- /dev/null
+++ b/tests/objcxx2.test
@@ -0,0 +1,33 @@
+#! /bin/sh
+# Copyright (C) 2009 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 Automake suggests using AC_PROG_OBJCXX if Objective C++
+# sources are used.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_PROG_CC >>configure.in
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.mm
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep AC_PROG_OBJCXX stderr
--
1.6.4
From 5998a1ac168c99447013301ede8ebb1138a56ef0 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <p...@mppmu.mpg.de>
Date: Wed, 25 Nov 2009 10:29:10 +0100
Subject: [PATCH 3/3] A complete demo package using ObjC++ and distcheck
* tests/objcxx3.test: New test.
* tests/Makefile.am: Adjust.
Signed-off-by: Peter Breitenlohner <p...@mppmu.mpg.de>
---
tests/Makefile.am | 1 +
tests/objcxx3.test | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 0 deletions(-)
create mode 100755 tests/objcxx3.test
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 49708c8..0a4691a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -487,6 +487,7 @@ objc.test \
objc2.test \
objcxx.test \
objcxx2.test \
+objcxx3.test \
obsolete.test \
order.test \
outdir.test \
diff --git a/tests/objcxx3.test b/tests/objcxx3.test
new file mode 100755
index 0000000..4807e59
--- /dev/null
+++ b/tests/objcxx3.test
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2009 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/>.
+
+# Demo package using Objective C++ and doing distcheck.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >configure.in <<'END'
+AC_INIT([play], [1.1], [p...@mppmu.mpg.de])
+AC_PREREQ([2.65])
+AC_CONFIG_SRCDIR([play.c])
+AM_INIT_AUTOMAKE([foreign])
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_OBJC
+AC_LANG_PUSH([Objective C++])
+AC_CACHE_CHECK([Objective C++ preprocessor],
+ [my_cv_preproc],
+ [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#import <objc/Object.h>]],
+ [[[Object class]]])],
+ [my_cv_preproc=PASS],
+ [my_cv_preproc=FAIL])])
+AC_CACHE_CHECK([Objective C++ compiler],
+ [my_cv_compile],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]],
+ [[extern void foo(int
i,...);]])],
+ [my_cv_compile=PASS],
+ [my_cv_compile=FAIL])])
+AC_LANG_POP([Objective C++])
+if test "x$my_cv_preproc:$my_cv_compile" != xPASS:PASS; then
+ AC_MSG_ERROR([Objective C++ compilation failed], 77)
+fi
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = play
+play_SOURCES = play.c playxx.cxx playobjc.m playobjcxx.mm
+TESTS = play
+END
+
+cat >play.c <<'END'
+#include <config.h>
+#include <stdio.h>
+int main()
+{
+ printf("Hello, world! (" PACKAGE_STRING ")\n");
+ return 0;
+}
+END
+
+echo '//' >>playxx.cxx
+
+echo '/* */' >>playobjc.m
+
+echo '//' >>playobjcxx.mm
+
+$ACLOCAL
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+$MAKE distcheck
--
1.6.4