Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-19-2004, 01:10 AM   #1
Registered: Mar 2004
Posts: 50

Rep: Reputation: 15
Exclamation Compiling Source

OK, I've been getting into linux more and more for a little while... but there's one problem I cant seem to solve. I've gotten apt-get and synaptic, but there are some linux apps that I only have the source for that I want to install. Can some take some time and help out a newbie? What is the process of compiling source code and making an application that I can run? I am currently running SuSE 9.1 primarily, but I also have access to FC2 and Mandrake 10.0

PS... If you are going to talk about things like "make" and "./configure" ... please explain what they do, and how to use them, I see these often in fourm posts regarding compiling source, but have no idea what they are!
Old 08-19-2004, 01:34 AM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
I hope you don't think this is a cop-out, but here's another thread:

It talks about things, and I have a response (about halfway down the page) that tries to explain things in "plain english". I'd be happy to clarify anything if you still aren't sure about things.
Old 08-19-2004, 01:37 AM   #3
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145

Rep: Reputation: 15
First thing you have to do is to cd into the source code directory

Then type
make install

./configure is a script that performs some necessary tests
and create some other necessary scripts

In case the package you are installing is dependent upon some other
application, this would be tested in ./configure script

Moreover the ./configure script will also set some necessary enviroment variables like include paths, libarary paths, LD FLAGS etc (for the moment dont concentrate much on this)

In addition to that the ./configure script would also create the necessary make files (later explained)....for example it is responsible for creating the makefile for the source


This is file that would be used to compile a source code.
Makefile is a seperate for the moment just think that it
is something necessary to compile a piece of source code

When you type "make" in the automatically looks for a file named
"Makefile" in the current directory...if it is'nt there it would display an error like "no targets found". That is because there was no Makefile in the current directory

make install:

install is a script which is also embedded in the makefile.
this scipt will copy the executable (.exe in windows)..and the required libraries into the appropiate folders.

I hope this this sufficient for you
Old 08-19-2004, 01:38 AM   #4
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Look your application have more then one source files. like and maybe one file is dependent to another file, so we must have to compile the files in some sequence. So that the dependent files will get their dependencies fullfilled. For that purpose there is make file, You can open the make fill you will see there aree some dependencies given like.
One is dependent on two like
One.o : two.cpp.

And the ./configure is simple as it means, It configure the directory paths etc. To run make and configure is not a big deal. Just you have to write ./configure and make. And this will compile the whole stuff and will generate an executable. Then you can run that executable. And that's it.
Old 08-19-2004, 01:55 AM   #5
Registered: Mar 2004
Posts: 50

Original Poster
Rep: Reputation: 15
OK, I don't have access to Linux right now... but I can't wait to try! A couple more questions though...
1.) Are make and ./configure part of the kernel? Included in most Linux distros? Or do I need to install them?
2.) Can I compile a Perl (.pl) script like that or is there a different way to set those up? (more specificly aimsniff)
Old 08-19-2004, 02:02 AM   #6
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
The configure script is a part of the software package you download. The developers of the software are responsible for providing you with a script that customizes their software.

The make command is exactly that: it's a separate utility just like the find command, ls, grep, etc.

A perl script isn't a traditional executable. It's a file containing commands for another program to execute. Specifically, a perl script uses the perl command to perform whatever its actions are. You don't have to compile scripts; think of them as input into another program. You can make scripts executable by telling the system where to find the program it needs as the first line of the script (it usually looks like: #!/usr/bin/perl), and then setting execute permissions on the file. After doing that, the system knows enough that when you "execute" the script, it starts the right program, and that program follows the directions in the script.

Last edited by Dark_Helmet; 08-19-2004 at 02:52 AM.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling apt from source - where's the source? stynhx9000 Ubuntu 2 12-01-2005 08:32 AM
compiling from source manicman Linux - Newbie 2 10-26-2005 04:49 PM
Compiling from source... (64) Blash Linux - Software 8 06-11-2005 01:31 AM
compiling software from do i delete the folder w/ source? webazoid Linux - Software 2 07-01-2004 10:09 PM
Compiling Qt-3.2.1 from source Kroenecker Linux - Software 1 02-08-2004 08:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:00 PM.

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