Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2005 20:38:59 -0300
From:      Alejandro Pulver <alejandro@varnet.biz>
To:        Florent Thoumie <flz@xbsd.org>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Creating port with options
Message-ID:  <20050411203859.33d6c45f@ale.varnet.bsd>
In-Reply-To: <1113260537.89967.48.camel@cream.xbsd.org>
References:  <20050411175526.54ffd260@ale.varnet.bsd> <20050411211923.GA9149@xor.obsecurity.org> <20050411184818.494ac35e@ale.varnet.bsd> <20050412005541.58ea5f0c@it.buh.cameradicommercio.ro> <1113260537.89967.48.camel@cream.xbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Apr 2005 01:02:17 +0200
Florent Thoumie <flz@xbsd.org> wrote:

> Le Tuesday 12 April 2005 =E0 00:55 +0300, Ion-Mihai Tetcu a =E9crit :
> > On Mon, 11 Apr 2005 18:48:18 -0300
> > Alejandro Pulver <alejandro@varnet.biz> wrote:
> >=20
> > >  P.S.: the Porter's Handbook does not say anything about the
> > >  "OPTIONS" variable (at least I did not found it with grep
> > >  "OPTIONS" * in the document directory).
> >=20
> >=20
> > Update your docs.
>=20
> 	That's not (yet) in the PH.
>=20
> 	Here [1] is the submission Edwin sent some weeks ago, and here=20
> 	[2] is a summarizeed-wiki'ed version of the draft.
>=20
> 	[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=3Ddocs/76472
> 	[2] http://www.xbsd.org/moin/FreeBSD/PortsGlossary/Options
>=20
> --=20
> Florent Thoumie
> flz@xbsd.org
>=20

Hello,

Thanks to all for the replies.

Wich is the best way to manage conflictive options inside the OPTIONS
variable?

For example, I have three options: SERVER, X11 and CURSES. SERVER means
the program will not be built with a user interface. X11 and CURSES
(the ncurses library) are the two possible user interfaces. So each
conflicts with the other two. Is the following adequate to handle it?
Will the port store the bad configuration in
/var/db/ports/<portname>/options?

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

OPTIONS=3D	SERVER "Server mode (no GUI)" off \
		X11 "X11 user interface" on \
		CURSES "console user interface" off \

# This port has a BSD Makefile (no configure) and the options are
# enabled/disabled with -D in CFLAGS (I tried to put it in CPPFLAGS but
# the Makefile defines its own rules; it does not use the predefined
# ones that include ${CPPFLAGS}).
# The variable "LIB" is used inside the final linking rule (inside the
# Makefile).

.include <bsd.port.pre.mk>

.if defined(WITH_SERVER) && (defined(WITH_X11) || defined(WITH_CURSES))
IGNORE=3D		Conflicting options: WITH_SERVER + WITH_X11/WITH_CURSES
.endif

.if defined(WITH_SERVER)
MAKE_ARGS+=3D	CFLAGS+=3D"-DSERVER"
.endif

.if !defined(WITH_SERVER)

.if defined(WITH_X11) && defined(WITH_CURSES)
IGNORE=3D		Conflicting options WITH_X11 + WITH_CURSES
.endif

.if defined(WITH_X11)
USE_XLIB=3D	yes
MAKE_ARGS+=3D	CFLAGS+=3D"-DXWINGRAPHX -I${X11BASE}/include"
MAKE_ARGS+=3D	LIB+=3D"-L${X11BASE}/lib -lX11"
.endif

.if defined(WITH_CURSES)
MAKE_ARGS+=3D	CFLAGS+=3D"-DGRAPHX"
MAKE_ARGS+=3D	LIB+=3D"-lcurses"
.endif

.endif

.include <bsd.port.post.mk>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Thanks and Best Regards,
Ale



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