Bug 532 - Conflicting basename and dirname on solaris
Summary: Conflicting basename and dirname on solaris
Status: CLOSED DUPLICATE of bug 531
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: UltraSPARC Solaris
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-03 08:24 AEST by Michael Bender
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bender 2003-04-03 08:24:42 AEST
While building openssh-3.6p1 or openssh-3.6.1p1 on Solaris 2.5.1 I get the
following errors:

--
In file included from progressmeter.c:66:
/usr/include/libgen.h:26: conflicting types for `basename'
openbsd-compat/basename.h:9: previous declaration of `basename'
/usr/include/libgen.h:50: conflicting types for `dirname'
openbsd-compat/dirname.h:3: previous declaration of `dirname'
--

and the build fails.

Based on information from the openssh-unix-dev mailing list, I edited config.h
and added "#define HAVE_BASENAME 1" and "#define HAVE_DIRNAME 1".  After doing
this, the compile goes farther only to fail at the following point:

--
gcc -o sshd sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o sshpty.o
sshlogin.o servconf.o serverloop.o uidswap.o auth.o auth1.o auth2.o
auth-options.o session.o auth-chall.o auth2-chall.o groupaccess.o auth-skey.o
auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o auth2-none.o auth2-passwd.o
auth2-pubkey.o monitor_mm.o monitor.o monitor_wrap.o monitor_fdpass.o kexdhs.o
kexgexs.o auth-krb5.o auth-krb4.o loginrec.o auth-pam.o auth2-pam.o auth-sia.o
md5crypt.o -L. -Lopenbsd-compat/ -L/usr/site/openssl/lib -R/usr/site/openssl/lib
-L/usr/site/zlib/lib -R/usr/site/zlib/lib  -L/usr/local/lib -R/usr/local/lib
-lssh -lopenbsd-compat   -lposix4 -lz -lsocket -lnsl  -lcrypto
auth.o: In function `secure_filename':
/home/pancake/benderm/Zip/openssh-3.6.1p1/auth.c:453: undefined reference to
`dirname'
collect2: ld returned 1 exit status
--

If I edit Makefile and add -lgen to LIBS, the compile finishes.

It looks like the configure script needs to check for the existence of basename
and dirname in libgen and adjust the Makefile and config.h accordingly.
Comment 1 Darren Tucker 2003-05-04 10:16:41 AEST

*** This bug has been marked as a duplicate of 531 ***
Comment 2 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED