LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2012, 09:29 PM   #1
zero91
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
How to read source code of linux utilities?


I am trying to read some linux source code, not about the kernel, just some utilities such as ls, grep, wget,etc. But after I download the source code, I found there are so much things, I do not know where to start. There are makefile, m4, configure.ac files. Where could I start? Need I to learn some other things, such as linux auto tools? Thanks in advance.
 
Old 05-06-2012, 09:40 PM   #2
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
If you don;t know what a makefile is, start by learning the C language and gcc.
 
Old 05-07-2012, 12:05 AM   #3
zero91
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by towheedm View Post
If you don;t know what a makefile is, start by learning the C language and gcc.
I can program using makefile. But I don't know much about the auto tools in linux. I think the source code's makefile is created by auto tools, not by hand. So reading the makefile is very difficult.
 
Old 05-07-2012, 02:57 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Start reading!

For instance, start here: info automake

---

Now, let me please set the stage for you. Let's start here: http://en.wikipedia.org/wiki/Automake (Do not keep reading until after you have actually read that page!! I mean it! Scout's Honor!)

The magickal folks who wrote all those tools intended for them to "just work" on ... an IBM mainframe, an AS/400, your Kindle Fire, your Windows PC, your Macintosh, your portable phone (or any and every flavor), or any of the several-dozen(!) hardware platforms supported by Unix/Linux.

And ... they do!

Thought Question: How?

The answer ... is Automake.

When you install a new package from source-code, the first command that you execute is: ./Configure. And this executes a whole slew of "discovery" steps that determine exactly what your hardware and software environment is. Based on this, Automake constructs an appropriate Makefile, and everything else that is needed, so that "everything 'Just Works'" on your environment.

If what I just said sounds like "effin' brilliant Voodoo ..." ... trust me: it is. There be Gods in these woods. Infinitely More than Wyzards. These be not Mortal folk.
 
Old 05-13-2012, 08:21 PM   #5
zero91
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Smile

This help me a lot, thank you very much!

Quote:
Originally Posted by sundialsvcs View Post
Start reading!

For instance, start here: info automake

---

Now, let me please set the stage for you. Let's start here: http://en.wikipedia.org/wiki/Automake (Do not keep reading until after you have actually read that page!! I mean it! Scout's Honor!)

The magickal folks who wrote all those tools intended for them to "just work" on ... an IBM mainframe, an AS/400, your Kindle Fire, your Windows PC, your Macintosh, your portable phone (or any and every flavor), or any of the several-dozen(!) hardware platforms supported by Unix/Linux.

And ... they do!

Thought Question: How?

The answer ... is Automake.

When you install a new package from source-code, the first command that you execute is: ./Configure. And this executes a whole slew of "discovery" steps that determine exactly what your hardware and software environment is. Based on this, Automake constructs an appropriate Makefile, and everything else that is needed, so that "everything 'Just Works'" on your environment.

If what I just said sounds like "effin' brilliant Voodoo ..." ... trust me: it is. There be Gods in these woods. Infinitely More than Wyzards. These be not Mortal folk.
 
  


Reply



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
Where to find the source of gnu/linux shell utilities irfanhab Programming 1 03-16-2006 06:05 AM
where is the source code for utilities in a distro? (If they are included) dr_zayus69 Linux - Software 1 09-04-2005 10:45 AM
start to read the source code and have questions pipehappy Linux - Newbie 1 01-05-2005 02:19 AM
source code for read() function ? Mike Davies Linux - Software 1 11-03-2004 02:10 PM
Questions about how to read OS source code hegel Programming 1 10-28-2003 12:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:57 PM.

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
Open Source Consulting | Domain Registration