ncurses 5.7 - patch 20100925
[ncurses.git] / mk-dlls.sh.in
similarity index 88%
rename from mk-dlls.sh
rename to mk-dlls.sh.in
index 3c21008de2b2ef8ccf0178efb45d455d02e85593..da2f39ba8aefc9ab205ad3c3945056e3362baef0 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: mk-dlls.sh,v 1.2 2010/01/30 19:23:49 tom Exp $
+# $Id: mk-dlls.sh.in,v 1.1 2010/09/25 22:29:49 juergen Exp $
 ##############################################################################
 # Copyright (c) 2008,2010 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -32,7 +32,7 @@
 #
 # Build DLLs on MinGW
 #
-gcc -v 2>&1 | grep specs | grep mingw
+LANG=en_US @CC@ -v 2>&1 | grep Target | grep mingw
 if [ $? -eq 1 ]; then
   echo "$0 requires a mingw environment" >&2
 else
@@ -47,18 +47,18 @@ else
           if [ -f libncurses${t}${m}.a ]; then
             f=libncurses${t}${m}.a
             g=`basename $f .a | cut -c 4-`
-            gi=libw${g}.a
+            gi=libw${g}.dll.a
             td=tmp-${g}
             rm -rf "${td}"
             mkdir "${td}"
             cd "${td}"
               ar x ../${f} `ar t ../${f}`
-              gcc $cf -o w${g}.dll -Wl,--out-implib,${gi} -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f`
+              @CC@ $cf -o w${g}.dll -Wl,--out-implib,${gi} -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f` @LIBS@
               lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
               rm -f `ar t ../$f`
               mv w${g}.dll ..
               mv w${g}.lib ..
-              mv libw${g}.a ..
+              mv ${gi} ..
             cd ..
             rm -rf "${td}"
 
@@ -68,17 +68,18 @@ else
               do
                 g=`basename $f .a | cut -c 4-`
                 td=tmp-${g}
+                gi2=libw${g}.dll.a
                 rm -rf "${td}"
                 mkdir "${td}"
                 echo $g
                 cd "${td}"
                   ar x ../$f `ar t ../$f`
-                  gcc $cf -o w${g}.dll -Wl,--out-implib,libw${g}.a -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f` ../${gi}
+                  @CC@ $cf -o w${g}.dll -Wl,--out-implib,${gi2} -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f` ../${gi} @LIBS@
                   lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
                   rm -f `ar t ../$f`
                   mv w${g}.dll ..
                   mv w${g}.lib ..
-                  mv libw${g}.a ..
+                  mv ${gi2} ..
                 cd ..
                 rm -rf "${td}"
               done