Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct file separator on windows for constants in build_h.jl #22416

Merged
merged 2 commits into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@ endif
@echo "const libllvm_version_string = \"$$($(LLVM_CONFIG_HOST) --version)\"" >> $@
@echo "const VERSION_STRING = \"$(JULIA_VERSION)\"" >> $@
@echo "const TAGGED_RELEASE_BANNER = \"$(TAGGED_RELEASE_BANNER)\"" >> $@
ifeq ($(OS),WINNT)
@echo 'const SYSCONFDIR = "$(subst /,\\\\,$(sysconfdir_rel))"' >> $@
@echo 'const DATAROOTDIR = "$(subst /,\\\\,$(datarootdir_rel))"' >> $@
@echo 'const DOCDIR = "$(subst /,\\\\,$(docdir_rel))"' >> $@
@echo 'const LIBDIR = "$(subst /,\\\\,$(libdir_rel))"' >> $@
@echo 'const PRIVATE_LIBDIR = "$(subst /,\\\\,$(private_libdir_rel))"' >> $@
@echo 'const INCLUDEDIR = "$(subst /,\\\\,$(includedir_rel))"' >> $@
else
@echo "const SYSCONFDIR = \"$(sysconfdir_rel)\"" >> $@
@echo "const DATAROOTDIR = \"$(datarootdir_rel)\"" >> $@
@echo "const DOCDIR = \"$(docdir_rel)\"" >> $@
@echo "const LIBDIR = \"$(libdir_rel)\"" >> $@
@echo "const PRIVATE_LIBDIR = \"$(private_libdir_rel)\"" >> $@
@echo "const INCLUDEDIR = \"$(includedir_rel)\"" >> $@
endif

@# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl,
@# ensuring we rebuild the system image as infrequently as possible
Expand Down
10 changes: 10 additions & 0 deletions test/osutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ end
@test (@static false && 1) === false
@test (@static true || 1) === true
@test (@static false || 1) === 1

# test that path variables use correct path delimiters on windows
if is_windows()
@test !contains(Base.SYSCONFDIR, "/")
@test !contains(Base.DATAROOTDIR, "/")
@test !contains(Base.DOCDIR, "/")
@test !contains(Base.LIBDIR, "/")
@test !contains(Base.PRIVATE_LIBDIR, "/")
@test !contains(Base.INCLUDEDIR, "/")
end