1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automaticly Choose Defaults with make install

Discussion in 'Installation and Maintenance of Ports or Packages' started by Just_Johnny, Mar 8, 2009.

  1. Just_Johnny

    Just_Johnny New Member

    Messages:
    29
    Thanks Received:
    0
    Is there a way to automatically choose defaults when compiling? If there is I cannot find it.
     
  2. anomie

    anomie New Member

    Messages:
    783
    Thanks Received:
    116
    IIRC, # setenv BATCH yes (for csh-based) or # export BATCH="yes" (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 # cd /usr/ports/path/to/port && make config-recursive -- answer all the config dialogs and then make afterwards so that you won't be bothered with them.
     
  3. Mel_Flynn

    Mel_Flynn New Member

    Messages:
    379
    Thanks Received:
    73
    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:
    #!/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
    
     
  4. tajudd

    tajudd New Member

    Messages:
    27
    Thanks Received:
    0
    personally, for a big compile like X11, gnome/kde, openoffice (i'm a glutton for punishment)..

    Code:
    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!
     
  5. anomie

    anomie New Member

    Messages:
    783
    Thanks Received:
    116
    Good to know. I may vaguely remember being burned by this before.
     
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,515
    Thanks Received:
    2,351
    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.
     
  7. graudeejs

    graudeejs Well-Known Member

    Messages:
    4,594
    Thanks Received:
    632
    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.