freebsd: don't link to libgeom

libgeom declares several symbols in GLib's namespace, including
g_close() and it therefore cannot be used from any program that also
uses GLib.

For now, disable the parts of the FreeBSD sysdep that use libgeom.
Hopefully the libgeom API will be changed soon.

https://bugzilla.gnome.org/show_bug.cgi?id=723685
This commit is contained in:
Ryan Lortie
2014-02-12 09:00:52 -05:00
parent a39f290683
commit 2e861977a6
3 changed files with 4 additions and 18 deletions

View File

@@ -160,20 +160,6 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
AC_CHECK_LIB(kvm, kvm_open, KVM_LIBS=-lkvm, KVM_LIBS=) AC_CHECK_LIB(kvm, kvm_open, KVM_LIBS=-lkvm, KVM_LIBS=)
AC_SUBST(KVM_LIBS) AC_SUBST(KVM_LIBS)
case "$host_os" in
kfreebsd*)
EXTRA_SYSDEPS_LIBS="-lgeom -ldevstat"
;;
freebsd*)
osreldate=`sysctl -n kern.osreldate 2>/dev/null`
if test -n "${osreldate}" && test ${osreldate} -ge 600000 ; then
EXTRA_SYSDEPS_LIBS="-lgeom -ldevstat"
fi
;;
esac
AC_SUBST(EXTRA_SYSDEPS_LIBS)
AC_CHECK_HEADERS(net/if_var.h,,, [ AC_CHECK_HEADERS(net/if_var.h,,, [
#include <net/if.h> #include <net/if.h>
#include <sys/types.h> #include <sys/types.h>

View File

@@ -11,7 +11,7 @@ libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c shm_limits.c \
libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) $(EXTRA_SYSDEPS_LIBS) libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS)
libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \
proclist.c procstate.c procuid.c \ proclist.c procstate.c procuid.c \
proctime.c procmem.c procsignal.c \ proctime.c procmem.c procsignal.c \

View File

@@ -11,7 +11,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/statvfs.h> #include <sys/statvfs.h>
#if __FreeBSD_version >= 600000 || defined(__FreeBSD_kernel__) #if 0
#include <libgeom.h> #include <libgeom.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <devstat.h> #include <devstat.h>
@@ -32,7 +32,7 @@ _glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const ch
{ {
int result; int result;
struct statfs sfs; struct statfs sfs;
#if __FreeBSD_version >= 600000 || defined(__FreeBSD_kernel__) #if 0
struct devstat *ds; struct devstat *ds;
void *sc; void *sc;
struct timespec ts; struct timespec ts;
@@ -49,7 +49,7 @@ _glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const ch
glibtop_warn_io_r (server, "statfs"); glibtop_warn_io_r (server, "statfs");
return; return;
} }
#if __FreeBSD_version >= 600000 || defined(__FreeBSD_kernel__) #if 0
ld[0] = 0; ld[0] = 0;
ld[1] = 0; ld[1] = 0;
result = geom_gettree (&gmp); result = geom_gettree (&gmp);