1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# dhcpcd-6.8.2 is D-Bus enabled and compatible with Brillo daemons. dhcpcd
16# is the standard version of this daemon used in Android.
17
18LOCAL_PATH := $(call my-dir)
19
20include $(CLEAR_VARS)
21LOCAL_MODULE := dhcpcd-6.8.2
22LOCAL_SRC_FILES := \
23    common.c \
24    control.c \
25    dhcpcd.c \
26    duid.c \
27    eloop.c \
28    if.c \
29    if-options.c \
30    dhcp-common.c \
31    auth.c \
32    if-linux.c \
33    if-linux-wext.c \
34    arp.c \
35    dhcp.c \
36    ipv4.c \
37    ipv4ll.c \
38    ifaddrs.c \
39    crypt/md5.c \
40    crypt/hmac_md5.c \
41    compat/closefrom.c \
42    compat/strtoi.c \
43    dhcpcd-embedded.c \
44    compat/posix_spawn.c
45
46# Always support IPv4.
47LOCAL_CFLAGS += -DINET
48
49ifeq ($(DHCPCD_USE_SCRIPT), yes)
50LOCAL_SRC_FILES += script.c
51else
52LOCAL_SRC_FILES += script-stub.c
53endif
54
55ifeq ($(DHCPCD_USE_IPV6), yes)
56LOCAL_SRC_FILES += ipv6.c ipv6nd.c dhcp6.c
57LOCAL_SRC_FILES += crypt/sha256.c
58LOCAL_C_INCLUDES += $(LOCAL_PATH)/crypt
59LOCAL_CFLAGS += -DINET6
60endif
61
62ifeq ($(DHCPCD_USE_DBUS), yes)
63LOCAL_SRC_FILES += dbus/dbus-dict.c dbus/rpc-dbus.c
64LOCAL_CFLAGS += -DCONFIG_DBUS -DPASSIVE_MODE
65LOCAL_SHARED_LIBRARIES += libdbus
66else
67LOCAL_SRC_FILES += rpc-stub.c
68endif
69
70# Compiler complains about implicit function delcarations in dhcpcd.c,
71# if-options.c, dhcp-common.c, and crypt/sha256.c.
72LOCAL_CFLAGS += -Wno-implicit-function-declaration
73# Compiler complains about signed-unsigned comparison in dhcp-common.c.
74LOCAL_CFLAGS += -Wno-sign-compare
75# Compiler complains about unused parameters in function stubs in rpc-stub.c.
76LOCAL_CFLAGS += -Wno-unused-parameter
77# Compiler complains about possibly uninitialized variables in rpc-dbus.c.
78LOCAL_CFLAGS += -Wno-maybe-uninitialized
79
80LOCAL_SHARED_LIBRARIES += libc libcutils libnetutils
81include $(BUILD_EXECUTABLE)
82
83# Each build target using dhcpcd-6.8.2 should define its own source
84# and destination for its dhcpcd.conf file.
85# include $(CLEAR_VARS)
86# LOCAL_MODULE := dhcpcd-6.8.2.conf
87# LOCAL_MODULE_CLASS := ETC
88# LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2
89# LOCAL_SRC_FILES := android.conf
90# include $(BUILD_PREBUILT)
91