Skip to content

Commit 353adba

Browse files
authored
Merge pull request swiftlang#197 from gonzalolarralde/host-install-path
os_string fixes for cross-compilation and Android when Swift is enabled
2 parents 7a03649 + 979da0f commit 353adba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: configure.ac

+4
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ AC_ARG_WITH([swift-toolchain],
194194
AC_DEFINE(HAVE_SWIFT, 1, [Define if building for Swift])
195195
SWIFTC="$swift_toolchain_path/bin/swiftc"
196196
case $target_os in
197+
*android*)
198+
os_string="android"
199+
;;
197200
linux*)
198201
os_string="linux"
199202
case $target_cpu in
@@ -215,6 +218,7 @@ AM_CONDITIONAL(HAVE_SWIFT, $have_swift)
215218
AC_SUBST([SWIFTC])
216219
AC_SUBST([SWIFTC_FLAGS])
217220
AC_SUBST([SWIFT_LIBDIR])
221+
AC_SUBST([OS_STRING], ["$os_string"])
218222

219223
#
220224
# Enable use of gold linker when building the Swift overlay

Diff for: src/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
if HAVE_SWIFT
6-
swiftlibdir=${prefix}/lib/swift/linux
6+
swiftlibdir=${prefix}/lib/swift/${OS_STRING}
77
swiftlib_LTLIBRARIES=libdispatch.la
88
else
99
lib_LTLIBRARIES=libdispatch.la
@@ -171,7 +171,7 @@ SWIFT_GEN_FILES= \
171171
$(abs_builddir)/swift/Dispatch.swiftdoc \
172172
$(SWIFT_OBJ_FILES)
173173

174-
swiftmoddir=${prefix}/lib/swift/linux/${build_cpu}
174+
swiftmoddir=${prefix}/lib/swift/${OS_STRING}/${host_cpu}
175175
swiftmod_HEADERS=\
176176
$(abs_builddir)/swift/Dispatch.swiftmodule \
177177
$(abs_builddir)/swift/Dispatch.swiftdoc

0 commit comments

Comments
 (0)