# ./configure



## iconicmoronic

does someone know the name of the package and the repository where i can find it to properly install the ./configure utility? everytime i use it I get this message from the terminal:


bash: ./configure: No such file or directory

i'm in the pwd where i have extracted my file so this has me stumped except to assume that the ./configure utility is not properly installed or configured itself.


----------



## wmorri

Bash is correct ./configure isn't a file or directory, it is a function. What are you trying to configure and install? The way that you use ./configure is when you download a file that is in the file systems of .rpm, .tar, .tar.gz. Plus you have to use the whole thing 


Code:


 ./configure
make
make install

Cheers!


----------



## iconicmoronic

then that is what i'm doing wrong, i thought i had to issue ./configure and then make, and then make install waiting for the outcome inbetween each command given.
other than that i was using it with a .tar.gz file -- which was ardour. thanks!


----------



## iconicmoronic

what exactly does this mean because i typed these commands as directed by the LFS book:

(on the second try after tar -xvjf)

[email protected]:/tmp# cd e2fsprogs-1.40.2
[email protected]:/tmp/e2fsprogs-1.40.2# mkdir -v build
mkdir: cannot create directory `build': File exists
[email protected]:/tmp/e2fsprogs-1.40.2# cd build
[email protected]:/tmp/e2fsprogs-1.40.2/build# ../configure make
configure: WARNING: you should use --build, --host, --target
Generating configuration file for e2fsprogs version 1.40.2
Release date is July, 2007
checking build system type... Invalid configuration `make': machine `make' not recognized
configure: error: /bin/bash ../config/config.sub make failed

make install is intentionally left out according to the book, although i did try it with make install after the first failure and got the same message


----------



## dragonember

just for giggles did you try:

"[email protected]:/tmp/e2fsprogs-1.40.2/build# ./configure"

I'm not sure how the ./configure make command works exactly but my thoughts (which may be wrong) are that when ./configure finishes it may try to make the file. if the configure ran into errors (which is likely due to dependencies) then it may not have told you that there were unfilled dependencies and tried to make the files anyway, causing it to fail. anyway try ./configure without "make" on the line after it


----------



## lensman3

Some configures have a dot in front of the name: .configure Note the prepended dot. So to run the configure type in "./.configure": two dots in a row separated by a forward slash. Since Linux does NOT, by default, put the current working directory in the path, to run a script/program that is in the current directory, then you have to prepend the ./ (dot-slash) for it to run. 

The .configure file, itself, is a very convoluted shell file. It tests to see if all the libraries, needed programs, etc have been installed. Try running the configure as: "sh -x .configure". (Hope you can ready very fast).


----------



## dragonember

ah ok that makes sense. thanks for that explanation. thats why when a file is named .configure instead of configure and I type ./configure it tells me that the file can't be found.


----------



## shuuhen

As lensman3 said, ./configure is a script. The "./" part just means "the directory I'm currently in." So generally if you extract a tarball (.tar.gz, .tar.bz2, etc.) to somedirectory-1.2.3, you will need to *cd path/to/somedirectory-1.2.3* then run *./configure*.

Often there will be a "read me" file (usually called README) that will tell you if there are any slightly less common steps. You might sometimes run into packages that require you to run a different script that will generate the "./configure" script.

Out of curiosity, what page are those instructions on? e2fsprogs should have a "./configure" script.


----------



## iconicmoronic

okay the previous error i understood, this one i do not. this is only the second command!!!!

[email protected]:/tmp: tar -zxvf e2fsprogs-1.40.2.tar.gz
...
e2fsprogs-1.40.2/po/tr.gmo
e2fsprogs-1.40.2/po/it.gmo
e2fsprogs-1.40.2/po/pl.gmo
e2fsprogs-1.40.2/po/[email protected]
e2fsprogs-1.40.2/po/cs.po
e2fsprogs-1.40.2/po/fr.gmo
[email protected]:/tmp$ cd e2fsprogs-1.40.2
[email protected]:/tmp/e2fsprogs-1.40.2$ mkdir -v build
mkdir: created directory `build'
[email protected]:/tmp/e2fsprogs-1.40.2$ cd build
[email protected]:/tmp/e2fsprogs-1.40.2/build$ ../configure
Generating configuration file for e2fsprogs version 1.40.2
Release date is July, 2007
checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
CC defaults to cc
checking for gcc... cc
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.


----------



## iconicmoronic

trying dragonmembers "solution" i got this:

[email protected]:/tmp/e2fsprogs-1.40.2/build$ ./configure
bash: ./configure: No such file or directory
[email protected]:/tmp/e2fsprogs-1.40.2/build$ ls
config.log
[email protected]:/tmp/e2fsprogs-1.40.2/build$ ../configure make
configure: WARNING: you should use --build, --host, --target
Generating configuration file for e2fsprogs version 1.40.2
Release date is July, 2007
checking build system type... Invalid configuration `make': machine `make' not recognized
configure: error: /bin/bash ../config/config.sub make failed
[email protected]:/tmp/e2fsprogs-1.40.2/build$


