LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-25-2005, 02:22 PM   #1
puishor
Member
 
Registered: Jun 2005
Location: Bucharest
Distribution: Debian,Knoppix,Slackware
Posts: 91

Rep: Reputation: 15
mkdir recompilation


HI !

I just downloaded the coreutils from gnu project site and I would like to recompile only mkdir.c utility ( in order to learn some code stuff , to change it , and to adjust to my own needs ) .

I'd searched through the Makefiles , and sources I found that I should recompile it with the following command:

Code:
 gcc -o mkdir mkdir.c dirname.h error.h makepath.h modechange.h quote.h system.h -lfetish
but I obtain only a bunch of errors.
What is wrong with that ?
Could somebody help me with this issue ?
Any suggestions are welcome.
 
Old 06-25-2005, 02:54 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
but I obtain only a bunch of errors.
What is wrong with that ?
Telling us what the errors are would be a good start.
 
Old 06-25-2005, 03:49 PM   #3
puishor
Member
 
Registered: Jun 2005
Location: Bucharest
Distribution: Debian,Knoppix,Slackware
Posts: 91

Original Poster
Rep: Reputation: 15
here is the command that I use:


Code:
gcc -o mkdir mkdir.c dirname.h error.h makepath.h modechange.h quote.h system.h -lfetish
on the top of mkdir.c file are all above listet header files included :
#include "dirname.h" l
#inlcude "error.h" ...



here are the errors
Code:
mkdir.c:20:20: config.h: No such file or directory
In file included from mkdir.c:25:
system.h:61:21: pathmax.h: No such file or directory
system.h:62:23: localedir.h: No such file or directory
system.h:160:22: exitfail.h: No such file or directory
In file included from mkdir.c:25:
system.h: In function `initialize_exit_failure':
system.h:167: error: `exit_failure' undeclared (first use in this function)
system.h:167: error: (Each undeclared identifier is reported only once
system.h:167: error: for each function it appears in.)
system.h:540:22: timespec.h: No such file or directory
system.h:655:21: gettext.h: No such file or directory
system.h:739:20: xalloc.h: No such file or directory
system.h:747:25: unlocked-io.h: No such file or directory
system.h:791:22: closeout.h: No such file or directory
system.h:792:25: version-etc.h: No such file or directory
mkdir.c: In function `usage':
mkdir.c:58: warning: passing arg 2 of `fprintf' makes pointer from integer without a cast
mkdir.c:61: warning: passing arg 1 of `printf' makes pointer from integer without a cast
mkdir.c:62: warning: passing arg 1 of `fputs' makes pointer from integer without a cast
mkdir.c:66: warning: passing arg 1 of `fputs' makes pointer from integer without a cast
mkdir.c:69: warning: passing arg 1 of `fputs' makes pointer from integer without a cast
mkdir.c:74: warning: passing arg 1 of `fputs' makes pointer from integer without a cast
mkdir.c:75: warning: passing arg 1 of `fputs' makes pointer from integer without a cast
mkdir.c:76: error: `PACKAGE_BUGREPORT' undeclared (first use in this function)
mkdir.c:76: warning: passing arg 1 of `printf' makes pointer from integer without a cast
mkdir.c: In function `main':
mkdir.c:97: error: `close_stdout' undeclared (first use in this function)
mkdir.c:114: warning: assignment makes pointer from integer without a cast
mkdir.c:117: error: `PACKAGE' undeclared (first use in this function)
mkdir.c:117: error: `VERSION' undeclared (first use in this function)
mkdir.c:125: warning: passing arg 3 of `error' makes pointer from integer without a cast
mkdir.c:141: warning: passing arg 3 of `error' makes pointer from integer without a cast
mkdir.c:172: warning: passing arg 3 of `error' makes pointer from integer without a cast
mkdir.c:192: warning: passing arg 3 of `error' makes pointer from integer without a cast
gcc: compilation of header file requested
gcc: compilation of header file requested
gcc: compilation of header file requested
gcc: compilation of header file requested
gcc: compilation of header file requested
gcc: compilation of header file requested
Code:
gcc -o mkdir mkdir.c dirname.h error.h makepath.h modechange.h quote.h system.h -lfetish
Code:
gcc -o mkdir mkdir.c dirname.h error.h makepath.h modechange.h quote.h system.h -lfetish

Any suggestions ?
 
Old 06-25-2005, 03:54 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
mkdir.c:20:20: config.h: No such file or directory
Looks like in mkdir.c at line 20, there's an include config.h, and config.h is missing.
 
Old 06-25-2005, 04:37 PM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
I've tried something similar to what you are. The difference is, I was trying to get the shred utility instead of mkdir.

You're causing yourself more grief than necessary. Just do the normal:
./configure
make

And work from there. The config.h that's missing is created by the configure script. Also, I would bet the Makefiles pass other command line settings to the sub-makes for each individual utility.

Bottom line, do the configure script and the initial make. Then, from that point on, make your changes to mkdir.c or whatever. Let make do the work of recompiling based on dependencies..
 
1 members found this post helpful.
  


Reply


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
mkdir -p ? shanenin Linux - Software 4 10-19-2011 11:41 AM
mkdir command digitalgravy Linux - General 5 08-12-2004 01:03 PM
mkdir help... Linux~Powered Linux - Software 2 06-13-2004 11:27 AM
mkdir doesn't work Kristian2 Slackware - Installation 7 06-10-2004 12:42 PM
mkdir help ITJedi Linux - Software 1 05-14-2004 05:19 PM


All times are GMT -5. The time now is 02:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration