Skip to content
Advertisement

./configure and make: is there a common flag to the output filename, and what does –prefix do?

From time to time i have to compile tools and apps i need directly from the source. Most of them (i am using linux), require to run a configure-script:

./configure

and after that:

make install

i basically understand what those commands do, but there are some details which are still very unlcear to me.

Those two steps normally resulting in a binary file that is created in the end, located in the ./src directory (but not always). I also noticed that i can use the “–prefix=/path” on the configure script to set the prefix directory on which the final package gets installed (when running: make install).

  1. is this the norm or a convention that all or most of the configure scripts follow?

I also noticed that many times when running make install, a symlink in /usr/local/bin (or similar) to the binary in the installed location gets created.

  1. Is there also a common flag for the configure script, to choose a different name for this symlink?
  2. Is there a common flag to define the output name for the binary?

Advertisement

Answer

--prefix=/path relocates many components of the installation path. Typically prefix has a default value of /usr/local, leading to binary executables being installed into ${prefix}/bin. If you wanted them to be installed in the system path, you would set --prefix=/usr and then the executables would go into /usr/bin

This is in accordance to the Automake / Autoconf packaging conventions, which is detailed in the GNU coding standards.

As for the symlink, odds are it follows a naming pattern that is fixed within the install routines, either by code or by the linked library name. Often linked libraries have their names chosen based on the programs that load them moreso than the libraries they link to, so changing the name is not advisable. The linking is probably being done since you are probably installing into /usr/local/bin, and the libraries are also probably installing into a /usr/local/lib<something> path. Without further details (and a second question should be a second post) it’s hard to comment on it. I’d say changing the name would probably not be good for the executables in /usr/local/bin

Yes, you can alter the output names of the executables with the --program-prefix=value command, which in my example would install valuecp instead of cp.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement