summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@freebsd.org>2009-08-12 10:04:15 -0400
committerDavid Zeuthen <davidz@redhat.com>2009-08-12 10:04:15 -0400
commitde9453f4c178fe76a4a36edb752e2ed75a329032 (patch)
tree70c9acfa847f5600dcafb5edbd7f99dfd1b7c9ba /configure.ac
parent933e21f13a44c556dcc1e4ce5c2493baf785ee76 (diff)
downloadpolkit-de9453f4c178fe76a4a36edb752e2ed75a329032.tar.gz
Bug 23093 – FreeBSD portability fixes
There are a few issues with building polkit-0.93 on FreeBSD: * No clearenv() function on FreeBSD * While FreeBSD has a /proc, it is deprecated, and kinfo_proc should be used instead. * FreeBSD's printf() functions do not support the %m notation. This is only supported for syslog(). * You can't call GINT_TO_POINTER() on a 64-bit value, as this will break on 64-bit OSes. The attached patch fixes these problems. First, a check for clearenv() is added to configure. Second, I moved the check for process uid to polkit/polkitunixprocess.c. This may not be ideal, but it seems to fit, and reduces code duplication. Third, I replaces all %m with %s ... g_strerror (errno). Finally, I replaced GINT_TO_POINTER() with GSIZE_TO_POINTER. Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c236341..3ea3818 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,6 +140,8 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
AC_SUBST(EXPAT_LIBS)
+AC_CHECK_FUNCS(clearenv)
+
if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi
@@ -323,6 +325,8 @@ if test x$with_os_type = x; then
with_os_type=pardus
elif test x$operating_system = xsolaris ; then
with_os_type=solaris
+ elif test x$operating_system = xfreebsd ; then
+ with_os_type=freebsd
else
with_os_type=unknown
fi