From 9be6b2e0b55434754bebddd74c8331337567db7d Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 11 Nov 2015 16:51:16 +0100 Subject: [PATCH] android: Replace AndroidConfigLocal.h with a header in utils/compat --- src/libstrongswan/Android.mk | 3 +-- src/libstrongswan/Makefile.am | 4 ++-- .../{AndroidConfigLocal.h => utils/compat/android.h} | 11 ++++++++++- src/libstrongswan/utils/utils.h | 3 +++ 4 files changed, 16 insertions(+), 5 deletions(-) rename src/libstrongswan/{AndroidConfigLocal.h => utils/compat/android.h} (88%) diff --git a/src/libstrongswan/Android.mk b/src/libstrongswan/Android.mk index 0464519fa..db3da8e15 100644 --- a/src/libstrongswan/Android.mk +++ b/src/libstrongswan/Android.mk @@ -117,8 +117,7 @@ LOCAL_SRC_FILES += $(call add_plugin, xcbc) # build libstrongswan ---------------------------------------------------------- -LOCAL_CFLAGS := $(strongswan_CFLAGS) \ - -include $(LOCAL_PATH)/AndroidConfigLocal.h +LOCAL_CFLAGS := $(strongswan_CFLAGS) LOCAL_MODULE := libstrongswan diff --git a/src/libstrongswan/Makefile.am b/src/libstrongswan/Makefile.am index 7ec5f37cc..ed3b85dd4 100644 --- a/src/libstrongswan/Makefile.am +++ b/src/libstrongswan/Makefile.am @@ -110,7 +110,7 @@ utils/lexparser.h utils/optionsfrom.h utils/capabilities.h utils/backtrace.h \ utils/cpu_feature.h utils/leak_detective.h utils/printf_hook/printf_hook.h \ utils/printf_hook/printf_hook_vstr.h utils/printf_hook/printf_hook_builtin.h \ utils/parser_helper.h utils/test.h utils/integrity_checker.h utils/process.h \ -utils/utils/strerror.h utils/compat/windows.h utils/compat/apple.h \ +utils/utils/strerror.h utils/compat/windows.h utils/compat/apple.h utils/compat/android.h \ utils/utils/atomics.h utils/utils/types.h utils/utils/byteorder.h \ utils/utils/string.h utils/utils/memory.h utils/utils/tty.h utils/utils/path.h \ utils/utils/status.h utils/utils/object.h utils/utils/time.h utils/utils/align.h @@ -191,7 +191,7 @@ endif EXTRA_DIST = \ asn1/oid.txt asn1/oid.pl \ crypto/proposal/proposal_keywords_static.txt \ -Android.mk AndroidConfigLocal.h +Android.mk BUILT_SOURCES = \ $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \ diff --git a/src/libstrongswan/AndroidConfigLocal.h b/src/libstrongswan/utils/compat/android.h similarity index 88% rename from src/libstrongswan/AndroidConfigLocal.h rename to src/libstrongswan/utils/compat/android.h index ae0e60633..91b6b1483 100644 --- a/src/libstrongswan/AndroidConfigLocal.h +++ b/src/libstrongswan/utils/compat/android.h @@ -13,10 +13,19 @@ * for more details. */ +/** + * @defgroup android android + * @{ @ingroup compat + */ + +#ifndef ANDROID_H_ +#define ANDROID_H_ + /* stuff defined in AndroidConfig.h, which is included using the -include * command-line option, thus cannot be undefined using -U CFLAGS options. * the reason we have to undefine these flags in the first place, is that * AndroidConfig.h defines them as 0, which in turn means that they are * actually defined. */ - #undef HAVE_BACKTRACE + +#endif /** ANDROID_H_ @}*/ diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h index acc15c42a..44d882bab 100644 --- a/src/libstrongswan/utils/utils.h +++ b/src/libstrongswan/utils/utils.h @@ -56,6 +56,9 @@ #ifdef __APPLE__ # include "compat/apple.h" #endif +#ifdef __ANDROID__ +# include "compat/android.h" +#endif /** * Initialize utility functions