In article <[EMAIL PROTECTED]> you write:
typedef unsigned blkcnt_t;
this one give a redefinition error, but changing
AIDE_BLKCNT_TYPE bcount;
into
unsigned bcount;
solved it
(defined by AIDE_BLKCNT_TYPE in configure, but doesn't see how to patch it quickly, so i make a patch for db_config.h)
until next one
gcc -DHAVE_CONFIG_H -I. -I/Users/touche/tmp/my-dports/aide/work/aide-0.10/src -I.. -I/opt/local/include -I/Users/touche/tmp/my-dports/aide/work/aide-0.10/include -I/opt/local/include/ -I/Users/touche/tmp/my-dports/aide/work/aide-0.10 -I/Users/touche/tmp/my-dports/aide/work/aide-0.10/src -g -O2 -c db.c
In file included from db.c:45:
/Users/touche/tmp/my-dports/aide/work/aide-0.10/include/util.h:60: error: conflicting types for `strnstr'
/usr/include/string.h:93: error: previous declaration of `strnstr'
make[2]: *** [db.o] Error 1
make[1]: *** [all-recursive] Error 1
solved by a ifndef HAVE_STRNSTR in util.[hc]
compile goes fine after. will test it later
$ man 2 stat|grep blkcnt_t
Looking at the manpage for stat(2), it looks like
#include <sys/types.h> #include <sys/stat.h> typedef quad_t blkcnt_t;
is appropriate. On my linux system stat.st_blocks is a blkcnt_t; with OSX, stat.st_blocks is a quad_t.
$
$ grep -rn blkcnt_t /usr/include/*
grep: warning: /usr/include/gcc/darwin/2.95.2/g++/std: recursive directory loop
$
Regards
Julien
--- configure.orig Thu Feb 26 16:08:08 2004
+++ configure Thu Feb 26 16:08:21 2004
@@ -1616,7 +1616,7 @@
if test $ac_cv_prog_gcc = yes; then
- LD_STATIC_FLAG='-static'
+ #LD_STATIC_FLAG='-static'
case "$host_os" in
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
--- include/db_config.h.orig Wed Mar 3 07:53:39 2004 +++ include/db_config.h Wed Mar 3 07:53:52 2004 @@ -354,7 +354,7 @@ AIDE_OFF_TYPE size; AIDE_OFF_TYPE size_o; /* ... */ - AIDE_BLKCNT_TYPE bcount; + unsigned bcount; char* filename; char* linkname;
--- src/util.c.orig Wed Mar 3 07:58:01 2004
+++ src/util.c Wed Mar 3 07:58:46 2004
@@ -357,6 +357,7 @@
}
+#ifndef HAVE_STRNSTR
/* Like strstr but only do search for maximum of n chars.
haystack does not have to be NULL terminated
needle has to be NULL terminated. NULL in needle is not used in compare.
@@ -392,6 +393,7 @@
/* If we get this far no match was found so we return NULL */
return NULL;
}
+#endif
/* We need these dummy stubs to fool the linker into believing that
we do not need them at link time */
--- include/util.h.orig Wed Mar 3 07:48:21 2004 +++ include/util.h Wed Mar 3 07:48:44 2004 @@ -57,6 +57,8 @@ void init_sighandler(void); +#ifndef HAVE_STRNSTR char* strnstr(char* haystack,char* needle,int n); +#endif #endif
