Skip to content

Commit

Permalink
Merge pull request JuliaLang#775 from JuliaLang/libuv
Browse files Browse the repository at this point in the history
Cherry pick of Makefiles and libuv
  • Loading branch information
Keno committed Apr 30, 2012
2 parents 110838b + 12349d6 commit 3444cbe
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/libuv"]
path = external/libuv
url = https://github.com/JuliaLang/libuv.git
47 changes: 36 additions & 11 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,42 @@ LLVMROOT = $(EXTROOT)
OS = $(shell uname)
ARCH = $(shell uname -m)

ifeq ($(OS), MINGW32_NT-6.1)
OS=WINNT
endif

ifeq ($(OS), WINNT)
fPIC =
else
fPIC = -fPIC
endif

DEFAULT_REPL = readline
JULIAGC = MARKSWEEP
USE_COPY_STACKS = 1

# Compiler specific stuff

FC = gfortran
JFFLAGS = -O2 -fPIC
JFFLAGS = -O2 $(fPIC)

USEGCC = 1
USECLANG = 0

ifeq ($(USEGCC),1)
CC = gcc
CXX = g++
JCFLAGS = -std=gnu99 -pipe -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCXXFLAGS = -pipe -fPIC -fno-rtti
JCFLAGS = -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -ggdb3 -DDEBUG
SHIPFLAGS = -O3 -DNDEBUG -falign-functions -momit-leaf-frame-pointer
endif

ifeq ($(USECLANG),1)
CC = clang
CXX = clang++
JCFLAGS = -std=gnu99 -pipe -fPIC -fno-strict-aliasing
JCXXFLAGS = -pipe -fPIC -fno-rtti
JCFLAGS = -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -g -DDEBUG
SHIPFLAGS = -O3 -DNDEBUG
endif
Expand Down Expand Up @@ -91,9 +101,15 @@ LLVM_CONFIG=$(LLVMROOT)/bin/llvm-config
endif

ifeq ($(USE_SYSTEM_READLINE), 1)
READLINE = -lreadline -lncurses -lcurses
READLINE = -lreadline
else
READLINE = $(EXTROOT)/lib/libreadline.a
endif

ifneq ($(OS),WINNT)
READLINE += -lncurses -lcurses
else
READLINE = $(EXTROOT)/lib/libreadline.a -lncurses -lcurses
READLINE += $(EXTROOT)/lib/libhistory.a
endif

ifeq ($(USE_SYSTEM_PCRE), 1)
Expand All @@ -109,8 +125,12 @@ else
LIBBLAS = -lblas
endif
else
ifeq ($(OS), WINNT)
LIBBLAS = $(JULIAHOME)/external/openblas-$(OPENBLAS_VER)/libopenblas.lib
else
LIBBLAS = $(JULIAHOME)/external/openblas-$(OPENBLAS_VER)/libopenblas.a
endif
endif

ifeq ($(USE_SYSTEM_LAPACK), 1)
ifeq ($(OS), Darwin)
Expand All @@ -127,23 +147,28 @@ endif
ifeq ($(OS), Linux)
SHLIB_EXT = so
JLDFLAGS = -Xlinker -rpath $(JULIAHOME)/lib
OSLIBS += -ldl -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND)
OSLIBS += -ldl -lrt -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND)
endif

ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
JLDFLAGS = -Xlinker -rpath $(JULIAHOME)/lib
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND)
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap -lutil -lm $(LIBUNWIND)
endif

ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
JLDFLAGS =
OSLIBS += -ldl -Wl,-w -framework ApplicationServices
OSLIBS += -ldl -Wl,-w -framework ApplicationServices -lutil -lm
endif

ifeq ($(OS), WINNT)
SHLIB_EXT = dll
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.expmap -L"F:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" -lntdll -lkernel32 -lWs2_32 -lIphlpapi
endif

# Libraries to link
LIBS = $(shell $(LLVM_CONFIG) --libfiles) $(JULIAHOME)/src/flisp/libflisp.a $(JULIAHOME)/src/support/libsupport.a -L$(EXTROOT)/lib -lutil -lm $(OSLIBS) -lpthread $(shell $(LLVM_CONFIG) --ldflags)
LIBS = $(shell $(LLVM_CONFIG) --libfiles) $(JULIAHOME)/src/flisp/libflisp.a $(JULIAHOME)/src/support/libsupport.a -L$(EXTROOT)/lib $(EXTROOTLIB)/uv.a $(OSLIBS) -lpthread $(shell $(LLVM_CONFIG) --ldflags)

# Colors for make

Expand Down
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include $(JULIAHOME)/Make.inc
all: default
default: release

debug release:
debug release: makelinks
@$(MAKE) -s julia-$@
@$(MAKE) -s sys.ji

Expand Down Expand Up @@ -70,7 +70,7 @@ distclean: cleanall
rm -fr dist

.PHONY: default debug release julia-debug julia-release \
test testall test-* sloccount clean cleanall
test testall test-* sloccount clean cleanall makelinks

test: release
@$(MAKE) -sC test default
Expand All @@ -80,3 +80,23 @@ testall: release

test-%: release
@$(MAKE) -sC test $*

lib:
mkdir -p external/root/lib
ifeq ($(OS),WINNT)
cmd //C mklink //J lib external\\root\\lib
else
test ! -h lib && ln -s external/root/lib lib
endif

include:
mkdir -p external/root/include
ifeq ($(OS),WINNT)
cmd //C mklink //J include external\\root\\include
else
test ! -h include && ln -s external/root/include include
endif


makelinks: lib include

Loading

0 comments on commit 3444cbe

Please sign in to comment.