File: patch_libtool_on_darwin_pass_all.html

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (92 lines) | stat: -rw-r--r-- 2,791 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
 <head>
  <title>
   Autoconf Macro: patch_libtool_on_darwin_pass_all
  </title>
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
 </head>
 <body>
  <table summary="web navigation" style="width:100%;">
   <tbody>
    <tr>
     <td style="width:50%;" align="center">
      <a href=
      "http://autoconf-archive.cryp.to/patch_libtool_on_darwin_pass_all.m4">Download
      M4 Source</a>
     </td>
     <td style="width:50%;" align="center">
      <a href="macros-by-category.html">Macro Index Page</a>
     </td>
    </tr>
   </tbody>
  </table>
  <hr>
  <h1>
   patch_libtool_on_darwin_pass_all
  </h1>
  <h2>
   Synopsis
  </h2>
  <p class="indent" style="white-space:nowrap;">
   <code>PATCH_LIBTOOL_ON_DARWIN_PASS_ALL</code>
  </p>
  <h2>
   Description
  </h2>
  <div class="indent">
   <p>
    libtool 1.4.x on darwin uses a lib_check with a file_magic that tests for
    "Mach-O dynamically linked shared library". However, this is the file_magic
    for ".dylib" sharedlibraries but not for ".so" sharedlibraries. They have
    another "file -L" result of "Mach-O bundle ppc", which has an annoying
    result: when a a module (a .so) is dependent on another module (another
    .so) then libtool will error out and say that the import-module was not
    found where in fact it is available. It does not even try to call the real
    linker.
   </p>
   <p>
    Later libtool generations have changed the processing, the import
    file_check has been changed from "file_magic" to "pass_all". This ac-macro
    does a similar thing: it checks for the darwin host, it checks for the
    check_method, and when it was not "pass_all" then we set it to
    "deplibs_check_method=pass_all"
   </p>
  </div>
  <h2>
   Author
  </h2>
  <p class="indent">
   Guido Draheim &lt;guidod@gmx.de&gt;
  </p>
  <h2>
   Last Modified
  </h2>
  <p class="indent">
   2005-01-21
  </p>
  <h2>
   M4 Source Code
  </h2>
  <div class="indent">
   <pre class="m4source">
AC_DEFUN([PATCH_LIBTOOL_ON_DARWIN_PASS_ALL],
[# libtool-1.4 specific, on darwin set deplibs_check_method=pass_all
case "$host_os" in
  darwin*)
    if grep "^deplibs_check_method=.*file_magic" libtool &gt;/dev/null ; then
AC_MSG_RESULT(patching libtool to set deplibs_check_method=pass_all)
      test -f libtool.old || (mv libtool libtool.old &amp;&amp; cp libtool.old libtool)
      sed -e '/^deplibs_check_method=/s/=.*/="pass_all"/' libtool &gt;libtool.new
      (test -s libtool.new || rm libtool.new) 2&gt;/dev/null
      test -f libtool.new &amp;&amp; mv libtool.new libtool # not 2&gt;/dev/null !!
      test -f libtool     || mv libtool.old libtool
    fi
  ;;
esac
])
</pre>
  </div>
 </body>
</html>