• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH:=$(call my-dir)
2
3# Build avahi-daemon, install the conf file, and generate the init rc file.
4
5include $(CLEAR_VARS)
6
7LOCAL_MODULE := avahi-daemon
8
9LOCAL_REQUIRED_MODULES := \
10        avahi-daemon.conf \
11        avahi-daemon.rc \
12
13LOCAL_SRC_FILES := \
14        main.c \
15        static-services.c \
16        static-hosts.c \
17        ini-file-parser.c \
18        setproctitle.c \
19        sd-daemon.c \
20        glob.c \
21        ../avahi-client/check-nss.c \
22        dbus-protocol.c \
23        dbus-util.c \
24        dbus-async-address-resolver.c \
25        dbus-async-host-name-resolver.c \
26        dbus-async-service-resolver.c \
27        dbus-domain-browser.c \
28        dbus-entry-group.c \
29        dbus-service-browser.c \
30        dbus-service-type-browser.c \
31        dbus-sync-address-resolver.c \
32        dbus-sync-host-name-resolver.c \
33        dbus-sync-service-resolver.c \
34        dbus-record-browser.c \
35        ../avahi-common/dbus.c \
36        ../avahi-common/dbus-watch-glue.c
37
38LOCAL_SHARED_LIBRARIES:=\
39        libavahi-common \
40        libavahi-core \
41        libexpat \
42        libdl \
43        libdaemon \
44        libdbus
45
46LOCAL_CFLAGS := \
47        -DHAVE_CONFIG_H \
48        -g \
49        -O2 \
50        -fstack-protector \
51        -std=c99 \
52        -Wall \
53        -W \
54        -Wextra \
55        -pedantic \
56        -pipe \
57        -Wformat \
58        -Wold-style-definition \
59        -Wdeclaration-after-statement \
60        -Wfloat-equal \
61        -Wmissing-declarations \
62        -Wmissing-prototypes \
63        -Wstrict-prototypes \
64        -Wredundant-decls \
65        -Wmissing-noreturn \
66        -Wshadow \
67        -Wendif-labels \
68        -Wpointer-arith \
69        -Wbad-function-cast \
70        -Wcast-qual \
71        -Wcast-align \
72        -Wwrite-strings \
73        -fdiagnostics-show-option \
74        -Wno-cast-qual \
75        -fno-strict-aliasing \
76        -DDEBUG_TRAP=__asm__\(\"int\ $3\"\) \
77        -DAVAHI_CONFIG_FILE=\"/system/etc/avahi-daemon.conf\" \
78        -DAVAHI_HOSTS_FILE=\"/data/misc/avahi/hosts\" \
79        -DAVAHI_SERVICE_DIR=\"/data/misc/avahi/services/\" \
80        -DUSE_EXPAT_H \
81        -DDBUS_VERSION_MAJOR=1 \
82        -DDBUS_VERSION_MINOR=6 \
83        -DDBUS_VERSION_MICRO=18 \
84        -DDBUS_API_SUBJECT_TO_CHANGE \
85        -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"unix:path=/dev/socket/dbus\"
86
87LOCAL_C_INCLUDES := \
88        $(LOCAL_PATH) \
89        external/avahi
90
91include $(BUILD_EXECUTABLE)
92
93# /system/etc/avahi-daemon.conf
94include $(CLEAR_VARS)
95LOCAL_MODULE := avahi-daemon.conf
96LOCAL_SRC_FILES := avahi-daemon.conf
97LOCAL_MODULE_CLASS := ETC
98LOCAL_MODULE_TARGET := $(TARGET_OUT_ETC)
99include $(BUILD_PREBUILT)
100
101# avahi-daemon.rc generation
102ifdef INITRC_TEMPLATE
103include $(CLEAR_VARS)
104LOCAL_MODULE := avahi-daemon.rc
105LOCAL_MODULE_CLASS := ETC
106LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
107
108include $(BUILD_SYSTEM)/base_rules.mk
109
110.PHONY: $(LOCAL_BUILT_MODULE)
111$(LOCAL_BUILT_MODULE): $(INITRC_TEMPLATE)
112	$(call generate-initrc-file,avahi-daemon,\
113          --syslog --no-drop-root,inet)
114endif
115