libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ac-macros for... Re: mingw32 cross-compile: (sys_lib_search_path setting


From: Guido Draheim
Subject: ac-macros for... Re: mingw32 cross-compile: (sys_lib_search_path setting insuffient)
Date: Sat, 28 Jul 2001 10:05:14 +0200

Sebastien Sable wrote:
> OK that was it indeed! I just had to modify this :
> 
> sys_lib_search_path_spec=" 
> [...]
> Great. But I still have the problem with the wrong $host_cc defined to
> compile impgen.c so I have to do it by hand.
> [...]
> 
> Hopefully I don't have to release win32 dlls too often. But I sure
> would appreciate an updated libtool concerning those two problems. If
> anyone as a temporary patch for libtool before an official correction,
> please send it to me.
> 

I did extract three libtool post-generation patches that I had
in my configure-scripts around. Here they are canned into their
own ac-macros, ready for usage in projects for people that want
to redistribute their projects now. Currently I have gone back
to libtool-1.4 as libtool-1.4b has shown to be broken on far
too many platforms to be acceptable.

Anyway, 'hope these macros show to be useful,

and if anyone has some configure.ac-embeddable canned macros
for me in return then don't hesitate to send me a copy, okay ;-)

cheers,
-- guido
AC_DEFUN([PATCH_LIBTOOL_TO_ADD_HOST_CC],
[# patch libtool to add HOST_CC sometimes needed in crosscompiling a win32 dll
if grep "HOST_CC" libtool >/dev/null; then
  if test "$build" != "$host" ; then
    if test "_$HOST_CC" = "_" ; then
      HOST_CC="false"
      for i in `echo $PATH | sed 's,:, ,g'` ; do
      test -x $i/cc && HOST_CC=$i/cc
      done
    fi
AC_MSG_RESULT(patching libtool to add HOST_CC=$HOST_CC)
    test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
    sed -e "/BEGIN.*LIBTOOL.*CONFIG/a\\
HOST_CC=$HOST_CC" libtool >libtool.new
    mv libtool.new libtool
    test -f libtool || (test -f libtool.old && mv libtool.old libtool)
  fi
fi
])
AC_DEFUN([PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC],
[# patch libtool to fix sys_lib_search_path (e.g. crosscompiling a win32 dll)
if test "_$PATH_SEPARATOR" = "_:" ; then
  if grep "^sys_lib_search_path_spec.*:" libtool >/dev/null ; then
AC_MSG_RESULT(patching libtool to fix sys_lib_search_path_spec)
    test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
    sed -e "/^sys_lib_search_path_spec/s/:/ /g" libtool >libtool.new
    mv libtool.new libtool
    test -f libtool || (test -f libtool.old && mv libtool.old libtool)
  fi
fi
])
AC_DEFUN([PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING],
[# libtool-1.4 specific, on zsh target the final requoting does one too much
case "$host_os" in
  darwin*)
    if grep "1.920" libtool ; then
AC_MSG_RESULT(patching libtool on .so-sharedlib creation (zsh overquoting))
      test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
      sed -e '/archive_cmds=/s:\\\\":\\":g' libtool > libtool.new
      mv libtool.new libtool
      test -f libtool || (test -f libtool.old && mv libtool.old libtool)
    fi
  ;;
esac
])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]