Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 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. |
Samuel Tan | c869152 | 2015-08-27 09:11:44 -0700 | [diff] [blame] | 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. |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 17 | |
| 18 | LOCAL_PATH := $(call my-dir) |
| 19 | |
| 20 | include $(CLEAR_VARS) |
| 21 | LOCAL_MODULE := dhcpcd-6.8.2 |
| 22 | LOCAL_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 \ |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 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. |
Chih-Hung Hsieh | b828aa3 | 2017-10-10 13:30:46 -0700 | [diff] [blame] | 47 | LOCAL_CFLAGS += -DINET -Wall -Werror -Wno-unused-variable |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 48 | |
Keun Soo Yim | ca69393 | 2016-02-26 14:08:10 -0800 | [diff] [blame] | 49 | ifeq ($(DHCPCD_USE_SCRIPT), yes) |
| 50 | LOCAL_SRC_FILES += script.c |
| 51 | else |
| 52 | LOCAL_SRC_FILES += script-stub.c |
| 53 | endif |
| 54 | |
Elliott Hughes | d088482 | 2016-05-13 13:23:20 -0700 | [diff] [blame] | 55 | LOCAL_CFLAGS += -D_BSD_SOURCE |
| 56 | |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 57 | ifeq ($(DHCPCD_USE_IPV6), yes) |
| 58 | LOCAL_SRC_FILES += ipv6.c ipv6nd.c dhcp6.c |
| 59 | LOCAL_SRC_FILES += crypt/sha256.c |
| 60 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/crypt |
| 61 | LOCAL_CFLAGS += -DINET6 |
| 62 | endif |
| 63 | |
| 64 | ifeq ($(DHCPCD_USE_DBUS), yes) |
| 65 | LOCAL_SRC_FILES += dbus/dbus-dict.c dbus/rpc-dbus.c |
Samuel Tan | 14596ac | 2015-09-30 13:01:42 -0700 | [diff] [blame] | 66 | LOCAL_CFLAGS += -DCONFIG_DBUS -DPASSIVE_MODE |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 67 | LOCAL_SHARED_LIBRARIES += libdbus |
| 68 | else |
| 69 | LOCAL_SRC_FILES += rpc-stub.c |
| 70 | endif |
| 71 | |
| 72 | # Compiler complains about implicit function delcarations in dhcpcd.c, |
| 73 | # if-options.c, dhcp-common.c, and crypt/sha256.c. |
| 74 | LOCAL_CFLAGS += -Wno-implicit-function-declaration |
| 75 | # Compiler complains about signed-unsigned comparison in dhcp-common.c. |
| 76 | LOCAL_CFLAGS += -Wno-sign-compare |
| 77 | # Compiler complains about unused parameters in function stubs in rpc-stub.c. |
| 78 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 79 | # Compiler complains about possibly uninitialized variables in rpc-dbus.c. |
| 80 | LOCAL_CFLAGS += -Wno-maybe-uninitialized |
Yi Kong | 7315019 | 2018-01-03 12:48:31 -0800 | [diff] [blame] | 81 | # Compiler complains about incorrect format placeholders in dhcpcd.c. |
| 82 | LOCAL_CFLAGS += -Wno-format |
Samuel Tan | 6265fcc | 2015-08-20 11:04:04 -0700 | [diff] [blame] | 83 | |
| 84 | LOCAL_SHARED_LIBRARIES += libc libcutils libnetutils |
| 85 | include $(BUILD_EXECUTABLE) |
| 86 | |
Samuel Tan | 1635047 | 2015-10-02 13:00:47 -0700 | [diff] [blame] | 87 | # Each build target using dhcpcd-6.8.2 should define its own source |
| 88 | # and destination for its dhcpcd.conf file. |
| 89 | # include $(CLEAR_VARS) |
| 90 | # LOCAL_MODULE := dhcpcd-6.8.2.conf |
| 91 | # LOCAL_MODULE_CLASS := ETC |
| 92 | # LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/dhcpcd-6.8.2 |
| 93 | # LOCAL_SRC_FILES := android.conf |
| 94 | # include $(BUILD_PREBUILT) |