<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 13.03.2013 20:25, schrieb Alex Rønne
Petersen:<br>
</div>
<blockquote
cite="mid:CAH9TF6Ma4MJuMpRmdeZ5UaxWUKZCU9o4kjAjp6VMwR-RM28snA@mail.gmail.com"
type="cite">
<pre wrap="">
The way to deal with both libdruntime.so and libdruntime.a existing on
a system is to explicitly ask for libdruntime.a when desired (note the
.a). The linker will prefer the shared library when just -ldruntime is
passed. So no dmd.conf change should be necessary with regards to
linking; DMD just has to do the right thing depending on whether
-shared was passed.
</pre>
</blockquote>
When you say "explicitly ask for libdruntime.a" you mean by using
the gcc/ld options "-Wl,-Bstatic<span class="st"><em></em></span><span
class="st"><em></em></span>" and "-Wl,-Bdynamic<span class="st"><em></em></span>"
right?<br>
<br>
I'd say just ship the release with a libdruntime.so and libruntime.a
and make sure dmd calls gcc like this:<br>
<br>
"gcc -Wl,-Bstatic<span class="st"><em> </em></span>-ldruntime
-lphobos2 -Wl,-Bdynamic -lpthread -lm -lrt"<br>
This way we don't have to worry about passing the correct .a file to
gcc, it should automatically detect the correct file.<br>
<br>
For dynamic linking, just drop the "-Wl,-Bstatic" / "-Wl,-Bdynamic".
Then add "<code>-static-libphobos -static-libdruntime</code>" flags
to select between static and dynamic linking. Make "<code>-static-libdruntime=true,
</code><code>-static-libphobos=true</code>" the default for one
release, then in the next release change the defaults to false. Then
linking with a static libdruntime would be as simple as passing "<code>-static-libdruntime</code>"
to dmd.<br>
<span class="st"><em></em></span>
<pre class="moz-signature" cols="72">--
Johannes Pfau</pre>
</body>
</html>