From 26f377d034e31c1ca2dbfd0da9813fdb8be4cf73 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Tue, 8 Jun 2021 16:33:55 +0200
Subject: [PATCH] Harbuzz: allow config.h filename customization: use
config_sdl_android.h for Android (see #132)
---
external/harfbuzz-2.8.0/Android.mk | 2 +-
.../harfbuzz-2.8.0/{config.h => config_sdl_android.h} | 0
external/harfbuzz-2.8.0/src/hb-config.hh | 10 ++++++++--
3 files changed, 9 insertions(+), 3 deletions(-)
rename external/harfbuzz-2.8.0/{config.h => config_sdl_android.h} (100%)
diff --git a/external/harfbuzz-2.8.0/Android.mk b/external/harfbuzz-2.8.0/Android.mk
index 65df63d..342c6c8 100644
--- a/external/harfbuzz-2.8.0/Android.mk
+++ b/external/harfbuzz-2.8.0/Android.mk
@@ -60,7 +60,7 @@ LOCAL_C_INCLUDES = \
#LOCAL_CFLAGS += -DHB_NO_MT -DHAVE_OT -DHAVE_UCDN -fPIC
-LOCAL_CFLAGS += -DHAVE_CONFIG_H -fPIC
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -DHB_CONFIG_H_FILENAME=\"config_sdl_android.h\" -fPIC
LOCAL_EXPORT_C_INCLUDES = $(LOCAL_PATH)/src/
diff --git a/external/harfbuzz-2.8.0/config.h b/external/harfbuzz-2.8.0/config_sdl_android.h
similarity index 100%
rename from external/harfbuzz-2.8.0/config.h
rename to external/harfbuzz-2.8.0/config_sdl_android.h
diff --git a/external/harfbuzz-2.8.0/src/hb-config.hh b/external/harfbuzz-2.8.0/src/hb-config.hh
index fc8d424..717927c 100644
--- a/external/harfbuzz-2.8.0/src/hb-config.hh
+++ b/external/harfbuzz-2.8.0/src/hb-config.hh
@@ -32,7 +32,10 @@
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifndef HB_CONFIG_H_FILENAME
+#define HB_CONFIG_H_FILENAME "config.h"
+#endif
+#include HB_CONFIG_H_FILENAME
#endif
@@ -156,7 +159,10 @@
#endif
#ifdef HAVE_CONFIG_OVERRIDE_H
-#include "config-override.h"
+#ifndef HB_CONFIG_OVERRIDE_H_FILENAME
+#define HB_CONFIG_OVERRIDE_H_FILENAME "config-override.h"
+#endif
+#include HB_CONFIG_OVERRIDE_H_FILENAME
#endif