Automaticly Choose Defaults with make install

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Automaticly Choose Defaults with make install

Postby Just_Johnny » 08 Mar 2009, 04:30

Is there a way to automatically choose defaults when compiling? If there is I cannot find it.
Just_Johnny
Junior Member
 
Posts: 29
Joined: 06 Dec 2008, 08:52

Postby anomie » 08 Mar 2009, 05:13

IIRC, [cmd=#]setenv BATCH yes[/cmd] (for csh-based) or [cmd=#]export BATCH="yes"[/cmd] (for sh-based) should do it. It's documented in the manpages for ports(7), but its description there is not crystal clear to me.

Failing that, you could just run [cmd=#]cd /usr/ports/path/to/port && make config-recursive[/cmd] -- answer all the config dialogs and then make afterwards so that you won't be bothered with them.
User avatar
anomie
Member
 
Posts: 783
Joined: 17 Nov 2008, 04:37
Location: Texas

Postby Mel_Flynn » 08 Mar 2009, 05:55

To describe it:
BATCH=yes surpresses everything that the ports system can surpress, which includes all OPTIONS dialogs and some pkg-install scripts that ask questions, like mail/postfix/pkg-install. It also bails out when the port has IS_INTERACTIVE set. These are circumstances where operator intervention cannot be worked around, for example accepting a license.

You can set this in your environment or in /etc/make.conf, though I advise setting it in your environment, since that allows you to easily turn it off.

I'm afraid make config-recursive is flawed. It uses the current list to traverse it's dependencies, rather then the list obtained after the OPTIONS dialog.

The following script works around it:
Code: Select all
#!/bin/sh
# vim: ts=4 sw=4 tw=78 noet ai

VISITED=
PORTSDIR=${PORTSDIR:="/usr/ports"}
CURDIR=$1
[ -z "${CURDIR}" ] && CURDIR=.
[ ! -d "${CURDIR}" ] && CURDIR="${PORTSDIR}/${CURDIR}"

config_port() {
        local ldeps rdeps bdeps

        make config-conditional

        ldeps=`make -V LIB_DEPENDS`
        rdeps=`make -V RUN_DEPENDS`
        bdeps=`make -V BUILD_DEPENDS`

        for dep in ${ldeps} ${rdeps} ${bdeps}; do
                dir=${dep##*:}
                case ${VISITED} in
                        *" ${dir}"*)
                        ;;
                        *)
                        echo "---> $dir"
                        VISITED="${VISITED} ${dir}"
                        cd ${dir}
                        config_port
                esac
        done
}

cd ${CURDIR}
config_port
Mel_Flynn
Member
 
Posts: 379
Joined: 18 Nov 2008, 18:02
Location: Drachten, Netherlands

Postby tajudd » 08 Mar 2009, 05:56

personally, for a big compile like X11, gnome/kde, openoffice (i'm a glutton for punishment)..

Code: Select all
make -DBATCH install


It'll take the default config/options in any port that hasn't had config/options already set. I also use -DBATCH when I upgrade, since the fact that I've already had options set for a port I installed is already saved..and any new options are likely not interesting to me (yet).


The other option is to use env(1) -- it's a one-time environmental alteration utility and then executes what's on the command line. So the confusion of setenv vs export are nullified with env(1)


Enjoy!
tajudd
Junior Member
 
Posts: 25
Joined: 16 Nov 2008, 19:15

Postby anomie » 09 Mar 2009, 17:28

Mel_Flynn wrote:I'm afraid make config-recursive is flawed. It uses the current list to traverse it's dependencies, rather then the list obtained after the OPTIONS dialog.


Good to know. I may vaguely remember being burned by this before.
User avatar
anomie
Member
 
Posts: 783
Joined: 17 Nov 2008, 04:37
Location: Texas

Postby SirDice » 10 Mar 2009, 10:30

Mel_Flynn wrote:I'm afraid make config-recursive is flawed. It uses the current list to traverse it's dependencies, rather then the list obtained after the OPTIONS dialog.

Just run it again after you've added some options. I usually run make config-recursive a couple of times until it returns without showing any options.
User avatar
SirDice
Old Fart
 
Posts: 16153
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby graudeejs » 10 Mar 2009, 11:38

You can install packages which are available for most ports.
They are compilled with default flags, recompiling under some other CPU won't give you real boost using them.
User avatar
graudeejs
Style(9) Addict
 
Posts: 4591
Joined: 16 Nov 2008, 23:23
Location: Riga, Latvia


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: Bing [Bot], iddqd, simonepucci and 3 guests