[BACK]Return to pthread.buildlink3.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /pkgsrc/mk/pthread.buildlink3.mk between version 1.17 and 1.30

version 1.17, 2004/11/17 21:05:24 version 1.30, 2013/11/01 12:19:29
Line 1 
Line 1 
 # $NetBSD$  # $NetBSD$
 #  #
 # The pthreads strategy for pkgsrc is to "bless" a particular pthread  # The pthreads strategy for pkgsrc is to "bless" a particular pthread
 # package as the Official Pthread Replacement (OPR).  A package that uses  # package as the Official Pthread Replacement (OPR).  The following
 # pthreads may do one of the following:  # variables may be set before including this file:
 #  #
 #   (1) Simply include pthread.buildlink3.mk.  This will make the package  # PTHREAD_OPTS?= # empty
 #       use the native pthread library if it's available, or else the OPR  #       A list of options to configure the search for a suitable pthreads
 #       package.  The value of PTHREAD_TYPE may be checked to be either  #       implementation.
 #       "native", or the name of the OPR package, or "none", e.g.  
 #  #
 #       #  #       "native" means that only a native pthreads implementation is
 #       # package Makefile stuff...  #               acceptable.
 #       #  
 #       .include "../../mk/pthread.buildlink3.mk"  
 #  #
 #       .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none"  #       "optional" will override the effects of any instance of
 #       CONFIGURE_ARGS+=        --without-pthreads  #               "require".  This should _only_ be used by those packages
 #       .endif  #               that can be built with or without pthreads independently
   #               of whether any of its dependencies need pthreads.
   #               Currently, this is only www/mozilla, which uses its own
   #               threading library if native pthreads are unavailable,
   #               despite that it uses GTK+, which _does_ need pthreads.
 #  #
 #       .include "../../mk/bsd.pkg.mk"  #       "require" means that the package is skipped silently when no
   #               implementation can be found.
 #  #
 #       Note that it's only safe to check and use the value of PTHREAD_TYPE  #       By default, the native pthreads implementation is used if it's
 #       after all other buildlink3.mk files have been included.  #       available. Otherwise the OPR is used.
 #  #
 #   (2) Add "native" to PTHREAD_OPTS prior to including  # PTHREAD_AUTO_VARS?= no
 #       pthread.buildlink3.mk.  This is like case (1), but we only check for  #       This variable specifies whether the values of the variables
 #       the native pthread library, e.g.,  #       PTHREAD_{CFLAGS,CPPFLAGS,LDFLAGS,LIBS} should be automatically
   #       added to their respective variables.
 #  #
 #       PTHREAD_OPTS+=  native  # After inclusion of this file, the following variables may be examined:
 #       #  
 #       # package Makefile stuff...  
 #       #  
 #       .include "../../mk/pthread.buildlink3.mk"  
 #  #
 #       .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none"  # PTHREAD_TYPE
 #       CONFIGURE_ARGS+=        --without-pthreads  #       The type of pthreads implementation that has been found.
 #       .endif  
 #  #
 #       .include "../../mk/bsd.pkg.mk"  #       "native" means that the native pthreads implementation is used.
 #  #
 #   (3) Add "require" to PTHREAD_OPTS prior to including  #       "none" means that no suitable pthreads implementation could be
 #       pthread.buildlink3.mk.  This will make the package use the native  #               found.
 #       pthread library or else use the OPR package, and will otherwise set  
 #       PKG_SKIP_REASON if neither can be used, e.g.,  
 #  
 #       PTHREAD_OPTS+=  require  
 #       #  
 #       # package Makefile stuff...  
 #       #  
 #       .include "../../mk/pthread.buildlink3.mk"  
 #       .include "../../mk/bsd.pkg.mk"  
 #  #
 #   (4) Add both "require" and "native" to PTHREAD_OPTS prior to including  #       Any other value is the name of the package that is used as the
 #       pthread.buildlink3.mk.  This is like case (3), but we only check for  #       pthread implementation.
 #       the native pthread library, e.g.,  
 #  #
 #       PTHREAD_OPTS+=  require native  #       Note that it's only safe to check and use the value of PTHREAD_TYPE
 #       #  #       after all other buildlink3.mk files have been included.
 #       # more package Makefile stuff...  
 #       #  
 #       .include "../../mk/pthread.buildlink3.mk"  
 #       .include "../../mk/bsd.pkg.mk"  
 #  #
 # The case where a package must use either the native pthread library or  # The case where a package must use either the native pthread library or
 # some pthread package aside from the OPR is a special case of (2), e.g.,  # some pthread package aside from the OPR (e.g. "ptl2") can be solved as
 # if the required pthread package is "ptl2", then:  # follows:
 #  #
 #       PTHREAD_OPTS+=  native  #       PTHREAD_OPTS+=  native
 #       #  #       #
