Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 2003 01:19:21 +0100
From:      "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To:        ports@freebsd.org
Cc:        portmgr@freebsd.org
Subject:   USE_GETOPT patch available
Message-ID:  <20030205011921.24c642cb.corecode@corecode.ath.cx>

next in thread | raw e-mail | index | archive | help
--=.5gmITUfS/qOJr'
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

hi people,

find a patch for bsd.ports.mk which enables conditionalization of
libgnugetopt requirement:

or get it at <http://corecode.ath.cx/~corecode/stuff/patch-getopt>;

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

--=.5gmITUfS/qOJr'
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+QFiNr5S+dk6z85oRAsqgAKC4JJ5fGlw0WpJiJBOYXoGo7UV7gACg6G6D
AUO1VH7Hq2+ak9V6qI4jNTA=
=lCwg
-----END PGP SIGNATURE-----

--=.5gmITUfS/qOJr'--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030205011921.24c642cb.corecode>