]> git.meshlink.io Git - catta/commitdiff
* cleaned configure.ac
authorSebastien Estienne <sebastien.estienne@gmail.com>
Wed, 6 Jul 2005 15:46:31 +0000 (15:46 +0000)
committerSebastien Estienne <sebastien.estienne@gmail.com>
Wed, 6 Jul 2005 15:46:31 +0000 (15:46 +0000)
* fix Avahi runtime dir
* use AM_CFLAGS instead of config.h.in to define paths (interfaces, socket, pid)

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@165 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/Makefile.am
avahi-daemon/main.c
avahi-discover/Makefile.am
avahi-discover/main.c
avahi-dnsconfd/Makefile.am
configure.ac

index 3762ba531fc3c17135023d5869aeec4e5968bcac..2f094905dbd718e9a5b434209763c479353b6f06 100644 (file)
@@ -22,6 +22,8 @@ servicedir=$(pkgsysconfdir)/services
 
 AM_CFLAGS= \
        -I$(top_srcdir) \
+       -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
+       -DAVAHI_SOCKET=\"$(avahi_socket)\" \
        -DAVAHI_SERVICE_DIRECTORY=\"$(servicedir)\" \
        -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\"
 
index ce82664c40518458c8dd4f747c55c56112d867a5..ab17a9c2577da481b09d264b9f8d3f1039af3bf4 100644 (file)
@@ -625,7 +625,7 @@ static gint drop_root(void) {
 }
 
 static const char* pid_file_proc(void) {
-    return AVAHI_RUNTIME_DIR"/avahi-daemon.pid";
+    return AVAHI_DAEMON_RUNTIME_DIR"/pid";
 }
 
 static gint make_runtime_dir(void) {
@@ -649,20 +649,20 @@ static gint make_runtime_dir(void) {
     u = umask(0000);
     reset_umask = TRUE;
     
-    if (mkdir(AVAHI_RUNTIME_DIR, 0755) < 0 && errno != EEXIST) {
-        avahi_log_error("mkdir(\""AVAHI_RUNTIME_DIR"\"): %s", strerror(errno));
+    if (mkdir(AVAHI_DAEMON_RUNTIME_DIR, 0755) < 0 && errno != EEXIST) {
+        avahi_log_error("mkdir(\""AVAHI_DAEMON_RUNTIME_DIR"\"): %s", strerror(errno));
         goto fail;
     }
     
-    chown(AVAHI_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
+    chown(AVAHI_DAEMON_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
 
-    if (stat(AVAHI_RUNTIME_DIR, &st) < 0) {
+    if (stat(AVAHI_DAEMON_RUNTIME_DIR, &st) < 0) {
         avahi_log_error("stat(): %s\n", strerror(errno));
         goto fail;
     }
 
     if (!S_ISDIR(st.st_mode) || st.st_uid != pw->pw_uid || st.st_gid != gr->gr_gid) {
-        avahi_log_error("Failed to create runtime directory "AVAHI_RUNTIME_DIR".");
+        avahi_log_error("Failed to create runtime directory "AVAHI_DAEMON_RUNTIME_DIR".");
         goto fail;
     }
 
index 338f528924bbd1be588d7d3af3409c35e42cc434..7890522fc7aff350aa5476f18bc05e89de332be9 100644 (file)
@@ -17,7 +17,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-AM_CFLAGS=-I$(top_srcdir)
+AM_CFLAGS=-I$(top_srcdir) \
+       -DAVAHI_INTERFACES_DIR=\"$(interfacesdir)\"
 
 AM_CFLAGS+=$(GLIB20_CFLAGS) $(GTK20_CFLAGS) $(GLADE20_CFLAGS)
 AM_LDADD=$(GLIB20_LIBS) $(GTK20_LIBS) $(GLADE20_LIBS)
index 05ad9674714621dc0a4f750b33e74a348be2c6b1..5e99bf80170c94fc853350cf9081cd3bc6bd8269 100644 (file)
@@ -253,7 +253,7 @@ int main(int argc, char *argv[]) {
     gtk_init(&argc, &argv);
     glade_init();
 
-    xml = glade_xml_new(INTERFACES_DIR"avahi-discover.glade", NULL, NULL);
+    xml = glade_xml_new(AVAHI_INTERFACES_DIR"avahi-discover.glade", NULL, NULL);
     main_window = glade_xml_get_widget(xml, "main_window");
     g_signal_connect(main_window, "delete-event", (GCallback) main_window_on_delete_event, NULL);
     
index 7a2185f1cc7d6199a502b30dc3622c8a33f0c0bd..3b3c79e4d5d1700f1e29a22a32fea1f6804b1791 100644 (file)
@@ -21,6 +21,8 @@ pkgsysconfdir=$(sysconfdir)/avahi
 
 AM_CFLAGS= \
        -I$(top_srcdir) \
+       -DAVAHI_RUNTIME_DIR=\"$(avahi_runtime_dir)/\" \
+       -DAVAHI_SOCKET=\"$(avahi_socket)\" \
        -DAVAHI_DNSCONF_SCRIPT=\"$(pkgsysconfdir)/dnsconf.action\"
 
 # GLIB 2.0
index d477743769d2a3bb995522400abe9aa95ae13b8e..e64fcdeacace80e333c96ce4d0b6c04e1611af8a 100644 (file)
@@ -90,13 +90,7 @@ if test "x$ENABLE_GTK" = "xyes"; then
         AC_SUBST(GLADE20_CFLAGS)
         AC_SUBST(GLADE20_LIBS)
 
-       DATADIRNAME=share
-       if test "x${prefix}" = "xNONE"; then
-          interfacesdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/"
-       else
-          interfacesdir="${prefix}/${DATADIRNAME}/${PACKAGE}/interfaces/"
-       fi
-       AC_DEFINE_UNQUOTED(INTERFACES_DIR, "${interfacesdir}", [path where glade files will be installed])
+       interfacesdir="${datadir}/${PACKAGE}/interfaces/"
        AC_SUBST(interfacesdir)
 
 fi
@@ -135,7 +129,6 @@ if test "x$ENABLE_DBUS" = "xyes"; then
           DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
        fi
        AC_SUBST(DBUS_SYS_DIR)
-       AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, `eval echo $DBUS_SYS_DIR` , [Where system.d dir for DBUS is])
 
         AC_SUBST(DBUS_CFLAGS)
        AC_SUBST(DBUS_LIBS)
@@ -219,10 +212,10 @@ 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])
-
+avahi_runtime_dir="${localstatedir}/run"
+avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
+AC_SUBST(avahi_runtime_dir)
+AC_SUBST(avahi_socket)
 
 AC_CONFIG_FILES([
 Makefile