Skip to content

Commit

Permalink
adjust linker invocation for msvc
Browse files Browse the repository at this point in the history
skip flisp unit test with msvc (for now?)

skip a few headers (will need to find replacements for these)
  • Loading branch information
tkelman committed Mar 31, 2014
1 parent e7955dd commit 6d1de78
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ endif
ifeq ($(OS), Darwin)
WHOLE_ARCHIVE = -Xlinker -all_load
NO_WHOLE_ARCHIVE =
else
else ifneq ($(USEMSVC), 1)
WHOLE_ARCHIVE = -Wl,--whole-archive
NO_WHOLE_ARCHIVE = -Wl,--no-whole-archive
endif
Expand Down
10 changes: 8 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ flisp/libflisp.a: flisp/*.h flisp/*.c support/libsupport.a
flisp/libflisp-debug.a: flisp/*.h flisp/*.c support/libsupport-debug.a
$(MAKE) -C flisp debug

ifneq ($(USEMSVC), 1)
CXXLD = $(CXX) -shared
else
CXXLD = $(LD) -dll
endif

$(build_shlibdir)/libjulia-debug.$(SHLIB_EXT): julia.expmap $(DOBJS) flisp/libflisp-debug.a support/libsupport-debug.a $(LIBUV)
@$(call PRINT_LINK, $(CXX) $(DEBUGFLAGS) $(DOBJS) $(RPATH_ORIGIN) -shared -o $@ $(LDFLAGS) $(DEBUG_LIBS))
@$(call PRINT_LINK, $(CXXLD) $(DEBUGFLAGS) $(DOBJS) $(RPATH_ORIGIN) -o $@ $(LDFLAGS) $(DEBUG_LIBS))
$(INSTALL_NAME_CMD)libjulia-debug.$(SHLIB_EXT) $@
libjulia-debug.a: julia.expmap $(DOBJS) flisp/libflisp-debug.a support/libsupport-debug.a
rm -f $@
Expand All @@ -94,7 +100,7 @@ else
endif

$(build_shlibdir)/libjulia.$(SHLIB_EXT): julia.expmap $(OBJS) flisp/libflisp.a support/libsupport.a $(LIBUV)
@$(call PRINT_LINK, $(CXX) $(SHIPFLAGS) $(OBJS) $(RPATH_ORIGIN) -shared -o $@ $(LDFLAGS) $(RELEASE_LIBS) $(SONAME))
@$(call PRINT_LINK, $(CXXLD) $(SHIPFLAGS) $(OBJS) $(RPATH_ORIGIN) -o $@ $(LDFLAGS) $(RELEASE_LIBS) $(SONAME))
$(INSTALL_NAME_CMD)libjulia.$(SHLIB_EXT) $@
libjulia.a: julia.expmap $(OBJS) flisp/libflisp.a support/libsupport.a
rm -f $@
Expand Down
14 changes: 12 additions & 2 deletions src/flisp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,25 @@ $(LIBTARGET).a: $(OBJS)
rm -rf $@
@$(call PRINT_LINK, $(AR) -rcs $@ $(OBJS))

ifneq ($(USEMSVC), 1)
CCLD = $(CC)
else
CCLD = $(LD)
endif

$(EXENAME)-debug: $(DOBJS) $(LIBFILES) $(LIBTARGET)-debug.a flmain.do
@$(call PRINT_CC, $(CC) $(DEBUGFLAGS) $(DOBJS) flmain.do -o $(EXENAME)-debug $(LIBTARGET).a $(LIBS) $(OSLIBS))
@$(call PRINT_LINK, $(CCLD) $(DEBUGFLAGS) $(DOBJS) flmain.do -o $(EXENAME)-debug $(LIBTARGET).a $(LIBS) $(OSLIBS))
ifndef CROSS_COMPILE
ifneq ($(USEMSVC), 1)
$(call spawn,./$(EXENAME)-debug) unittest.lsp
endif
endif

$(EXENAME): $(OBJS) $(LIBFILES) $(LIBTARGET).a flmain.o
@$(call PRINT_CC, $(CC) $(SHIPFLAGS) $(OBJS) flmain.o $(LDFLAGS) -o $(EXENAME) $(LIBTARGET).a $(LIBS) $(OSLIBS))
@$(call PRINT_LINK, $(CCLD) $(SHIPFLAGS) $(OBJS) flmain.o $(LDFLAGS) -o $(EXENAME) $(LIBTARGET).a $(LIBS) $(OSLIBS))
ifneq ($(USEMSVC), 1)
$(call spawn,./$(EXENAME)) unittest.lsp
endif

clean:
rm -f *.o
Expand Down
16 changes: 12 additions & 4 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ override CFLAGS += $(JCFLAGS)
override CXXFLAGS += $(JCXXFLAGS)
override CPPFLAGS += $(JCPPFLAGS)

FLAGS = -Wall -Wno-strict-aliasing -fno-omit-frame-pointer \
-I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -I$(build_includedir)
FLAGS = -I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -I$(build_includedir)
ifneq ($(USEMSVC), 1)
FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer
endif

DEBUGFLAGS += $(FLAGS)
SHIPFLAGS += $(FLAGS)
Expand Down Expand Up @@ -44,10 +46,16 @@ endif
julia-release: $(build_bindir)/julia$(EXE)
julia-debug: $(build_bindir)/julia-debug$(EXE)

ifneq ($(USEMSVC), 1)
CXXLD = $(CXX)
else
CXXLD = $(LD)
endif

$(build_bindir)/julia$(EXE): repl.o repl-basic.o
@$(call PRINT_LINK, $(CXX) $(LINK_FLAGS) $(SHIPFLAGS) $^ -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia $(JLDFLAGS))
@$(call PRINT_LINK, $(CXXLD) $(LINK_FLAGS) $(SHIPFLAGS) $^ -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia $(JLDFLAGS))
$(build_bindir)/julia-debug$(EXE): repl.do repl-basic.do
@$(call PRINT_LINK, $(CXX) $(LINK_FLAGS) $(DEBUGFLAGS) $^ -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia-debug $(JLDFLAGS))
@$(call PRINT_LINK, $(CXXLD) $(LINK_FLAGS) $(DEBUGFLAGS) $^ -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia-debug $(JLDFLAGS))

clean: | $(CLEAN_TARGETS)
rm -f *.o *.do
Expand Down
6 changes: 4 additions & 2 deletions ui/repl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h>
#include <libgen.h>
#include <getopt.h>
#endif
#include <limits.h>
#include <errno.h>
#include <math.h>
#include <libgen.h>
#include <getopt.h>
#include <ctype.h>

#include "julia.h"
Expand Down

0 comments on commit 6d1de78

Please sign in to comment.