diff --git a/sysutils/hourglass/Makefile b/sysutils/hourglass/Makefile index c6d1bf2b3cf4..8c63e2d70ab4 100644 --- a/sysutils/hourglass/Makefile +++ b/sysutils/hourglass/Makefile @@ -23,15 +23,25 @@ PORTDOCS= CALIBRATION .include +.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) diff --git a/sysutils/hourglass/files/patch-configure b/sysutils/hourglass/files/patch-configure index d1530314f6a6..3a83e19c3822 100644 --- a/sysutils/hourglass/files/patch-configure +++ b/sysutils/hourglass/files/patch-configure @@ -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*)