# Port compile options



## Cromulent (Nov 27, 2022)

I'm pretty new to FreeBSD, so I'm not sure what the accepted policy is. I attempted to install PostgreSQL 15 on my local virtual machine but wasn't sure which options to compile when I was shown the options menu. One of those choices I made meant that the compilation failed. When trying to install it again, I didn't know how to clean the port tree so that I would have the option to make my selections again.

I guess my question boils down to this: Is there a way to determine what the different compile-time options are, what difference they make, and how you clean the port tree so that when installing again, everything is reset to its default condition?

I'm unsure if I have explained myself, so if you need clarification, please let me know.


----------



## W.hâ/t (Nov 27, 2022)

Have a look at ports(7)
You'll find more information about options on the ports website.

```
% make www-site
https://git-scm.com/
# make config
# make showconfig
===> The following configuration options are available for git-2.38.1_4:
     CONTRIB=on: Install contributed scripts
     CURL=on: Install curl support (provides HTTPS transport)
     GITWEB=on: Install gitweb
     HTMLDOCS=off: Install additional documentation
     ICONV=on: Encoding conversion support via iconv
     NLS=off: Native Language Support
     PCRE2=on: Use Perl Compatible Regular Expressions (v2)
     PERL=on: Perl scripting language support
     SEND_EMAIL=on: Enable the git-send-email(1) script
     SUBTREE=on: Install git-subtree
===> Use 'make config' to modify these settings
# make rmconfig
# make install
.....
# make clean
# make deinstall # You usually use `pkg delete git'
```


----------



## Cromulent (Nov 27, 2022)

W.hâ/t said:


> Have a look at ports(1)
> You'll find more information about options on the ports website.
> 
> ```
> ...


Awesome. Thank you very much for your help.


----------



## Phishfry (Nov 27, 2022)

Cromulent said:


> but wasn't sure which options to compile when I was shown the options menu.


That is a pretty good indicator that you don't need to compile from ports. Consider using packages.
Generally speaking the only reason to compile from ports is if you need to change a default port option.
Otherwise you are making life difficult. Packages are the best approach for most people..

I use ports for one program that is not in the tree. Seamonkey from a un-official port.
With that I use all package dependencies and only compile the SeaMonkey port.
`make build-depends-list | cut -c 12- | xargs pkg install -A -y`
I have found this ideal.
It allows use of the simple `pkg upgrade` command and is fast.

One advantage of ports is you can dig into the source code and make magic happen.
Average users do not need that.


----------



## Cromulent (Nov 27, 2022)

Phishfry said:


> That is a pretty good indicator that you don't need to compile from ports. Consider using packages.
> Generally speaking the only reason to compile from ports is if you need to change a default port option.
> Otherwise you are making life difficult. Packages are the best approach for most people..
> 
> ...


Thank you for replying.

Ah, I see. So packages are just pre-compiled versions of the ports tree? That makes sense coming from a Linux background.

Having said that, if I decided I needed to compile a specific port and customise it, I'm not sure where the options are specified and how to configure them in advance. I was reading the ports man page and saw that make.conf was involved, but I wasn't entirely sure about its correct usage.

Sorry for the newbie questions.


----------

