build: Remove dependency on libcap-ng
This commit is contained in:
		
							
								
								
									
										13
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Makefile.am
									
									
									
									
									
								
							@@ -152,8 +152,12 @@ builtin_sources += plugins/u8500.c
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
if QMIMODEM
 | 
			
		||||
qmi_sources = drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c
 | 
			
		||||
 | 
			
		||||
builtin_modules += qmimodem
 | 
			
		||||
builtin_sources += drivers/qmimodem/qmimodem.h drivers/qmimodem/qmimodem.c
 | 
			
		||||
builtin_sources += $(qmi_sources) \
 | 
			
		||||
			drivers/qmimodem/qmimodem.h \
 | 
			
		||||
			drivers/qmimodem/qmimodem.c
 | 
			
		||||
 | 
			
		||||
builtin_modules += gobi
 | 
			
		||||
builtin_sources += plugins/gobi.c
 | 
			
		||||
@@ -471,7 +475,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) src/ofono.ver \
 | 
			
		||||
			src/cdma-sms.c src/private-network.c src/cdma-netreg.c \
 | 
			
		||||
			src/cdma-provision.c src/handsfree.c
 | 
			
		||||
 | 
			
		||||
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
 | 
			
		||||
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -ldl
 | 
			
		||||
 | 
			
		||||
src_ofonod_LDFLAGS = -Wl,--export-dynamic \
 | 
			
		||||
				-Wl,--version-script=$(srcdir)/src/ofono.ver
 | 
			
		||||
@@ -488,7 +492,7 @@ else
 | 
			
		||||
build_plugindir = $(plugindir)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @USB_CFLAGS@ \
 | 
			
		||||
AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @USB_CFLAGS@ \
 | 
			
		||||
					$(builtin_cflags) \
 | 
			
		||||
					-DOFONO_PLUGIN_BUILTIN \
 | 
			
		||||
					-DPLUGINDIR=\""$(build_plugindir)"\"
 | 
			
		||||
@@ -704,8 +708,7 @@ dundee_dundee_SOURCES = $(gdbus_sources) $(gatchat_sources) $(btio_sources) \
 | 
			
		||||
			dundee/dundee.h dundee/main.c dundee/dbus.c \
 | 
			
		||||
			dundee/manager.c dundee/device.c dundee/bluetooth.c
 | 
			
		||||
 | 
			
		||||
dundee_dundee_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
 | 
			
		||||
							@CAPNG_LIBS@ -ldl
 | 
			
		||||
dundee_dundee_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -ldl
 | 
			
		||||
 | 
			
		||||
if DATAFILES
 | 
			
		||||
dist_dbusconf_DATA += dundee/dundee.conf
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,6 @@ fi
 | 
			
		||||
		--mandir=/usr/share/man \
 | 
			
		||||
		--sysconfdir=/etc \
 | 
			
		||||
		--localstatedir=/var \
 | 
			
		||||
		--enable-capng \
 | 
			
		||||
		--enable-tools \
 | 
			
		||||
		--enable-dundee \
 | 
			
		||||
		--enable-tools \
 | 
			
		||||
		--disable-datafiles $*
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								configure.ac
									
									
									
									
									
								
							@@ -114,16 +114,6 @@ if (test -n "${path_systemdunit}"); then
 | 
			
		||||
fi
 | 
			
		||||
AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
 | 
			
		||||
 | 
			
		||||
AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
 | 
			
		||||
		[enable capabilities support]), [enable_capng=${enableval}])
 | 
			
		||||
if (test "${enable_capng}" = "yes"); then
 | 
			
		||||
	PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
 | 
			
		||||
				AC_MSG_ERROR(Capabilities library is required))
 | 
			
		||||
	AC_SUBST(CAPNG_CFLAGS)
 | 
			
		||||
	AC_SUBST(CAPNG_LIBS)
 | 
			
		||||
	AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
 | 
			
		||||
			[don't use udev support even if available]),
 | 
			
		||||
						[enable_udev=${enableval}])
 | 
			
		||||
 
 | 
			
		||||
@@ -33,10 +33,6 @@
 | 
			
		||||
 | 
			
		||||
#include <gdbus.h>
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_CAPNG
 | 
			
		||||
#include <cap-ng.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "dundee.h"
 | 
			
		||||
 | 
			
		||||
#define SHUTDOWN_GRACE_SECONDS 10
 | 
			
		||||
@@ -169,15 +165,6 @@ int main(int argc, char **argv)
 | 
			
		||||
	DBusError error;
 | 
			
		||||
	guint signal;
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_CAPNG
 | 
			
		||||
	/* Drop capabilities */
 | 
			
		||||
	capng_clear(CAPNG_SELECT_BOTH);
 | 
			
		||||
	capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
 | 
			
		||||
				CAP_NET_BIND_SERVICE, CAP_NET_ADMIN,
 | 
			
		||||
				CAP_NET_RAW, CAP_SYS_ADMIN, -1);
 | 
			
		||||
	capng_apply(CAPNG_SELECT_BOTH);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	context = g_option_context_new(NULL);
 | 
			
		||||
	g_option_context_add_main_entries(context, options, NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.c
									
									
									
									
									
								
							@@ -32,10 +32,6 @@
 | 
			
		||||
 | 
			
		||||
#include <gdbus.h>
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_CAPNG
 | 
			
		||||
#include <cap-ng.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "ofono.h"
 | 
			
		||||
 | 
			
		||||
#define SHUTDOWN_GRACE_SECONDS 10
 | 
			
		||||
@@ -173,15 +169,6 @@ int main(int argc, char **argv)
 | 
			
		||||
	DBusError error;
 | 
			
		||||
	guint signal;
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_CAPNG
 | 
			
		||||
	/* Drop capabilities */
 | 
			
		||||
	capng_clear(CAPNG_SELECT_BOTH);
 | 
			
		||||
	capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
 | 
			
		||||
				CAP_NET_BIND_SERVICE, CAP_NET_ADMIN,
 | 
			
		||||
				CAP_NET_RAW, CAP_SYS_ADMIN, -1);
 | 
			
		||||
	capng_apply(CAPNG_SELECT_BOTH);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef NEED_THREADS
 | 
			
		||||
	if (g_thread_supported() == FALSE)
 | 
			
		||||
		g_thread_init(NULL);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user