----------



## iconicmoronic

where can i find a dependencies list,website,database or whatever?


----------



## lensman3

./configure should tell you what the dependecies are. Yours died on gcc, it found cc, but couldn't create an executable (probably a temp file called a.out). It doesn't look like you have gcc, the GNU C compiler, installed. It later failed to find a program called "make". The "make" program will have to be installed.

You might try to find the list a programs that turnsUbuntu into a "development" machine. A development configured machine will have cc, gcc, g++, make, rcs/sccs, gdb, nm, ldd and so on. The cc, gcc, g++ will probably only be soft links since the "C" compiler bundles all that together now. You might have to install the "development" kernel headers too.

Look at the tail-end of configure.log to see the ./configure errors. Until you get the "development" built, the compilers, you won't even get to the required libraries that will be needed. Use the "tail" command to see the end of the log file.

Hope this helps.

A good command to know is "which <command>" where <command>, like "make", is substituted. The shell will look through its PATH's and find which program you will be executing. That is a quick way to see if the the command has even been installed. If in you path you have the same command twice, "which" will tell you which executable will be used. The "locate <command>" will tell you the same thing, but you will get pages and pages of output.


----------



## iconicmoronic

au contraire mon ami

i have all the versions of gcc installed from gcc to gcc 4.1, and i just installed make.

the program i'm trying to build is e2fsprogs-1.40.2 for use with the LFS book version 6.3

i'm kind of at a loss, the only thing that i can think of is that the folder gcc is trying to write this a.out file to does not have permissions? could this be possible?

LFS also says specifically not to do make install but ../configure make, either way its done as you suggest or the book suggests, the error is the same, 'make' not recognized although i have installed make already.


----------



## lensman3

The instructions say to do (probably) three things.
1) ./configure (this will build a file called "Makefile". Note the the capital M. This will have the instructions needed in "make" syntax to build the e2fsprogs binary. (In the traditional, Unix development environment, the Makefile with the capital M would be sorted in the directory before the "C" files which "tradtionally" are all lower case letters).

2) Then at the prompt you will run "make". "make" the program, will read the "Makefile" file and execute the steps needed to build the e2fsprogs binary. This step will run the gcc compiler as needed. It will probably build some libraries. The libraries will be named "lib???.a" for static libraries and "lib???.so" for relocatable libraries. Eventually, as the last step, the linker, named "ld" will run which will combine all the dot-oh (.o) and the libraries in to a executable binary. By default, if a binary isn't given a name by gcc or ld, it will be called "a.out". You can rename a.out to any valid program name.

3) "make install" command will read the Makefile and install the libraries and the e2fsprogs binary in the correct place in the file system. 

To answer your questions about gcc writing the binary into a directory that doesn't have write permissions: Yes that is very possible. But if any libraries or .o files are written the "make" will abort as soon as a file can't be written.


As a test, when you type "make", type in "make -n". This will dump to the screen all the commands that make would be run but not execute them. Another switch for "make" is -i, run "make -i", this tells make to ignore all errors, just blow through them, and go to the end. Remember is a file fails to compile you won't get an executable at the end.

Hang in there. The first one you do is always the hardest.


----------



## shuuhen

iconicmoronic said:


> the program i'm trying to build is e2fsprogs-1.40.2 for use with the LFS book version 6.3
> 
> i'm kind of at a loss, the only thing that i can think of is that the folder gcc is trying to write this a.out file to does not have permissions? could this be possible?
> 
> LFS also says specifically not to do make install but ../configure make, either way its done as you suggest or the book suggests, the error is the same, 'make' not recognized although i have installed make already.


I doubt the permissions have issues. What it looks like to me is one of the authors put in a pretty big typo. In most source packages I've dealt with, there was a README or INSTALL file (yes, usually capitalized - but not always), sometimes both. The README and/or INSTALL file should just be a text file and should have install instructions and sometimes dependencies.

e2fsprogs-1.40.2 is a little out of the ordinary as far as instructions - most I've seen don't tell you to make a directory OR run a configure script from a different directory. The LFS instructions were fine up until the *../configure make*. Instead you should run *../configure* then *make*


Just wondering, what page were these instructions on?


----------



## iconicmoronic

http://www.linuxfromscratch.org/lfs/view/stable/chapter02/creatingfilesystem.html

these are the first steps of the process.
to get to the link go to www.linuxfromscratch.org and then click the LFS link. When it loads, click read online on the left hand side and after this loads, follow 'Stable' link that is just below stable erata. 

Follow the next button to creating a partition

thanks again for your posts, especially that nice long informative one sir!!
i'm gonna give it another try when I get back home.


----------



## iconicmoronic

well i got it installed, the problem was that i had autoconf and make installed, but no automake. so it was obvious problem i overlooked because i was staring at the LFS package requirements too much! thanks for your help !!


----------

