From e96d6e22c6d53a31577c07ea7b7ebfd5e1632248 Mon Sep 17 00:00:00 2001 From: Gonzalo Larralde Date: Mon, 2 Jan 2017 11:11:40 -0300 Subject: [PATCH 1/2] os_string for android was resolved as linux --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 98e114209..3a46b072a 100644 --- a/configure.ac +++ b/configure.ac @@ -194,6 +194,9 @@ AC_ARG_WITH([swift-toolchain], AC_DEFINE(HAVE_SWIFT, 1, [Define if building for Swift]) SWIFTC="$swift_toolchain_path/bin/swiftc" case $target_os in + *android*) + os_string="android" + ;; linux*) os_string="linux" case $target_cpu in From 979da0fc49b1b5f9e16849f3e8a10f2006660c28 Mon Sep 17 00:00:00 2001 From: Gonzalo Larralde Date: Mon, 2 Jan 2017 11:13:33 -0300 Subject: [PATCH 2/2] Improve swiftlibdir and swiftmoddir generation linux was hardcoded, now we use OS_STRING generated in configure.ac. Also, the build_cpu instead of the host_cpu was used for swiftmoddir, resulting in an incorrect destination directory. --- configure.ac | 1 + src/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3a46b072a..73d661324 100644 --- a/configure.ac +++ b/configure.ac @@ -218,6 +218,7 @@ AM_CONDITIONAL(HAVE_SWIFT, $have_swift) AC_SUBST([SWIFTC]) AC_SUBST([SWIFTC_FLAGS]) AC_SUBST([SWIFT_LIBDIR]) +AC_SUBST([OS_STRING], ["$os_string"]) # # Enable use of gold linker when building the Swift overlay diff --git a/src/Makefile.am b/src/Makefile.am index 967d5a073..1e2ba6538 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ # if HAVE_SWIFT -swiftlibdir=${prefix}/lib/swift/linux +swiftlibdir=${prefix}/lib/swift/${OS_STRING} swiftlib_LTLIBRARIES=libdispatch.la else lib_LTLIBRARIES=libdispatch.la @@ -171,7 +171,7 @@ SWIFT_GEN_FILES= \ $(abs_builddir)/swift/Dispatch.swiftdoc \ $(SWIFT_OBJ_FILES) -swiftmoddir=${prefix}/lib/swift/linux/${build_cpu} +swiftmoddir=${prefix}/lib/swift/${OS_STRING}/${host_cpu} swiftmod_HEADERS=\ $(abs_builddir)/swift/Dispatch.swiftmodule \ $(abs_builddir)/swift/Dispatch.swiftdoc