bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 1/7] gnulib-tool: transform include guards with `--macro-prefix'


From: Gary V. Vaughan
Subject: [PATCH 1/7] gnulib-tool: transform include guards with `--macro-prefix'
Date: Tue, 12 Oct 2010 23:08:36 +0700

From: Sam Steingold <address@hidden>

This is based on:

http://clisp.cvs.sourceforge.net/viewvc/clisp/clisp/gnulib-tool.patch?revision=1.1&view=markup

But doesn't have any of the problems I outlined earlier today.

Although I've committed on topic/libposix branch for testing, I think
it can be safely merged to master independently of the rest of that
branch.

* gnulib-tool (func_import): support multiple gllib directories:
headers are generated for each gllib differently, depending on which
features are actually used, so we need to be able to include all
these generated headers without fear that one will shadow another,
so we prepend the macro-prefix before the guard macros.
---
 ChangeLog   |   10 ++++++++++
 gnulib-tool |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25790a6..8b0f6a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-12  Sam Steingold  <address@hidden>
+           Gary V. Vaughan  <address@hidden>
+
+       gnulib-tool: transform include guards with `--macro-prefix'
+       * gnulib-tool (func_import): support multiple gllib directories:
+       headers are generated for each gllib differently, depending on which
+       features are actually used, so we need to be able to include all
+       these generated headers without fear that one will shadow another,
+       so we prepend the macro-prefix before the guard macros.
+
 2010-10-11  Bruno Haible  <address@hidden>
 
        stdlib: Allow multiple gnulib generated replacements to coexist.
diff --git a/gnulib-tool b/gnulib-tool
index 0e1694d..f43b7ad 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3847,6 +3847,9 @@ s,^\(.................................................[^ 
]*\) *,
       break
     fi
   done
+  test -n ${macro_prefix} && sed_transform_lib_file=$sed_transform_lib_file"
+    s/_GL_\(.*\)_H/_${macro_prefix}_GL_\1_H/g
+  "
   sed_transform_main_lib_file="$sed_transform_lib_file"
   if test -n "$do_copyrights"; then
     if test -n "$lgpl"; then
@@ -3885,6 +3888,10 @@ s,^\(.................................................[^ 
]*\) *,
       s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
     '
   fi
+  test -n ${macro_prefix} \
+    && sed_transform_build_aux_file=$sed_transform_build_aux_file"
+         s/_GL_\(.*\)_H/_${macro_prefix}_GL_\1_H/g
+       "
 
   # Determine script to apply to library files that go into $testsbase/.
   sed_transform_testsrelated_lib_file="$sed_transform_lib_file"
-- 
1.7.3




reply via email to

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