Hi gurus
I am trying to compile coreutils for studying purposes. I downloaded package (exact version which target system already contains) and tried following:
./configure
make
but compiling ands with some header file dependency problem. Then I tried compile particular binary
maybe further more header files I dont know - but the result is the same header file problem.
I tried the metioned procedure on Archbang and Fedora (on both the coreutils was the same version whih is already installed and is working properly)
If you tell us what it actually did, maybe we can actually help you. But my crystal ball is still in for maintenance so I can't tell you why those errors were happening, or what they even were. "some header file dependency problem" doesn't cut it. There might be reasons you're missing a specific header. I can't tell you why you might be missing any random header.
Please don't throw random symlinks into /usr/include. Take out the ones you put before you forget where they are. They'll come back to haunt you later.
Are you sure that ./configure succeeded? config.h is one of the files that ought to be autogenerated by it. Run ./configure again and check closely if it bombs out.
Also, run 'make' from the base directory where you extracted that, not basedir/src. The base makefile might have exported something important.
would be nice if you paste the result of the configure script. Also check the exit status and try to locate the "missing header" using a simple find if you can find it.
[root@localhost coreutils-8.5]# tar -xvzf coreutils-8.5.tar.gz
[root@localhost coreutils-8.5]# cd coreutils-8.5
[root@localhost coreutils-8.5]# ./configure
long output
long output
long output
configure: WARNING: libgmp development library was not found or not usable.
configure: WARNING: GNU coreutils will be built without GMP support.
long output
long output
[root@localhost coreutils-8.5]# echo $0
0
[root@localhost coreutils-8.5]# make
long utput
long utput
long utput
make[4]: Entering directory `/root/coreutils-8.5/gnulib-tests'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/root/coreutils-8.5/gnulib-tests'
make[3]: Leaving directory `/root/coreutils-8.5/gnulib-tests'
make[2]: Leaving directory `/root/coreutils-8.5/gnulib-tests'
make[2]: Entering directory `/root/coreutils-8.5'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/root/coreutils-8.5'
make[1]: Leaving directory `/root/coreutils-8.5'
[root@localhost coreutils-8.5]# echo $?
0
[root@localhost coreutils-8.5]# src/whoami
root
Seems make works. This package has been installed since last post.
id.c, cat.c, and uniq.c aren't binaries so you're barking up the wrong tree. You're also assuming all the source code for id resides in id.c and so forth, which isn't necessarily true, they may have other source files in common.
You might try 'cd src ; make id'
Just as the 'id' utility doesn't reside in id-0.78-1.fc14.i686.tar.gz, not every individual program has its own tiny individual package. I think passwd belongs to the shadow password tools.
[cepido@localhost src]$ make id
cc id.c -o id
id.c:20:20: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [id] Error 1
[cepido@localhost src]$ echo $?
2
After ./configure
[cepido@localhost src]$ make id
CC id.o
id.c:26:29: fatal error: selinux/selinux.h: No such file or directory
compilation terminated.
make: *** [id.o] Error 1
[cepido@localhost src]$ echo $?
2
Hi guys and sorry for very long reply and for weird questions
My goal was to modify particular binary from package and compile only particular binary, because this is less time consuming than compile whole package.
Now I am able to do it: ./configure && make && cd src && change something in binary.c and compile it via make binary_name.
Thanks all for patience and sorry again for weird questions.