[sane-devel] Compiling sane-desc on OS/2

Henning Meier-Geinitz henning@meier-geinitz.de
Sun, 7 Jul 2002 00:21:17 +0200


On Sat, Jul 06, 2002 at 11:09:01PM +0200, Franz Bakan wrote:
> >It's compiled by running "make sane-desc". Have a look at its options
> >with "sane-desc --help".
> sane-desc does not compile on OS/2

I have to admit that I haven't tested with anything but Linux. So I'm
not that surprised.

> can you add
> AC_DEFINE(strcasecmp,stricmp,[Define for OS/2 only])
> to configure.in?


> 2.
> OS/2 has no libgen.h
> If I remove this include sane-desc compiles
> but it does not link. I get
> sane-desc.o: Undefined symbol _basename referenced from text segment
> I assume that's because of to libgen.h
> What does basename do?

"dirname and basename break a null-terminated pathname string into
directory and filename components.  In the usual case, dirname returns
the string up to, but not including, the final '/', and basename
returns the compo­ nent following the final '/'. Trailing '/'
characters are not counted as part of the pathname. " (from the man

It's used to remove the path from the program name. I've used the
approach with strrchr now. Won't work on OS/2 beacuse of "/" instead
of "\" I guess. But you probably don't mind if sane-desc prints its
full path name in its debug messages.