| 1 |
dnl /usr/share/aclocal/guidod-cvs/patch_libtool_sys_lib_search_path_spec.m4 |
| 2 |
dnl ______ /usr/share/aclocal/guidod-cvs/patch_libtool_sys_lib_search_path_spec.m4 ______ |
| 3 |
dnl @synopsis PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC |
| 4 |
dnl |
| 5 |
dnl Cross-compiling to win32 from a unix system reveals a bug - the |
| 6 |
dnl path-separator has been set to ";" depending on the target system. |
| 7 |
dnl However, the crossgcc search_path_spec works in a unix-environment |
| 8 |
dnl with unix-style directories and unix-stylish path_separator. The |
| 9 |
dnl result: the search_path_spec is a single word still containing the |
| 10 |
dnl ":" separators. |
| 11 |
dnl |
| 12 |
dnl This macro fixes the situation: when we see the libtool PATH_SEP to |
| 13 |
dnl be ":" and search_path_spec to contain ":" characters, then these |
| 14 |
dnl are replaced with spaces to let the resulting string work as a |
| 15 |
dnl for-loop argument in libtool scripts that resolve -no-undefined |
| 16 |
dnl libraries. |
| 17 |
dnl |
| 18 |
dnl Later libtool generations have fixed the situation with using |
| 19 |
dnl $PATH_SEPARATOR in the first place as the original path delimiter |
| 20 |
dnl that will be scanned for and replaced into spaces. |
| 21 |
dnl |
| 22 |
dnl @category Misc |
| 23 |
dnl @author Guido U. Draheim <[email protected]> |
| 24 |
dnl @version 2005-01-21 |
| 25 |
dnl @license GPLWithACException |
| 26 |
|
| 27 |
AC_DEFUN([PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC], |
| 28 |
[# patch libtool to fix sys_lib_search_path (e.g. crosscompiling a win32 dll) |
| 29 |
if test "_$PATH_SEPARATOR" = "_:" ; then |
| 30 |
if grep "^sys_lib_search_path_spec.*:" libtool >/dev/null ; then |
| 31 |
AC_MSG_RESULT(patching libtool to fix sys_lib_search_path_spec) |
| 32 |
test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool) |
| 33 |
sed -e "/^sys_lib_search_path_spec/s/:/ /g" libtool >libtool.new |
| 34 |
(test -s libtool.new || rm libtool.new) 2>/dev/null |
| 35 |
test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !! |
| 36 |
test -f libtool || mv libtool.old libtool |
| 37 |
fi |
| 38 |
fi |
| 39 |
]) |
| 40 |
|
| 41 |
|