Next patch in the MSVC series...

This is
"MSVC needs a hint to force it to compile either as C or C++."
abfb96f4c44b3e38fcf960c876e17fc252e9712c

and the relevant part of

"patch msvc-documentation.patch"
06cfce005204bb8ca212aadab38b38c0202ea04e

with @var changed to @code

This was originally suggested by Ralf here:
http://lists.gnu.org/archive/html/libtool-patches/2006-02/msg00067.html

and first posted here (I think):
http://lists.gnu.org/archive/html/libtool-patches/2007-07/msg00042.html

If you want to see how it is intended to be used, look in
"Add MSVC support"
9c848f1e8acdf435d019aa80f3f0b0aeb45613f7

I don't remember any feedback on this patch, but it seems pretty
benign to me.

Cheers,
Peter

2010-06-22  Peter Rosin  <p...@lysator.liu.se>

        MSVC needs a hint to force it to compile either as C or C++.
        * libltdl/m4/libtool.m4: Add tag variable compile_tag to
        enable tag specific compiler options that are bad in the
        linking phase.
        * libltdl/config/ltmain.m4sh: Add the tag specific options
        to the compile command line.
        * doc/libtool.texi (libtool script contents): Document
        new variable.
commit 3d2d3ef899cb7e83d5d77dea695e13dfeb80ee7f
Author: Gary V. Vaughan <gary@gnu.org>
Date:   Mon Jun 21 19:49:29 2010 +0700

    Ensure getopts.m4sh is compatible with Autoconf-2.61 and newer.
    
    * libltdl/config/getopt.m4sh (m4_chomp): Ensure this macro is
    implemented even if Autoconf's m4sugar.m4 doesn't provide it.
    (m4go_expand): New macro based on Autoconf-2.64 m4_expand. Use
    it everywhere incase m4sugar.m4 doesn't have an implementation.
    (m4_ifnblank): Replace all uses with m4_ifval, which was
    available long before m4_ifnblank was introduced.

diff --git a/ChangeLog b/ChangeLog
index 9bc84c8..18e346d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-21  Gary V. Vaughan  <gary@gnu.org>
+
+	Ensure getopts.m4sh is compatible with Autoconf-2.61 and newer.
+	* libltdl/config/getopt.m4sh (m4_chomp): Ensure this macro is
+	implemented even if Autoconf's m4sugar.m4 doesn't provide it.
+	(m4go_expand): New macro based on Autoconf-2.64 m4_expand. Use
+	it everywhere incase m4sugar.m4 doesn't have an implementation.
+	(m4_ifnblank): Replace all uses with m4_ifval, which was
+	available long before m4_ifnblank was introduced.
+
 2010-06-20  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	Fix clean mode for HP-UX 11.31 sh.
diff --git a/libltdl/config/getopt.m4sh b/libltdl/config/getopt.m4sh
index 44cf727..031402c 100644
--- a/libltdl/config/getopt.m4sh
+++ b/libltdl/config/getopt.m4sh
@@ -44,8 +44,46 @@ m4_include([general.m4sh])m4_divert_push([KILL])	-*- Autoconf -*-
 # All internal macros begin with `m4go_'.
 m4_pattern_forbid([^_?m4go_])
 
+
+## --------------------------- ##
+## 1. Backwards compatibility. ##
+## --------------------------- ##
+
+# m4_chomp(STRING)
+# ----------------
+# m4_chomp was not introduced until Autoconf-2.64.  Currently we
+# only use it indirectly via m4go_expand, below.  This implementation
+# is taken from Autoconf-2.65.
+m4_ifndef([m4_chomp],
+[m4_define([m4_chomp],
+[m4_format([[%.*s]], m4_index(m4_translit([[$1]], [
+/.], [/  ])[./.], [/.]), [$1])])])
+
+# m4go_expand(ARG)
+# ----------------
+# M4SH_GETOPTS wants to pass unbalanced parentheses to m4_expand to
+# build the branches of a shell `case' statement.  That is only
+# supported by the implementation of m4_expand in Autoconf-2.64 and
+# newer.  Since we want to be compatible back to at least
+# Autoconf-2.62, reimplement our own 2.64 based m4_expand in the
+# m4go_ namespace so that we can be compatible with Autoconf versions
+# supporting either semantic.
+m4_define([m4go_expand],
+[m4_chomp(_$0([$1
+]))])
+
+m4_define([_m4go_expand], [$0_([$1], [(], -=<{($1)}>=-, [}>=-])])
+
+m4_define([_m4go_ignore])
+
+m4_define([_m4go_expand_],
+[m4_if([$4], [}>=-],
+       [m4_changequote([-=<{$2], [)}>=-])$3m4_changequote([, ])],
+       [$0([$1], [($2], -=<{($2$1)}>=-, [}>=-])_m4go_ignore$2])])
+
+
 ## --------------------------------- ##
