Skip to content
Browse files

Fix windows build

  • Loading branch information...
1 parent 36e09bc commit f056bbf2b7e64e0fb845fd63994b5af3637d9c6f @Keno Keno committed Jan 13, 2013
Showing with 58 additions and 20 deletions.
  1. +1 −0 base/export.jl
  2. +14 −4 base/file.jl
  3. +1 −1 base/path.jl
  4. +5 −5 base/uv_constants.jl
  5. +1 −0 deps/.gitignore
  6. +22 −5 deps/Makefile
  7. +11 −0 deps/fftw-config-nopthreads.patch
  8. +1 −4 src/Makefile
  9. +1 −0 src/codegen.cpp
  10. +1 −1 ui/Makefile
View
1 base/export.jl
@@ -1244,6 +1244,7 @@ export
touch,
mv,
mkdir,
+ mkpath,
rmdir,
tmpnam,
tempdir,
View
18 base/file.jl
@@ -8,11 +8,8 @@ function pwd()
bytestring(p)
end
-function cd(dir::String)
- @unix_only system_error(:chdir, ccall(:chdir,Int32,(Ptr{Uint8},),dir) == -1)
- @windows_only system_error(:chdir, ccall(:_chdir,Int32,(Ptr{Uint8},),dir) == -1)
-end
+cd(dir::String) = system_error(:chdir, ccall(:uv_chdir,Int32,(Ptr{Uint8},),dir) == -1)
cd() = cd(ENV["HOME"])
# do stuff in a directory, then return to current directory
@@ -54,6 +51,19 @@ function mkdir(path::String, mode::Unsigned)
end
mkdir(path::String, mode::Signed) = error("mkdir: mode must be an unsigned integer -- perhaps 0o", mode, "?")
mkdir(path::String) = mkdir(path, 0o777)
+function mkpath(path::String, mode)
+ dparts = splitdrive(path)
+ path = dparts[1]
+ @windows_only path *= "\\"
+ parts = (split(dparts[2],Base.path_separator_re,false))
+ for x in parts
+ path=joinpath(path,x)
+ if(!isdir(path))
+ mkdir(path,mode)
+ end
+ end
+end
+mkpath(path::String) = mkpath(path,0o777)
function rmdir(path::String)
@unix_only ret = ccall(:rmdir, Int32, (Ptr{Uint8},), bytestring(path))
View
2 base/path.jl
@@ -10,7 +10,7 @@ end
@windows_only begin
const path_separator = "\\"
const path_separator_re = r"[/\\]+"
- const path_absolute_re = r"^(?:\w+:)?[/\\]"
+ const path_absolute_re = r"^(?:\w+:)[/\\]"
const path_dir_splitter = r"^(.*?[/\\]+)([^/\\]*)$"
const path_ext_splitter = r"^((?:.*[/\\])?(?:\.|[^/\\\.])[^/\\]*?)(\.[^/\\\.]*|)$"
View
10 base/uv_constants.jl
@@ -1,5 +1,5 @@
-const UV_UNKNOWN_HANDLE = 0
-handles = [:UV_ASYNC, :UV_CHECK, :UV_FS_EVENT, :UV_FS_POLL, :UV_HANDLE, :UV_IDLE, :UV_NAMED_PIPE, :UV_POLL, :UV_PREPARE, :UV_PROCESS, :UV_STREAM, :UV_TCP, :UV_TIMER, :UV_TTY, :UV_UDP, :UV_SIGNAL, :UV_FILE, :UV_HANDLE_TYPE_MAX, :UV_RAW_FD, :UV_RAW_HANDLE]
-for i=1:(length(handles))
-@eval const $(handles[i]) = $i
-end
+const UV_UNKNOWN_HANDLE = 0
+handles = [:UV_ASYNC, :UV_CHECK, :UV_FS_EVENT, :UV_FS_POLL, :UV_HANDLE, :UV_IDLE, :UV_NAMED_PIPE, :UV_POLL, :UV_PREPARE, :UV_PROCESS, :UV_STREAM, :UV_TCP, :UV_TIMER, :UV_TTY, :UV_UDP, :UV_SIGNAL, :UV_FILE, :UV_HANDLE_TYPE_MAX, :UV_RAW_FD, :UV_RAW_HANDLE]
+for i=1:(length(handles))
+@eval const $(handles[i]) = $i
+end
View
1 deps/.gitignore
@@ -6,6 +6,7 @@
/double-conversion-*
/dsfmt-*
/fftw-*
+!fftw-config-nopthreads.patch
/glpk-*
/gmp-*
/grisu-*
View
27 deps/Makefile
@@ -144,13 +144,15 @@ else
LLVM_BUILDDIR = build/Release
endif
-LLVM_LIB_FILE = libLLVM-$(LLVM_VER)$(LLVM_LIB_SUFFIX).$(SHLIB_EXT)
-LLVM_OBJ_TARGET = $(BUILD)/lib/$(LLVM_LIB_FILE)
ifeq ($(OS),WINNT)
-LLVM_OBJ_SOURCE = llvm-$(LLVM_VER)/$(LLVM_BUILDDIR)/bin/LLVM-$(LLVM_VER)$(LLVM_LIB_SUFFIX).$(SHLIB_EXT)
+LLVM_LIB_FILE = LLVM-$(LLVM_VER)$(LLVM_LIB_SUFFIX).$(SHLIB_EXT)
+LLVM_OBJ_SOURCE = llvm-$(LLVM_VER)/$(LLVM_BUILDDIR)/bin/$(LLVM_LIB_FILE)
else
+LLVM_LIB_FILE = libLLVM-$(LLVM_VER)$(LLVM_LIB_SUFFIX).$(SHLIB_EXT)
LLVM_OBJ_SOURCE = llvm-$(LLVM_VER)/$(LLVM_BUILDDIR)/lib/$(LLVM_LIB_FILE)
endif
+LLVM_OBJ_TARGET = $(BUILD)/lib/$(LLVM_LIB_FILE)
+
ifeq ($(LLVM_VER), 3.0)
LLVM_TAR=llvm-$(LLVM_VER).tar.gz
@@ -263,6 +265,7 @@ $(LLVM_OBJ_TARGET): $(LLVM_OBJ_SOURCE) | $(llvm_python_workaround)
export PATH=$(abspath llvm-$(LLVM_VER)/python2_path):$$PATH && \
$(MAKE) -C llvm-$(LLVM_VER)/build install
$(INSTALL_NAME_CMD)$(LLVM_LIB_FILE) $(BUILD)/lib/$(LLVM_LIB_FILE)
+ $(AUTOTOOLS_PATH_CORRECT)
touch -c $@
clean-llvm:
@@ -281,10 +284,10 @@ install-llvm: $(LLVM_OBJ_TARGET)
## GNU readline ##
-READLINE_OBJ_TARGET = $(BUILD)/lib/libreadline.$(SHLIB_EXT)
-READLINE_OBJ_SOURCE = readline-$(READLINE_VER)/shlib/libreadline.$(READLINE_VER).$(SHLIB_EXT)
ifeq ($(OS),WINNT)
+READLINE_OBJ_TARGET = $(BUILD)/lib/libreadline.a
+READLINE_OBJ_SOURCE = readline-$(READLINE_VER)/libreadline.a
READLINE_URL = https://github.com/JuliaLang/readline/tarball/master
READLINE_OPTS = --disable-shared --enable-static --with-curses
READLINE_CFLAGS = LOCAL_DEFS="-include $(abspath .)/readline-win.h"
@@ -299,8 +302,11 @@ $(READLINE_OBJ_TARGET): $(READLINE_OBJ_SOURCE) readline-$(READLINE_VER)/checked
$(MAKE) -C readline-$(READLINE_VER) $(READLINE_CFLAGS) install
touch -c $@
else
+READLINE_OBJ_TARGET = $(BUILD)/lib/libreadline.$(SHLIB_EXT)
ifneq ($(OS),Darwin)
READLINE_OBJ_SOURCE = readline-$(READLINE_VER)/shlib/libreadline.$(SHLIB_EXT).$(READLINE_VER)
+else
+READLINE_OBJ_SOURCE = readline-$(READLINE_VER)/shlib/libreadline.$(READLINE_VER).$(SHLIB_EXT)
endif
READLINE_URL = ftp://ftp.gnu.org/gnu/readline/readline-$(READLINE_VER).tar.gz
READLINE_OPTS = --enable-shared --enable-static --with-curses
@@ -618,6 +624,7 @@ $(RMATH_OBJ_SOURCE): Rmath/src/Makefile $(LIBRANDOM_OBJ_TARGET)
cd Rmath/src && \
$(MAKE) CC="$(CC)" && \
$(INSTALL_NAME_CMD)libRmath.$(SHLIB_EXT) libRmath.$(SHLIB_EXT)
+ touch -c $@
$(RMATH_OBJ_TARGET): $(RMATH_OBJ_SOURCE)
cp $< $@
@@ -786,7 +793,11 @@ ARPACK_FFLAGS = -fdefault-integer-8
endif
ARPACK_OBJ_TARGET = $(BUILD)/lib/libarpack.$(SHLIB_EXT)
+ifeq ($(OS),WINNT)
+ARPACK_OBJ_SOURCE = arpack-ng_$(ARPACK_VER)/libarpack.$(SHLIB_EXT)
+else
ARPACK_OBJ_SOURCE = arpack-ng_$(ARPACK_VER)/.libs/libarpack.$(SHLIB_EXT)
+endif
ARPACK_ARGS = F77="$(FC)" MPIF77="$(FC)"
ARPACK_OPTS = $(FFLAGS) $(JFFLAGS)
@@ -878,6 +889,9 @@ fftw-$(FFTW_VER).tar.gz:
fftw-$(FFTW_VER)-single/configure: fftw-$(FFTW_VER).tar.gz
mkdir -p fftw-$(FFTW_VER)-single && \
tar -C fftw-$(FFTW_VER)-single --strip-components 1 -xf $<
+ifeq ($(OS),WINNT)
+ patch fftw-$(FFTW_VER)-single/configure < fftw-config-nopthreads.patch
+endif
touch -c $@
fftw-$(FFTW_VER)-single/config.status: fftw-$(FFTW_VER)-single/configure
cd fftw-$(FFTW_VER)-single && \
@@ -912,6 +926,9 @@ endif
fftw-$(FFTW_VER)-double/configure: fftw-$(FFTW_VER).tar.gz
mkdir -p fftw-$(FFTW_VER)-double && \
tar -C fftw-$(FFTW_VER)-double --strip-components 1 -xf $<
+ifeq ($(OS),WINNT)
+ patch fftw-$(FFTW_VER)-double/configure < fftw-config-nopthreads.patch
+endif
touch -c $@
fftw-$(FFTW_VER)-double/config.status: fftw-$(FFTW_VER)-double/configure
cd fftw-$(FFTW_VER)-double && \
View
11 deps/fftw-config-nopthreads.patch
@@ -0,0 +1,11 @@
+--- configure 2013-01-12 06:08:54 +0100
++++ configure.new 2013-01-12 06:08:51 +0100
+@@ -19500,7 +19500,7 @@
+ fi
+ fi
+
+-THREADLIBS=""
++THREADLIBS=" "
+ if test "$enable_threads" = "yes"; then
+ # POSIX threads, the default choice:
+ if test -z "$THREADLIBS"; then
View
5 src/Makefile
@@ -15,10 +15,7 @@ FLAGS = \
-I$(shell $(LLVM_CONFIG) --includedir) \
-I$(JULIAHOME)/deps/libuv/include -I$(JULIAHOME)/usr/include
-LIBS = $(shell $(LLVM_CONFIG) --ldflags) $(WHOLE_ARCHIVE) $(JULIAHOME)/src/flisp/libflisp.a $(WHOLE_ARCHIVE) $(JULIAHOME)/src/support/libsupport.a -L$(BUILD)/lib $(BUILD)/lib/libuv.a $(shell $(LLVM_CONFIG) --libs) $(OSLIBS)
-ifeq ($(OS),WINNT)
-LIBS += -ldbghelp
-endif
+LIBS = $(WHOLE_ARCHIVE) $(JULIAHOME)/src/flisp/libflisp.a $(WHOLE_ARCHIVE) $(JULIAHOME)/src/support/libsupport.a -L$(BUILD)/lib $(BUILD)/lib/libuv.a $(shell $(LLVM_CONFIG) --libs) $(NO_WHOLE_ARCHIVE) $(shell $(LLVM_CONFIG) --ldflags) $(OSLIBS)
ifneq ($(MAKECMDGOALS),debug)
TARGET =
View
1 src/codegen.cpp
@@ -34,6 +34,7 @@
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Config/llvm-config.h"
#include <setjmp.h>
+#include <malloc.h>
#include <string>
#include <sstream>
#include <map>
View
2 ui/Makefile
@@ -9,7 +9,7 @@ FLAGS = -Wall -Wno-strict-aliasing -fno-omit-frame-pointer \
DEBUGFLAGS += $(FLAGS)
SHIPFLAGS += $(FLAGS)
-JLDFLAGS += $(LDFLAGS) $(shell $(LLVM_CONFIG) --ldflags) $(OSLIBS) $(RPATH)
+JLDFLAGS += $(LDFLAGS) $(NO_WHOLE_ARCHIVE) $(shell $(LLVM_CONFIG) --ldflags) $(OSLIBS) $(RPATH)
julia-release julia-debug: %: %-basic %-readline

0 comments on commit f056bbf

Please sign in to comment.
Something went wrong with that request. Please try again.