IRIX compilation and openbsd-compat/basename.h

Albert Chin openssh-unix-dev at thewrittenword.com
Thu Apr 10 01:53:23 EST 2003


On Wed, Apr 09, 2003 at 09:55:36AM -0500, Ben Lindstrom wrote:
> On Wed, 9 Apr 2003, Ayamura KIKUCHI wrote:
> 
> > > I was trying to compile openssh-3.6.1p1 on IRIX and ran across this
> > > error while compiling progressmeter.c:
> > >
> > > "/usr/include/libgen.h", line 35: error(1143): declaration is incompatible
> > >            with "char *basename(const char *)" (declared at line 9 of
> > >            "openbsd-compat/basename.h")
> > >    extern char *basename(char *);
> > >                 ^
> >
> > IRIX has the basename() function in libgen.  Autoconf script under
> > current cvs tree is not yet modified to detect it.
> >
> > --- openssh-3.6.1p/configure.ac.orig	2003-03-21 10:18:09.000000000 +0900
> > +++ openssh-3.6.1p/configure.ac	2003-04-09 23:12:09.041843000 +0900
> > @@ -619,6 +619,9 @@
> >
> >  AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
> >
> > +dnl IRIX has basename() in libgen
> > +AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
> > +
> 
> This is not right... Nor has any other solution I've seen is right.
> 
> basename needs to be checked in multiple places.  We need to check libc
> and gen at this point.
> 
> Otherwise it will break for other platforms.

AC_SEARCH_LIBS checks first with no libraries, then iterates over the
list of libraries contained in the 2nd argument.

The above patch compiles fine on Solaris 2.5.1-9/SPARC, IRIX 6.5,
HP-UX 10.20-11i, Tru64 UNIX 4.0D, 5.1, AIX 4.3.2, AIX 5.1, and Redhat
Linux 7.1.

-- 
albert chin (china at thewrittenword.com)




More information about the openssh-unix-dev mailing list