Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having trouble compiling coreutils-8.5 on Solaris 5.10 on the Intel platform using cc.

Firstly I had the following error during ./configure:

checking whether <wchar.h> uses 'inline' correctly... no
configure: error: <wchar.h> cannot be used with this compiler (/tool/sunstudio12.1/bin/cc -xc99=all -g  -D_REENTRANT).

This seemed similar to the problem in this question. The solution was to edit configure and replace the reference of -xc99=all to -xc99=all,no_lib.

This permitted the configure to complete.

Then I ran /usr/sfw/bin/gmake and it progressed until I received the following message:

Making all in src
gmake[2]: Entering directory `/home/peterp/src/coreutils-8.5/src'
gmake  all-am
gmake[3]: Entering directory `/home/peterp/src/coreutils-8.5/src'
  CCLD     chroot
Undefined                       first referenced
 symbol                             in file
eaccess                             ../lib/libcoreutils.a(euidaccess.o)
ld: fatal: Symbol referencing errors. No output written to chroot

What could cause this problem?

PS I was only compiling coreutils because I wanted colour ls.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I found this post which implied that there might be a missing -lgen parameter required for libcoreutils.a to link.

I edited src/Makefile and changed the line:

LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@

to:

LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -lgen -o $@

and running gmake again worked through successfully to completion.

share|improve this answer

You can also compile, (well, install), one individual program if you want. Here's how I just install 'ginstall' on it's own:

cd /var/tmp
rm -rf /coreutils coreutils-8.5
untgz /usr/local/src/gnu/coreutils-8.5.tar.gz
cd coreutils-8.5
setenv LDFLAGS -lgen
./configure --prefix=/usr/local \
            --with-libiconv-prefix=/usr/local \
            --with-libintl-prefix=/usr/local
gmake
cd /var/tmp/coreutils-8.5/src
gmake install OPTIONAL_BIN_PROGS="" bin_PROGRAMS=ginstall pkglibdir=""
cd /var/tmp/coreutils-8.5/man
gmake install MAN=install.1
mv /usr/local/bin/install /usr/local/bin/ginstall
mv /usr/local/share/man/man1/install.1 /usr/local/share/man/man1/ginstall.1
share|improve this answer
    
very nice answer! Thank you! –  PP. Aug 9 '10 at 12:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.