Build _scproxy for Mac
This is required for the urllib module.
Test: py2-cmd -murllib
Change-Id: Ifaa4e92e5c95b86fbf9eb397d4b4929db77de3a1
diff --git a/Android.bp b/Android.bp
index aba4538..b6dc00e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -237,6 +237,12 @@
linux_glibc_x86_64: {
host_ldlibs: ["-lutil"],
},
+ darwin: {
+ host_ldlibs: [
+ "-framework SystemConfiguration",
+ "-framework CoreFoundation",
+ ],
+ },
host: {
static_libs: ["libsqlite"],
},
@@ -331,6 +337,11 @@
"py2-c-module-_ctypes_test",
"py2-c-module-_ctypes",
],
+ target: {
+ darwin: {
+ whole_static_libs: ["py2-c-module-_scproxy"],
+ },
+ },
}
cc_binary {
@@ -937,3 +948,14 @@
},
},
}
+
+cc_library_host_static {
+ name: "py2-c-module-_scproxy",
+ defaults: ["py2-interp-defaults"],
+ srcs: ["Mac/Modules/_scproxy.c"],
+ target: {
+ linux: {
+ enabled: false,
+ },
+ },
+}
diff --git a/Modules/config.c b/Modules/config.c
index 677c063..2255347 100644
--- a/Modules/config.c
+++ b/Modules/config.c
@@ -81,6 +81,9 @@
extern void init_sqlite3(void);
extern void init_ctypes(void);
extern void init_ctypes_test(void);
+#ifdef __APPLE__
+extern void init_scproxy(void);
+#endif
/* -- ADDMODULE MARKER 1 -- */
@@ -150,6 +153,9 @@
{"_sqlite3", init_sqlite3},
{"_ctypes", init_ctypes},
{"_ctypes_test", init_ctypes_test},
+#ifdef __APPLE__
+ {"_scproxy", init_scproxy},
+#endif
/* -- ADDMODULE MARKER 2 -- */