Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile question 2

Status
Not open for further replies.

cdtech9198

IS-IT--Management
Feb 14, 2008
48
US
I apologize ahead of time for this beginner type question.

I have recently downloaded a patch for squid and not sure how to install it.

The directions say to compile squid using


>>> ./configure; make; make install

Since I am a newby I have never used make before. What does the above mean? Where do I insert the patch file.

thanks in advance. here is the link to the document.
 
Usually after downloading and unzipping a tarball, you are told to go to the directory that the file was unzipped to and perform the set of instructions you just mentioned. In most cases, there is a script that will configure all the files that will be needed for the compile process. These are configured to run on your specific machine. The script (program) that does this is called 'configure'. The './' in front of it tells the system that that you want to run the configure that is in the current directory, not one that may be in the user's path. The 'make' command takes all the files that were created by configure along with all the header and source files and sends them to the compiler. Many times the is also an install file. The 'make install' files just executes this and copies all the files to where they need to go. Sometimes there are things you may want to optionally compile into the executable. This is done at the ./configure stage and the options are usually listed in the docs that came with the package.
 
Read man patch. Patch changes the source code, so you must be cd-ed to the source of the squid tree that built your running squid.

If you don't have that, you need to download it again, look/save your squid.conf.

cd WHEREYOUUNTARREDSQUID
patch < PATHTOPATCHFILE
./configure
/usr/bin/make

If you have the old squid source (the one that was built) then it is easier:

cd WHEREYOUUNTARREDSQUID
patch < PATHTOPATCHFILE
/usr/bin/make

then for both to install:

/usr/bin/make install

configure looks at your system and builds makefiles. It figures out machine types, compilers, etc. and if you have the required tools.

make is a command that reads makefiles and builds things, usually binaries from sources. It is smart( well, if the makefile is correct), so it should understand dependencies (if the source doesn't change, it won't rebuild something).
 
Thank you for responding. I beleive squid was installed when I installed Fedora 8. I attempted to do a locate squid but all data yips past me. is there a way i can get it to show 1 page at a time and do page down? I am trying not to use the gui and doing everything from the command line since I've heard this is the best way to learn.

Thanks again for the info i will check the man pages for patch.
 
locate squid | more

BTW, if it was installed it probably was a binary distribution. You will have to build from source by downloading the squid tar ball and applying the patch yourself or running squid 3 either by building it or finding a binary
install of squid 3.

To build, you will probably need a C build environment (compiler, headers, libraries)

 
Ideally you should try and find an updated binary distribution that includes the patch, if possible.

Annihilannic.
 
Normally, I would look for a binary. But this is a log extension to awstats, it isn't a fixit patch. So the chances of you finding a binary distrib are probably nil.

eugene
 
Thanks guy for all your help. I am a bit nervous on compiling from source. I have backedup my squid.conf file and directory. I plan on builidng from source the same version that was installed via binary. Will the source build over write the binary version? Do I need to tell it where to install to?

Right now I am on the step that says "make install" but have not hit enter.

 

The configure steps determine where it will install,
the --prefix option.

You can get the old configure parameters by looking
at ./squid -v from your OLD squid binary. Save that output.

You can see what make will do, like:
make -n install
(sometimes make nests and this really does, however).

So you can always rerun configure like:

make clean
(rerun configure with new options)
make

and
make install

eugene

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top