Line 77 
Line 61 
 #       .endif  #       .endif
 #  #
 #       .include "../../mk/bsd.pkg.mk"  #       .include "../../mk/bsd.pkg.mk"
 #  
 # A package Makefile may add the word "optional" to PTHREAD_OPTS, which  
 # will override the effects of any instance of the word "require".  This  
 # should _only_ be used by those packages that can be built with or  
 # without pthreads _independently_ of whether any of its dependencies need  
 # pthreads.  Currently, this only only www/mozilla, which uses its own  
 # threading library if native pthreads is unavailable, despite that it  
 # uses GTK+, which _does_ need pthreads.  
 #  
 ###########################################################################  
 #  
 # PTHREAD_OPTS represents whether this package requires pthreads, and also  
 #       whether it needs to be native.  It may include the word "require"  
 #       to denote that a pthreads implementation is required, and may also  
 #       include the word "native" to denote that only native pthreads are  
 #       acceptable.  
 #  
 # PTHREAD_AUTO_VARS is "yes" or "no" for whether the values of the variables  
 #       PTHREAD_{CFLAGS,CPPFLAGS,LDFLAGS,LIBS} should be automatically added  
 #       to their respective variables.  Defaults to "yes".  
 #  
 # _PKG_PTHREAD is the fall-back package pthread implementation use by  
 #       pthread.buildlink3.mk.  
 #  
 # _PKG_PTHREAD_COMPAT_PATTERNS matches the ONLY_FOR_PLATFORMS from the  
 #       Makefile for ${_PKG_PTHREAD}.  It's used to see if ${_PKG_PTHREADS}  
 #       can actually be used to replace a native pthreads.  
 #  
 PTHREAD_BUILDLINK3_MK:= ${PTHREAD_BUILDLINK3_MK}+  PTHREAD_BUILDLINK3_MK:= ${PTHREAD_BUILDLINK3_MK}+
   
   _VARGROUPS+=            pthread
   _PKG_VARS.pthread=      PTHREAD_OPTS PTHREAD_AUTO_VARS
   _SYS_VARS.pthread=      PTHREAD_TYPE PTHREAD_CFLAGS PTHREAD_LDFLAGS PTHREAD_LIBS
   
   # The fall-back package pthread implementation
 _PKG_PTHREAD?=                  pth  _PKG_PTHREAD?=                  pth
 _PKG_PTHREAD_DEPENDS?=          pth>=2.0.0  _PKG_PTHREAD_DEPENDS?=          pth>=2.0.0
 _PKG_PTHREAD_PKGSRCDIR?=        ../../devel/${_PKG_PTHREAD}  _PKG_PTHREAD_PKGSRCDIR?=        ../../devel/${_PKG_PTHREAD}
 _PKG_PTHREAD_BUILDLINK3_MK?=    ${_PKG_PTHREAD_PKGSRCDIR}/buildlink3.mk  _PKG_PTHREAD_BUILDLINK3_MK?=    ${_PKG_PTHREAD_PKGSRCDIR}/buildlink3.mk
   
   # _PKG_PTHREAD_COMPAT_PATTERNS matches the ONLY_FOR_PLATFORMS from the
   # Makefile for ${_PKG_PTHREAD}.  It is used to see if ${_PKG_PTHREADS}
   # can actually be used to replace a native pthreads.
 _PKG_PTHREAD_COMPAT_PATTERNS=   *-*-*  _PKG_PTHREAD_COMPAT_PATTERNS=   *-*-*
   
 .include "../../mk/bsd.prefs.mk"  .include "../../mk/bsd.fast.prefs.mk"
   
 PTHREAD_OPTS?=  # empty  PTHREAD_OPTS?=  # empty
   
   CHECK_BUILTIN.pthread:=  yes
   .include "../../mk/pthread.builtin.mk"
   CHECK_BUILTIN.pthread:=  no
   
 #  #
 # We check for a native pthreads implementation by checking for the presence  # Set the value of PTHREAD_TYPE depending on the platform and what's
 # of /usr/include/pthread.h (we might want to make this check stricter).  # available in the base system.
 #  #
 .undef PTHREAD_TYPE  .undef PTHREAD_TYPE
 .if exists(/usr/include/pthread.h) && \  .if defined(USE_BUILTIN.pthread) && \
       !empty(USE_BUILTIN.pthread:M[yY][eE][sS]) && \
     !empty(PREFER_NATIVE_PTHREADS:M[yY][eE][sS])      !empty(PREFER_NATIVE_PTHREADS:M[yY][eE][sS])
 PTHREAD_TYPE=   native  PTHREAD_TYPE=   native
 .else  .else
 .  if !empty(PTHREAD_OPTS:Mnative)  .  if !empty(PTHREAD_OPTS:Mnative)
 PTHREAD_TYPE=   none  PTHREAD_TYPE=   none
 .    if !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional)  .    if !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional)
 PKG_SKIP_REASON= "${PKGNAME} requires a native pthreads implementation."  PKG_FAIL_REASON= "${PKGNAME} requires a native pthreads implementation."
 .    endif  .    endif
 .  else  .  else
 PTHREAD_TYPE=   none  PTHREAD_TYPE=   none
