Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
First thing you have to do is to cd into the source code directory
Then type
./configure
make
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
Makefile:
This is file that would be used to compile a source code.
Makefile is a seperate debate..so for the moment just think that it
is something necessary to compile a piece of source code
When you type "make" in the shell...it 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.
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.
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)
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 01:52 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.