automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {maint} automake: refactoring: factor out common cpp-like flags


From: Stefano Lattarini
Subject: [FYI] {maint} automake: refactoring: factor out common cpp-like flags
Date: Fri, 19 Apr 2013 18:01:40 +0200

* automake.in (@cpplike_flags): In this new variable...
(C, C++, Objective C, Objective C++, Unified Parallel C, Preprocessed
Assembler, Preprocessed Fortran, Preprocessed Fortran 77): ... to be
used by registration (with the 'register_language' subroutine) of these
languages.

This is a refactoring meant to simplify future changes; no semantic
change is intended.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/automake.in b/automake.in
index bbf0c88..751dc84 100644
--- a/automake.in
+++ b/automake.in
@@ -609,6 +609,15 @@ sub initialize_per_input ()
 
 # Initialize our list of languages that are internally supported.
 
+my @cpplike_flags =
+  qw{
+    $(DEFS)
+    $(DEFAULT_INCLUDES)
+    $(INCLUDES)
+    $(AM_CPPFLAGS)
+    $(CPPFLAGS)
+  };
+
 # C.
 register_language ('name' => 'c',
                   'Name' => 'C',
@@ -617,7 +626,7 @@ register_language ('name' => 'c',
                   'flags' => ['CFLAGS', 'CPPFLAGS'],
                   'ccer' => 'CC',
                   'compiler' => 'COMPILE',
-                  'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+                  'compile' => "\$(CC) @cpplike_flags \$(AM_CFLAGS) 
\$(CFLAGS)",
                   'lder' => 'CCLD',
                   'ld' => '$(CC)',
                   'linker' => 'LINK',
@@ -634,7 +643,7 @@ register_language ('name' => 'cxx',
                   'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
                   'autodep' => 'CXX',
                   'flags' => ['CXXFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+                  'compile' => "\$(CXX) @cpplike_flags \$(AM_CXXFLAGS) 
\$(CXXFLAGS)",
                   'ccer' => 'CXX',
                   'compiler' => 'CXXCOMPILE',
                   'compile_flag' => '-c',
@@ -653,7 +662,7 @@ register_language ('name' => 'objc',
                   'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) 
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
                   'autodep' => 'OBJC',
                   'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+                  'compile' => "\$(OBJC) @cpplike_flags \$(AM_OBJCFLAGS) 
\$(OBJCFLAGS)",
                   'ccer' => 'OBJC',
                   'compiler' => 'OBJCCOMPILE',
                   'compile_flag' => '-c',
@@ -671,7 +680,7 @@ register_language ('name' => 'objcxx',
                   '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)',
+                  'compile' => "\$(OBJCXX) @cpplike_flags \$(AM_OBJCXXFLAGS) 
\$(OBJCXXFLAGS)",
                   'ccer' => 'OBJCXX',
                   'compiler' => 'OBJCXXCOMPILE',
                   'compile_flag' => '-c',
@@ -689,7 +698,7 @@ register_language ('name' => 'upc',
                   'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
                   'autodep' => 'UPC',
                   'flags' => ['UPCFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
+                  'compile' => "\$(UPC) @cpplike_flags \$(AM_UPCFLAGS) 
\$(UPCFLAGS)",
                   'ccer' => 'UPC',
                   'compiler' => 'UPCCOMPILE',
                   'compile_flag' => '-c',
@@ -808,7 +817,7 @@ register_language ('name' => 'cppasm',
 
                   'autodep' => 'CCAS',
                   'flags' => ['CCASFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+                  'compile' => "\$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) 
\$(CCASFLAGS)",
                   'ccer' => 'CPPAS',
                   'compiler' => 'CPPASCOMPILE',
                   'compile_flag' => '-c',
@@ -862,7 +871,7 @@ register_language ('name' => 'ppfc',
                   'flags' => ['FCFLAGS', 'CPPFLAGS'],
                   'ccer' => 'PPFC',
                   'compiler' => 'PPFCCOMPILE',
-                  'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+                  'compile' => "\$(FC) @cpplike_flags \$(AM_FCFLAGS) 
\$(FCFLAGS)",
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'libtool_tag' => 'FC',
@@ -894,7 +903,7 @@ register_language ('name' => 'ppf77',
                   'flags' => ['FFLAGS', 'CPPFLAGS'],
                   'ccer' => 'PPF77',
                   'compiler' => 'PPF77COMPILE',
-                  'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
+                  'compile' => "\$(F77) @cpplike_flags \$(AM_FFLAGS) 
\$(FFLAGS)",
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'libtool_tag' => 'F77',
-- 
1.8.2.1.389.gcaa7d79




reply via email to

[Prev in Thread] Current Thread [Next in Thread]