Skip to content

Commit

Permalink
Add detection for WSL
Browse files Browse the repository at this point in the history
Change-Id: I8d57cd653157bb9b51019b3cc1192c8210e990e2
  • Loading branch information
btongminh authored and luca020400 committed Jul 28, 2018
1 parent 14925d0 commit ecf6137
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/combo/HOST_EXTRA_wsl-x86_64.mk
@@ -0,0 +1,18 @@
#
# Copyright (C) 2018 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Configuration for builds hosted on wsl-x86_64.
# Included by combo/HOST_linux-x86_64.mk
5 changes: 5 additions & 0 deletions core/combo/HOST_linux-x86_64.mk
Expand Up @@ -20,3 +20,8 @@
define $(combo_var_prefix)transform-shared-lib-to-toc
$(call _gen_toc_command_for_elf,$(1),$(2))
endef

# Microsoft Windows Subsystem for Linux
ifeq ($(HOST_OS_IS_WSL),true)
include $(BUILD_COMBOS)/HOST_EXTRA_wsl-x86_64.mk
endif
6 changes: 6 additions & 0 deletions core/envsetup.mk
Expand Up @@ -102,6 +102,12 @@ UNAME := $(shell uname -sm)
# HOST_OS
ifneq (,$(findstring Linux,$(UNAME)))
HOST_OS := linux
ifneq (,$(findstring Microsoft,$(shell uname -r)))
# Microsoft Windows Subsystem for Linux
# The HOST_OS is still Linux but with some limitations.
# Assumes that there are no other Microsoft Linux kernels
HOST_OS_IS_WSL := true
endif
endif
ifneq (,$(findstring Darwin,$(UNAME)))
HOST_OS := darwin
Expand Down

0 comments on commit ecf6137

Please sign in to comment.