# make.conf file is missing from /etc/ directory



## sachinborkar (Feb 18, 2014)

Hi,
I've freshly turned to FreeBSD from Linux. I've successfully installed a dual-boot system with Windows 7 and FreeBSD 8.2 64 bit. After installing I successfully used `portsnap fetch && portsnap extract && portsnap update` I have also successfully tried installing Nano on the system. Now I want to configure Xorg with Gnome and I want to configure Intel HD graphics driver for the desktop. I've read in several related posts that one should edit one's /etc/make.conf file for SETTING WITH_NEW-XORG AND WITH_KMS to 'true' before using ports to install Xorg and Gnome. However, strangely I find that the make.conf is missing from my /etc/ directory. I searched the internet and found that make.conf is created IF it is required.

I hereby appeal to fellow users to kindly resolve my following issues - 
1) 'Why there is no make.conf in my /etc/ directory?'

2) 'Wasn't make.conf needed when I installed nano using ports?' 

3) How can I get my make.conf in /etc/. I observed that there is a template of make.conf in /usr/share/examples/etc/.So can I just `cp` that template to /etc ?
The whole template seems commented out. I'm certain that some tweaking must be required to the template if it has to work properly.

I thank you all for your efforts in advance.


----------



## SirDice (Feb 18, 2014)

sachinborkar said:
			
		

> 1) 'Why there is no make.conf in my /etc/ directory?'


You said it yourself, it's only there when it's needed.



> 2) 'Wasn't make.conf needed when I installed nano using ports?'


No.



> 3) How can I get my make.conf in /etc/. I observed that there is a template of make.conf in /usr/share/examples/etc/.So can I just `cp` that template to /etc ?


Create one, read make.conf(5). Don't use the example file, it's an _example_. Tip: Stay away from CFLAGS and friends, they will not improve anything and may even break stuff.


----------



## sachinborkar (Feb 18, 2014)

Thanks @SirDice for a blazing fast reply. 
The link to make.conf man page is a great help.
However, may I ask why nano installation did not require make.conf even though I have issued `make install` and `clean` commands to get nano?


----------



## SirDice (Feb 18, 2014)

If the file doesn't exist default settings will be used. It's not mandatory to have it.


----------



## sachinborkar (Feb 18, 2014)

SirDice said:
			
		

> If the file doesn't exist default settings will be used. It's not mandatory to have it.



By default settings, I suppose you mean, the default settings set in the software code. am I right? or are there any other settings on the system itself which I must be aware of?


----------



## SirDice (Feb 18, 2014)

sachinborkar said:
			
		

> SirDice said:
> 
> 
> 
> ...


Yes, the default settings as set by the ports. For example, editors/vim installs with a GUI by default. If you add WITHOUT_X11 to /etc/make.conf all ports will be build _without_ X support (i.e. no GUI). That's assuming the port in question is actually capable of being built without a GUI.


----------



## wblock@ (Feb 18, 2014)

Much of the work of building ports for FreeBSD is done behind the scenes by the ports system.  Look in /usr/ports/Mk, for example.  /etc/make.conf is for additional general settings from the user.


----------



## sachinborkar (Feb 18, 2014)

Thank you so much. That's indeed enlightening. I'll give a try to creating my own make.conf and post the results of installing X11, Gnome and Intel drivers through ports system.


----------



## SirDice (Feb 18, 2014)

A lot of ports have KNOBS, you can find a partial list of them in /usr/ports/KNOBS. And a lot of those KNOBS can be set using `make config` but not all ports have the luxury of a TUI option screen. The best way to find them is by reading the port's Makefile. You can use them as WITH_SOMEKNOB or WITHOUT_SOMEKNOB to turn options on or off.

By setting those KNOBS in /etc/make.conf you can set them 'globally', i.e. they're used by every port that supports it. Or with a little trick you can set it for a specific port only:

```
.if ${.CURDIR:M*/editors/vim}
 WITHOUT_X11=YES
.endif
```

Keep in mind that the value usually doesn't matter, only if it's defined or not. These are all treated the same:

```
WITHOUT_X11=
WITHOUT_X11=YES
WITHOUT_X11=NO
```
The last one is counter-intuitive and should be avoided. If you want to turn it on use WITH_X11 instead.


----------

