Findutils

From Genunix

findutils - A set of utilities for searching a filesystem

Contents

Rating

4 points (out of 4)

Rating scheme: 4 points means the source builds seamlessly on Solaris Express (OpenSolaris). Points are subtracted as follows:

  • Minus 1 if the source doesn't come with an automated way to localize the build (e.g. configure)
  • Minus 1 if the source won't compile with Sun's cc (this usually means the code is gcc-centric)
  • Minus 1 if a minor patch is required, or
  • Minus 2 if a major patch(es) is required

How to build findutils-4.2.27 on Solaris Express

Build Environment (platform, compiler, tools, PATH, ld)

Configure and compile steps (on x86 hardware)

/usr/bin/gzip -dc findutils-4.2.27.tar.gz | /usr/sfw/bin/gtar xf -

cd findutils-4.2.27


export CFLAGS="-i -xO4 -xspace -xstrconst -xpentium -mr"
export LDFLAGS="-Wl,-zignore -Wl,-zcombreloc -Wl,-Bdirect -R/usr/gnu/lib"

./configure --prefix=/usr/gnu  \
            --mandir=/usr/gnu/share/man \
	    --infodir=/usr/gnu/share/info \
	    --libexecdir=/usr/gnu/lib

make

Other configure options

output of ./configure --help

Directory paths that findutils installs to

bin
lib
share/info
share/man/man1
share/man/man5

Other 3rd party software findutils requires

(none)

Possible Portability Issues

We had a report of problems in the Sun Studio forums. Not sure what version of findutils these were detected in. The thread is here:

http://forum.java.sun.com/thread.jspa?threadID=5094621

I installed findutils from sunfreeware.com onto my Solaris 10 x86 machine but had to fix some of the hard coded defaults in the /usr/local/bin/updatedb command. I commented out the section below that used "-print0" and had to change /usr/local/bin/sort to /usr/bin/sort.

[code]
if true
then
# sort="/usr/local/bin/sort -z"
# print_option="-print0"
# frcode_options="-0"
# else
#sort="/usr/local/bin/sort"
sort="/usr/bin/sort"
print_option="-print"
frcode_options=""
fi
[/code]

I then used this crontab entry:

30 3 * * * /usr/local/bin/updatedb --prunepaths="/tmp /usr/tmp /var/tmp /system /proc /net"

You may want to include /cdrom as well if you don't want that indexed. The index was created as /usr/local/var/locatedb.