Skip to content

Commit

Permalink
More Makefile definitions for targeting emscripten (JuliaLang#32482)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jul 4, 2019
1 parent 4d68846 commit 0060e13
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ OPENBLAS_DYNAMIC_ARCH := 1
override CROSS_COMPILE:=$(XC_HOST)-
ifneq (,$(findstring mingw,$(XC_HOST)))
override OS := WINNT
else ifneq (,$(findstring emscripten,$(XC_HOST)))
override OS := emscripten
override CROSS_COMPILE:=
else
ifeq (,$(OS))
$(error "unknown XC_HOST variable set, please set OS")
Expand Down Expand Up @@ -1049,7 +1052,7 @@ else
endif

# shared library runtime paths
ifeq ($(OS), WINNT)
ifneq (,$(filter $(OS),WINNT emscripten))
RPATH :=
RPATH_ORIGIN :=
RPATH_ESCAPED_ORIGIN :=
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ $(build_depsbindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(buil
@$(call PRINT_CC, $(HOSTCC) -o $(build_depsbindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c)

julia-base-cache: julia-sysimg-$(JULIA_BUILD_MODE) | $(DIRS) $(build_datarootdir)/julia
@$(call spawn,$(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
@$(call spawn,JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
$(call cygpath_w,$(build_datarootdir)/julia/base.cache))

# public libraries, that are installed in $(prefix)/lib
Expand Down
2 changes: 1 addition & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ else
endif
endif

ifneq ($(OS), WINNT)
ifeq (,$(filter $(OS), WINNT emscripten))
# For any USE_SYSTEM_* libraries that will be dynamically loaded by libjulia,
# put a symlink in the private libdir.
# System package managers may want to install these links manually,
Expand Down
4 changes: 2 additions & 2 deletions sysimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ $(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS)

$(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS)
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
if ! $(call spawn,$(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
if ! $(call spawn,JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) $(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $(call cygpath_w,$<) sysimg.jl $(RELBUILDROOT); then \
echo '*** This error might be fixed by running `make clean`. If the error persists$(COMMA) try `make cleanall`. ***'; \
false; \
Expand All @@ -74,7 +74,7 @@ $(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAH
define sysimg_builder
$$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(build_private_libdir)/sys$1-%.a : $$(build_private_libdir)/sys.ji
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
if ! $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
if ! $$(call spawn,JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \
false; \
Expand Down

0 comments on commit 0060e13

Please sign in to comment.