Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 00:10:45 +0200
From:      Oliver Mahmoudi <olivermahmoudi@gmail.com>
To:        freebsd-ports@freebsd.org
Subject:   Check for set Makefile options and compile accordingly
Message-ID:  <CAE63APwSEW4rcrcwb3WZQWUNJAF96nbVngthJxFVGeUOQ185XA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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?


Oliver Mahmoudi



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