From: Tor Lillqvist Date: Sat, 22 Sep 2001 14:20:17 +0000 (+0000) Subject: * libtool.m4 [mingw* cygwin*]: Small improvement for mingw-hosted X-Git-Tag: release-1-4d~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f934c69cf49ce15e792221be944ea2da2a8142e6;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index ef44ff01d..534993047 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2001-09-22 Tor Lillqvist + * 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 f773355e0..532a55158 100644 --- 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. diff --git a/configure.ac b/configure.ac index 904528ff9..07a3b78b7 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/libtool.m4 b/libtool.m4 index 49804bb40..c568ebc9f 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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) +])