LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-11-2004, 11:37 AM   #1
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Rep: Reputation: 30
Whats the point of ./configure?


Not a practical question as such, but what exactly is the point of a ./configure script?

I mean surely if the right headers and libraries are not present the compiler will just throw a readable error anyway, so what good does it do for configure to do this?
 
Old 07-11-2004, 11:38 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Checks for dependencies, check paths, and creates the make file. Without it, well, I'd probably guess your install would fail each time.
 
Old 07-11-2004, 11:46 AM   #3
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Original Poster
Rep: Reputation: 30
I'm not convinced, of the things you mentioned the only thing a 'make' can't do is write the makefile.
 
Old 07-11-2004, 11:56 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
source files are non system/distro specific. ./configure configures the makefile for your system/distro. Without doing this, the make file would not work.
 
Old 07-11-2004, 12:04 PM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Okay.. let me use a different word, it prepares make before making the makefile, etc.

You know, when you run ./configure, it should spit out characters and numbers and such on your screen, it actually is telling you there what its doing.
 
Old 07-11-2004, 12:12 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
An easy way to convince yourself would be to try write a Makefile that will compile
the same program on multiple operating systems and accross many different architectures.
Also try to get a makefile to generate those .moc files used in Qt KDE compilations
across different operating systems and architectures.
Also your Makefile will have to take command line args to set various programs feature sets and default pathways so the user can cantroll how the program functions.
Some of the Unix guys don't use configure but they write a million Makefiles and you pick the one that works for you -- somehow that doesn't seem better.

Last edited by foo_bar_foo; 07-11-2004 at 12:14 PM.
 
Old 07-11-2004, 05:16 PM   #7
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Original Poster
Rep: Reputation: 30
hmm I see your point, but changing the architecture is a very simple process isn't it? Just change a compiler switch.

I see how it would be difficult to get code to compile on multiple OS's though.
 
Old 07-11-2004, 09:02 PM   #8
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
I'm not really qualified to be discussing this but crosscompiling i think involves both compilng and linking against different than the native core libraries...
the whole configure thing is automated and is to help developers spend time writing programms rather than Makefiles -- the configure script itself is generated by autoconf based on a script generated by automake. configure can even be setup to generate the spec files for package managers.
I mean yea the Makefile is all just compiler commands ultimately you just have to get them into the Makefile somehow along with the other stuff your package needs to compile..
People for instance build Linux with different directory structures so you sometimes have to ask where things are and many libraries keep track of where their header files are installed in case configure asks..
If there are some platform specific defines (MACROS) you need to use as a workaround for something they are generated by config in config.h that becomes a part of the programs header files.
Autoheader takes as input the files acconfig.h and generates the config.h.in template by parsing configure.in.
then config turns config.h.in into config.h.
configure now rather than just checking for the needed symbols presence in the libs header files will actually go and check for the needed symbol in the library itself. and can check for functions within the std c lib.
to make sure they are present so your newly compiled programm will actually run.
libtool can keep track of the extent of backward compatability in a certain library.
and of course like i said earlier configure allows you to install things in unorthodox places with different config file locations or using external rather than internal libraries of even do a total static linkage disable some functionality you don't like or whatever.

for a look at a non-configure alternative check out the cdrtools package
i have looked at that Makefile system for hours and have no idea how it works
 
Old 07-12-2004, 04:44 PM   #9
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Original Poster
Rep: Reputation: 30
Sounds like fun... But if you seriously think writing a makefile is any more hassle than all that, you're nuts.

So configure gives a nice readable output, but wheres the fun then?
 
Old 07-12-2004, 11:01 PM   #10
jspenguin
Member
 
Registered: Feb 2003
Location: Wichita, KS
Distribution: Heavily modified Redhat
Posts: 194

Rep: Reputation: 30
Personally, I would rather have configure tell me I need libfoo >= 2.42.493, rather than start a make, leave, come back 5 hours later, and find out it failed after 5 minutes with some obscure error message which may or may not be because I need to upgrade libfoo.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
whats the point in Xor encryption ? qwijibow Linux - Security 26 02-08-2004 03:37 PM
Distro's.. whats the point ??? (no realy, tell me) qwijibow Linux - Distributions 16 11-28-2003 12:22 PM
Mandrake MNF with point-to-point T1, routers ioannes Linux - Networking 0 07-24-2003 09:59 AM
whats the point in ide-scsi emulation ? qwijibow Linux - Newbie 7 05-31-2003 08:05 PM
Is there a detailed point by point comparison on Linux to Windows? Paul Parr Linux - General 4 04-26-2003 03:35 AM


All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration