]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
[cygwin|mingw] Fix compile warnings when -std=c89.
authorCharles Wilson <libtool@cwilson.fastmail.fm>
Sat, 3 Jan 2009 06:56:54 +0000 (01:56 -0500)
committerCharles Wilson <libtool@cwilson.fastmail.fm>
Wed, 21 Jan 2009 20:59:17 +0000 (15:59 -0500)
* libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
move contents to...
(func_emit_wrapper_part2): move contents to...
(func_emit_wrapper): here.
(func_emit_cwrapperexe_src) [file scope]: Remove
variables script_text_part1 and script_text_part2.
(func_emit_cwrapperexe_src) [lt_dump_script]: New function.
(func_emit_cwrapperexe_src) [main]: Call it.

ChangeLog
libltdl/config/ltmain.m4sh

index b702907566b028fe54d704f8dfe5e2c905229b88..8d83a7bb3020eef5b3fa6df6352b9b0d9e43a4ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-01-21  Charles Wilson  <libtool@cwilson.fastmail.fm>
+
+       [cygwin|mingw] Fix compile warnings when -std=c89.
+       * libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
+       move contents to...
+       (func_emit_wrapper_part2): move contents to...
+       (func_emit_wrapper): here.
+       (func_emit_cwrapperexe_src) [file scope]: Remove
+       variables script_text_part1 and script_text_part2.
+       (func_emit_cwrapperexe_src) [lt_dump_script]: New function.
+       (func_emit_cwrapperexe_src) [main]: Call it.
+
 2009-01-21  Charles Wilson  <libtool@cwilson.fastmail.fm>
 
        Minor cygwin cleanup
index 760f64779e78e4ba19c28525e0082b343207fa64..3f1a30ca8987d87fc964278bb2ab43fe9976e1e8 100644 (file)
@@ -2308,15 +2308,23 @@ func_extract_archives ()
 }
 
 
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
 #
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
 {
-       func_emit_wrapper_part1_arg1=${1-no}
+       func_emit_wrapper_arg1=${1-no}
 
        $ECHO "\
 #! $SHELL
@@ -2397,24 +2405,10 @@ _LTECHO_EOF'
     file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
     file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
   done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
-    func_emit_wrapper_part2_arg1=${1-no}
-
-       $ECHO "\
 
   # Usually 'no', except on cygwin/mingw when embedded into
   # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
     # special case for '.'
     if test \"\$thisdir\" = \".\"; then
@@ -2531,30 +2525,6 @@ func_emit_wrapper_part2 ()
 fi\
 "
 }
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-       # split this up so that func_emit_cwrapperexe_src
-       # can call each part independently.
-       func_emit_wrapper_part1 ${1-no}
-       func_emit_wrapper_part2 ${1-no}
-}
 
 
 # func_to_host_path arg
@@ -2875,22 +2845,8 @@ int lt_split_name_value (const char *arg, char** name, char** value);
 void lt_update_exe_path (const char *name, const char *value);
 void lt_update_lib_path (const char *name, const char *value);
 char **prepare_spawn (char **argv);
-
-static const char *script_text_part1 =
-EOF
-
-           func_emit_wrapper_part1 yes |
-               $SED -e 's/\([\\"]\)/\\\1/g' \
-                    -e 's/^/  "/' -e 's/$/\\n"/'
-           echo ";"
-           cat <<EOF
-
-static const char *script_text_part2 =
+void lt_dump_script (FILE *f);
 EOF
-           func_emit_wrapper_part2 yes |
-               $SED -e 's/\([\\"]\)/\\\1/g' \
-                    -e 's/^/  "/' -e 's/$/\\n"/'
-           echo ";"
 
            cat <<EOF
 const char * MAGIC_EXE = "$magic_exe";
@@ -2986,8 +2942,7 @@ EOF
              esac
 
            cat <<"EOF"
-         printf ("%s", script_text_part1);
-         printf ("%s", script_text_part2);
+         lt_dump_script (stdout);
          return 0;
        }
     }
@@ -3747,6 +3702,18 @@ prepare_spawn (char **argv)
 EOF
                ;;
            esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+           func_emit_wrapper yes |
+              $SED -e 's/\([\\"]\)/\\\1/g' \
+                  -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
+
+            cat <<"EOF"
+}
+EOF
 }
 # end: func_emit_cwrapperexe_src