LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What does ./configure mean? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-configure-mean-112331/)

jkpalmer52 11-04-2003 01:09 PM

What does ./configure mean?
 
I've seen many references in installation procedures for Apache and PHP to
do a
./configure --activate./.......

or
./configure --without-mysql.........

What directory should I be in and what user should I be logged in as?

How do I know what directory I should be in?

Is this is one of those "hidden" tricks of Linux.?

TIA

JP

michaelk 11-04-2003 01:25 PM

configure is a script that checks to see if you have the required software dependencies to compile the application and it will configure the make file for any specific options like --without-mysql. Which means I do not want to compile mysql database support.

The configure script is specific to the application you are compiling which is why you have the ./ i.e. current working directory. Depends on the application but to install you usually need to be logged in as root. The readme instructions will specify which steps that require you to be root.

The usual steps to compile and install a program.
./configure
make
make install

LogicG8 11-04-2003 01:29 PM

When you download the source code for a project
for example Apache it's usually in a "tar ball"
(looks like project-version.tar.gz)
when you extract the tar ball (tar xzvf project-version.tar.gz)
it usually creates a directory project-version
inside that directory there is the source code
Large projects get very complicated so in order to
simplify things the programmers use build tools like
autoconf. ./configure runs a script that automagically
configures things. You can pass arguments to the
configure script so it can create a Makefile that suits
your computer system. For example a project includes
a gui client but your computer doesn't have X but you
still want that program ./configure --no-gui
the options that you pass a configure script are entirely
up to the project so they vary considerably from script
to script. Usually there is the option ./configure --help
and it will list all of the possible options.

This isn't really one of the "hidden" tricks of linux like
messing w/ the kernel directly through /proc it's
pretty well documented. In fact most projects have
a file called README or INSTALL that tells you what
you need to do. Of course to make use of these
files you need to know how to extract an archive.

Good luck.

Oh yes ./ is a shorcut refering to the directory you are
in. so ./configure executes the configure script in the
directory you are in if there is one.

Lostman 11-04-2003 01:57 PM

let's say, like in the case of gaim, there is no configure file. If I type "make" I get nothing. If I type "make install" I get nothing. I d/l a tar.gz, is there another way to install these?

LogicG8 11-04-2003 02:16 PM

In the case of gaim there are those readme and install files
that tell you all the secrets

LogicG8 11-04-2003 02:25 PM

I just d/led the gaim archive from sourceforge and
it does have a configure file

and there is a file called Install with installation instructions:

Quote:

If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

The file `configure.ac' is used to create `configure' by a program
called `autoconf'. You only need `configure.ac' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

The simplest way to compile this package is:

1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.

Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.

2. Type `make' to compile the package.

3. Optionally, type `make check' to run any self-tests that come with
the package.

4. Type `make install' to install the programs and any data files and
documentation.

5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.

Compilers and Options
=====================

Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure


All times are GMT -5. The time now is 08:04 AM.