compiling coreutils
Hi gurus
I am trying to compile coreutils for studying purposes. I downloaded package (exact version which target system already contains) and tried following: Code:
./configure Code:
cd src Code:
export CFLAGS="-static -02 -g" So I tried to find particular file on system and link to /usr/include location for example: Code:
ln -s /usr/lib/syslinux/com32/include/syslinux/config.h /usr/include/config.h 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) Thanks a lot |
Archbang may be too lightweight. Anyway, you will need a complete glibc.
( May be the headers are omitted, to make it more lightweight ? ) Fedora : # yum install glibc-devel glibc-headers kernel-headers .. providing /usr/include/*, /usr/include/linux/*, /usr/include/asm/* |
Quote:
Code:
[cepido@localhost src]$ yum list installed | grep glibc |
Quote:
|
It's been several years since I dealt with coreutils (version 6.9) when I was building a Linux system based on CLFS (cross-compiled linux from scratch). From what I can recall, to build coreutils, these steps were performed:
1. Untar the package; 2. Change directory into coreutils-<version>; 3. Patch any source modules as necessary (check if your version of coreutils has any available patches); 4. ./configure 5. make The CLFS cookbook required that the following packages be built in this order: Code:
STAGE1 = tcl-testsuite \ |
Fedora 14 : That is coreutils-8.5
http://ftp.gnu.org/gnu/coreutils/coreutils-8.5.tar.gz > coreutils-8.5.tar.gz cd coreutils-8.5/ && ./configure && make : No errors. Version 8.9 : The same, no errors. ( http://ftp.gnu.org/gnu/coreutils/coreutils-8.9.tar.gz ) For the above, glibc* 2.12.90 was used. You have updated to 2.13, but I don't know why 2.13 should be that different ( or unstable ). .. |
Tried that
Code:
ARCHBANG ./configure make has been issued before |
When I scan through many of the config.h files on the system I'm writing this from, I see in most of them:
Code:
/* config.h. Generated from config.h.in by configure. */ Also, it looks like you are trying to run gcc independently, whereas there should be a properly configured Makefile that will let you just build everything. --- rod. |
Quote:
Or is that (cd coreutils-8.5/src/) from the output of 'make' ? I'd guess, that it is a must to run make in the top directory only. There is no /usr/include/config.h in Fedora 14 : Anyway coreutils is compiled with no errors. (The locale config.h is used ?) Code:
gcc -std=gnu99 -I../lib -static -O2 -g -MT uniq.o -MD -MP -MF .deps/uniq.Tpo -c -o uniq.o uniq.c You have headers in lib/ and src/, some includes a header from the other folder. ( Unless you already have run 'make' with no errors in the top directory. But then again : As the uniq.o already is present : Nothing will be created.) The 'gcc -std=..' command will however work, if make has been run, and uniq.o deleted: Then a new different uniq.o is created. EDIT : I wrote the above, while theNbomr was posting. .. |
Hi people - sorry for long response
I tried that: Code:
[root@localhost coreutils-8.5]# tar -xvzf coreutils-8.5.tar.gz Code:
[root@localhost src]# yum list installed coreutils-debuginfo - is it possible to compile only specific binary ? (id.c uniq.c cat.c etc) and not whole package ? - where to find another packages that I can compile from source ? for example passwd command ? I tried to search for passwd-0.78-1.fc14.i686 tar gz but no luck |
Quote:
The "tar package" for passwd-0.78-1.fc14.i686.rpm ( passwd-0.78.tar.bz2 ) It is inside the Fedora 14 source package passwd-0.78-1.fc14.src.rpm http://download.fedora.redhat.com/pu.../source/SRPMS/ |
Quote:
And is possible to compile only particular binary not whole package ? |
Quote:
You will have to use lots of time to rewrite files to do so. Makefile ? Then better compile the whole package : A few minutes. When coreutils-<version>/lib/configmake.h and ///src/version.h are generated, just then it is possible to compile a standalone object, like : gcc -std=gnu99 -I../lib -static -O2 -g -MT uniq.o -MD -MP -MF .deps/uniq.Tpo -c -o uniq.o uniq.c But you can of course do make in the top directory, then you have the two files : configmake.h, version.h, which you can use in another coreutils-<version>, same version. .. |
You should be able to find source tarballs for all Gnu software. To build these packages, the usual steps are (after unpacking the tarball, and making the source code package directory you current working directory), as a normal user:
Code:
./configure --- rod. |
Yes you can compile individual bins from coreutils. Jzs run configure, then cd into the various subdirs in the right order !-search the Makefile for the string 'subdir' to find the order. Probably po m4 etc, the main ones are 'lib' which needs to be done before 'src'. Once lib and all other required ones are done, cd into src and run 'make stat(or whichever pro you want). This is not always the case, but coreutils does have a separate Makefile rule for each binary.
|
All times are GMT -5. The time now is 10:35 AM. |