From owner-svn-ports-head@FreeBSD.ORG Fri Jun 14 13:41:38 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8E9FC99E; Fri, 14 Jun 2013 13:41:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 816711FDD; Fri, 14 Jun 2013 13:41:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EDfcGG033527; Fri, 14 Jun 2013 13:41:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EDfcIM033525; Fri, 14 Jun 2013 13:41:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201306141341.r5EDfcIM033525@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Jun 2013 13:41:38 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r320916 - in head: . Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 13:41:38 -0000 Author: bapt Date: Fri Jun 14 13:41:37 2013 New Revision: 320916 URL: http://svnweb.freebsd.org/changeset/ports/320916 Log: New macros to help dealing with ports that have options: OPTIONS_SUB=yes when set in a port, all the option names are automatically added to the PLIST_SUB with "@comment " value in case the option is off and empty value in case the options is on. ${OPT}_CONFIGURE_ENABLE= will automatically add: CONFIGURE_ARGS+=--enable- in case OPT is activated CONFIGURE_ARGS+=--disable- in case OPT is deactivated ${OPT}_CONFIGURE_ON= will automatically add: CONFIGURE_ARGS+= in case OPT is activated ${OPT_CONFIGURE_OFF= will automatically add: CONFIGURE_ARGS+= in case OPT is deactivated ${OPT}_CFLAGS will append the specified new flags to CFLAGS if OPT is 'on' ${OPT}_CXXFLAGS will append the specified new flags to CXXFLAGS if OPT is 'on' ${OPT}_LDFLAGS will append the specified new flags to LDFLAGS if OPT is 'on' ${OPT}_CONFIGURE_ENV will append the specified variables to CONFIGURE_ENV if OPT is 'on' ${OPT}_MAKE_ENV will append the specified variables to MAKE_ENV if OPT is 'on' ${OPT}_USES will append the speficied uses to USES if OPT is 'on' ${OPT}_DISTFILES will append the specified distiles to DISTFILES if OPT in 'on' Reviewed and tested by: bdrewery Modified: head/CHANGES head/Mk/bsd.options.mk Modified: head/CHANGES ============================================================================== --- head/CHANGES Fri Jun 14 13:33:23 2013 (r320915) +++ head/CHANGES Fri Jun 14 13:41:37 2013 (r320916) @@ -11,6 +11,37 @@ in the release notes and/or placed into All ports committers are allowed to commit to this file. 20130614: +AUTHOR: bapt@FreeBSD.org + + * New macros to help dealing with ports that have options: + + OPTIONS_SUB=yes when set in a port, all the option names are automatically + added to the PLIST_SUB with "@comment " value in case the option is off and + empty value in case the options is on. + + ${OPT}_CONFIGURE_ENABLE= will automatically add: + CONFIGURE_ARGS+=--enable- in case OPT is activated + CONFIGURE_ARGS+=--disable- in case OPT is deactivated + + ${OPT}_CONFIGURE_ON= will automatically add: + CONFIGURE_ARGS+= in case OPT is activated + + ${OPT_CONFIGURE_OFF= will automatically add: + CONFIGURE_ARGS+= in case OPT is deactivated + + ${OPT}_CFLAGS will append the specified new flags to CFLAGS if OPT is 'on' + ${OPT}_CXXFLAGS will append the specified new flags to CXXFLAGS if OPT is 'on' + ${OPT}_LDFLAGS will append the specified new flags to LDFLAGS if OPT is 'on' + + ${OPT}_CONFIGURE_ENV will append the specified variables to CONFIGURE_ENV if + OPT is 'on' + ${OPT}_MAKE_ENV will append the specified variables to MAKE_ENV if OPT is 'on' + + ${OPT}_USES will append the speficied uses to USES if OPT is 'on' + + ${OPT}_DISTFILES will append the specified distiles to DISTFILES if OPT in 'on' + +20130614: AUTHOR: bapt@FreeBSD.org * New 'display' USES macro to handle building ports that may require a Modified: head/Mk/bsd.options.mk ============================================================================== --- head/Mk/bsd.options.mk Fri Jun 14 13:33:23 2013 (r320915) +++ head/Mk/bsd.options.mk Fri Jun 14 13:41:37 2013 (r320916) @@ -287,5 +287,47 @@ WITH_${opt}:= true . endif .endif .endfor -.endif ### + +.for opt in ${COMPLETE_OPTIONS_LIST} +# PLIST_SUB +PLIST_SUB?= +. if defined(OPTIONS_SUB) +. if ! ${PLIST_SUB:M${opt}=*} +. if ${PORT_OPTIONS:M${opt}} +PLIST_SUB:= ${PLIST_SUB} ${opt}="" +. else +PLIST_SUB:= ${PLIST_SUB} ${opt}="@comment " +. endif +. endif +. endif + +. if ${PORT_OPTIONS:M${opt}} +. if defined(${opt}_CONFIGURE_ENABLE) +CONFIGURE_ARGS+= --enable-${${opt}_CONFIGURE_ENABLE} +. endif +. if defined(${opt}_CONFIGURE_ON) +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ON} +. endif +. for flags in CFLAGS CXXFLAGS LDFLAGS CONFIGURE_ENV MAKE_ENV USES DISTFILES +. if defined(${opt}_${flags}) +${flags}+= ${${opt}_${flags}} +. endif +. endfor +. for deptype in PKG EXTRACT PATCH FETCH BUILD LIB RUN +. if defined(${opt}_${deptype}_DEPENDS) +${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS} +. endif +. endfor +. else +. if defined(${opt}_CONFIGURE_ENABLE) +CONFIGURE_ARGS+= --disable-${${opt}_CONFIGURE_ENABLE} +. endif +. if defined(${opt}_CONFIGURE_OFF) +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_OFF} +. endif +. endif +.endfor + + +.endif