From e450748208da2479a4d94ffda84b77f1446aa270 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 17 Aug 2019 04:45:58 +0800 Subject: [PATCH] python,python3: Fix host Python compilation for macOS * Remove $$$$(pkg-config --static --libs libcrypto libssl) from HOST_LDFLAGS Having this leads to an "unknown type name 'u_int'" error on Mac. Removing it doesn't appear to affect Python's ability to find buildroot LibreSSL. * Change -Wl,-rpath=... to -Wl,-rpath,... in HOST_LDFLAGS The equals sign version is not supported by the Mac linker (appears to be an GNU extension). The comma version is supported; -rpath and its argument will be separated by a space when passed to the linker. * Add ac_cv_header_libintl_h=no to HOST_CONFIGURE_VARS for Mac Python on Mac doesn't expect to use libintl, but if gettext-full is compiled for host, it will try, leading to undefined symbol errors during compilation. This prevents configure from finding libintl.h. Fixes #7171. Fixes #9621. Signed-off-by: Jeffery To --- lang/python/python/Makefile | 7 ++++++- lang/python/python3/Makefile | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index b83613cdc6..0560d34758 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -290,13 +290,18 @@ define PyPackage/python/filespec endef HOST_LDFLAGS += \ - $$$$(pkg-config --static --libs libcrypto libssl) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib + -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib ifeq ($(HOST_OS),Linux) HOST_LDFLAGS += \ -Wl,--no-as-needed -lrt endif +ifeq ($(HOST_OS),Darwin) +HOST_CONFIGURE_VARS += \ + ac_cv_header_libintl_h=no +endif + HOST_CONFIGURE_ARGS+= \ --without-cxx-main \ --without-pymalloc \ diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 4cd1dc9973..79a71ccafd 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -285,13 +285,18 @@ define Py3Package/python3/filespec endef HOST_LDFLAGS += \ - $$$$(pkg-config --static --libs libcrypto libssl) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib + -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib ifeq ($(HOST_OS),Linux) HOST_LDFLAGS += \ -Wl,--no-as-needed -lrt endif +ifeq ($(HOST_OS),Darwin) +HOST_CONFIGURE_VARS += \ + ac_cv_header_libintl_h=no +endif + HOST_CONFIGURE_ARGS+= \ --without-cxx-main \ --without-pymalloc \ -- 2.30.2