diff options
author | Dan Willemsen <dwillemsen@google.com> | 2018-11-20 06:27:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-11-20 06:27:16 +0000 |
commit | d81c8f26048597532bdfe6625f7d29a07b6b8af0 (patch) | |
tree | 301fbc82387ee8a6bd5ed38a9c0c793438430326 | |
parent | f13d12fe9cebb595f7e18e09a1e97486ae874f80 (diff) | |
parent | f2c876e52e994e027370c5840c03f0b795648081 (diff) | |
download | platform_external_iproute2-d81c8f26048597532bdfe6625f7d29a07b6b8af0.tar.gz platform_external_iproute2-d81c8f26048597532bdfe6625f7d29a07b6b8af0.tar.bz2 platform_external_iproute2-d81c8f26048597532bdfe6625f7d29a07b6b8af0.zip |
Merge "Convert to Android.bp"
-rw-r--r-- | Android.bp | 47 | ||||
-rw-r--r-- | Android.mk | 7 | ||||
-rw-r--r-- | ip/Android.bp | 65 | ||||
-rw-r--r-- | ip/Android.mk | 41 | ||||
-rw-r--r-- | lib/Android.bp | 48 | ||||
-rw-r--r-- | lib/Android.mk | 81 | ||||
-rw-r--r-- | misc/Android.bp | 23 | ||||
-rw-r--r-- | misc/Android.mk | 37 | ||||
-rw-r--r-- | tc/Android.bp | 36 | ||||
-rw-r--r-- | tc/Android.mk | 25 |
10 files changed, 219 insertions, 191 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..a8e21e3c --- /dev/null +++ b/Android.bp @@ -0,0 +1,47 @@ +NETNS_RUN_DIR = "/mnt/run" + +cc_library_headers { + name: "iproute2_headers", + export_include_dirs: ["include"], +} + +cc_defaults { + name: "iproute2_defaults", + + header_libs: ["iproute2_headers"], + + cflags: [ + "-O2", + "-g", + "-W", + "-Wall", + "-Wno-pointer-arith", + "-Wno-sign-compare", + "-Wno-unused-parameter", + "-Werror", + + "-DHAVE_ERRNO_H", + "-DHAVE_EXT2_IOCTLS", + "-DHAVE_GETPAGESIZE", + "-DHAVE_LINUX_FD_H", + "-DHAVE_LSEEK64", + "-DHAVE_LSEEK64_PROTOTYPE", + "-DHAVE_MMAP", + "-DHAVE_NETINET_IN_H", + "-DHAVE_SELINUX", + "-DHAVE_SETNS", + "-DHAVE_STDLIB_H", + "-DHAVE_STRDUP", + "-DHAVE_SYS_IOCTL_H", + "-DHAVE_SYS_MMAN_H", + "-DHAVE_SYS_MOUNT_H", + "-DHAVE_SYS_PRCTL_H", + "-DHAVE_SYS_RESOURCE_H", + "-DHAVE_SYS_SELECT_H", + "-DHAVE_SYS_STAT_H", + "-DHAVE_SYS_TYPES_H", + "-DHAVE_TYPE_SSIZE_T", + "-DHAVE_UNISTD_H", + "-DHAVE_UTIME_H", + ], +} diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 962bdcea..00000000 --- a/Android.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Explicitly list the bionic UAPI includes so we don't pick up stray -# vendor copies of the UAPI includes that are too old for us to build. -UAPI_INCLUDES := bionic/libc/kernel/uapi - -NETNS_RUN_DIR ?= /mnt/run - -include $(call all-subdir-makefiles) diff --git a/ip/Android.bp b/ip/Android.bp new file mode 100644 index 00000000..1b6ca1f7 --- /dev/null +++ b/ip/Android.bp @@ -0,0 +1,65 @@ +cc_binary { + name: "ip", + defaults: ["iproute2_defaults"], + + srcs: [ + "ip.c", + "ipaddress.c", + "ipaddrlabel.c", + "iproute.c", + "iprule.c", + "ipnetns.c", + "rtm_map.c", + "iptunnel.c", + "ip6tunnel.c", + "tunnel.c", + "ipneigh.c", + "ipntable.c", + "iplink.c", + "ipmaddr.c", + "ipmonitor.c", + "ipmroute.c", + "ipprefix.c", + "iptuntap.c", + "ipxfrm.c", + "xfrm_state.c", + "xfrm_policy.c", + "xfrm_monitor.c", + "iplink_vlan.c", + "link_veth.c", + "link_gre.c", + "iplink_can.c", + "iplink_macvlan.c", + "ipl2tp.c", + "ipfou.c", + "iptoken.c", + "tcp_metrics.c", + "ipnetconf.c", + "iproute_lwtunnel.c", + "iplink_xdp.c", + "iplink_vrf.c", + "iplink_xstats.c", + "ipila.c", + "ipmacsec.c", + "ipseg6.c", + "ipvrf.c", + ], + + shared_libs: [ + "libiprouteutil", + "libnetlink", + ], + + cflags: [ + "-Wno-implicit-function-declaration", + "-Wno-int-conversion", + "-Wno-missing-field-initializers", + "-D_GNU_SOURCE", + "-DNETNS_RUN_DIR=\"" + NETNS_RUN_DIR + "\"", + ], + + ldflags: [ + "-Wl,-export-dynamic", + "-Wl,--no-gc-sections", + ], +} diff --git a/ip/Android.mk b/ip/Android.mk deleted file mode 100644 index 23ffbfdd..00000000 --- a/ip/Android.mk +++ /dev/null @@ -1,41 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := ip.c ipaddress.c ipaddrlabel.c iproute.c iprule.c ipnetns.c \ - rtm_map.c iptunnel.c ip6tunnel.c tunnel.c ipneigh.c ipntable.c iplink.c \ - ipmaddr.c ipmonitor.c ipmroute.c ipprefix.c iptuntap.c \ - ipxfrm.c xfrm_state.c xfrm_policy.c xfrm_monitor.c \ - iplink_vlan.c link_veth.c link_gre.c iplink_can.c \ - iplink_macvlan.c ipl2tp.c \ - ipfou.c iptoken.c tcp_metrics.c ipnetconf.c \ - iproute_lwtunnel.c iplink_xdp.c iplink_vrf.c iplink_xstats.c \ - ipila.c ipmacsec.c ipseg6.c ipvrf.c - -LOCAL_MODULE := ip - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := libc libm libdl - -LOCAL_SHARED_LIBRARIES += libiprouteutil libnetlink - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES) - -LOCAL_CFLAGS := \ - -O2 -g \ - -W -Wall \ - -Wno-implicit-function-declaration \ - -Wno-int-conversion \ - -Wno-missing-field-initializers \ - -Wno-pointer-arith \ - -Wno-sign-compare \ - -Wno-unused-parameter \ - -Werror \ - -D_GNU_SOURCE \ - -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \ - -DHAVE_SETNS \ - -LOCAL_LDFLAGS := -Wl,-export-dynamic -Wl,--no-gc-sections - -include $(BUILD_EXECUTABLE) - diff --git a/lib/Android.bp b/lib/Android.bp new file mode 100644 index 00000000..7b9f59ca --- /dev/null +++ b/lib/Android.bp @@ -0,0 +1,48 @@ +cc_library_shared { + name: "libiprouteutil", + defaults: ["iproute2_defaults"], + + system_shared_libs: [ + "libc", + "libdl", + ], + + srcs: [ + "color.c", + "utils.c", + "rt_names.c", + "ll_types.c", + "ll_proto.c", + "ll_addr.c", + "inet_proto.c", + "mpls_pton.c", + "namespace.c", + "names.c", + "libgenl.c", + "libnetlink.c", + "bpf.c", + "exec.c", + "fs.c", + "json_print.c", + "json_writer.c", + ], + cflags: [ + "-DCONFDIR=\"/data/misc/net\"", + "-DNETNS_RUN_DIR=\"" + NETNS_RUN_DIR + "\"", + "-D_GNU_SOURCE", + ], + + // This is a work around for b/18403920 + ldflags: ["-Wl,--no-gc-sections"], +} + +cc_library_shared { + name: "libnetlink", + defaults: ["iproute2_defaults"], + + system_shared_libs: ["libc"], + srcs: [ + "ll_map.c", + "libnetlink.c", + ], +} diff --git a/lib/Android.mk b/lib/Android.mk deleted file mode 100644 index e1bd3fec..00000000 --- a/lib/Android.mk +++ /dev/null @@ -1,81 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - color.c utils.c rt_names.c ll_types.c ll_proto.c ll_addr.c inet_proto.c \ - mpls_pton.c namespace.c names.c libgenl.c libnetlink.c bpf.c exec.c fs.c \ - json_print.c json_writer.c -LOCAL_MODULE := libiprouteutil -LOCAL_SYSTEM_SHARED_LIBRARIES := libc - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES) -LOCAL_CFLAGS := -O2 -g -W -Wall \ - -DCONFDIR=\"/data/misc/net\" \ - -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \ - -DHAVE_UNISTD_H \ - -DHAVE_ERRNO_H \ - -DHAVE_NETINET_IN_H \ - -DHAVE_SYS_IOCTL_H \ - -DHAVE_SYS_MMAN_H \ - -DHAVE_SYS_MOUNT_H \ - -DHAVE_SYS_PRCTL_H \ - -DHAVE_SYS_RESOURCE_H \ - -DHAVE_SYS_SELECT_H \ - -DHAVE_SYS_STAT_H \ - -DHAVE_SYS_TYPES_H \ - -DHAVE_STDLIB_H \ - -DHAVE_STRDUP \ - -DHAVE_MMAP \ - -DHAVE_UTIME_H \ - -DHAVE_GETPAGESIZE \ - -DHAVE_LSEEK64 \ - -DHAVE_LSEEK64_PROTOTYPE \ - -DHAVE_EXT2_IOCTLS \ - -DHAVE_LINUX_FD_H \ - -DHAVE_TYPE_SSIZE_T \ - -DHAVE_SETNS \ - -D_GNU_SOURCE \ - -Wno-pointer-arith \ - -Wno-sign-compare \ - -Wno-unused-parameter \ - -Werror - -# This is a work around for b/18403920 -LOCAL_LDFLAGS := -Wl,--no-gc-sections - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := ll_map.c libnetlink.c -LOCAL_MODULE := libnetlink -LOCAL_SYSTEM_SHARED_LIBRARIES := libc - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES) -LOCAL_CFLAGS := -O2 -g -W -Wall \ - -DHAVE_UNISTD_H \ - -DHAVE_ERRNO_H \ - -DHAVE_NETINET_IN_H \ - -DHAVE_SYS_IOCTL_H \ - -DHAVE_SYS_MMAN_H \ - -DHAVE_SYS_MOUNT_H \ - -DHAVE_SYS_PRCTL_H \ - -DHAVE_SYS_RESOURCE_H \ - -DHAVE_SYS_SELECT_H \ - -DHAVE_SYS_STAT_H \ - -DHAVE_SYS_TYPES_H \ - -DHAVE_STDLIB_H \ - -DHAVE_STRDUP \ - -DHAVE_MMAP \ - -DHAVE_UTIME_H \ - -DHAVE_GETPAGESIZE \ - -DHAVE_LSEEK64 \ - -DHAVE_LSEEK64_PROTOTYPE \ - -DHAVE_EXT2_IOCTLS \ - -DHAVE_LINUX_FD_H \ - -DHAVE_TYPE_SSIZE_T \ - -Wno-pointer-arith \ - -Wno-sign-compare \ - -Wno-unused-parameter \ - -Werror - -include $(BUILD_SHARED_LIBRARY) diff --git a/misc/Android.bp b/misc/Android.bp new file mode 100644 index 00000000..8e86e728 --- /dev/null +++ b/misc/Android.bp @@ -0,0 +1,23 @@ +cc_binary { + name: "ss", + defaults: ["iproute2_defaults"], + + srcs: [ + "ss.c", + "ssfilter.y", + ], + + shared_libs: [ + "libiprouteutil", + "libnetlink", + "libselinux", + ], + + cflags: [ + "-Wno-missing-field-initializers", + "-Wno-tautological-pointer-compare", + "-Dsethostent(x)=", + ], + + ldflags: ["-Wl,-export-dynamic"], +} diff --git a/misc/Android.mk b/misc/Android.mk deleted file mode 100644 index 2fd13070..00000000 --- a/misc/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ss.c ssfilter.y - -LOCAL_MODULE := ss - -LOCAL_MODULE_TAGS := debug - -LOCAL_SHARED_LIBRARIES += libiprouteutil libnetlink libselinux - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES) - -## -# "-x c" forces the lex/yacc files to be compiled as c the build system -# otherwise forces them to be c++. -yacc_flags := -x c - -LOCAL_CFLAGS := \ - -O2 -g \ - -W -Wall \ - -Wno-missing-field-initializers \ - -Wno-sign-compare \ - -Wno-tautological-pointer-compare \ - -Wno-unused-parameter \ - -Werror \ - '-Dsethostent(x)=' \ - $(yacc_flags) \ - -DHAVE_SETNS \ - -DHAVE_SELINUX - -LOCAL_CPPFLAGS := $(yacc_flags) - -LOCAL_LDFLAGS := -Wl,-export-dynamic -include $(BUILD_EXECUTABLE) - diff --git a/tc/Android.bp b/tc/Android.bp new file mode 100644 index 00000000..a87da516 --- /dev/null +++ b/tc/Android.bp @@ -0,0 +1,36 @@ +cc_binary { + name: "tc", + defaults: ["iproute2_defaults"], + + srcs: [ + "tc.c", + "tc_exec.c", + "tc_qdisc.c", + "q_cbq.c", + "tc_util.c", + "tc_class.c", + "tc_core.c", + "m_action.c", + "m_estimator.c", + "tc_filter.c", + "tc_monitor.c", + "tc_stab.c", + "tc_cbq.c", + "tc_estimator.c", + "f_u32.c", + "m_police.c", + "q_ingress.c", + "m_mirred.c", + "q_htb.c", + ], + + shared_libs: [ + "libiprouteutil", + "libnetlink", + ], + + cflags: ["-Wno-missing-field-initializers"], + + // This is a work around for b/18403920 + ldflags: ["-Wl,--no-gc-sections"], +} diff --git a/tc/Android.mk b/tc/Android.mk deleted file mode 100644 index 78463a86..00000000 --- a/tc/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := tc.c tc_exec.c tc_qdisc.c q_cbq.c tc_util.c tc_class.c tc_core.c m_action.c \ - m_estimator.c tc_filter.c tc_monitor.c tc_stab.c tc_cbq.c \ - tc_estimator.c f_u32.c m_police.c q_ingress.c m_mirred.c q_htb.c - -LOCAL_MODULE := tc - -LOCAL_SYSTEM_SHARED_LIBRARIES := \ - libc libm libdl - -LOCAL_SHARED_LIBRARIES += libiprouteutil libnetlink - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES) - -LOCAL_CFLAGS := -O2 -g -W -Wall -Wno-pointer-arith -Wno-sign-compare -Werror \ - -Wno-unused-parameter \ - -Wno-missing-field-initializers - -# This is a work around for b/18403920 -LOCAL_LDFLAGS := -Wl,--no-gc-sections - -include $(BUILD_EXECUTABLE) - |