ports/55683: Add USE_PTHREAD_HACK to bsd.port.mk for simplified pthread handling

Ulrich Spoerlein q at uni.de
Sun Aug 17 21:20:16 UTC 2003


>Number:         55683
>Category:       ports
>Synopsis:       Add USE_PTHREAD_HACK to bsd.port.mk for simplified pthread handling
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 17 14:20:13 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Spoerlein
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
>Description:
Many ports fail to detect libpthread (because it is still non-existant on
FreeBSD). Therefore provide an easy way for port maintainers to 
s/-lpthread/${PHTREAD_LIBS}/ in the ports configure script.

The setting can be used like this
USE_PTHREAD_HACK=	yes
or
USE_PTHREAD_HACK	file1 file2 file3

Which will apply the substitution on configure or file1, file2 and file3 
respectively. 

Note: This can probably be made an no-op, once libpthread hits the tree.
Or one could set PTHREAD_LIBS to -lthr (or whatever that 1:1 thread
library will be called)
>How-To-Repeat:
>Fix:
--- patch begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.462
@@ -1380,6 +1387,13 @@
 MAKE_ENV+=		SDL_CONFIG=${SDL_CONFIG}
 .endif
 
+.if defined(USE_PTHREAD_HACK)
+USE_REINPLACE=	yes
+.if ${USE_PTHREAD_HACK} == "yes"
+USE_PTHREAD_HACK=	configure
+.endif
+.endif
+
 .if defined(USE_MOTIF)
 USE_XPM=			yes
 .if !defined(NO_OPENMOTIF)
@@ -2822,6 +2836,11 @@
 			done; \
 		fi; \
 	fi
+.if defined(USE_PTHREAD_HACK)
+.for file in ${USE_PTHREAD_HACK}
+	@${REINPLACE_CMD} -e 's/-lpthread/${PTHREAD_LIBS}/g' ${WRKSRC}/${file}
+.endfor
+.endif
 .endif
 
 # Configure
--- patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list