Date: Wed, 22 Aug 2007 16:34:47 +0200 From: Gabriel Linder <linder@jeuxvideo.com> To: "Maxim Khitrov" <mkhitrov@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Ports build parameters (knobs) Message-ID: <20070822163447.3741e377@oblivion.jeuxvideo.com> In-Reply-To: <26ddd1750708220632u48ed0773i80f9dc77ffddf980@mail.gmail.com> References: <20070822095408.61c11ab2@oblivion.jeuxvideo.com> <26ddd1750708220632u48ed0773i80f9dc77ffddf980@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 22 Aug 2007 09:32:34 -0400 "Maxim Khitrov" <mkhitrov@gmail.com> wrote: > On 8/22/07, Gabriel Linder <linder@jeuxvideo.com> wrote: > > Hello, > > > > During the build of the graphical portion of my new FreeBSD-powered > > laptop I noticed that some knobs are not listed in /usr/ports/KNOBS > > and so, I can't add them to make.conf before building the packages. > > > > When I run "make fetch-recursive" for fluxbox, I get : > > > > WITH_DEBUG=yes Build with debugging symbols > > WITH_DOCHTML=yes Install the HTML documentation > > WITH_DOCPDF=yes Install the PDF documentation > > WITH_GNOME=yes Enable GNOME support > > WITH_IMLIB2=yes Enable Imlib2 (pixmap themes) support > > [snip] > > > > and for libiconv : > > > > WITHOUT_EXTRA_ENCODINGS=yes Disable extra character sets > > WITH_EXTRA_PATCHES=yes Apply extra patches (fixes cp932, > > adds EUCJP-MS) > > > > GNOME and DEBUG are listed in /usr/ports/KNOBS, but IMLIB2 and > > EXTRA_PATCHES are not... Is there a way to have the full list of > > supported build options ? Or maybe I am wrong and these settings > > are not supposed to be in make.conf but > > in /var/db/ports/<portname>/options, if so please let me know :) > > My experience has shown that it's always best to look at the Makefile > of any port you are about to install. That's the most reliable way to > learn about the port and the knobs it supports. However, this can be > rather tedious when installing something with a few hundred > dependencies (like gnome), so I actually came up with a solution to > speed things up. > > First of all, you should install portconf from ports-mgmt and use it > to specify port-specific options. It's a much cleaner way of doing > things than using if statements in make.conf. You can also easily > transfer the configuration to other systems. In addition to > port-specific options, you can use * to set global knobs. Here's the > start of my ports.conf file just to give you an idea: > > *: WITHOUT_BDB |\ > WITHOUT_DEBUG |\ > WITHOUT_DEBUGGING |\ > WITHOUT_IPV6 |\ > WITHOUT_NLS |\ > WITHOUT_PROFILE |\ > WITH_OPTIMIZED_CFLAGS |\ > WITH_TTF_BYTECODE_ENABLED > converters/libiconv: WITHOUT_EXTRA_ENCODINGS > lang/php5: WITHOUT_CGI |\ > WITH_MULTIBYTE I did not know this tool, thanks :) > And so on... Now as far as actually discovering what knobs are > available, I wrote a simple script to do this. The contents are below, > save them as /usr/local/sbin/getknobs or something similar. The idea > is this; when you are about to install a port, run getknobs from the > port's directory. The script uses 'make missing' to determine all the > other ports that are about to be installed, then goes through their > port directories and searches all the files for WITH/WITHOUT_* > patterns. You then get a nice print out of all the knobs that you can > configure before running make install for the current port. > > Since this script is using make missing you will not get the knobs for > ports that are already installed. The script was meant to be used from > the very beginning (i.e. starting from a clean system), so that on > each step you are only shown knobs for ports that aren't already > configured. You can easily modify this behavior if you want. You may > also need to adjust the regular expression used to find the knobs. Wow, this is a great idea with a wonderful script. Thanks you !
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070822163447.3741e377>