Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 3rd February 2011, 11:37 AM
mypass604 Offline
Registered User
 
Join Date: May 2010
Posts: 27
windows_vistachrome
How to compile source code files?

I have download loaded squid 2.6 source code file squid-2.6.STABLE22.tar.gz
I extract the file with the command

PHP Code:
[root@localhost home]#tar xvfz squid-2.6.STABLE22.tar.gz 
Now I can see a folder quid-2.6.STABLE22.

The issue is I want to complete the it.I can see Makefile.am , Makefile.in , configure,
configure.in and INSTALL .


There are more files and folders but I think that these are the files which I have to deal with.

I does't have any idea how can I compile the files or what ever steps should take after extracting the tar file..Please guide me.
Thanks many times in advance.
mypass
Reply With Quote
  #2  
Old 3rd February 2011, 11:49 AM
marriedto51 Offline
Registered User
 
Join Date: Jul 2009
Location: England, UK
Posts: 821
linuxfedorafirefox
Re: How to compile source code files?

The usual drill is
Code:
./configure && make
followed by
Code:
su -c 'make install'
if the code builds successfully, but you should read the INSTALL file for complete instructions.

PS: you might want to use a different forum for this (read the description of this forum).
Reply With Quote
  #3  
Old 3rd February 2011, 11:54 AM
mypass604 Offline
Registered User
 
Join Date: May 2010
Posts: 27
windows_vistachrome
Re: How to compile source code files?

thanks "marriedto51" for the reply. As you explain in your post

PHP Code:
./configure && make 
PHP Code:
su -'make install' 
I know that these may work but what the first and second command are doing ?
How can I check that It has been compile successfully ?
Reply With Quote
  #4  
Old 3rd February 2011, 12:08 PM
bob's Avatar
bob Online
Administrator (yeah, back again)
 
Join Date: Jul 2004
Location: Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
Age: 67
Posts: 21,215
linuxfedorafirefox
Re: How to compile source code files?

moved to General Support. Guides & Solutions is for answers, not questions.
__________________
Linux & Beer - That TOTALLY Computes!
Registered Linux User #362651


Don't use any of my solutions on working computers or near small children.
Reply With Quote
  #5  
Old 3rd February 2011, 12:20 PM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,076
linuxfedorafirefox
Re: How to compile source code files?

Do you have some specific reason to use an obsolete version of squid? Fedora 14 includes squid 3.1, and the latest version in the 2.* series is 2.7-STABLE9. The code you're trying to compile has several security-related bugs fixed in later releases.
Reply With Quote
  #6  
Old 3rd February 2011, 12:26 PM
marriedto51 Offline
Registered User
 
Join Date: Jul 2009
Location: England, UK
Posts: 821
linuxfedorafirefox
Re: How to compile source code files?

I'd agree with markkuk that you should consider installing the squid package from the fedora repositories instead.

But to answer your general points...

"./configure" runs a script that checks if and where various libraries are installed on your system, and prepares the makefiles that will tell the compiler how to build the source code.

Then "make" will generate a lot of output as it runs the compiler and linker. You can see if it succeeded or not by looking at the last few lines of output: a failure is usually pretty obvious. You could also try typing
Code:
echo $?
immediately after the make command has finished: a success is reported as '0' and any other number indicates some kind of failure.
Reply With Quote
  #7  
Old 3rd February 2011, 04:29 PM
mypass604 Offline
Registered User
 
Join Date: May 2010
Posts: 27
symbiansafari
Re: How to compile source code files?

thanks for the replies.well the issue is not squid for me.on the internet there r lot of softwares which are in source code so in that case i have to know how to compile and then install it.
My machine is old thats why i can't use latest fedora.
I shall be thankfull if u suggest me any web site from where i may lean step by step how to compile & install softwares especially for beginners.thanks

Last edited by mypass604; 3rd February 2011 at 04:34 PM.
Reply With Quote
  #8  
Old 3rd February 2011, 05:15 PM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,076
linuxfedorafirefox
Re: How to compile source code files?

There is no single universal way to compile and install software, each program has its own requirements. You should go to the web site of the specific package you are trying to compile and look for the installation instructions. For example, the instructions for compiling squid are in: http://wiki.squid-cache.org/SquidFaq/CompilingSquid
Reply With Quote
  #9  
Old 4th February 2011, 03:13 AM
JamesNZ's Avatar
JamesNZ Offline
Registered User
 
Join Date: Aug 2010
Location: Wellington, New Zealand
Age: 16
Posts: 889
windows_7chrome
Re: How to compile source code files?

And always, always look at the INSTALL or README files. You can open those from the terminal by
Code:
less whateverTextFile
EDIT: Its usually easier to install software from the repo's using yum, so try that whenever possible.
__________________
"For what is a man profited if he gains the whole world, but loses his own soul?"

- Jesus
Reply With Quote
  #10  
Old 4th February 2011, 03:57 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
linuxfedorafirefox
Re: How to compile source code files?

Quote:
Originally Posted by mypass604 View Post
thanks "marriedto51" for the reply. As you explain in your post

PHP Code:
./configure && make 
...
My usual method is

Quote:
./configure --help
Scratch head and stroke beard a long time figuring ot the useful options

Quote:
./configure --some=options
Then I read the long long output and wonder what the error messages mean and which extra packages are missing.

Then after approximately doing
Quote:
yum install \*-devel
after diddling the package version numbers and sometimes eve nhacking the config file then it's

Quote:
./configure --some=other_options
make
sudo make install

Point is that sometimes a source package just slips in, other times it takes a crowbar.

Use the binary if it meets your needs. If you want an education Go for it.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #11  
Old 4th February 2011, 08:52 AM
mypass604 Offline
Registered User
 
Join Date: May 2010
Posts: 27
windows_vistachrome
Re: How to compile source code files?

Thanks for the valuable suggestions. I read in the INSTALL fine and it say

PHP Code:
To build and install the squid Cache,type:

% ./
configure --prefix=/urs/local/squid
make all
%make install 
when I give the above command in my terminal it show me error message as.

PHP Code:
# % ./configure --prefix=/urs/local/squid
bashfg:  %.configureno such job 


please guide me

---------- Post added 4th February 2011 at 01:52 AM ---------- Previous post was 3rd February 2011 at 09:49 PM ----------

well sorry I forget it .But why users use % ? any special reason for it ?
I have install c compiler in my linux box. After that I apply the commands

#./configure --prefix=/usr/local/squid
#make all
#make install

all these work successfully.I can see squid folder in /usr/local folder. The new thing for me is that there is no squid.conf file in it but it is in /usr/local/squid/etc folder ?
kindly guide me.
Reply With Quote
Reply

Tags
code, compile, files, source

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile Xine source code. jakarins Using Fedora 2 2nd January 2012 02:18 PM
F9 - compile source code sd-user Using Fedora 1 29th July 2008 06:24 AM


Current GMT-time: 23:14 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat