diff --git a/base/Makefile b/base/Makefile index 270877176528f..7622ca46df918 100644 --- a/base/Makefile +++ b/base/Makefile @@ -67,6 +67,11 @@ endif @echo "const DOCDIR = \"$(docdir_rel)\"" >> $@ @echo "const LIBDIR = \"$(libdir_rel)\"" >> $@ @echo "const INCLUDEDIR = \"$(includedir_rel)\"" >> $@ +ifeq ($(NODATES), 1) + @echo "const NODATES = true" >> $@ +else + @echo "const NODATES = false" >> $@ +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 diff --git a/base/excluded.jl b/base/excluded.jl new file mode 100644 index 0000000000000..ae44635074e25 --- /dev/null +++ b/base/excluded.jl @@ -0,0 +1,22 @@ +# This file is a part of Julia. License is MIT: http://julialang.org/license + +module Excluded + +macro exclude(typexpr) + f = typexpr.args[2] + if typexpr.head == :type + return quote + export $f + type $f + $(f)() = throw(ArgumentError("`$($f)` has been excluded in this build")) + end + end + end +end + +export Dates +module Dates end +@exclude type Date end +@exclude type DateTime end + +end # module diff --git a/base/sysimg.jl b/base/sysimg.jl index aed8231efd4c9..b93fef65a0457 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -78,6 +78,9 @@ Array{T}(::Type{T}, m::Integer) = Array{T,1}(Int(m)) Array{T}(::Type{T}, m::Integer,n::Integer) = Array{T,2}(Int(m),Int(n)) Array{T}(::Type{T}, m::Integer,n::Integer,o::Integer) = Array{T,3}(Int(m),Int(n),Int(o)) +include("excluded.jl") +using .Excluded + # numeric operations include("hashing.jl") include("rounding.jl") @@ -323,8 +326,10 @@ include("profile.jl") importall .Profile # dates -include("Dates.jl") -import .Dates: Date, DateTime, now +if !NODATES + include("Dates.jl") + import .Dates: Date, DateTime, now +end # sparse matrices, vectors, and sparse linear algebra include("sparse.jl")