Skip to content
Browse files

Link all libraries statically into the julia binary.

  • Loading branch information...
1 parent 1d9d441 commit acf590afc3f51baf5edc1b2afc0c9d41d8d2208f @ViralBShah ViralBShah committed
Showing with 20 additions and 17 deletions.
  1. +4 −0 Make.inc
  2. +10 −8 src/Makefile
  3. +6 −9 ui/Makefile
View
4 Make.inc
@@ -44,3 +44,7 @@ SHLIB_EXT = dylib
OSLIBS += -Wl,-w -framework ApplicationServices
#CFLAGS += -fno-optimize-sibling-calls -fno-inline-functions
endif
+
+# Libraries to link
+LIBS = $(shell $(LLVMROOT)/bin/llvm-config --libfiles) $(JULIAHOME)/src/support/libsupport.a $(JULIAHOME)/src/flisp/libflisp.a -L$(EXTROOT)/lib -lutil -ldl -lm $(OSLIBS) -lpthread $(shell $(LLVMROOT)/bin/llvm-config --ldflags)
+
View
18 src/Makefile
@@ -16,10 +16,6 @@ FLAGS = -falign-functions -Wall -Wno-strict-aliasing -fno-omit-frame-pointer \
DEBUGFLAGS += $(FLAGS)
SHIPFLAGS += $(FLAGS)
-LIBFILES = $(FLISP) $(SUPPORT)
-LIBS = $(LIBFILES) -L$(EXTROOT)/lib -lutil -ldl -lm $(OSLIBS) \
- $(shell $(LLVMROOT)/bin/llvm-config --ldflags --libfiles) -lpthread
-
ifeq ($(JULIAGC),MARKSWEEP)
SRCS += gc
endif
@@ -60,13 +56,19 @@ $(SUPPORT): $(SUPPORTDIR)/*.h $(SUPPORTDIR)/*.c
$(FLISP): $(FLISPDIR)/*.h $(FLISPDIR)/*.c $(SUPPORT)
cd $(FLISPDIR) && $(MAKE)
-$(JULIAHOME)/libjulia-debug.$(SHLIB_EXT): $(DOBJS) $(LIBFILES)
+$(JULIAHOME)/libjulia-debug.$(SHLIB_EXT): $(DOBJS) $(FLISP) $(SUPPORT)
$(CXX) $(DEBUGFLAGS) $(DOBJS) -shared -o $(JULIAHOME)/libjulia-debug.$(SHLIB_EXT) $(LIBS)
-libjulia-debug: $(JULIAHOME)/libjulia-debug.$(SHLIB_EXT)
+$(JULIAHOME)/libjulia-debug.a: $(DOBJS) $(FLISP) $(SUPPORT)
+ ar -rcs libjulia-debug.a $(DOBJS)
+#libjulia-debug: $(JULIAHOME)/libjulia-debug.$(SHLIB_EXT)
+libjulia-debug: $(JULIAHOME)/libjulia-debug.a
-$(JULIAHOME)/libjulia-release.$(SHLIB_EXT): $(OBJS) $(LIBFILES)
+$(JULIAHOME)/libjulia-release.$(SHLIB_EXT): $(OBJS) $(FLISP) $(SUPPORT)
$(CXX) $(SHIPFLAGS) $(OBJS) -shared -o $(JULIAHOME)/libjulia-release.$(SHLIB_EXT) $(LIBS)
-libjulia-release: $(JULIAHOME)/libjulia-release.$(SHLIB_EXT)
+$(JULIAHOME)/libjulia-release.a: $(OBJS)
+ ar -rcs libjulia-release.a $(OBJS)
+#libjulia-release: $(JULIAHOME)/libjulia-release.$(SHLIB_EXT)
+libjulia-release: $(JULIAHOME)/libjulia-release.a
clean:
rm -f $(JULIAHOME)/libjulia*.$(SHLIB_EXT)
View
15 ui/Makefile
@@ -1,11 +1,8 @@
JULIAHOME = $(shell pwd)/..
include $(JULIAHOME)/Make.inc
-LIBS = -L$(EXTROOT)/lib -lutil -ldl -lpthread $(OSLIBS)
-
LLTDIR = $(JULIAHOME)/src/support
FLISPDIR = $(JULIAHOME)/src/flisp
-MONGOOSE = $(JULIAHOME)/external/mongoose-3.0
READLINE = -lncurses $(EXTROOT)/lib/libreadline.a
FLAGS = -falign-functions -Wall -Wno-strict-aliasing \
@@ -14,8 +11,8 @@ FLAGS = -falign-functions -Wall -Wno-strict-aliasing \
DEBUGFLAGS += $(FLAGS)
SHIPFLAGS += $(FLAGS)
-LIBJULIA_RELEASE = $(JULIAHOME)/libjulia-release.$(SHLIB_EXT)
-LIBJULIA_DEBUG = $(JULIAHOME)/libjulia-debug.$(SHLIB_EXT)
+LIBJULIA_RELEASE = $(JULIAHOME)/src/libjulia-release.a
+LIBJULIA_DEBUG = $(JULIAHOME)/src/libjulia-debug.a
julia-debug julia-release: %: %-basic %-readline
@@ -33,14 +30,14 @@ julia-release-readline: $(JULIAHOME)/julia-release-readline
julia-debug-readline: $(JULIAHOME)/julia-debug-readline
$(JULIAHOME)/julia-release-basic: repl.o repl-basic.o
- $(CC) $(SHIPFLAGS) $^ -o $@ $(LIBJULIA_RELEASE) $(LIBS)
+ $(CXX) $(SHIPFLAGS) $^ -o $@ $(LIBJULIA_RELEASE) $(LIBS)
$(JULIAHOME)/julia-debug-basic: repl.do repl-basic.do
- $(CC) $(DEBUGFLAGS) $^ -o $@ $(LIBJULIA_DEBUG) $(LIBS)
+ $(CXX) $(DEBUGFLAGS) $^ -o $@ $(LIBJULIA_DEBUG) $(LIBS)
$(JULIAHOME)/julia-release-readline: repl.o repl-readline.o
- $(CC) $(SHIPFLAGS) $^ -o $@ $(LIBJULIA_RELEASE) $(READLINE) $(LIBS)
+ $(CXX) $(SHIPFLAGS) $^ -o $@ $(LIBJULIA_RELEASE) $(READLINE) $(LIBS)
$(JULIAHOME)/julia-debug-readline: repl.do repl-readline.do
- $(CC) $(DEBUGFLAGS) $^ -o $@ $(LIBJULIA_DEBUG) $(READLINE) $(LIBS)
+ $(CXX) $(DEBUGFLAGS) $^ -o $@ $(LIBJULIA_DEBUG) $(READLINE) $(LIBS)
clean:
rm -f *.o *.do

0 comments on commit acf590a

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