Compiling on FreeBSD

Havoc Pennington hp at redhat.com
Fri Sep 15 20:36:53 PDT 2006


Hi,

Thanks for sending in the fixes.

Steev Klimaszewski wrote:
> diff -ur dbus-0.93.orig/bus/bus.c dbus-0.93/bus/bus.c
> --- dbus-0.93.orig/bus/bus.c	Sat Sep 16 00:06:35 2006
> +++ dbus-0.93/bus/bus.c	Sat Sep 16 00:17:02 2006
> @@ -517,7 +517,12 @@
>    /* Watch all conf directories */
>    _dbus_list_foreach (bus_config_parser_get_conf_dirs (parser),
>  		      (DBusForeachFunction) bus_watch_directory,
> -		      NULL);
> +#ifdef __FreeBSD__
> +		      bus_context_get_loop (context)
> +#else
> +		      NULL
> +#endif
> +		      );
>  

I don't even have a guess what this change is about - can you explain? 
Why would this be BSD specific? What bug does it fix?

> +#ifdef __FreeBSD__
> +#undef LOCAL_CREDS
> +#endif

What's the explanation here? Does FreeBSD define LOCAL_CREDS but not 
really support them or ... ?

> +
>  #ifndef HAVE_SOCKLEN_T
>  #define socklen_t int
>  #endif
> diff -ur dbus-0.93.orig/dbus/dbus-sysdeps-util-unix.c dbus-0.93/dbus/dbus-sysdeps-util-unix.c
> --- dbus-0.93.orig/dbus/dbus-sysdeps-util-unix.c	Sat Sep 16 00:06:35 2006
> +++ dbus-0.93/dbus/dbus-sysdeps-util-unix.c	Sat Sep 16 00:08:25 2006
> @@ -502,8 +502,8 @@
>  dirent_buf_size(DIR * dirp, size_t *size)
>  {
>   long name_max;
> -#   if defined(HAVE_FPATHCONF) && defined(HAVE_DIRFD) \
> -    && defined(_PC_NAME_MAX)
> +#   if defined(HAVE_FPATHCONF) && (defined(HAVE_DIRFD) \
> +    || defined(dirfd)) && defined(_PC_NAME_MAX)

if dirfd is a macro then the right fix would be to change configure.in 
to detect it as a macro I think.

> -dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
> -dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la
> -dbus_launch_LDADD= $(DBUS_X_LIBS)
> +dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la -lpthread
> +dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la -lpthread
> +dbus_launch_LDADD= $(DBUS_X_LIBS) -lpthread

If this is needed the -lpthread will also be required in the .pc file 
for apps linking to dbus I would think. Does gthread-2.0.pc on FreeBSD 
have -lpthread in it also?

We'd probably have to autoconf PTHREAD_LIBS or something then put it 
here and in the .pc file, to avoid -lpthread on platforms where it isn't 
right. Though, I don't know on which platforms it's right... maybe all?

Havoc



More information about the dbus mailing list