Commit 73659e72 authored by Dan Williams's avatar Dan Williams

makefile cleanups

0.7 requires dbus 1.1 or greater (for system bus activation), so make that
explicit, and remove compat code for D-Bus 0.6 and earlier.  Consolidate
the various glib pkgconfig checks into one, since most anything will require
gthread, glib, and gobject anyway.  Fixup the docs makefile to be more
automake-compatible and let 'make clean' actually work correctly when
docs are built.
parent c100d0d7
if WITH_DOCS
all:
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard introspection/nm-*.xml)
# Figure out if we need ASYNC_INTROSPECT and add it later
GENERATED_FILES = \
docs/spec.html
docs/spec.html: $(XMLS) introspection/all.xml introspection/generic-types.xml introspection/errors.xml introspection/vpn-errors.xml tools/doc-generator.xsl introspection/generic-types.xml
@install -d docs
$(XSLTPROC) tools/doc-generator.xsl introspection/all.xml > $@
all: $(GENERATED_FILES)
clean:
rm -f $(GENERATED_FILES)
endif
SUBDIRS = marshallers
if NO_GIO
......@@ -28,30 +5,29 @@ SUBDIRS += gfilemonitor
endif
SUBDIRS += \
libnm-util \
libnm-glib \
src \
initscript \
test \
po \
man \
include \
introspection \
libnm-util \
libnm-glib \
src \
include \
introspection \
callouts \
system-settings \
tools \
policy \
docs/libnm-glib \
docs/libnm-util
EXTRA_DIST = \
CONTRIBUTING \
NetworkManager.pc.in \
intltool-extract.in \
intltool-merge.in \
initscript \
test \
po \
man \
docs
EXTRA_DIST = \
CONTRIBUTING \
NetworkManager.pc.in \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --with-tests=yes
DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes --with-docs=yes
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
......
......@@ -12,17 +12,17 @@ libexec_PROGRAMS = \
nm_dhcp_client_action_SOURCES = \
nm-dhcp-client-action.c
nm_dhcp_client_action_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
-DSYSCONFDIR=\"$(sysconfdir)\" \
nm_dhcp_client_action_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\"
nm_dhcp_client_action_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS)
$(GLIB_LIBS)
nm_avahi_autoipd_action_SOURCES = \
......@@ -30,7 +30,7 @@ nm_avahi_autoipd_action_SOURCES = \
nm_avahi_autoipd_action_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
-DSYSCONFDIR=\"$(sysconfdir)\" \
......@@ -38,7 +38,7 @@ nm_avahi_autoipd_action_CPPFLAGS = \
nm_avahi_autoipd_action_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS)
$(GLIB_LIBS)
nm_dispatcher_action_SOURCES = \
......@@ -50,7 +50,7 @@ nm_dispatcher_action_CPPFLAGS = \
-I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
-DSYSCONFDIR=\"$(sysconfdir)\" \
......@@ -58,7 +58,7 @@ nm_dispatcher_action_CPPFLAGS = \
nm_dispatcher_action_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/libnm-glib/libnm_glib.la \
$(top_builddir)/libnm-util/libnm-util.la
......
......@@ -38,7 +38,7 @@ dbus_init (void)
{
DBusConnection * connection;
DBusError error;
int ret, flags;
int ret;
dbus_connection_set_change_sigpipe (TRUE);
......@@ -54,16 +54,10 @@ dbus_init (void)
dbus_connection_set_exit_on_disconnect (connection, FALSE);
#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR < 60)
flags = DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT;
#else
flags = DBUS_NAME_FLAG_DO_NOT_QUEUE;
#endif
dbus_error_init (&error);
ret = dbus_bus_request_name (connection,
NM_AVAHI_AUTOIPD_DBUS_SERVICE,
flags,
DBUS_NAME_FLAG_DO_NOT_QUEUE,
&error);
if (dbus_error_is_set (&error)) {
fprintf (stderr, "Error: Could not acquire the NM DHCP client service. "
......
......@@ -233,7 +233,7 @@ dbus_init (void)
{
DBusConnection * connection;
DBusError error;
int ret, flags;
int ret;
dbus_connection_set_change_sigpipe (TRUE);
......@@ -249,16 +249,10 @@ dbus_init (void)
dbus_connection_set_exit_on_disconnect (connection, FALSE);
#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR < 60)
flags = DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT;
#else
flags = DBUS_NAME_FLAG_DO_NOT_QUEUE;
#endif
dbus_error_init (&error);
ret = dbus_bus_request_name (connection,
NM_DHCP_CLIENT_DBUS_SERVICE,
flags,
DBUS_NAME_FLAG_DO_NOT_QUEUE,
&error);
if (dbus_error_is_set (&error)) {
fprintf (stderr, "Error: Could not acquire the NM DHCP client service. "
......
......@@ -172,47 +172,11 @@ if test "$ac_have_iwevgenie" = no; then
AC_MSG_ERROR(wireless-tools library and development headers >= 28pre9 not installed or not functional)
fi
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.75)
##### Find out the version of DBUS we're using
dbus_version=`pkg-config --modversion dbus-1`
DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
if test "z$DBUS_VERSION_MAJOR" = "z"; then
DBUS_VERSION_MAJOR="0"
fi
if test "z$DBUS_VERSION_MINOR" = "z"; then
DBUS_VERSION_MINOR="0"
fi
if test "z$DBUS_VERSION_MICRO" = "z"; then
DBUS_VERSION_MICRO="0"
fi
if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
echo "Error: Couldn't determine the version of your DBUS package."
echo " This is probably an error in this script, please report it"
echo " along with the following information:"
echo " Base DBUS version ='$dbus_version'"
echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
exit 1
else
echo "Your dbus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
fi
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.10)
PKG_CHECK_MODULES(GLIB, gthread-2.0 glib-2.0 >= 2.10 gobject-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
......@@ -220,10 +184,6 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
PKG_CHECK_EXISTS(gio-2.0,[have_gio=yes],[have_gio=no])
if test x"$have_gio" = "xno"; then
AC_DEFINE([NO_GIO],[1],[Define if you don't have GIO])
......@@ -550,6 +510,7 @@ man/NetworkManager.8
man/nm-tool.1
po/Makefile.in
policy/Makefile
docs/Makefile
docs/libnm-glib/Makefile
docs/libnm-util/Makefile
NetworkManager.pc
......
SUBDIRS = libnm-glib libnm-util
if WITH_DOCS
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
OTHER_FILES= \
$(top_srcdir)/introspection/all.xml \
$(top_srcdir)/introspection/generic-types.xml \
$(top_srcdir)/introspection/errors.xml \
$(top_srcdir)/introspection/vpn-errors.xml \
$(top_srcdir)/tools/doc-generator.xsl \
$(top_srcdir)/introspection/generic-types.xml
GENERATED_FILES = spec.html
spec.html: $(XMLS) $(OTHER_FILES)
@install -d docs
$(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@
EXTRA_DIST = $(GENERATED_FILES)
CLEANFILES = $(GENERATED_FILES)
endif
......@@ -24,6 +24,6 @@ libgfilemonitor_la_SOURCES = \
inotify-sub.c \
inotify-sub.h
libgfilemonitor_la_CPPFLAGS = $(GTHREAD_CFLAGS)
libgfilemonitor_la_CPPFLAGS = $(GLIB_CFLAGS)
libgfilemonitor_la_LIBADD = $(GTHREAD_LIBS)
libgfilemonitor_la_LIBADD = $(GLIB_LIBS)
......@@ -24,7 +24,6 @@ lib_LTLIBRARIES = libnm_glib.la libnm_glib_vpn.la
libnm_glib_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(DBUS_CFLAGS) \
$(GCONF_CFLAGS) \
$(GNOME_KEYRING_CFLAGS)
......@@ -86,7 +85,6 @@ libnm_glib_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(GLIB_LIBS) \
$(GTHREAD_LIBS) \
$(DBUS_LIBS) \
$(GCONF_LIBS) \
$(GNOME_KEYRING_LIBS)
......
......@@ -14,7 +14,7 @@ test_settings_defaults_CPPFLAGS = \
$(DBUS_CFLAGS)
test_settings_defaults_LDADD = \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la
......@@ -26,7 +26,7 @@ test_crypto_CPPFLAGS = \
-D_GNU_SOURCE
test_crypto_LDADD = \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/libnm-util/libtest-crypto.la
......
......@@ -8,11 +8,11 @@ libmarshallers_la_SOURCES = \
nm-marshal-main.c
libmarshallers_la_CPPFLAGS = \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED
libmarshallers_la_LIBADD = $(GTHREAD_LIBS)
libmarshallers_la_LIBADD = $(GLIB_LIBS)
EXTRA_DIST = nm-marshal.list
CLEANFILES = $(BUILT_SOURCES)
......
......@@ -132,7 +132,7 @@ BUILT_SOURCES = \
NetworkManager_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(HAL_CFLAGS) \
$(OPENSSL_CFLAGS) \
$(LIBNL_CFLAGS) \
......@@ -150,7 +150,7 @@ NetworkManager_CPPFLAGS = \
NetworkManager_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(HAL_LIBS) \
$(LIBNL_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la \
......@@ -169,14 +169,14 @@ NetworkManager_LDFLAGS = -rdynamic
libexec_PROGRAMS = nm-crash-logger
nm_crash_logger_SOURCES = nm-crash-logger.c
nm_crash_logger_CPPFLAGS = \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED \
-DBINDIR=\"$(bindir)\" \
-DSBINDIR=\"$(sbindir)\" \
-DDATADIR=\"$(datadir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\"
nm_crash_logger_LDADD = $(GTHREAD_LIBS)
nm_crash_logger_LDADD = $(GLIB_LIBS)
NetworkManagerdir = $(datadir)/NetworkManager
......
......@@ -49,9 +49,9 @@ if TARGET_MANDRIVA
libnmbackend_la_SOURCES += NetworkManagerMandriva.c
endif
libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GTHREAD_LIBS)
libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GLIB_LIBS)
libnmbackend_la_CPPFLAGS = $(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(HAL_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
......
......@@ -15,7 +15,7 @@ libdhcp_manager_la_SOURCES = \
libdhcp_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(HAL_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DG_DISABLE_DEPRECATED \
......@@ -28,7 +28,7 @@ libdhcp_manager_la_CPPFLAGS = \
libdhcp_manager_la_LIBADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la
EXTRA_DIST = \
......
......@@ -10,7 +10,7 @@ libdnsmasq_manager_la_SOURCES = \
nm-dnsmasq-manager.c
libdnsmasq_manager_la_CPPFLAGS = \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
-DLOCALSTATEDIR=\"$(localstatedir)\"
libdnsmasq_manager_la_LIBADD = $(GTHREAD_LIBS)
libdnsmasq_manager_la_LIBADD = $(GLIB_LIBS)
......@@ -4,6 +4,11 @@ noinst_LTLIBRARIES = libnamed-manager.la
libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c
libnamed_manager_la_CPPFLAGS = $(DBUS_CFLAGS) $(GTHREAD_CFLAGS) -DNM_PKGDATADIR=\"$(pkgdatadir)\" -DNM_LOCALSTATEDIR=\"$(localstatedir)\" -DDBUS_API_SUBJECT_TO_CHANGE
libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GTHREAD_LIBS)
libnamed_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-DNM_LOCALSTATEDIR=\"$(localstatedir)\" \
-DDBUS_API_SUBJECT_TO_CHANGE
libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS)
......@@ -306,8 +306,7 @@ gboolean
nm_dbus_manager_start_service (NMDBusManager *self)
{
NMDBusManagerPrivate *priv;
int flags;
int request_name_result;
int result;
GError *err = NULL;
g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), FALSE);
......@@ -319,17 +318,11 @@ nm_dbus_manager_start_service (NMDBusManager *self)
return FALSE;
}
#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR < 60)
flags = DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT;
#else
flags = DBUS_NAME_FLAG_DO_NOT_QUEUE;
#endif
if (!dbus_g_proxy_call (priv->proxy, "RequestName", &err,
G_TYPE_STRING, NM_DBUS_SERVICE,
G_TYPE_UINT, flags,
G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE,
G_TYPE_INVALID,
G_TYPE_UINT, &request_name_result,
G_TYPE_UINT, &result,
G_TYPE_INVALID)) {
nm_warning ("Could not acquire the NetworkManager service.\n"
" Error: '%s'",
......@@ -338,7 +331,7 @@ nm_dbus_manager_start_service (NMDBusManager *self)
return FALSE;
}
if (request_name_result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
nm_warning ("Could not acquire the NetworkManager service as it is already taken.");
return FALSE;
}
......
......@@ -20,7 +20,7 @@ libsupplicant_manager_la_SOURCES = \
libsupplicant_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(HAL_CFLAGS) \
-DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-DNM_LOCALSTATEDIR=\"$(localstatedir)\" \
......@@ -28,6 +28,6 @@ libsupplicant_manager_la_CPPFLAGS = \
libsupplicant_manager_la_LIBADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la
......@@ -16,7 +16,7 @@ test_dhcp_options_CPPFLAGS = \
$(DBUS_CFLAGS)
test_dhcp_options_LDADD = \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/src/dhcp-manager/libdhcp-manager.la \
......
......@@ -20,11 +20,12 @@ libvpn_manager_la_SOURCES = \
libvpn_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED
libvpn_manager_la_LIBADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/libnm-util/libnm-util.la
......
......@@ -16,5 +16,5 @@ libkeyfile_io_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
libkeyfile_io_la_LIBADD = $(GTHREAD_LIBS)
libkeyfile_io_la_LIBADD = $(GLIB_LIBS)
......@@ -30,7 +30,7 @@ nm_system_settings_SOURCES = \
nm_system_settings_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(GMODULE_CFLAGS) \
$(POLKIT_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
......@@ -46,7 +46,7 @@ nm_system_settings_CPPFLAGS = \
nm_system_settings_LDADD = \
$(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
$(POLKIT_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la \
......
......@@ -6,7 +6,7 @@ INCLUDES = -I${top_srcdir} \
AM_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(GLIB_CFLAGS) \
$(HAL_CFLAGS) \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DBINDIR=\"$(bindir)\" \
......@@ -18,16 +18,24 @@ bin_PROGRAMS = nm-tool
noinst_PROGRAMS = nm-online libnm_glib_test
nm_tool_SOURCES = nm-tool.c
nm_tool_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) $(HAL_LIBS) \
$(top_builddir)/libnm-glib/libnm_glib.la \
$(top_builddir)/libnm-util/libnm-util.la
nm_tool_LDADD = \
$(DBUS_LIBS) \
$(GLIB_LIBS) \
$(HAL_LIBS) \
$(top_builddir)/libnm-glib/libnm_glib.la \
$(top_builddir)/libnm-util/libnm-util.la
nm_online_SOURCES = nm-online.c
nm_online_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) $(HAL_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la
nm_online_LDADD = \
$(DBUS_LIBS) \
$(GLIB_LIBS) \
$(HAL_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la
libnm_glib_test_SOURCES = libnm_glib_test.c
libnm_glib_test_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) \
$(top_builddir)/libnm-glib/libnm_glib.la \
$(top_builddir)/libnm-util/libnm-util.la
libnm_glib_test_LDADD = \
$(DBUS_LIBS) \
$(GLIB_LIBS) \
$(top_builddir)/libnm-glib/libnm_glib.la \
$(top_builddir)/libnm-util/libnm-util.la
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment