mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-11 07:22:22 +00:00
PR: 108154
- respect PTHREAD_LIBS and PTHREAD_CFLAGS - add WITH_LINUXTHREADS tunable to override PTHREAD_LIBS and PTHREAD_CFLAGS with linuxthreads port
This commit is contained in:
parent
18ebf7811d
commit
bfb17f6834
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=182866
@ -23,15 +23,25 @@ PORTDOCS= CALIBRATION
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITH_LINUXTHREADS)
|
||||
|
||||
.if ${OSVERSION} >= 500035
|
||||
PTHREAD_LIBS= -L${LOCALBASE}/lib -llthread -llgcc_r
|
||||
PTHREAD_CFLAGS= -D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
|
||||
LIB_DEPENDS+= lthread.3:${PORTSDIR}/devel/linuxthreads
|
||||
.else
|
||||
LIB_DEPENDS+= lthread.2:${PORTSDIR}/devel/linuxthreads
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's,%LOCALBASE%,${LOCALBASE},g' \
|
||||
${WRKSRC}/configure
|
||||
@${REINPLACE_CMD} -e 's,%PTHREAD_LIBS%,${PTHREAD_LIBS},g' \
|
||||
${WRKSRC}/configure
|
||||
@${REINPLACE_CMD} -e 's,%PTHREAD_CFLAGS%,${PTHREAD_CFLAGS},g' \
|
||||
${WRKSRC}/configure
|
||||
|
||||
post-install:
|
||||
.if !defined(NOPORTDOCS)
|
||||
|
@ -24,8 +24,8 @@
|
||||
- CFLAGS='-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads' ;
|
||||
+ CFLAGS_sav=$CFLAGS ;
|
||||
+ LDFLAGS_sav=$LDFLAGS ;
|
||||
+ LDFLAGS="$LDFLAGS_sav -llthread -llgcc_r -L%LOCALBASE%/lib" ;
|
||||
+ CFLAGS="$CFLAGS_sav -D_THREAD_SAFE -I%LOCALBASE%/include/pthread/linuxthreads" ;
|
||||
+ LDFLAGS="$LDFLAGS_sav %PTHREAD_LIBS%" ;
|
||||
+ CFLAGS="$CFLAGS_sav %PTHREAD_CFLAGS%" ;
|
||||
on_unix='yes' ;
|
||||
on_windows='no' ;;
|
||||
*cygwin*)
|
||||
|
Loading…
Reference in New Issue
Block a user