]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 [mingw* cygwin*]: Small improvement for mingw-hosted
authorTor Lillqvist <tml@iki.fi>
Sat, 22 Sep 2001 14:20:17 +0000 (14:20 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 22 Sep 2001 14:20:17 +0000 (14:20 +0000)
tool support (while still running libtool on cygwin). In that case
PATH_SEPARATOR is ':', but gcc -print-search-dirs still prints its
search path with ';' as separator.
(AC_LIBTOOL_RC, AC_LIBTOOL_LANG_RC_CONFIG): Add support for .rc
files (Windows resource files), compiled by the resource compiler
(windres in mingw) to .o files.
(AC_PROG_NM): Minor bug fix for $PATH elements with spaces in
them.
* configure.ac: Use LT_AC_PROG_RC.
* ltmain.in: Check for .rc files.
* NEWS: Updated.

ChangeLog
NEWS
configure.ac
libtool.m4

index ef44ff01d834c5c539fa778564a03cacd8322052..534993047c869d916ae1366ca61c28243eb6819c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2001-09-22  Tor Lillqvist  <tml@iki.fi>
 
+       * libtool.m4 [mingw* cygwin*]: Small improvement for mingw-hosted
+       tool support (while still running libtool on cygwin). In that case
+       PATH_SEPARATOR is ':', but gcc -print-search-dirs still prints its
+       search path with ';' as separator.
+       (AC_LIBTOOL_RC, AC_LIBTOOL_LANG_RC_CONFIG): Add support for .rc
+       files (Windows resource files), compiled by the resource compiler
+       (windres in mingw) to .o files.
+       (AC_PROG_NM): Minor bug fix for $PATH elements with spaces in
+       them.
+       * configure.ac: Use LT_AC_PROG_RC.
+       * ltmain.in: Check for .rc files.
+       * NEWS: Updated.
+
        * ltmain.in: Add a space to $base_compile in the case statement,
        as the case labels checks for trailing spaces, but there aren't
        necessarily in $base_compile.
diff --git a/NEWS b/NEWS
index f773355e0c7b0af6b6ac1b2efbdf703d5c3395fa..532a55158c4baa8b7dee0c6162fb1ae93d44fbb2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ New in 1.4d: 2001-??-??; CVS version 1.4c, Libtool team:
 * Better search path management in libltdl with `lt_dlinsertsearchdir' call.
 * Support /lib/w32api in recent cygwin releases.
 * Support cross compilation to mingw.
+* Support for .rc files (Windows resource compiler).
+* Improved handling of mingw gcc.
+* Improved handling of $PATH with entries containing spaces.
 * Improved support for linking with gcc on aix4* and aix5*.
 * Improved support for GCC 3.0.
 * Initial support for QNX RTOS, UnixWare 7 and OpenUNIX 8.
index 904528ff95c0d72a2123b77d66928a3879c22c13..07a3b78b71ff627af6769804ee2af8ec8f3da75e 100644 (file)
@@ -23,7 +23,7 @@ case "$VERSION" in
     echo $dashes
     echo
     ;;
-esac    
+esac
 AC_SUBST(TIMESTAMP)
 
 pkgdatadir='${datadir}'"/${PACKAGE}"
@@ -48,6 +48,10 @@ AM_CONDITIONAL(HAVE_CXX, [test "x$CXX" != xno])
 LT_AC_PROG_GCJ
 AM_CONDITIONAL(HAVE_GCJ, [test "x$GCJ" != xno])
 
+LT_AC_PROG_RC
+AM_CONDITIONAL(HAVE_RC, [test "x$RC" != xno])
+
+
 # Declare win32 dll support
 AC_LIBTOOL_WIN32_DLL
 
index 49804bb407f3792ba17faaae1fff1bc3a16c50cc..c568ebc9f8ec47d9c1a63b48a0273325a5171cdd 100644 (file)
@@ -1086,7 +1086,18 @@ cygwin* | mingw* | pw32*)
     ;;
   yes,mingw*)
     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/$PATH_SEPARATOR/ /g"`
+    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
+    if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then
+      # It is most probably a Windows format PATH printed by
+      # mingw gcc, but we are running on Cygwin. Gcc prints its search
+      # path with ; separators, and with drive letters. We can handle the
+      # drive letters (cygwin fileutils understands them), so leave them,
+      # especially as we might pass files found there to a mingw objdump,
+      # which wouldn't understand a cygwinified path. Ahh.
+      sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
+    else
+      sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed  -e "s/$PATH_SEPARATOR/ /g"`
+    fi
     ;;
   yes,pw32*)
     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
@@ -1408,7 +1419,10 @@ AC_DEFUN([_LT_AC_TAGCONFIG],
     [AC_HELP_STRING([--with-tags=TAGS],
        [include additional configurations @<:@CXX,GCJ@:>@])],
     [tagnames="$withval"],
-    [tagnames="CXX,GCJ"])
+    [tagnames="CXX,GCJ"
+    case $host_os in
+      mingw*|cygwin*) tagnames="$tagnames,RC" ;;
+    esac])
 
 if test -f "$ltmain" && test -n "$tagnames"; then
   if test ! -f "${ofile}"; then
@@ -1456,6 +1470,10 @@ if test -f "$ltmain" && test -n "$tagnames"; then
        AC_LIBTOOL_LANG_GCJ_CONFIG
        ;;
 
+      RC)
+       AC_LIBTOOL_LANG_RC_CONFIG
+       ;;
+
       *)
        AC_MSG_ERROR([Unsupported tag name: $tagname])
        ;;
@@ -2018,16 +2036,16 @@ else
   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
     IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+      if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
        lt_cv_path_NM="$tmp_nm -B"
        break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+      elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
        lt_cv_path_NM="$tmp_nm -p"
        break
       else
@@ -2165,6 +2183,14 @@ AC_DEFUN([_LT_AC_LANG_GCJ],
 ])# _LT_AC_LANG_GCJ
 
 
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([AC_PROG_RC])
+])# AC_LIBTOOL_RC
+
+
 # AC_LIBTOOL_LANG_C_CONFIG
 # ------------------------
 # Ensure that the configuration vars for the C compiler are
@@ -3159,6 +3185,46 @@ CC="$lt_save_CC"
 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
 
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+set dummy $CC
+compiler="[$]2"
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
 # AC_LIBTOOL_CONFIG([TAGNAME])
 # ----------------------------
 # If TAGNAME is not passed, then create an initial libtool script
@@ -5226,3 +5292,7 @@ AC_DEFUN([LT_AC_PROG_GCJ],
   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
   AC_SUBST(GCJFLAGS)
 ])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])