ed71 Automaticly Choose Defaults with make install - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

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

Reply
 
Thread Tools Display Modes
  #1  
Old March 8th, 2009, 05:30
Just_Johnny Just_Johnny is offline
Junior Member
 
Join Date: Dec 2008
Posts: 29
Thanks: 16
Thanked 0 Times in 0 Posts
Default Automaticly Choose Defaults with make install

Is there a way to automatically choose defaults when compiling? If there is I cannot find it.
Reply With Quote
  #2  
Old March 8th, 2009, 06:13
anomie's Avatar
anomie anomie is offline
Member
 
Join Date: Nov 2008
Location: Texas
Posts: 783
Thanks: 49
Thanked 113 Times in 100 Posts
Default

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.
Reply With Quote
  #3  
Old March 8th, 2009, 06:55
Mel_Flynn Mel_Flynn is offline
Member
 
Join Date: Nov 2008
Location: Drachten, Netherlands
Posts: 379
Thanks: 7
Thanked 74 Times in 57 Posts
Default

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
Reply With Quote
  #4  
Old March 8th, 2009, 06:56
tajudd tajudd is offline
Junior Member
 
Join Date: Nov 2008
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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!
Reply With Quote
  #5  
Old March 9th, 2009, 18:28
anomie's Avatar
anomie anomie is offline
Member
 
Join Date: Nov 2008
Location: Texas
Posts: 783
Thanks: 49
Thanked 113 Times in 100 Posts
Default

Quote:
Originally Posted by Mel_Flynn
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.
Reply With Quote
  #6  
Old March 10th, 2009, 11:30
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,021 Times in 1,860 Posts
Default

Quote:
Originally Posted by Mel_Flynn View Post
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.
Reply With Quote
  #7  
Old March 10th, 2009, 12:38
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,522
Thanks: 422
Thanked 607 Times in 475 Posts
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Broadcom 4401 chipset defaults to 10baseT/UTP Connection eschleicher Networking 5 February 17th, 2009 05:13
what is real different between portupgrade -R and make deinstall and install mfaridi Installation and Maintenance of FreeBSD Ports or Packages 7 February 7th, 2009 20:37
portinstall or make install clean ccc Installation and Maintenance of FreeBSD Ports or Packages 2 February 3rd, 2009 00:00
send make install clean to Screen mfaridi Installation and Maintenance of FreeBSD Ports or Packages 9 January 25th, 2009 04:05
make package without install spock Installation and Maintenance of FreeBSD Ports or Packages 6 November 19th, 2008 20:06


All times are GMT +1. The time now is 23:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0