From ea3c64e6fe432a91938e52fe9529d4fea0961b66 Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Thu, 14 Jun 2018 20:22:11 +0300 Subject: pppd: Convert Android.mk to Android.bp Since Android moved from makefiles to blueprint files [1], all Android.mk files should be coverted to corresponding Android.bp files. To do so, next command was used: $ androidmk Android.mk > Android.bp A bit of polishing was done to resulting Android.bp file (like moving "-ldl" flag to shared_libs, which wasn't done automatically, and extracting common CFLAGS to cc_defaults section). Also add Android.bp in ppp/, to actually run ppp/pppd/Android.bp during the build. [1] https://android.googlesource.com/platform/build/soong/+/master/README.md Change-Id: I45f3e3633f3813381d7710dccbad4da99ce2cb47 Signed-off-by: Sam Protsenko --- Android.bp | 15 ++++++++++ pppd/Android.bp | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pppd/Android.mk | 66 ------------------------------------------- 3 files changed, 103 insertions(+), 66 deletions(-) create mode 100644 Android.bp create mode 100644 pppd/Android.bp delete mode 100644 pppd/Android.mk diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..3704241 --- /dev/null +++ b/Android.bp @@ -0,0 +1,15 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +subdirs = ["pppd"] diff --git a/pppd/Android.bp b/pppd/Android.bp new file mode 100644 index 0000000..d995a0d --- /dev/null +++ b/pppd/Android.bp @@ -0,0 +1,88 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +cc_defaults { + name: "ppp_defaults", + cflags: [ + "-DCHAPMS=1", + "-DMPPE=1", + "-DINET6=1", + "-DUSE_OPENSSL=1", + "-Wno-missing-field-initializers", + "-Wno-unused-parameter", + "-Werror", + "-Wno-pointer-sign", + ], + local_include_dirs: ["include"], +} + +cc_binary { + name: "pppd", + defaults: ["ppp_defaults"], + + srcs: [ + "auth.c", + "ccp.c", + "chap-md5.c", + "chap-new.c", + "chap_ms.c", + "demand.c", + "eap.c", + "ecp.c", + "eui64.c", + "fsm.c", + "ipcp.c", + "ipv6cp.c", + "lcp.c", + "magic.c", + "main.c", + "options.c", + "pppcrypt.c", + "pppox.c", + "session.c", + "sys-linux.c", + "tty.c", + "upap.c", + "utils.c", + ], + + // options.c:623:21: error: passing 'const char *' to parameter of + // type 'char *' discards qualifiers. + // [-Werror,-Wincompatible-pointer-types-discards-qualifiers] + clang_cflags: ["-Wno-incompatible-pointer-types-discards-qualifiers"], + + shared_libs: [ + "libdl", + "liblog", + "libcutils", + "libcrypto", + ], + + cflags: [ + "-Wno-empty-body", + "-Wno-attributes", + "-Wno-sign-compare", + "-DPLUGIN", + ], + + ldflags: ["-rdynamic"], + required: ["pppol2tp-android"], +} + +cc_library_shared { + name: "pppol2tp-android", + defaults: ["ppp_defaults"], + srcs: ["plugins/pppol2tp-android/pppol2tp-android.c"], + allow_undefined_symbols: true, +} diff --git a/pppd/Android.mk b/pppd/Android.mk deleted file mode 100644 index 7cb13b0..0000000 --- a/pppd/Android.mk +++ /dev/null @@ -1,66 +0,0 @@ -# Flags common to both pppd and plugins -COMMON_CFLAGS := -DCHAPMS=1 -DMPPE=1 -DINET6=1 -DUSE_OPENSSL=1 \ - -Wno-missing-field-initializers -Wno-unused-parameter -Werror \ - -Wno-pointer-sign - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - auth.c \ - ccp.c \ - chap-md5.c \ - chap-new.c \ - chap_ms.c \ - demand.c \ - eap.c \ - ecp.c \ - eui64.c \ - fsm.c \ - ipcp.c \ - ipv6cp.c \ - lcp.c \ - magic.c \ - main.c \ - options.c \ - pppcrypt.c \ - pppox.c \ - session.c \ - sys-linux.c \ - tty.c \ - upap.c \ - utils.c - -# options.c:623:21: error: passing 'const char *' to parameter of type 'char *' discards qualifiers. -# [-Werror,-Wincompatible-pointer-types-discards-qualifiers] -LOCAL_CLANG_CFLAGS += -Wno-incompatible-pointer-types-discards-qualifiers - -LOCAL_SHARED_LIBRARIES := \ - libcutils liblog libcrypto - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include - -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CFLAGS += -Wno-empty-body -Wno-attributes -Wno-sign-compare - -# Enable plugin support -LOCAL_CFLAGS += -DPLUGIN -LOCAL_LDFLAGS := -ldl -rdynamic - -LOCAL_MODULE:= pppd -LOCAL_REQUIRED_MODULES := pppol2tp-android - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_MODULE := pppol2tp-android -LOCAL_SRC_FILES := plugins/pppol2tp-android/pppol2tp-android.c -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/plugins/pppol2tp-android -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CFLAGS += -Wno-gnu-designator -Wno-format -LOCAL_ALLOW_UNDEFINED_SYMBOLS := true -include $(BUILD_SHARED_LIBRARY) -- cgit v1.2.3