# What compiler options were used for a given binary package?



## JHavermans (Apr 26, 2013)

Dear all,

I have a question regarding (binary) software packages installed via pkg_add on FreeBSD 9.1. How can you, for a given package (lets say apache22) determine what compile options were used? If I understand the FreeBSD package concept correctly regarding FreeBSD 9.1, FreeBSD does not make a distinction w*h*ether a package is installed as a binary via pgk_add or compiled via ports.

To determine what compile options where used for a package installed via ports, you might `cd` into the proper ports directory of that application and do a `make showconfig`. But how can you see the compile options for a binary package that is installed via pkg_add?

I ask this question here since while searching for an answer (and using apache22) for this, I noticed a difference between the Apache installed on my vanilla *F*reeBSD 9.1 box and what I found when doing a `make showconfig` in the directory /usr/ports/www/apache22.

This brings me to my second question: how you can determine for a given FreeBSD 9.1 system w*h*ether a package was installed via pkg_add or ports?

Thank you for helping me out!



Met vriendelijke groeten / Kind Regards,

Johan Havermans


----------



## Beastie (Apr 26, 2013)

Welcome on board!



			
				JHavermans said:
			
		

> How can you, for a given package (lets say apache22), determine what compile options were used?


A binary package is built using the port's default options.



			
				JHavermans said:
			
		

> But how can you see the compile options for a binary package that is installed via `pkg_add`?


If it's a custom build, you can't, AFAIK. Some applications may provide a command showing a list of "built-in" options.
If it's built using the defaults, then use `make showconfig` on your local copy of the ports tree, as you've already mentioned, or check it online, e.g. www/apache22.



			
				JHavermans said:
			
		

> This brings me to my second question how you can determine for a given FreeBSD 9.1 system wether a package was installed via `pkg_add` or ports?


You can't. Unless you notice some non-default settings, libraries, etc.


----------



## kpa (Apr 26, 2013)

PKGNG has options to query the compile time options for an installed package or for a package in a remote repository.


```
firewall ~ % pkg query -e "%n=perl" "%n-%v %Ok %Ov"
perl-5.14.2_3 DEBUGGING off
perl-5.14.2_3 GDBM off
perl-5.14.2_3 PERL_MALLOC off
perl-5.14.2_3 PERL_64BITINT on
perl-5.14.2_3 THREADS off
perl-5.14.2_3 PTHREAD on
perl-5.14.2_3 MULTIPLICITY off
perl-5.14.2_3 SITECUSTOMIZE off
perl-5.14.2_3 USE_PERL on
firewall ~ %
```


----------



## fonz (May 4, 2013)

@JHavermans wrote a tutorial for this, which has been moved to the _Howtos & FAQs_ section here.


----------

