Date: Wed, 10 Sep 2014 00:17:24 +0200 From: Antoine Brodin <antoine@freebsd.org> To: Oliver Mahmoudi <olivermahmoudi@gmail.com> Cc: FreeBSD Ports <freebsd-ports@freebsd.org> Subject: Re: Check for set Makefile options and compile accordingly Message-ID: <CAALwa8mycj3sVv%2BVq5C8UK61tQXO0Fv7YOekqEaN%2Bmj7ZxudPw@mail.gmail.com> In-Reply-To: <CAE63APwSEW4rcrcwb3WZQWUNJAF96nbVngthJxFVGeUOQ185XA@mail.gmail.com> References: <CAE63APwSEW4rcrcwb3WZQWUNJAF96nbVngthJxFVGeUOQ185XA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 10, 2014 at 12:10 AM, Oliver Mahmoudi <olivermahmoudi@gmail.com> wrote: > Hello, > > I am working on a new port here and have a few questions regarding the new > style of handling Makefile options. > > The program I got, is configured in a non standard way, i.e. there is no > configure script or the like. Depending on what modules/libraries you want > to build along with the executable, > > pre-build: > ${GMAKE} ${MAKE_ARGS} cfg > > is run, to configure the program's build system. This can be translated to: > > pre-build: > ${GMAKE} include_modules="module_1 module_2 ..." cfg > > I set up MAKE_ARGS in the following way: > > .if !empty (EXTRA_MODULES) > MAKE_ARGS= include_modules="${EXTRA_MODULES}" > .endif > > About a year ago, when writing the original Makefile, I handled the > situation like this: > > .if ${PORT_OPTIONS:MMYSQL} > BUILD_DEPENDS+= > ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql56-server > RUN_DEPENDS+:= ${BUILD_DEPENDS} > EXTRA_MODULES+= db_mysql > PLIST_SUB+= MYSQL="" > .else > PLIST_SUB+= MYSQL="@comment " > .endif > > To get the port out there, folks now want me to change the way I handle the > Makefile options. Therefore, the above if/else/endif block now now looks > like this: > > OPT_ABOVEVARIABLE= YES > OPTIONS_SUB= YES > > MYSQL_BUILD_DEPENDS= > ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql56-server > > # > # This stuff now hangs loose > # > RUN_DEPENDS+:= ${BUILD_DEPENDS} > EXTRA_MODULES+= db_mysql > # > # > # > > Given the new style of handling Makefile options how do I handle passing my > EXTRA_MODULES variable - there is more than just the one above - to the > port's configure stage via MAKE_ARGS and how would I deal with the > RUN_DEPENDS+:= ${BUILD_DEPENDS} situation? > > None of the situations offered on: > > https://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html > > match my given scenario. > > Any pointers? Hi, If the options helpers do not fit your needs, you can still use constructs like .include <bsd.port.options.mk> .if ${PORT_OPTIONS:MMYSQL} ... Cheers, Antoine
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAALwa8mycj3sVv%2BVq5C8UK61tQXO0Fv7YOekqEaN%2Bmj7ZxudPw>