# How to know knobs in using port install?



## benpptung (Oct 27, 2010)

Is it knob or what? I am not sure, if I am wrong please correct. Thanks.

Sorry, I am new to FreeBSD, and I have some questions really difficult to find out the answers in ports installation, so I list them here, hope to get some insight answers.

1. How can I know exactly the "knobs" in installing? 

For example, I know I can use the following command to install apache22 port, and compiling all the modules statically (*knob, here I mean MPM=event, WITH_ALL...= yes* )

[cmd=]make WITH_MPM=event WITH_ALL_STATIC_MODULES=yes install clean[/cmd]

But this is because I look into the Makefile.doc file to know this knob (or argument?). Or... I know I can install MySQL51 port by [cmd=]make BUILD_OPTIMIZED=yes install clean[/cmd]

That is because I read the mysql51-server port Makefile.

I am wondering if there is any documentation I can study? Or I have to study the Makefile to know them? [cmd=]make showconfig[/cmd] won't show me "WITH_MPM, WITH_ALL_STATIC_MODULES....knobs (or arguments whatever).

2. Also, I install apache, mysql, php5, php5-extensions ports in this order, It looks ok, but I am not sure is it the correct sequence to install them? I noticed there is a Makefile.ext in php5 port, which become the options list in php5-extensions port. Why?

3. Is it possible to compile php5 as a static module into apache22?

Any documents or ideas?

Thanks a lot.


----------



## SirDice (Oct 27, 2010)

benpptung said:
			
		

> or I have to study the Makefile to know them?


That's the only way to find out _all_ possible options. Not all options can be turned on/off with a configuration menu.


----------



## jb_fvwm2 (Oct 27, 2010)

The portsopt (port) when run in a ports directory will show options, both those unchecked by a "choices" screen and those settable only on the command line. Some other command I used before it works similar but I don't recall its name right now.
....
It is 
	
	



```
make showconfig
```
 but that command may only show the ones settable by the options screen, (maybe). Otherwise it works almost the same as the port mentioned above.


----------



## aragon (Oct 27, 2010)

benpptung said:
			
		

> Or I have to study the Makefile to know them?


You don't like it?  It's one of FreeBSD's best features.  Try and do that with <insert package manager from any other OS>.


----------



## benpptung (Oct 28, 2010)

aragon said:
			
		

> You don't like it?  It's one of FreeBSD's best features.  Try and do that with <insert package manager from any other OS>.



 I like it. It saves your time to install packages from compiling, also empowers you flexibility for customizing & tuning server.

I just wanna make sure I am doing right, because I cannot find any document to suggest me using these "hidden options". What does you mean "<insert package manager from any other OS>" ?


----------



## olivine (Oct 28, 2010)

Two other options that be useful sometimes are "DBATCH" or "config-recursive".  The first runs make with all defaults, the second displays all of the options menus at the start of the make, so that you can get them out of the way and then go do something else while the port is building.  I haven't found these officially documented anywhere (let me know if they are!).


----------



## SirDice (Oct 28, 2010)

olivine said:
			
		

> Two other options that be useful sometimes are "DBATCH" or "config-recursive".


It's BATCH not DBATCH. You might be confusing the D as part of the variable in a command like:
[cmd=]make -DBATCH all install[/cmd]

But it's part of an option (-D) to the make command. See make(1)


----------



## UNIXgod (Oct 28, 2010)

olivine said:
			
		

> I haven't found these officially documented anywhere (let me know if they are!).



config-recursive and friends are documented in `% man [man]ports[/man](7)`


----------



## benpptung (Oct 28, 2010)

Thanks for all the suggestion & replies.

I have gone through the apache22->mysql51-server->php5->php5-extensions. Wow... FreeBSD really makes it so simplified.

But one question here added, what does "meta-port" mean ? I mean php5-extensions is a meta port, what does it exactly mean?

I've just thinking a situation, after php5-extensions helped me installed the needed extensions. How can I add additional extensions if i need them in the future?

I've tried: 
`make config && make install clean`
but error message happened to ask me to deinstall && reinstall.

So, what should I do? should I 
[cmd=]make deinstall && make config && make reinstall clean[/cmd]
to add additional php5 extensions after 1st time php-extensions was installed?

It made me a little confused...


----------



## SirDice (Oct 28, 2010)

benpptung said:
			
		

> But one question here added, what does "meta-port" mean ? I mean php5-extensions is a meta port, what does it exactly mean?


It means that the port itself doesn't install anything. The port only consists of dependencies (which in turn do install something).



> I've just thinking a situation, after php5-extensions helped me installed the needed extensions. How can I add additional extensions if i need them in the future?


Just build/install the php5-<extension name> port.


----------



## benpptung (Oct 28, 2010)

Thank you for the clarify about meta port!! :e



			
				SirDice said:
			
		

> Just build/install the php5-<extension name> port.



Hi... build/install ? 
Do you mean : 

Step1: `make config`
(and select what you want to add)

Step2: `make build clean`
(and it will install the added extension)

Step3: `make install clean` 
(I've tried, if add the step 3, it will cause error code 1 again)

In this case, I've found
`make config && make build clean` = [cmd=]make deinstall clean && make config && make reinstall clean[/cmd]

Point is, after installation, stop using `make install` since it will cause error code 1. Am I wrong?


----------



## DutchDaemon (Oct 28, 2010)

Use a port manager and be done with questions like that. You can simply run e.g. [cmd=]portmaster lang/perl5[/cmd] whether that port is already installed or not. It will simply reinstall if it is.


----------



## SirDice (Oct 29, 2010)

benpptung said:
			
		

> Step2: `make build clean`
> (and it will install the added extension)


You don't need this step. It also has an extra 'clean', which will remove everything the 'build' before that did.

Error code 1 is just a generic error. Please post the full error so we can see why it's failing.


----------

