- Modify the 12.11 Threading Libraries chapter to reflect the recent dismission
of PTHREAD_CFLAGS and PTHREAD_LIBS Reviewed by: eadler, bcr Approved by: bcr
This commit is contained in:
parent
2460b60e13
commit
6e44e1b23f
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=40970
1 changed files with 9 additions and 17 deletions
|
@ -787,8 +787,7 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
|
|||
variable value. Example:</para>
|
||||
|
||||
<programlisting>post-patch:
|
||||
@${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README
|
||||
@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' ${WRKSRC}/configure</programlisting>
|
||||
@${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README</programlisting>
|
||||
|
||||
<para>Quite often, there is a situation when the software being
|
||||
ported, especially if it is primarily developed on &windows;,
|
||||
|
@ -16171,25 +16170,18 @@ exec %%LOCALBASE%%/bin/java -jar %%DATADIR%%/foo.jar "$@"</programlisting>
|
|||
<title>Threading Libraries</title>
|
||||
|
||||
<para>The threading library must be linked to the binaries using
|
||||
a special linker flag <literal>-pthread</literal> on &os;. If
|
||||
a special flag <literal>-pthread</literal> on &os;. If
|
||||
a port insists on linking <literal>-lpthread</literal>
|
||||
directly, patch it to use
|
||||
<makevar>PTHREAD_LIBS</makevar> variable provided by the ports
|
||||
framework. This variable usually has the value of
|
||||
<literal>-pthread</literal>, but on certain architectures and
|
||||
&os; versions it can have different values, so do not just
|
||||
hardcode <literal>-pthread</literal> into patches and always
|
||||
use <makevar>PTHREAD_LIBS</makevar>.</para>
|
||||
directly, patch it to use <literal>-pthread</literal>.</para>
|
||||
|
||||
<note>
|
||||
<para>If building the port errors out with
|
||||
<literal>unrecognized option '-pthread'</literal> when
|
||||
setting <makevar>PTHREAD_LIBS</makevar>, it may be desirable
|
||||
to use <command>cc</command> as linker by setting
|
||||
<makevar>CONFIGURE_ENV</makevar> to
|
||||
<literal>LD=${CC}</literal>. The
|
||||
<literal>-pthread</literal> option is not supported by
|
||||
<command>ld</command> directly.</para>
|
||||
<literal>unrecognized option '-pthread'</literal>,
|
||||
it may be desirable to use <command>cc</command> as linker by
|
||||
setting <makevar>CONFIGURE_ENV</makevar> to
|
||||
<literal>LD=${CC}</literal>. The
|
||||
<literal>-pthread</literal> option is not supported by
|
||||
<command>ld</command> directly.</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue