74

I have seen that while installing new software in Linux, I always have to use first configure it.

But sometimes we need to pass various options like I did today to install lxml:

./configure --with-python=/opt/python27/bin/python 
--prefix=/usr/local 
--with-libxml-prefix=/usr/local 
--with-libxml-include-prefix=/usr/local/include 
--with-libxml-libs-prefix=/usr/local/lib

Now I want to know that how will the person know that what type of paramaters like --with-python can be used?
I mean:

  1. Are those parameters same across all software packages or they vary software to software?

  2. I even tried to read documentation as well, but no one mentions those parameters.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Mirage
  • 30,868
  • 62
  • 166
  • 261
  • 2
    Look at the script: `less configure` – Michael Jun 03 '11 at 13:46
  • I can only speak in lay mans terms on this - but writing ./configure then accessing auto-complete (tab) you will get a list of possible options. These are most definately unique, depending on the actual software. – Max Jun 03 '11 at 13:47
  • 9
    @Mikaveli: Seriously? It's an autogenerated script created to be as portable and robust (instead of readable) as possible, and hence extremely unreadable (just like the makefiles generated by it), not meant for manual inspection. `./configure --help` is the way to go. Just follow an abritary autotools tutorial, generate the configure script from its super-simple `configure.in` and try reading that. –  Jun 03 '11 at 13:50
  • @delnan: I've also seen a lot of manually created configure scripts too, so I always start by giving it a quick once over. :) – Michael Jun 03 '11 at 15:17

4 Answers4

135
./configure --help

That will show you all options for that particular configure script.

Carlos Campderrós
  • 22,354
  • 11
  • 51
  • 57
  • Never knew that was a standard practice...wow. I love that for applications and commands in the CLI, wonderful to know `./configure [OPTION]`s can be listed. Thanks for the answer – TryTryAgain Nov 28 '13 at 08:38
  • 1
    This doesn't appear to be exhaustive. Ex: "--disable-shared" isn't listed, but "--disable-FEATURE" is, but one must look elsewhere for what "FEATURE[s]" are available. Which is what I'm looking for, and lead me here. So now I must RTFM myself. – TheHairyOne Jan 22 '18 at 22:33
4

Some are the same across all configure scripts produced by Autoconf (which is most of them, but not all); for instance --prefix is basically universal. Others are peculiar to the particular configure script.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
3

./configure --help is always helpful. But I would say more about that in some packages not only is there a configure script in the top source directory but also the possible subdirectories. So, for knowing all possible parameters which can be passed to the configure script in the top source directory you should also have a look at the configure scripts in each possible subdirectory.

For example, in the top source directory of binutils-2.34 tarball there are --with-sysroot and --with-lib-path parameters with configure script. If you type ./configure --help under the top source directory, there are no document items for both of them because they are documented in the configure script under the subdirectory ld/. So you should type ./ld/configure --help.

Li-Guangda
  • 341
  • 1
  • 4
  • 14
1

I know about configure --help but the information provided is "light". The following GNU resources contain useful additional information:

Installation directory variables

Release process

Pancho
  • 2,043
  • 24
  • 39