unix - Why always ./configure; make; make install; as 3 separate steps? -
every time compile source, go through same 3 steps:
$ ./configure $ make $ make install
i understand, makes sense divide installing process different steps, don't it, why each , every coder on planet has write same 3 commands again , again 1 single job done. point of view make totally sense have ./install.sh
script automatically delivered source code contains following text:
#!/bin/sh ./configure make make install
why people 3 steps separately?
because each step different things
prepare(setup) environment building
./configure
this script has lots of options should change. --prefix
or --with-dir=/foo
. means every system has different configuration. ./configure
checks missing libraries should installed. wrong here causes not build application. that's why distros have packages installed on different places, because every distro thinks it's better install libraries , files directories. said run ./configure
, in fact should change always.
for example have @ the arch linux packages site. here you'll see package uses different configure parameter (assume using autotools build system).
building system
make
this make all
default. , every make has different actions do. building, tests after building, checkout external scm repositories. don't have give parameters, again packages execute them differently.
install system
make install
this installs package in place specified configure. if want can specify ./configure
point home directory. however, lots of configure options pointing /usr
or /usr/local
. means have use sudo make install
because root can copy files /usr , /usr/local.
now see each step pre-requirement next step. each step preparation make things work in problemless flow. distros use metaphor build packages (like rpm, deb, etc.).
here you'll see each step different state. that's why package managers have different wrappers. below example of wrapper lets build whole package in 1 step. remember each application has different wrapper (actually these wrappers have name spec, pkgbuild, etc.):
def setup: ... #use ./configure if autotools used def build: ... #use make if autotools used def install: ... #use make if autotools used
here 1 can use autotools, means ./configure
, make
, make install
. 1 can use scons, python related setup or different.
as see splitting each state makes things easier maintaining , deployment, package maintainers , distros.
Comments
Post a Comment