Subject: Re: tnftp build fails on MacOS X 10.3.9 (bootstrap)
To: John D. Baker <jdbaker@mylinuxisp.com>
From: Todd Vierling <tv@duh.org>
List: tech-pkg
Date: 06/10/2005 22:45:32
On Fri, 10 Jun 2005, John D. Baker wrote:

> > The configure script looks for dirname (in libgen, for example),
> > and if it's not found it does AC_REPLACE_FUNCS(dirname),
> > so I don't understand why the latter isn't providing it if the former
> > doesn't find it.

Exactly:

=====
AC_SEARCH_LIBS(dirname, [gen], [have_dirname=yes], [have_dirname=no])
=====

> While MacOS X has dirname(3), it does not have libgen.dylib.  Instead
> dirname(3) is found in libSystem.dylib.  The header file <libgen.h>
> is still used, though, which leads to the conflict with tnftp.h

Unfortunately, this does not search the library System.  I think "-framework
System" is what's needed, right?  If so, a block like the following can be
added above the "Checks for libraries." part of configure.in:

=====
case $host in
*-*-darwin*) LDFLAGS="$LDFLAGS -framework System";;
esac
=====

Alternately, changing the AC_SEARCH_LIBS line above to read

=====
AC_SEARCH_LIBS(dirname, [gen System], [have_dirname=yes], [have_dirname=no])
=====

might do it too.  (Of course, re-running autoconf after these changes is
required.)

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com> <todd@vierling.name>