1819847 Members
2351 Online
109607 Solutions
New Discussion юеВ

Re: GNU find static

 
SOLVED
Go to solution
Maicon Stihler
Advisor

GNU find static

Hi,
I need to use GNU find utility and to ship it with my scripts. The problem is that I dont know if the right libs will be in place in the other systems.
I tried to compile GNU findutils on my HP-UX B.11.11 U 9000/811, but it failed. Im using the default C compiler (no gcc).

Can someone give me some tips on how to compile with static libs? Is there any patch that I must apply to be able to compile?

Thanks
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: GNU find static

Try this version with the HP compiler:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.1.5/

live free or die
harry d brown jr
Live Free or Die
Maicon Stihler
Advisor

Re: GNU find static

it failled with this message:

cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -DLOCALEDIR=\"/opt/findutils/share/locale\" -c -o quotearg_.o `test -f quotearg_.c || echo './'`quotearg_.c
(Bundled) cc: "quotearg.c", line 359: error 1000: Unexpected symbol: "mbstate".
(Bundled) cc: "quotearg.c", line 275: warning 30: Character constant contains undefined escape sequence.
(Bundled) cc: "quotearg.c", line 359: error 1588: "mbstate_t" undefined.
(Bundled) cc: "quotearg.c", line 360: error 1588: "mbstate" undefined.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
Joe Harrison_1
Advisor
Solution

Re: GNU find static

1) Download this depot:

http://hpux.cs.utah.edu/ftp/hpux/Gnu/findutils-4.1.5/findutils-4.1.5-sd-11.00.depot.gz

2) gunzip the depot

3) install the depot:

$ mkdir /mnt/depot
$ mv findutils-4.1.5-sd-11.00.depot /tmp/depot
$ swreg -l depot /tmp/depot/findutils-4.1.5-sd-11.00.depot
$ /usr/sbin/swinstall -s /tmp/depot/findutils-4.1.5-sd-11.00.depot

'/opt/findutils/bin/find' will work without additional libraries.

A. Clay Stephenson
Acclaimed Contributor

Re: GNU find static

Probably your least evil method would be to modify your Makefile to produce a statically linked version of the executable. As long as you compiled on an 11.0 machine as a 32-bit executable, this version would run on an HP-UX 11.x machine and would require no shared libraries.
If it ain't broke, I can fix that.
H.Merijn Brand (procura
Honored Contributor

Re: GNU find static

Grr. all those stupid ports have internationalization on by default, which is IMHO a stupid thing to do.

I've just uploaded version 4.2.20 that is only depending on libc and libld, both standard on HP-UX

Fetch it on my site:
http://mirrors.develooper.com/hpux/downloads.html look in the depot section

If you are in a hurry, you might get it from
http://www.cmve.net/~mbrand/downloads.html

Enjoy, Have FUN! H.merijn
Enjoy, Have FUN! H.Merijn
Maicon Stihler
Advisor

Re: GNU find static

I tried to compile it again and I got this error: (Bundled) cc: "strftime.c", line 610: error 1716: Automatic aggregate initialization is an ANSI feature.

It seems that my compiler doesnt support ANSI C :/

I dont know what to do to fix this problem, the offending line looks like this:
mbstate_t mbstate = mbstate_zero;
H.Merijn Brand (procura
Honored Contributor

Re: GNU find static

1. Look at my previous post.

2. Get a free ANSI C compiler (without localization and weird dependencies) from my site too:

http://mirrors.develooper.com/hpux/gcc-3.4.3-32-11.11-hppa2.0.tbz

Installation instructions here:
http://mirrors.develooper.com/hpux/#gcc_install

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
A. Clay Stephenson
Acclaimed Contributor

Re: GNU find static

You don't stand a prayer with the Bundled compiler; it is really only intended to build kernels and only understands K&R syntax. The gnu c compiler will suffice; all you have to do is add the "-static" option and no linking will be done against shared libraries. The downside is that your executable will be considerably larger.
If it ain't broke, I can fix that.