Line 139  PTHREAD_TYPE= ${_PKG_PTHREAD}
Line 111  PTHREAD_TYPE= ${_PKG_PTHREAD}
 .    endfor  .    endfor
 .    if ${PTHREAD_TYPE} == "none" && \  .    if ${PTHREAD_TYPE} == "none" && \
         !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional)          !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional)
 PKG_SKIP_REASON= "${PKGNAME} requires a working pthreads implementation."  PKG_FAIL_REASON= "${PKGNAME} requires a working pthreads implementation."
 .    endif  .    endif
 .  endif  .  endif
 .endif  .endif
   
 PTHREAD_AUTO_VARS?=     yes  PTHREAD_AUTO_VARS?=     no
   
 .if ${PTHREAD_TYPE} == "native"  .if ${PTHREAD_TYPE} == "native"
 BUILDLINK_PACKAGES:=            ${BUILDLINK_PACKAGES:Npthread}  BUILDLINK_TREE+=                pthread -pthread
 BUILDLINK_PACKAGES+=            pthread  
 BUILDLINK_BUILTIN_MK.pthread=   ../../mk/pthread.builtin.mk  BUILDLINK_BUILTIN_MK.pthread=   ../../mk/pthread.builtin.mk
 BUILDLINK_AUTO_VARS.pthread?=   ${PTHREAD_AUTO_VARS}  BUILDLINK_AUTO_VARS.pthread?=   ${PTHREAD_AUTO_VARS}
 .elif ${PTHREAD_TYPE} == "${_PKG_PTHREAD}"  .elif ${PTHREAD_TYPE} == "${_PKG_PTHREAD}"
 .  if exists(${_PKG_PTHREAD_BUILDLINK3_MK})  .  if exists(${_PKG_PTHREAD_BUILDLINK3_MK})
 .    if !empty(_PKG_PTHREAD_DEPENDS)  .    if !empty(_PKG_PTHREAD_DEPENDS)
 BUILDLINK_DEPENDS.${_PKG_PTHREAD}+=     ${_PKG_PTHREAD_DEPENDS}  BUILDLINK_API_DEPENDS.${_PKG_PTHREAD}+= ${_PKG_PTHREAD_DEPENDS}
 .    endif  .    endif
 .    include "${_PKG_PTHREAD_BUILDLINK3_MK}"  .    include "${_PKG_PTHREAD_BUILDLINK3_MK}"
 BUILDLINK_PREFIX.pthread=               ${BUILDLINK_PREFIX.${_PKG_PTHREAD}}  BUILDLINK_PREFIX.pthread=               ${BUILDLINK_PREFIX.${_PKG_PTHREAD}}
