Subject: Darwin / OS/X Probes HAVE_DIRENT_H wrong in Bacula autoconf...
To: None <bacula-devel@lists.sourceforge.net>
From: Brian A. Seklecki <seklecki@collaborativefusion.com>
List: pkgsrc-users
Date: 11/21/2007 17:54:06
In find.h:

#ifdef HAVE_DIRENT_H
#include <dirent.h>
#define NAMELEN(dirent) (strlen((dirent)->d_name))
#endif

Change to explicit definitions -->

#include <dirent.h>
#define NAMELEN(dirent) (strlen((dirent)->d_name))

----------

# grep -ir HAVE_DIRENT_H work/bacula-2.2.6/*
work/bacula-2.2.6/autoconf/config.h.in:#undef HAVE_DIRENT_H
work/bacula-2.2.6/autoconf/config.h.in.save:#undef HAVE_DIRENT_H
work/bacula-2.2.6/autoconf/gnome-macros/gnome-support.m4:#ifdef 
HAVE_DIRENT_H
work/bacula-2.2.6/src/config.h:/* #undef HAVE_DIRENT_H */

The file is there:

# ls -al /usr/include/dirent.h
-r--r--r--  1 root  wheel  5348 Oct  5 22:45 /usr/include/dirent.h

I don't see a DIRENT check in config.log ... which may be the problem?

This is:

# uname -a
Darwin galvatron.pitbpa0.priv.collaborativefusion.com 9.1.0 Darwin Kernel 
Version 9.1.0: Wed Oct 31 17:48:21 PDT 2007; 
root:xnu-1228.0.2~1/RELEASE_PPC Power Macintosh


You either end up with no "DIR" defintion due to lack of #include dirent.h 
or:

==>Entering directory 
/usr/pkgsrc/sysutils/bacula-clientonly/work/bacula-2.2.6/src/findlib
Compiling find_one.c
find_one.c: In function 'int find_one_file(JCR*, FF_PKT*, int (*)(FF_PKT*, 
void*, bool), void*, char*, dev_t, bool)':
find_one.c:622: error: 'NAMELEN' was not declared in this scope
find_one.c:630: error: 'NAMELEN' was not declared in this scope
find_one.c:635: error: 'NAMELEN' was not declared in this scope
*** Error code 1