1

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.

PP.
  • 3,246
  • 6
  • 26
  • 31

2 Answers2

2

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.

PP.
  • 3,246
  • 6
  • 26
  • 31
1

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