Line 167  BUILDLINK_LIBS.pthread=   ${BUILDLINK_LI
Line 138  BUILDLINK_LIBS.pthread=   ${BUILDLINK_LI
 BUILDLINK_AUTO_VARS.${_PKG_PTHREAD}?=   ${PTHREAD_AUTO_VARS}  BUILDLINK_AUTO_VARS.${_PKG_PTHREAD}?=   ${PTHREAD_AUTO_VARS}
 BUILDLINK_AUTO_VARS.pthread=            ${BUILDLINK_AUTO_VARS.${_PKG_PTHREAD}}  BUILDLINK_AUTO_VARS.pthread=            ${BUILDLINK_AUTO_VARS.${_PKG_PTHREAD}}
 .  else  .  else
 PKG_SKIP_REASON= "${PKGNAME} needs pthreads, but ${_PKG_PTHREAD_BUILDLINK3_MK} is missing."  PKG_FAIL_REASON= ${PKGNAME:Q}" needs pthreads, but "${_PKG_PTHREAD_BUILDLINK3_MK:Q}" is missing."
 .  endif  .  endif
 .endif  .endif
   
Line 180  PTHREAD_CFLAGS=  ${BUILDLINK_CFLAGS.pthr
Line 151  PTHREAD_CFLAGS=  ${BUILDLINK_CFLAGS.pthr
 PTHREAD_CFLAGS+=        ${BUILDLINK_CPPFLAGS.pthread}  PTHREAD_CFLAGS+=        ${BUILDLINK_CPPFLAGS.pthread}
 PTHREAD_LDFLAGS=        ${BUILDLINK_LDFLAGS.pthread}  PTHREAD_LDFLAGS=        ${BUILDLINK_LDFLAGS.pthread}
 PTHREAD_LIBS=           ${BUILDLINK_LIBS.pthread}  PTHREAD_LIBS=           ${BUILDLINK_LIBS.pthread}
 CONFIGURE_ENV+=         PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"  CONFIGURE_ENV+=         PTHREAD_CFLAGS=${PTHREAD_CFLAGS:Q}
 CONFIGURE_ENV+=         PTHREAD_LDFLAGS="${PTHREAD_LDFLAGS}"  CONFIGURE_ENV+=         PTHREAD_LDFLAGS=${PTHREAD_LDFLAGS:Q}
 CONFIGURE_ENV+=         PTHREAD_LIBS="${PTHREAD_LIBS}"  CONFIGURE_ENV+=         PTHREAD_LIBS=${PTHREAD_LIBS:Q}
 MAKE_ENV+=              PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"  MAKE_ENV+=              PTHREAD_CFLAGS=${PTHREAD_CFLAGS:Q}
 MAKE_ENV+=              PTHREAD_LDFLAGS="${PTHREAD_LDFLAGS}"  MAKE_ENV+=              PTHREAD_LDFLAGS=${PTHREAD_LDFLAGS:Q}
 MAKE_ENV+=              PTHREAD_LIBS="${PTHREAD_LIBS}"  MAKE_ENV+=              PTHREAD_LIBS=${PTHREAD_LIBS:Q}
   
 PTHREADBASE=            ${BUILDLINK_PREFIX.pthread}  PTHREADBASE=            ${BUILDLINK_PREFIX.pthread}
 CONFIGURE_ENV+=         PTHREADBASE=${PTHREADBASE}  CONFIGURE_ENV+=         PTHREADBASE=${PTHREADBASE:Q}
 MAKE_ENV+=              PTHREADBASE=${PTHREADBASE}  MAKE_ENV+=              PTHREADBASE=${PTHREADBASE:Q}
   
 .endif  # PTHREAD_BUILDLINK3_MK  .endif  # PTHREAD_BUILDLINK3_MK

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.30

CVSweb <webmaster@jp.NetBSD.org>