From owner-freebsd-ports Tue Feb 4 17: 0:16 2003 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBD7937B401; Tue, 4 Feb 2003 17:00:12 -0800 (PST) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31F4543FBD; Tue, 4 Feb 2003 17:00:07 -0800 (PST) (envelope-from max@vega.com) Received: from vega.vega.com (root@xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.12.6/8.12.6) with ESMTP id h150xrsE028732; Wed, 5 Feb 2003 02:59:57 +0200 (EET) (envelope-from max@vega.com) Received: from vega.vega.com (max@localhost.vega.com [127.0.0.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id h1510AUk036091; Wed, 5 Feb 2003 03:00:10 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: (from max@localhost) by vega.vega.com (8.12.6/8.12.5/Submit) id h151058J036090; Wed, 5 Feb 2003 03:00:05 +0200 (EET) Date: Wed, 5 Feb 2003 03:00:05 +0200 From: Maxim Sobolev To: "Simon 'corecode' Schubert" Cc: ports@freebsd.org, portmgr@freebsd.org Subject: Re: USE_GETOPT patch available Message-ID: <20030205010005.GA35933@vega.vega.com> References: <20030205011921.24c642cb.corecode@corecode.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20030205011921.24c642cb.corecode@corecode.ath.cx> User-Agent: Mutt/1.4i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I think that you had overcomplicated things a bit, with all those automagick. Something like the following would be more than enough: .if defined(USE_GNUGETOPT) .if ${OSVERSION} < BLABLABLA LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt GNUGETOPT_CFLAGS?= -I${LOCALBASE}/include GNUGETOPT_LIBS?= -lgnugetopt .else # Do nothing - gnugetopt already in libc. .endif .endif And then poke individual maintainers to fix their ports. Those maintainers could be easily identified by looking at LIB_DEPENDS in each particular makefile. -Maxim On Wed, Feb 05, 2003 at 01:19:21AM +0100, Simon 'corecode' Schubert wrote: > hi people, > > find a patch for bsd.ports.mk which enables conditionalization of > libgnugetopt requirement: > > or get it at > > comments (as usual) welcome > > cheers > simon > > Index: Mk/bsd.port.mk > =================================================================== > RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v > retrieving revision 1.437 > diff -u -r1.437 bsd.port.mk > --- Mk/bsd.port.mk 5 Dec 2002 22:43:22 -0000 1.437 > +++ Mk/bsd.port.mk 5 Feb 2003 00:15:11 -0000 > @@ -259,6 +259,9 @@ > # USE_XLIB - Says that the port uses X libraries. > # USE_MOTIF - Says that the port uses the Motif toolkit. Implies USE_XPM. > # > +# USE_GETOPT - Says that the port uses getopt*(3). Set to "long_only" if > +# getopt_long_only(3) is required > +# > # Dependency checking. Use these if your port requires another port > # not in the list above. > # > @@ -1250,6 +1253,46 @@ > REINPLACE_CMD?= ${LOCALBASE}/bin/sed_inplace ${REINPLACE_ARGS} > .else > REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS} > +.endif > +.endif > + > +.if defined(USE_GETOPT) > +.if !empty(USE_GETOPT:Mlong_only) || !exists(/usr/include/getopt.h) > +LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt > +CFLAGS+= -I${LOCALBASE}/include > +. if !empty(CONFIGURE_ENV:MCFLAGS=*) > +. undef __c > +. for _p in ${CONFIGURE_ENV} > +__p:= ${_p} > +. if !empty(__p:MCFLAGS=*) > +. if !empty(__p:C/[^"]*//g) && empty(__p:C/[^"]*//g:C/"//1) > +__p:= ${__p:C/=.*//}="-I${LOCALBASE}/include "${__p:C/[^=]*=//} > +. else > +__p:= ${__p}" -I${LOCALBASE}/include" > +. endif > +. endif > +__c:= ${__c} ${__p} > +. endfor > +CONFIGURE_ENV:= ${__c} > +. endif > +.for __env in CONFIGURE MAKE > +. if empty(${__env}_ENV:MLDFLAGS=*) > +${__env}_ENV+= LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -lgnugetopt" > +. else > +.undef __c > +. for __p in ${${__env}_ENV} > +. if !empty(__p:MLDFLAGS=*) > +. if !empty(__p:C/[^"]*//g) && empty(__p:C/[^"]*//g:C/"//1) > +__p:= ${__p:C/=.*//}=" -L${LOCALBASE}/lib -lgnugetopt "${__p:C/[^=]*=//} > +. else > +__p:= ${__p}" -L${LOCALBASE}/lib -lgnugetopt" > +. endif > +. endif > +__c:= ${__c} ${__p} > +. endfor > +${__env}_ENV:= ${__c} > +. endif > +.endfor > .endif > .endif > > > -- > /"\ http://corecode.ath.cx/#donate > \ / > \ ASCII Ribbon Campaign > / \ Against HTML Mail and News To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message