[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] objc++: initial support for Objective C++
From: |
Stefano Lattarini |
Subject: |
[PATCH 1/5] objc++: initial support for Objective C++ |
Date: |
Fri, 27 Apr 2012 10:19:25 +0200 |
From: Peter Breitenlohner <address@hidden>
Original thread (dating back to almost three years ago):
<http://lists.gnu.org/archive/html/automake-patches/2009-07/msg00016.html>
* automake.in: Register new language 'objcxx'.
(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 <address@hidden>
Signed-off-by: Stefano Lattarini <address@hidden>
---
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..dd4ac67 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.9.5
- ObjC++ integration (was: Re: bug#11346: automake-1.12 - one test fails (due to truncated timestamp), Stefano Lattarini, 2012/04/26
- [SPAM] Re: ObjC++ integration (was: Re: bug#11346: automake-1.12 - one test fails (due to truncated timestamp), Peter Breitenlohner, 2012/04/26
- [PATCH 0/5] Add Objective C++ support in Automake, Stefano Lattarini, 2012/04/27
- [PATCH 2/5] objc++: add documentation, Stefano Lattarini, 2012/04/27
- [PATCH 4/5] news: announce initial support for Objective C++, Stefano Lattarini, 2012/04/27
- [PATCH 1/5] objc++: initial support for Objective C++,
Stefano Lattarini <=
- Re: [PATCH 1/5] objc++: initial support for Objective C++, Stefano Lattarini, 2012/04/30
- Re: [PATCH 1/5] objc++: initial support for Objective C++, Peter Breitenlohner, 2012/04/30
- Re: [PATCH 1/5] objc++: initial support for Objective C++, Stefano Lattarini, 2012/04/30
- [PATCH 5/5] objc++: add first tests, Stefano Lattarini, 2012/04/27
- Re: [PATCH 5/5] objc++: add first tests, Stefano Lattarini, 2012/04/27
- Re: [PATCH 5/5] objc++: add first tests, Peter Breitenlohner, 2012/04/27
- Re: [PATCH 5/5] objc++: add first tests, Stefano Lattarini, 2012/04/27