pkgsysconfdir=$(sysconfdir)/avahi
servicedir=$(pkgsysconfdir)/services
-dbusservicedir=$(DBUS_SYS_DIR)
AM_CFLAGS= \
-I$(top_srcdir) \
-D_GNU_SOURCE \
-DAVAHI_SERVICE_DIRECTORY=\"$(servicedir)\" \
- -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\" \
- -DAVAHI_RUNTIME_DIR=\"$(localstatedir)/run/avahi\"
+ -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\"
+
AM_LDADD=-lexpat
if ENABLE_DBUS
avahi_SOURCES += dbus-protocol.c dbus-protocol.h
+dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = avahi-dbus.conf
EXTRA_DIST = $(dbusservice_DATA)
#define BUFFER_SIZE (20*1024)
-#define UNIX_SOCKET AVAHI_RUNTIME_DIR "/socket"
-
#define CLIENTS_MAX 50
typedef struct Client Client;
memset(&sa, 0, sizeof(sa));
sa.sun_family = AF_LOCAL;
- strncpy(sa.sun_path, UNIX_SOCKET, sizeof(sa.sun_path)-1);
+ strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1);
/* We simply remove existing UNIX sockets under this name. The
Avahi daemons makes sure that it runs only once on a host,
therefore sockets that already exist are stale and may be
removed without any ill effects */
- unlink(UNIX_SOCKET);
+ unlink(AVAHI_SOCKET);
if (bind(server->fd, &sa, sizeof(sa)) < 0) {
avahi_log_warn("bind(): %s", strerror(errno));
client_free(server->clients);
if (server->bind_successful)
- unlink(UNIX_SOCKET);
+ unlink(AVAHI_SOCKET);
if (server->fd >= 0)
close(server->fd);
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AC_PROG_GCC_TRADITIONAL
# libtool stuff
AC_PROG_LIBTOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
+AC_HEADER_SYS_WAIT
# Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
-AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strerror strrchr strstr uname setresuid setreuid])
+AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid])
AC_FUNC_CHOWN
AC_FUNC_STAT
DATADIRNAME=share
if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(INTERFACES_DIR, "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/", [path where glade files will be installed])
interfacesdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/"
- AC_SUBST(interfacesdir)
else
- AC_DEFINE_UNQUOTED(INTERFACES_DIR, "${prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/", [path where glade files will be installed])
interfacesdir="${prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/"
- AC_SUBST(interfacesdir)
fi
+ AC_DEFINE_UNQUOTED(INTERFACES_DIR, "${interfacesdir}", [path where glade files will be installed])
+ AC_SUBST(interfacesdir)
fi
AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes")
DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
fi
AC_SUBST(DBUS_SYS_DIR)
- AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
+ AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, `eval echo $DBUS_SYS_DIR` , [Where system.d dir for DBUS is])
if pkg-config dbus-1 --atleast-version=0.30 ; then
AC_DEFINE(DBUS_USE_NEW_API, 1, [Whether to use the new API for DBUS 0.30])
exit 1
else
case $with_distro in
- debian)
- ;;
- gentoo)
+ debian|gentoo)
;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
AC_SUBST(AVAHI_GROUP)
AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
+#
+# Avahi runtime dir
+#
+avahi_runtime_dir=`eval echo ${localstatedir}/run/avahi`
+AC_DEFINE_UNQUOTED(AVAHI_RUNTIME_DIR, "${avahi_runtime_dir}", [path where pid and socket will be stored])
+AC_DEFINE_UNQUOTED(AVAHI_SOCKET, "${avahi_runtime_dir}/socket", [path for avahi socket])
+
+
AC_CONFIG_FILES([
Makefile
avahi-core.pc