-## 1. Low level string manipulation. ##
+## 2. Low level string manipulation. ##
 ## --------------------------------- ##
 
 # m4go_slice(STRING, BEGIN, END)
@@ -96,10 +134,10 @@ m4_define([m4go_slice],
 #     to turn them off for the duration.
 #  6. Finally, we need to requote the result to account for the quotes
 #     we probably stripped.  m4_quote() doesn't handle commas well, so
-#     we use m4_expand() to requote without losing whitespace after any
-#     embedded commas.
+#     we use m4go_expand() to requote without losing whitespace after
+#     any embedded commas.
 m4_define([m4go_trimn],
-[m4_changecom()m4_expand([m4go_slice([$1], m4_bregexp(m4_translit([$1],[
+[m4_changecom()m4go_expand([m4go_slice([$1], m4_bregexp(m4_translit([$1],[
 [/,()]], [//     ]), [[^/]]), m4_bregexp(m4_translit([$1], [
 [/,()]], [/     /]), [/*$]))])[]m4_changecom([#])])
 
@@ -119,7 +157,7 @@ m4_define([m4go_unindent],
 
 
 ## ------------------------------ ##
-## 2. Option processing compiler. ##
+## 3. Option processing compiler. ##
 ## ------------------------------ ##
 
 # Shell fragments are piecemeal added to these macros for each
@@ -288,7 +326,7 @@ m4_define([m4go_option],
             [^=],       [],
             [.],        [[$1]],
                         []))],
-    [_$0(opt_[]m4_ifnblank([$2],
+    [_$0(opt_[]m4_ifval([$2],
             m4_translit(m4_bpatsubst([$2], [^--\(no-\)?\([^|]+\).*$],
                                      [\2]), -, _),
                 _short),
@@ -329,11 +367,11 @@ m4_define([_m4go_option],
 [m4_do(
     [m4_append([m4go_defaults],
         m4_bmatch([$3],
-            [[?!;+@^]], [m4_ifnblank([$5], [m4_n([$1="$5"])])],
+            [[?!;+@^]], [m4_ifval([$5], [m4_n([$1="$5"])])],
             [~],        [m4_n([$1=:])],
                         [m4_n([$1=false])]))],
     [m4_append([m4go_branches], [[]dnl (
-      m4_join([|], [$4], m4_ifnblank([$2], [-$2])))
+      m4_join([|], [$4], m4_ifval([$2], [-$2])))
 ])],
     [m4_append([m4go_branches],
         [m4_bmatch([$3], [[!+@]],
@@ -346,8 +384,8 @@ m4_n(m4_bmatch([$3],
     [+],       [			$1_num=`expr 1 + ${$1_num-0}`
 			eval $1_${$1_num}=\"$optarg\"],
     [?],       [m4_bmatch([$3],
-                    [@], [m4_expand([m4go_optional_file_arg([$1])])],
-                         [m4_expand([m4go_optional_arg([$1])])])],
+                    [@], [m4go_expand([m4go_optional_file_arg([$1])])],
+                         [m4go_expand([m4go_optional_arg([$1])])])],
     [[!@]],    [			$1="$optarg"],
     [;],       [			$1="${$1+[$]$1
 }$optarg"],
@@ -356,12 +394,12 @@ m4_n(m4_bmatch([$3],
                [			$1=:]))[]dnl
 dnl only write the file_arg fragment when we didn't already write opt_file_arg:
 m4_bmatch([$3], [@], [m4_bmatch([$3], [?], [],
-                   [m4_expand([m4go_file_arg([$1])])
+                   [m4go_expand([m4go_file_arg([$1])])
 ])])m4_n(m4go_unindent([$6]))[]dnl
 m4_bmatch([$3], [[!+;]], [			shift
 ])			;;
 ])],
-    [m4_ifnblank([$2],
+    [m4_ifval([$2],
         [m4_bmatch([$3],
             [[?!;+@^~]], [m4_append([m4go_shortargs],   [-$2*], [|])],
                        [m4_append([m4go_shortnoargs], [-$2*],
@@ -489,7 +527,7 @@ m4go_validation
 
 
 ## ------------------------- ##
-## 3. Supporting Shell Code. ##
+## 4. Supporting Shell Code. ##
 ## ------------------------- ##
 
 # The shell functions below are expanded verbatim into the shell script

Reply via email to